[Python-checkins] python/dist/src/Objects listobject.c,2.175,2.176
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Sun Jan 18 15:29:57 EST 2004
- Previous message: [Python-checkins] python/dist/src/Lib/test pystone.py, 1.8,
1.9 test_applesingle.py, 1.1, 1.2 test_codeccallbacks.py, 1.15,
1.16 test_codecencodings_cn.py, 1.1,
1.2 test_codecencodings_jp.py, 1.1,
1.2 test_codecencodings_kr.py, 1.1,
1.2 test_codecencodings_tw.py, 1.1, 1.2 test_codecmaps_cn.py,
1.1, 1.2 test_codecmaps_jp.py, 1.1, 1.2 test_codecmaps_kr.py,
1.1, 1.2 test_codecmaps_tw.py, 1.1, 1.2 test_curses.py, 1.6,
1.7 test_descr.py, 1.198, 1.199 test_difflib.py, 1.8,
1.9 test_marshal.py, 1.4, 1.5 test_md5.py, 1.5,
1.6 test_multibytecodec.py, 1.1,
1.2 test_multibytecodec_support.py, 1.1, 1.2 test_os.py, 1.20,
1.21 test_re.py, 1.46, 1.47 test_set.py, 1.9,
1.10 test_sort.py, 1.11, 1.12 test_support.py, 1.61,
1.62 test_unicode_file.py, 1.12, 1.13 test_urllib2.py, 1.10, 1.11
- Next message: [Python-checkins] python/dist/src/Objects listobject.c,2.176,2.177
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv17688/Objects
Modified Files:
listobject.c
Log Message:
Whitespace normalization.
Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.175
retrieving revision 2.176
diff -C2 -d -r2.175 -r2.176
*** listobject.c 4 Jan 2004 06:08:16 -0000 2.175
--- listobject.c 18 Jan 2004 20:29:55 -0000 2.176
***************
*** 58,68 ****
PyListObject *op;
size_t nbytes;
if (size < 0) {
PyErr_BadInternalCall();
return NULL;
}
! nbytes = size * sizeof(PyObject *);
/* Check for overflow */
! if (nbytes / sizeof(PyObject *) != (size_t)size) {
return PyErr_NoMemory();
}
--- 58,70 ----
PyListObject *op;
size_t nbytes;
+ int allocated_size = roundupsize(size);
+
if (size < 0) {
PyErr_BadInternalCall();
return NULL;
}
! nbytes = allocated_size * sizeof(PyObject *);
/* Check for overflow */
! if (nbytes / sizeof(PyObject *) != (size_t)allocated_size) {
return PyErr_NoMemory();
}
***************
*** 79,83 ****
return PyErr_NoMemory();
}
! memset(op->ob_item, 0, sizeof(*op->ob_item) * size);
}
op->ob_size = size;
--- 81,85 ----
return PyErr_NoMemory();
}
! memset(op->ob_item, 0, sizeof(*op->ob_item) * allocated_size);
}
op->ob_size = size;
***************
*** 155,159 ****
}
items = self->ob_item;
! NRESIZE(items, PyObject *, self->ob_size+1);
if (items == NULL) {
PyErr_NoMemory();
--- 157,162 ----
}
items = self->ob_item;
! if (roundupsize(self->ob_size) - 1 == self->ob_size || items == NULL)
! NRESIZE(items, PyObject *, self->ob_size+1);
if (items == NULL) {
PyErr_NoMemory();
***************
*** 1879,1883 ****
saved_ob_item = self->ob_item;
self->ob_size = 0;
! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0);
if (keyfunc != NULL) {
--- 1882,1887 ----
saved_ob_item = self->ob_item;
self->ob_size = 0;
! /* self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); */
! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, roundupsize(0));
if (keyfunc != NULL) {
- Previous message: [Python-checkins] python/dist/src/Lib/test pystone.py, 1.8,
1.9 test_applesingle.py, 1.1, 1.2 test_codeccallbacks.py, 1.15,
1.16 test_codecencodings_cn.py, 1.1,
1.2 test_codecencodings_jp.py, 1.1,
1.2 test_codecencodings_kr.py, 1.1,
1.2 test_codecencodings_tw.py, 1.1, 1.2 test_codecmaps_cn.py,
1.1, 1.2 test_codecmaps_jp.py, 1.1, 1.2 test_codecmaps_kr.py,
1.1, 1.2 test_codecmaps_tw.py, 1.1, 1.2 test_curses.py, 1.6,
1.7 test_descr.py, 1.198, 1.199 test_difflib.py, 1.8,
1.9 test_marshal.py, 1.4, 1.5 test_md5.py, 1.5,
1.6 test_multibytecodec.py, 1.1,
1.2 test_multibytecodec_support.py, 1.1, 1.2 test_os.py, 1.20,
1.21 test_re.py, 1.46, 1.47 test_set.py, 1.9,
1.10 test_sort.py, 1.11, 1.12 test_support.py, 1.61,
1.62 test_unicode_file.py, 1.12, 1.13 test_urllib2.py, 1.10, 1.11
- Next message: [Python-checkins] python/dist/src/Objects listobject.c,2.176,2.177
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Python-checkins
mailing list