[Python-checkins] cpython: Issue #9566: Use the right type to fix a compiler warnings on Win64

victor.stinner python-checkins at python.org
Wed Oct 31 01:07:10 CET 2012


http://hg.python.org/cpython/rev/dabe2486e2ce
changeset:   80067:dabe2486e2ce
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Oct 31 00:37:41 2012 +0100
summary:
  Issue #9566: Use the right type to fix a compiler warnings on Win64

files:
  Modules/_sre.c        |  14 +++++++-------
  Objects/frameobject.c |   8 ++++----
  2 files changed, 11 insertions(+), 11 deletions(-)


diff --git a/Modules/_sre.c b/Modules/_sre.c
--- a/Modules/_sre.c
+++ b/Modules/_sre.c
@@ -1865,7 +1865,7 @@
 pattern_match(PatternObject* self, PyObject* args, PyObject* kw)
 {
     SRE_STATE state;
-    int status;
+    Py_ssize_t status;
 
     PyObject* string;
     Py_ssize_t start = 0;
@@ -2034,7 +2034,7 @@
 {
     SRE_STATE state;
     PyObject* list;
-    int status;
+    Py_ssize_t status;
     Py_ssize_t i, b, e;
 
     PyObject* string;
@@ -2160,7 +2160,7 @@
     SRE_STATE state;
     PyObject* list;
     PyObject* item;
-    int status;
+    Py_ssize_t status;
     Py_ssize_t n;
     Py_ssize_t i;
     void* last;
@@ -2276,7 +2276,7 @@
     PyObject* args;
     PyObject* match;
     void* ptr;
-    int status;
+    Py_ssize_t status;
     Py_ssize_t n;
     Py_ssize_t i, b, e;
     int logical_charsize, charsize;
@@ -2295,7 +2295,7 @@
         ptr = getstring(ptemplate, &n, &logical_charsize, &charsize, &view);
         b = charsize;
         if (ptr) {
-            literal = sre_literal_template(b, ptr, n);
+            literal = sre_literal_template(charsize, ptr, n);
         } else {
             PyErr_Clear();
             literal = 0;
@@ -3721,7 +3721,7 @@
 {
     SRE_STATE* state = &self->state;
     PyObject* match;
-    int status;
+    Py_ssize_t status;
 
     state_reset(state);
 
@@ -3752,7 +3752,7 @@
 {
     SRE_STATE* state = &self->state;
     PyObject* match;
-    int status;
+    Py_ssize_t status;
 
     state_reset(state);
 
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -466,7 +466,7 @@
 frame_traverse(PyFrameObject *f, visitproc visit, void *arg)
 {
     PyObject **fastlocals, **p;
-    int i, slots;
+    Py_ssize_t i, slots;
 
     Py_VISIT(f->f_back);
     Py_VISIT(f->f_code);
@@ -496,7 +496,7 @@
 frame_clear(PyFrameObject *f)
 {
     PyObject **fastlocals, **p, **oldtop;
-    int i, slots;
+    Py_ssize_t i, slots;
 
     /* Before anything else, make sure that this frame is clearly marked
      * as being defunct!  Else, e.g., a generator reachable from this
@@ -848,7 +848,7 @@
     PyObject *error_type, *error_value, *error_traceback;
     PyCodeObject *co;
     Py_ssize_t j;
-    int ncells, nfreevars;
+    Py_ssize_t ncells, nfreevars;
     if (f == NULL)
         return;
     locals = f->f_locals;
@@ -900,7 +900,7 @@
     PyObject *error_type, *error_value, *error_traceback;
     PyCodeObject *co;
     Py_ssize_t j;
-    int ncells, nfreevars;
+    Py_ssize_t ncells, nfreevars;
     if (f == NULL)
         return;
     locals = f->f_locals;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list