summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-06-27 17:24:49 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-06-27 17:24:49 (GMT)
commite7c053233fa4a0f9a1ddfe96b5a3ea57495f9882 (patch)
treeefed7f3371dfa55c3e40a63ebb3569e2682bd522 /Modules
parentef82d2fdfe1aba18e29abbd59b22d19d490e9fca (diff)
downloadcpython-e7c053233fa4a0f9a1ddfe96b5a3ea57495f9882.zip
cpython-e7c053233fa4a0f9a1ddfe96b5a3ea57495f9882.tar.gz
cpython-e7c053233fa4a0f9a1ddfe96b5a3ea57495f9882.tar.bz2
sizeof(char) is 1, by definition, so get rid of that expression in
places it's just noise.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cStringIO.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c
index 1420bce..7e75879 100644
--- a/Modules/cStringIO.c
+++ b/Modules/cStringIO.c
@@ -336,8 +336,8 @@ O_seek(Oobject *self, PyObject *args) {
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 @@ O_cwrite(PyObject *self, char *c, int l) {
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 @@ newOobject(int size) {
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;