diff Modules/cStringIO.c @ 32423:64534fb3afcd legacy-trunk

sizeof(char) is 1, by definition, so get rid of that expression in places it's just noise.
author Tim Peters <tim.peters@gmail.com>
date Sun, 27 Jun 2004 17:24:49 +0000
parents 1543afab1b67
children db1bafa9b656
line wrap: on
line diff
--- a/Modules/cStringIO.c	Sun Jun 27 16:51:46 2004 +0000
+++ b/Modules/cStringIO.c	Sun Jun 27 17:24:49 2004 +0000
@@ -336,8 +336,8 @@
         if (position > self->buf_size) {
                   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))) {
+                  UNLESS (self->buf = (char*)
+                          realloc(self->buf,self->buf_size)) {
                       self->buf_size=self->pos=0;
                       return PyErr_NoMemory();
                     }
@@ -371,8 +371,7 @@
             if (oself->buf_size <= newl) 
                     oself->buf_size = newl+1;
             UNLESS (oself->buf = 
-                    (char*)realloc(oself->buf,
-                                   (oself->buf_size) * sizeof(char))) {
+                    (char*)realloc(oself->buf, oself->buf_size)) {
                     PyErr_SetString(PyExc_MemoryError,"out of memory");
                     oself->buf_size = oself->pos = 0;
                     return -1;
@@ -529,7 +528,7 @@
         self->string_size = 0;
         self->softspace = 0;
 
-        UNLESS (self->buf=malloc(size*sizeof(char))) {
+        UNLESS (self->buf = (char *)malloc(size)) {
                   PyErr_SetString(PyExc_MemoryError,"out of memory");
                   self->buf_size = 0;
                   return NULL;