Skip to content

Commit faf90c1

Browse files
author
skip.montanaro
committed
C++ compiler cleanup: a cast here, a cast there... still does not compile under C++ though...
git-svn-id: http://svn.python.org/projects/python/trunk@45546 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 4644313 commit faf90c1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Modules/arraymodule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ array_reverse(arrayobject *self, PyObject *unused)
11641164
register char *p, *q;
11651165
/* little buffer to hold items while swapping */
11661166
char tmp[256]; /* 8 is probably enough -- but why skimp */
1167-
assert(itemsize <= sizeof(tmp));
1167+
assert((size_t)itemsize <= sizeof(tmp));
11681168

11691169
if (self->ob_size > 1) {
11701170
for (p = self->ob_item,
@@ -1674,7 +1674,8 @@ array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value)
16741674
}
16751675

16761676
self->ob_size -= slicelength;
1677-
self->ob_item = PyMem_REALLOC(self->ob_item, itemsize*self->ob_size);
1677+
self->ob_item = (char *)PyMem_REALLOC(self->ob_item,
1678+
itemsize*self->ob_size);
16781679
self->allocated = self->ob_size;
16791680

16801681
return 0;
@@ -1866,7 +1867,7 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
18661867
if (n > 0) {
18671868
arrayobject *self = (arrayobject *)a;
18681869
char *item = self->ob_item;
1869-
item = PyMem_Realloc(item, n);
1870+
item = (char *)PyMem_Realloc(item, n);
18701871
if (item == NULL) {
18711872
PyErr_NoMemory();
18721873
Py_DECREF(a);

0 commit comments

Comments
 (0)