[Python-3000-checkins] r64218 - python/branches/py3k/Modules/_pickle.c

alexandre.vassalotti python-3000-checkins at python.org
Fri Jun 13 04:16:06 CEST 2008


Author: alexandre.vassalotti
Date: Fri Jun 13 04:16:06 2008
New Revision: 64218

Log:
Fixed compiler warnings on MSVC9.0


Modified:
   python/branches/py3k/Modules/_pickle.c

Modified: python/branches/py3k/Modules/_pickle.c
==============================================================================
--- python/branches/py3k/Modules/_pickle.c	(original)
+++ python/branches/py3k/Modules/_pickle.c	Fri Jun 13 04:16:06 2008
@@ -627,7 +627,7 @@
     else {
         if (x < 256) {
             pdata[0] = BINPUT;
-            pdata[1] = x;
+            pdata[1] = (unsigned char)x;
             len = 2;
         }
         else if (x <= 0xffffffffL) {
@@ -3930,7 +3930,8 @@
 
         /* Use the size_t type to check for overflow. */
         alloc = ((size_t)self->num_marks << 1) + 20;
-        if (alloc > PY_SSIZE_T_MAX || alloc <= (self->num_marks + 1)) {
+        if (alloc > PY_SSIZE_T_MAX || 
+            alloc <= ((size_t)self->num_marks + 1)) {
             PyErr_NoMemory();
             return -1;
         }


More information about the Python-3000-checkins mailing list