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):
if runtime_check:
code.putln("if (unlikely((%s) != (%s))) {" % (runtime_check, target_size))
code.putln(
'PyErr_Format(PyExc_ValueError, "Assignment to slice of wrong length,'
' expected %%" CYTHON_FORMAT_SSIZE_T "d, got %%" CYTHON_FORMAT_SSIZE_T "d",'
' (Py_ssize_t)(%s), (Py_ssize_t)(%s));' % (
target_size, runtime_check))
'PyErr_Format(PyExc_ValueError,'
' "Assignment to slice of wrong length, expected %%zd, got %%zd",'
' (Py_ssize_t)(%s), (Py_ssize_t)(%s));' % (target_size, runtime_check))
code.putln(code.error_goto(self.pos))
code.putln("}")
......
......@@ -481,7 +481,7 @@ static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
offset = ctx->head->parent_offset + field->offset;
if (ctx->fmt_offset != offset) {
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);
return -1;
}
......
......@@ -64,7 +64,7 @@ static void __Pyx_RaiseArgtupleInvalid(
more_or_less = "exactly";
}
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,
(num_expected == 1) ? "" : "s", num_found);
}
......
......@@ -331,8 +331,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
if ((unsigned) buf->itemsize != dtype->size) {
PyErr_Format(PyExc_ValueError,
"Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
"does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
"Item size of buffer (%zu byte%s) does not match size of '%s' (%zu byte%s)",
buf->itemsize,
(buf->itemsize > 1) ? "s" : "",
dtype->name,
......
......@@ -24,8 +24,7 @@ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/////////////// RaiseTooManyValuesToUnpack ///////////////
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
PyErr_Format(PyExc_ValueError, "too many values to unpack (expected %zd)", expected);
}
/////////////// RaiseNeedMoreValuesToUnpack.proto ///////////////
......@@ -35,8 +34,7 @@ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/////////////// RaiseNeedMoreValuesToUnpack ///////////////
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
PyErr_Format(PyExc_ValueError, "need more than %zd value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
......
......@@ -344,8 +344,7 @@ static CYTHON_INLINE Py_UCS4 __Pyx_PyObject_AsPy_UCS4(PyObject* x) {
#endif
#endif
PyErr_Format(PyExc_ValueError,
"only single character unicode strings can be converted to Py_UCS4, "
"got length %" CYTHON_FORMAT_SSIZE_T "d", length);
"only single character unicode strings can be converted to Py_UCS4, got length %zd", length);
return (Py_UCS4)-1;
}
ival = __Pyx_PyInt_As_long(x);
......@@ -382,8 +381,8 @@ static CYTHON_INLINE Py_UNICODE __Pyx_PyObject_AsPy_UNICODE(PyObject* x) {
if (PyUnicode_Check(x)) {
if (unlikely(__Pyx_PyUnicode_GET_LENGTH(x) != 1)) {
PyErr_Format(PyExc_ValueError,
"only single character unicode strings can be converted to Py_UNICODE, "
"got length %" CYTHON_FORMAT_SSIZE_T "d", __Pyx_PyUnicode_GET_LENGTH(x));
"only single character unicode strings can be converted to Py_UNICODE, got length %zd",
__Pyx_PyUnicode_GET_LENGTH(x));
return (Py_UNICODE)-1;
}
#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