From: Lisandro Dalcin Date: Sat, 9 Apr 2011 21:56:16 +0000 (-0300) Subject: Fix GCC warnings with Python 2.3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=deaa7d0fe44aab2401cb144dec69481ed709fcec;p=cython.git Fix GCC warnings with Python 2.3 --- diff --git a/Cython/Compiler/Buffer.py b/Cython/Compiler/Buffer.py index 86eb69c7..3e2418e7 100644 --- a/Cython/Compiler/Buffer.py +++ b/Cython/Compiler/Buffer.py @@ -967,7 +967,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { if (ctx->fmt_offset != offset) { PyErr_Format(PyExc_ValueError, "Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d " - "but %"PY_FORMAT_SIZE_T"d expected", ctx->fmt_offset, offset); + "but %"PY_FORMAT_SIZE_T"d expected", (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); return -1; } @@ -1168,7 +1168,7 @@ static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* ob "Item size of buffer (%"PY_FORMAT_SIZE_T"d byte%s) does not match size of '%s' (%"PY_FORMAT_SIZE_T"d byte%s)", buf->itemsize, (buf->itemsize > 1) ? "s" : "", dtype->name, - dtype->size, (dtype->size > 1) ? "s" : ""); + (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : ""); goto fail; } if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones; diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 305d2bdb..4a4d41ce 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -7776,7 +7776,7 @@ static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) { #if PY_MAJOR_VERSION < 3 if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { PyObject *base = PyTuple_GET_ITEM(bases, 0); - metaclass = PyObject_GetAttrString(base, "__class__"); + metaclass = PyObject_GetAttrString(base, (char *)"__class__"); if (!metaclass) { PyErr_Clear(); metaclass = (PyObject*) Py_TYPE(base); @@ -7854,7 +7854,7 @@ PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObje PyObject *ns; PyObject *str; - prep = PyObject_GetAttrString(metaclass, "__prepare__"); + prep = PyObject_GetAttrString(metaclass, (char *)"__prepare__"); if (!prep) { if (!PyErr_ExceptionMatches(PyExc_AttributeError)) return NULL; @@ -8560,7 +8560,7 @@ static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args, CYTHON_UN PyObject *tb = NULL; PyObject *val = NULL; - if (!PyArg_UnpackTuple(args, "throw", 1, 3, &typ, &val, &tb)) + if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; __Pyx_Raise(typ, val, tb); return __Pyx_Generator_SendEx(generator, NULL);