From 07ef7b1669be74071de6b1c9e3084c3052c9edc8 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 28 Oct 2009 23:36:46 -0700 Subject: [PATCH] Fix to compile sage. Was giving a gcc error for a local named "zero" --- Cython/Compiler/PyrexTypes.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 5c2e83fa..e7ffb1d7 100644 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -621,8 +621,8 @@ static INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject *); """, impl=""" static INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject* x) { - const %(type)s neg_one = (%(type)s)-1, zero = 0; - const int is_unsigned = neg_one > zero; + const %(type)s neg_one = (%(type)s)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(%(type)s) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(%(type)s)val)) { @@ -646,8 +646,8 @@ static INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject *); """, impl=""" static INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject* x) { - const %(type)s neg_one = (%(type)s)-1, zero = 0; - const int is_unsigned = neg_one > zero; + const %(type)s neg_one = (%(type)s)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); @@ -687,8 +687,8 @@ static INLINE %(type)s __Pyx_PyInt_from_py_%(TypeName)s(PyObject *); """, impl=""" static INLINE %(type)s __Pyx_PyInt_from_py_%(TypeName)s(PyObject* x) { - const %(type)s neg_one = (%(type)s)-1, zero = 0; - const int is_unsigned = neg_one > zero; + const %(type)s neg_one = (%(type)s)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(%(type)s) == sizeof(char)) { if (is_unsigned) return (%(type)s)__Pyx_PyInt_AsUnsignedChar(x); @@ -734,8 +734,8 @@ static INLINE PyObject *__Pyx_PyInt_to_py_%(TypeName)s(%(type)s); """, impl=""" static INLINE PyObject *__Pyx_PyInt_to_py_%(TypeName)s(%(type)s val) { - const %(type)s neg_one = (%(type)s)-1, zero = 0; - const int is_unsigned = neg_one > zero; + const %(type)s neg_one = (%(type)s)-1, const_zero = 0; + const int is_unsigned = neg_one > const_zero; if (sizeof(%(type)s) < sizeof(long)) { return PyInt_FromLong((long)val); } else if (sizeof(%(type)s) == sizeof(long)) { -- 2.26.2