summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Objects/bufferobject.c6
-rw-r--r--Objects/dictobject.c2
-rw-r--r--Objects/funcobject.c4
-rw-r--r--Objects/listobject.c4
-rw-r--r--Objects/structseq.c6
5 files changed, 11 insertions, 11 deletions
diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c
index 4a9e3aeb40..a21d0b1da3 100644
--- a/Objects/bufferobject.c
+++ b/Objects/bufferobject.c
@@ -246,15 +246,15 @@ buffer_repr(PyBufferObject *self)
return PyString_FromFormat("<%s buffer ptr %p, size %ld at %p>",
status,
self->b_ptr,
- self->b_size,
+ (long)self->b_size,
self);
else
return PyString_FromFormat(
"<%s buffer for %p, size %ld, offset %ld at %p>",
status,
self->b_base,
- self->b_size,
- self->b_offset,
+ (long)self->b_size,
+ (long)self->b_offset,
self);
}
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index bacb705892..abc9c8cc93 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1149,7 +1149,7 @@ PyDict_MergeFromSeq2(PyObject *d, PyObject *seq2, int override)
PyErr_Format(PyExc_ValueError,
"dictionary update sequence element #%d "
"has length %ld; 2 is required",
- i, n);
+ i, (long)n);
goto Fail;
}
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 4abf51ad26..d644001227 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -251,7 +251,7 @@ func_set_code(PyFunctionObject *op, PyObject *value)
"%s() requires a code object with %ld free vars,"
" not %ld",
PyString_AsString(op->func_name),
- nclosure, nfree);
+ (long)nclosure, (long)nfree);
return -1;
}
tmp = op->func_code;
@@ -403,7 +403,7 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
return PyErr_Format(PyExc_ValueError,
"%s requires closure of length %ld, not %ld",
PyString_AS_STRING(code->co_name),
- nfree, nclosure);
+ (long)nfree, (long)nclosure);
if (nclosure) {
Py_ssize_t i;
for (i = 0; i < nclosure; i++) {
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 41f7390541..460f63ac8d 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2601,8 +2601,8 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
/* XXX can we use %zd here? */
PyErr_Format(PyExc_ValueError,
"attempt to assign sequence of size %ld to extended slice of size %ld",
- PySequence_Fast_GET_SIZE(seq),
- slicelength);
+ (long)PySequence_Fast_GET_SIZE(seq),
+ (long)slicelength);
Py_DECREF(seq);
return -1;
}
diff --git a/Objects/structseq.c b/Objects/structseq.c
index b035ca2966..a95f3a9ad6 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -126,7 +126,7 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (len < min_len) {
PyErr_Format(PyExc_TypeError,
"%.500s() takes an at least %ld-sequence (%ld-sequence given)",
- type->tp_name, min_len, len);
+ type->tp_name, (long)min_len, (long)len);
Py_DECREF(arg);
return NULL;
}
@@ -134,7 +134,7 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (len > max_len) {
PyErr_Format(PyExc_TypeError,
"%.500s() takes an at most %ld-sequence (%ld-sequence given)",
- type->tp_name, max_len, len);
+ type->tp_name, (long)max_len, (long)len);
Py_DECREF(arg);
return NULL;
}
@@ -143,7 +143,7 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (len != min_len) {
PyErr_Format(PyExc_TypeError,
"%.500s() takes a %ld-sequence (%ld-sequence given)",
- type->tp_name, min_len, len);
+ type->tp_name, (long)min_len, (long)len);
Py_DECREF(arg);
return NULL;
}