Commit 049ebe24 authored by Stefan Behnel's avatar Stefan Behnel

remove usages of CYTHON_FORMAT_SSIZE_T (which is always 'z')

parent 3ad62f34
...@@ -4210,10 +4210,9 @@ class SliceIndexNode(ExprNode): ...@@ -4210,10 +4210,9 @@ class SliceIndexNode(ExprNode):
if runtime_check: if runtime_check:
code.putln("if (unlikely((%s) != (%s))) {" % (runtime_check, target_size)) code.putln("if (unlikely((%s) != (%s))) {" % (runtime_check, target_size))
code.putln( code.putln(
'PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length,' 'PyErr_Format(PyExc_ValueError,'
' expected %%" CYTHON_FORMAT_SSIZE_T "d, got %%" CYTHON_FORMAT_SSIZE_T "d",' ' "Assignment to slice of wrong length, expected %%zd, got %%zd",'
' (Py_ssize_t)(%s), (Py_ssize_t)(%s));' % ( ' (Py_ssize_t)(%s), (Py_ssize_t)(%s));' % (target_size, runtime_check))
target_size, runtime_check))
code.putln(code.error_goto(self.pos)) code.putln(code.error_goto(self.pos))
code.putln("}") code.putln("}")
......
...@@ -481,7 +481,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) { ...@@ -481,7 +481,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 %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected", "Buffer dtype mismatch; next field is at offset %zd but %zd 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;
} }
......
...@@ -64,7 +64,7 @@ static void __Pyx_RaiseArgtupleInvalid( ...@@ -64,7 +64,7 @@ static void __Pyx_RaiseArgtupleInvalid(
more_or_less = "exactly"; more_or_less = "exactly";
} }
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,
"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", "%.200s() takes %.8s %zd positional argument%.1s (%zd 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);
} }
......
...@@ -331,8 +331,7 @@ static int __Pyx_ValidateAndInit_memviewslice( ...@@ -331,8 +331,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
if ((unsigned) buf->itemsize != dtype->size) { if ((unsigned) buf->itemsize != dtype->size) {
PyErr_Format(PyExc_ValueError, PyErr_Format(PyExc_ValueError,
"Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) " "Item size of buffer (%zu byte%s) does not match size of '%s' (%zu byte%s)",
"does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
buf->itemsize, buf->itemsize,
(buf->itemsize > 1) ? "s" : "", (buf->itemsize > 1) ? "s" : "",
dtype->name, dtype->name,
......
...@@ -24,8 +24,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); ...@@ -24,8 +24,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/////////////// RaiseTooManyValuesToUnpack /////////////// /////////////// RaiseTooManyValuesToUnpack ///////////////
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 %zd)", expected);
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
} }
/////////////// RaiseNeedMoreValuesToUnpack.proto /////////////// /////////////// RaiseNeedMoreValuesToUnpack.proto ///////////////
...@@ -35,8 +34,7 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); ...@@ -35,8 +34,7 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/////////////// RaiseNeedMoreValuesToUnpack /////////////// /////////////// RaiseNeedMoreValuesToUnpack ///////////////
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 %zd value%.1s to unpack",
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s"); index, (index == 1) ? "" : "s");
} }
......
...@@ -344,8 +344,7 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) { ...@@ -344,8 +344,7 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) {
#endif #endif
#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 %zd", length);
"got length %" CYTHON_FORMAT_SSIZE_T "d", length);
return (Py_UCS4)-1; return (Py_UCS4)-1;
} }
ival = __Pyx_PyInt_As_long(x); ival = __Pyx_PyInt_As_long(x);
...@@ -382,8 +381,8 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) { ...@@ -382,8 +381,8 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) {
if (PyUnicode_Check(x)) { if (PyUnicode_Check(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 %zd",
"got length %" CYTHON_FORMAT_SSIZE_T "d", __Pyx_PyUnicode_GET_LENGTH(x)); __Pyx_PyUnicode_GET_LENGTH(x));
return (Py_UNICODE)-1; return (Py_UNICODE)-1;
} }
#if CYTHON_PEP393_ENABLED #if CYTHON_PEP393_ENABLED
......
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