Kaydet (Commit) a6d80faf authored tarafından Neal Norwitz's avatar Neal Norwitz

Impl ssize_t

üst 052cbcf6
This diff is collapsed.
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
typedef struct { typedef struct {
PyObject_VAR_HEAD PyObject_VAR_HEAD
int groups; /* must be first! */ Py_ssize_t groups; /* must be first! */
PyObject* groupindex; PyObject* groupindex;
PyObject* indexgroup; PyObject* indexgroup;
/* compatibility */ /* compatibility */
...@@ -31,7 +31,7 @@ typedef struct { ...@@ -31,7 +31,7 @@ typedef struct {
int flags; /* flags used when compiling pattern source */ int flags; /* flags used when compiling pattern source */
PyObject *weakreflist; /* List of weak references */ PyObject *weakreflist; /* List of weak references */
/* pattern code */ /* pattern code */
int codesize; Py_ssize_t codesize;
SRE_CODE code[1]; SRE_CODE code[1];
} PatternObject; } PatternObject;
...@@ -42,10 +42,10 @@ typedef struct { ...@@ -42,10 +42,10 @@ typedef struct {
PyObject* string; /* link to the target string (must be first) */ PyObject* string; /* link to the target string (must be first) */
PyObject* regs; /* cached list of matching spans */ PyObject* regs; /* cached list of matching spans */
PatternObject* pattern; /* link to the regex (pattern) object */ PatternObject* pattern; /* link to the regex (pattern) object */
int pos, endpos; /* current target slice */ Py_ssize_t pos, endpos; /* current target slice */
int lastindex; /* last index marker seen by the engine (-1 if none) */ Py_ssize_t lastindex; /* last index marker seen by the engine (-1 if none) */
int groups; /* number of groups (start/end marks) */ Py_ssize_t groups; /* number of groups (start/end marks) */
int mark[1]; Py_ssize_t mark[1];
} MatchObject; } MatchObject;
typedef unsigned int (*SRE_TOLOWER_HOOK)(unsigned int ch); typedef unsigned int (*SRE_TOLOWER_HOOK)(unsigned int ch);
...@@ -54,7 +54,7 @@ typedef unsigned int (*SRE_TOLOWER_HOOK)(unsigned int ch); ...@@ -54,7 +54,7 @@ typedef unsigned int (*SRE_TOLOWER_HOOK)(unsigned int ch);
#define SRE_MARK_SIZE 200 #define SRE_MARK_SIZE 200
typedef struct SRE_REPEAT_T { typedef struct SRE_REPEAT_T {
int count; Py_ssize_t count;
SRE_CODE* pattern; /* points to REPEAT operator arguments */ SRE_CODE* pattern; /* points to REPEAT operator arguments */
void* last_ptr; /* helper to check for infinite loops */ void* last_ptr; /* helper to check for infinite loops */
struct SRE_REPEAT_T *prev; /* points to previous repeat context */ struct SRE_REPEAT_T *prev; /* points to previous repeat context */
...@@ -68,17 +68,17 @@ typedef struct { ...@@ -68,17 +68,17 @@ typedef struct {
void* end; /* end of original string */ void* end; /* end of original string */
/* attributes for the match object */ /* attributes for the match object */
PyObject* string; PyObject* string;
int pos, endpos; Py_ssize_t pos, endpos;
/* character size */ /* character size */
int charsize; int charsize;
/* registers */ /* registers */
int lastindex; Py_ssize_t lastindex;
int lastmark; Py_ssize_t lastmark;
void* mark[SRE_MARK_SIZE]; void* mark[SRE_MARK_SIZE];
/* dynamically allocated stuff */ /* dynamically allocated stuff */
char* data_stack; char* data_stack;
unsigned int data_stack_size; size_t data_stack_size;
unsigned int data_stack_base; size_t data_stack_base;
/* current repeat context */ /* current repeat context */
SRE_REPEAT *repeat; SRE_REPEAT *repeat;
/* hooks */ /* hooks */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment