[Python-checkins] r84075 - in python/branches/release31-maint: Objects/bytearrayobject.c Objects/bytes_methods.c Objects/bytesobject.c

antoine.pitrou python-checkins at python.org
Sun Aug 15 19:46:50 CEST 2010


Author: antoine.pitrou
Date: Sun Aug 15 19:46:50 2010
New Revision: 84075

Log:
Merged revisions 84070,84074 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r84070 | antoine.pitrou | 2010-08-15 19:12:55 +0200 (dim., 15 août 2010) | 5 lines
  
  Fix some compilation warnings under 64-bit Windows (issue #9566).
  Some of these are genuine bugs with objects bigger than 2GB, but
  my system doesn't allow me to write tests for it.
........
  r84074 | antoine.pitrou | 2010-08-15 19:41:31 +0200 (dim., 15 août 2010) | 3 lines
  
  Fix (harmless) warning with MSVC.
........


Modified:
   python/branches/release31-maint/   (props changed)
   python/branches/release31-maint/Objects/bytearrayobject.c
   python/branches/release31-maint/Objects/bytes_methods.c
   python/branches/release31-maint/Objects/bytesobject.c

Modified: python/branches/release31-maint/Objects/bytearrayobject.c
==============================================================================
--- python/branches/release31-maint/Objects/bytearrayobject.c	(original)
+++ python/branches/release31-maint/Objects/bytearrayobject.c	Sun Aug 15 19:46:50 2010
@@ -1215,7 +1215,7 @@
     Py_ssize_t ival = PyNumber_AsSsize_t(arg, PyExc_ValueError);
     if (ival == -1 && PyErr_Occurred()) {
         Py_buffer varg;
-        int pos;
+        Py_ssize_t pos;
         PyErr_Clear();
         if (_getbuffer(arg, &varg) < 0)
             return -1;
@@ -1229,7 +1229,7 @@
         return -1;
     }
 
-    return memchr(PyByteArray_AS_STRING(self), ival, Py_SIZE(self)) != NULL;
+    return memchr(PyByteArray_AS_STRING(self), (int) ival, Py_SIZE(self)) != NULL;
 }
 
 

Modified: python/branches/release31-maint/Objects/bytes_methods.c
==============================================================================
--- python/branches/release31-maint/Objects/bytes_methods.c	(original)
+++ python/branches/release31-maint/Objects/bytes_methods.c	Sun Aug 15 19:46:50 2010
@@ -417,7 +417,7 @@
     }
     p = PyBytes_AS_STRING(res);
     for (i = 0; i < 256; i++)
-        p[i] = i;
+        p[i] = (char) i;
     for (i = 0; i < bfrm.len; i++) {
         p[((unsigned char *)bfrm.buf)[i]] = ((char *)bto.buf)[i];
     }

Modified: python/branches/release31-maint/Objects/bytesobject.c
==============================================================================
--- python/branches/release31-maint/Objects/bytesobject.c	(original)
+++ python/branches/release31-maint/Objects/bytesobject.c	Sun Aug 15 19:46:50 2010
@@ -791,7 +791,7 @@
     Py_ssize_t ival = PyNumber_AsSsize_t(arg, PyExc_ValueError);
     if (ival == -1 && PyErr_Occurred()) {
         Py_buffer varg;
-        int pos;
+        Py_ssize_t pos;
         PyErr_Clear();
         if (_getbuffer(arg, &varg) < 0)
             return -1;
@@ -805,7 +805,7 @@
         return -1;
     }
 
-    return memchr(PyBytes_AS_STRING(self), ival, Py_SIZE(self)) != NULL;
+    return memchr(PyBytes_AS_STRING(self), (int) ival, Py_SIZE(self)) != NULL;
 }
 
 static PyObject *
@@ -1980,7 +1980,7 @@
 }
 
 Py_LOCAL_INLINE(Py_ssize_t)
-countchar(const char *target, int target_len, char c, Py_ssize_t maxcount)
+countchar(const char *target, Py_ssize_t target_len, char c, Py_ssize_t maxcount)
 {
     Py_ssize_t count=0;
     const char *start=target;
@@ -3039,7 +3039,7 @@
             if (_PyBytes_Resize(&new, size) < 0)
                 goto error;
         }
-        ((PyBytesObject *)new)->ob_sval[i] = value;
+        ((PyBytesObject *)new)->ob_sval[i] = (char) value;
     }
     _PyBytes_Resize(&new, i);
 


More information about the Python-checkins mailing list