[Python-checkins] python/dist/src/Modules cStringIO.c,2.47,2.48
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Sun Jun 27 13:24:51 EDT 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31535/Modules
Modified Files:
cStringIO.c
Log Message:
sizeof(char) is 1, by definition, so get rid of that expression in
places it's just noise.
Index: cStringIO.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cStringIO.c,v
retrieving revision 2.47
retrieving revision 2.48
diff -C2 -d -r2.47 -r2.48
*** cStringIO.c 8 Mar 2004 18:17:31 -0000 2.47
--- cStringIO.c 27 Jun 2004 17:24:49 -0000 2.48
***************
*** 337,342 ****
self->buf_size*=2;
if (self->buf_size <= position) self->buf_size=position+1;
! UNLESS (self->buf=(char*)
! realloc(self->buf,self->buf_size*sizeof(char))) {
self->buf_size=self->pos=0;
return PyErr_NoMemory();
--- 337,342 ----
self->buf_size*=2;
if (self->buf_size <= position) self->buf_size=position+1;
! UNLESS (self->buf = (char*)
! realloc(self->buf,self->buf_size)) {
self->buf_size=self->pos=0;
return PyErr_NoMemory();
***************
*** 372,377 ****
oself->buf_size = newl+1;
UNLESS (oself->buf =
! (char*)realloc(oself->buf,
! (oself->buf_size) * sizeof(char))) {
PyErr_SetString(PyExc_MemoryError,"out of memory");
oself->buf_size = oself->pos = 0;
--- 372,376 ----
oself->buf_size = newl+1;
UNLESS (oself->buf =
! (char*)realloc(oself->buf, oself->buf_size)) {
PyErr_SetString(PyExc_MemoryError,"out of memory");
oself->buf_size = oself->pos = 0;
***************
*** 530,534 ****
self->softspace = 0;
! UNLESS (self->buf=malloc(size*sizeof(char))) {
PyErr_SetString(PyExc_MemoryError,"out of memory");
self->buf_size = 0;
--- 529,533 ----
self->softspace = 0;
! UNLESS (self->buf = (char *)malloc(size)) {
PyErr_SetString(PyExc_MemoryError,"out of memory");
self->buf_size = 0;
More information about the Python-checkins
mailing list