Commit 4a4d5d9a authored by Peinthor Rene's avatar Peinthor Rene

Fix compile error with gcc 4.7 and using c++11

For the new c++ standard a space between simple string concatenation
is mandatory, otherwise it's interpreted as operator"".
parent 39055360
...@@ -3368,7 +3368,7 @@ class SliceIndexNode(ExprNode): ...@@ -3368,7 +3368,7 @@ class SliceIndexNode(ExprNode):
check = stop check = stop
if check: if check:
code.putln("if (unlikely((%s) != %d)) {" % (check, target_size)) code.putln("if (unlikely((%s) != %d)) {" % (check, target_size))
code.putln('PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %%"PY_FORMAT_SIZE_T"d, got %%"PY_FORMAT_SIZE_T"d", (Py_ssize_t)%d, (Py_ssize_t)(%s));' % ( code.putln('PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length, expected %%" PY_FORMAT_SIZE_T "d, got %%" PY_FORMAT_SIZE_T "d", (Py_ssize_t)%d, (Py_ssize_t)(%s));' % (
target_size, check)) target_size, check))
code.putln(code.error_goto(self.pos)) code.putln(code.error_goto(self.pos))
code.putln("}") code.putln("}")
......
...@@ -1534,7 +1534,7 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) { ...@@ -1534,7 +1534,7 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) {
#endif #endif
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"only single character unicode strings can be converted to Py_UCS4, " "only single character unicode strings can be converted to Py_UCS4, "
"got length %"PY_FORMAT_SIZE_T"d", length); "got length %" PY_FORMAT_SIZE_T "d", length);
return (Py_UCS4)-1; return (Py_UCS4)-1;
} }
ival = __Pyx_PyInt_AsLong(x); ival = __Pyx_PyInt_AsLong(x);
...@@ -1589,7 +1589,7 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) { ...@@ -1589,7 +1589,7 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) {
if (unlikely(__Pyx_PyUnicode_GET_LENGTH(x) != 1)) { if (unlikely(__Pyx_PyUnicode_GET_LENGTH(x) != 1)) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"only single character unicode strings can be converted to Py_UNICODE, " "only single character unicode strings can be converted to Py_UNICODE, "
"got length %"PY_FORMAT_SIZE_T"d", __Pyx_PyUnicode_GET_LENGTH(x)); "got length %" PY_FORMAT_SIZE_T "d", __Pyx_PyUnicode_GET_LENGTH(x));
return (Py_UNICODE)-1; return (Py_UNICODE)-1;
} }
#ifdef CYTHON_PEP393_ENABLED #ifdef CYTHON_PEP393_ENABLED
......
...@@ -537,7 +537,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ...@@ -537,7 +537,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
offset = ctx->head->parent_offset + field->offset; offset = ctx->head->parent_offset + field->offset;
if (ctx->fmt_offset != offset) { if (ctx->fmt_offset != offset) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"Buffer dtype mismatch; next field is at offset %"PY_FORMAT_SIZE_T"d but %"PY_FORMAT_SIZE_T"d expected", "Buffer dtype mismatch; next field is at offset %" PY_FORMAT_SIZE_T "d but %" PY_FORMAT_SIZE_T "d expected",
(Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset); (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
return -1; return -1;
} }
......
...@@ -58,7 +58,7 @@ static void __Pyx_RaiseArgtupleInvalid( ...@@ -58,7 +58,7 @@ static void __Pyx_RaiseArgtupleInvalid(
more_or_less = "exactly"; more_or_less = "exactly";
} }
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)", "%s() takes %s %" PY_FORMAT_SIZE_T "d positional argument%s (%" PY_FORMAT_SIZE_T "d given)",
func_name, more_or_less, num_expected, func_name, more_or_less, num_expected,
(num_expected == 1) ? "" : "s", num_found); (num_expected == 1) ? "" : "s", num_found);
} }
......
...@@ -37,7 +37,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); ...@@ -37,7 +37,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %"PY_FORMAT_SIZE_T"d)", expected); "too many values to unpack (expected %" PY_FORMAT_SIZE_T "d)", expected);
} }
/////////////// RaiseNeedMoreValuesToUnpack.proto /////////////// /////////////// RaiseNeedMoreValuesToUnpack.proto ///////////////
...@@ -48,7 +48,7 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); ...@@ -48,7 +48,7 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"need more than %"PY_FORMAT_SIZE_T"d value%s to unpack", "need more than %" PY_FORMAT_SIZE_T "d value%s to unpack",
index, (index == 1) ? "" : "s"); index, (index == 1) ? "" : "s");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment