summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2006-04-18 19:39:48 (GMT)
committerSkip Montanaro <skip@pobox.com>2006-04-18 19:39:48 (GMT)
commitcbe2e491bc8996cbe3a8f498c086cf2b2fb01168 (patch)
tree49f2c752aaf5ab25d0b04b693b9329098785ad45
parent14f8899dc209c20b15440d8ca597c44d0c2d9e34 (diff)
downloadcpython-cbe2e491bc8996cbe3a8f498c086cf2b2fb01168.zip
cpython-cbe2e491bc8996cbe3a8f498c086cf2b2fb01168.tar.gz
cpython-cbe2e491bc8996cbe3a8f498c086cf2b2fb01168.tar.bz2
C++ compiler cleanup: a cast here, a cast there... still does not compile under C++ though...
-rw-r--r--Modules/arraymodule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 4551342..52a7f5e 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1164,7 +1164,7 @@ array_reverse(arrayobject *self, PyObject *unused)
register char *p, *q;
/* little buffer to hold items while swapping */
char tmp[256]; /* 8 is probably enough -- but why skimp */
- assert(itemsize <= sizeof(tmp));
+ assert((size_t)itemsize <= sizeof(tmp));
if (self->ob_size > 1) {
for (p = self->ob_item,
@@ -1674,7 +1674,8 @@ array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value)
}
self->ob_size -= slicelength;
- self->ob_item = PyMem_REALLOC(self->ob_item, itemsize*self->ob_size);
+ self->ob_item = (char *)PyMem_REALLOC(self->ob_item,
+ itemsize*self->ob_size);
self->allocated = self->ob_size;
return 0;
@@ -1866,7 +1867,7 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (n > 0) {
arrayobject *self = (arrayobject *)a;
char *item = self->ob_item;
- item = PyMem_Realloc(item, n);
+ item = (char *)PyMem_Realloc(item, n);
if (item == NULL) {
PyErr_NoMemory();
Py_DECREF(a);