summaryrefslogtreecommitdiffstats
path: root/Objects/bufferobject.c
diff options
context:
space:
mode:
authorMoshe Zadka <moshez@math.huji.ac.il>2000-08-04 15:36:13 (GMT)
committerMoshe Zadka <moshez@math.huji.ac.il>2000-08-04 15:36:13 (GMT)
commitcf703f04ad406d905d280a364048d56aa9d21315 (patch)
treef25e872aef54e6756c573e2e2fbdc65496b98d5d /Objects/bufferobject.c
parent92a69138b3f607384a22e291b4d0af3b1bd1b237 (diff)
downloadcpython-cf703f04ad406d905d280a364048d56aa9d21315.zip
cpython-cf703f04ad406d905d280a364048d56aa9d21315.tar.gz
cpython-cf703f04ad406d905d280a364048d56aa9d21315.tar.bz2
Removing warnings found by gcc -Wall
Diffstat (limited to 'Objects/bufferobject.c')
-rw-r--r--Objects/bufferobject.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c
index 67d26a1..91f58c9 100644
--- a/Objects/bufferobject.c
+++ b/Objects/bufferobject.c
@@ -141,6 +141,7 @@ PyBuffer_FromReadWriteMemory(void *ptr, int size)
PyObject *
PyBuffer_New(int size)
{
+ PyObject *o;
PyBufferObject * b;
if (size < 0) {
@@ -149,10 +150,10 @@ PyBuffer_New(int size)
return NULL;
}
/* PyObject_New is inlined */
- b = (PyBufferObject *) PyObject_MALLOC(sizeof(*b) + size);
- if ( b == NULL )
+ o = PyObject_MALLOC(sizeof(*b) + size);
+ if ( o == NULL )
return PyErr_NoMemory();
- PyObject_INIT((PyObject *)b, &PyBuffer_Type);
+ b = (PyBufferObject *) PyObject_INIT(o, &PyBuffer_Type);
b->b_base = NULL;
b->b_ptr = (void *)(b + 1);
@@ -162,7 +163,7 @@ PyBuffer_New(int size)
b->b_hash = -1;
#endif
- return (PyObject *) b;
+ return o;
}
/* Methods */