summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-08-15 17:12:55 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-08-15 17:12:55 (GMT)
commit0010d37a431b580034a1da979c2ee7c546fbda90 (patch)
tree5f6d46ae3903afcca0c71532055a199fdbe7471f
parent1d0aaea54ad0bed77b22e59b67f2e9659036aa53 (diff)
downloadcpython-0010d37a431b580034a1da979c2ee7c546fbda90.zip
cpython-0010d37a431b580034a1da979c2ee7c546fbda90.tar.gz
cpython-0010d37a431b580034a1da979c2ee7c546fbda90.tar.bz2
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.
-rw-r--r--Objects/bytearrayobject.c4
-rw-r--r--Objects/bytesobject.c12
2 files changed, 8 insertions, 8 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index be19a82..283102a 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -1214,7 +1214,7 @@ bytearray_contains(PyObject *self, PyObject *arg)
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;
@@ -1228,7 +1228,7 @@ bytearray_contains(PyObject *self, PyObject *arg)
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;
}
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 41c86d9..77f193c 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -770,7 +770,7 @@ bytes_contains(PyObject *self, PyObject *arg)
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;
@@ -784,7 +784,7 @@ bytes_contains(PyObject *self, PyObject *arg)
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 *
@@ -1654,7 +1654,7 @@ return_self(PyBytesObject *self)
}
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;
@@ -2609,7 +2609,7 @@ PyBytes_FromObject(PyObject *x)
Py_DECREF(new);
return NULL;
}
- ((PyBytesObject *)new)->ob_sval[i] = value;
+ ((PyBytesObject *)new)->ob_sval[i] = (char) value;
}
return new;
}
@@ -2630,7 +2630,7 @@ PyBytes_FromObject(PyObject *x)
Py_DECREF(new);
return NULL;
}
- ((PyBytesObject *)new)->ob_sval[i] = value;
+ ((PyBytesObject *)new)->ob_sval[i] = (char) value;
}
return new;
}
@@ -2685,7 +2685,7 @@ PyBytes_FromObject(PyObject *x)
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);