From 26efe402c2a5dba441dc2feae2f15fea6be452ba Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 16 Feb 2006 06:21:57 +0000 Subject: [PATCH] Get rid of compiler warnings (gcc 3.3.4 on x86) --- Objects/bufferobject.c | 6 +++--- Objects/dictobject.c | 2 +- Objects/funcobject.c | 4 ++-- Objects/listobject.c | 4 ++-- Objects/structseq.c | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Objects/bufferobject.c b/Objects/bufferobject.c index 4a9e3aeb402..a21d0b1da3e 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 bacb705892d..abc9c8cc93d 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 4abf51ad262..d6440012271 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 41f73905417..460f63ac8d5 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 b035ca29662..a95f3a9ad6b 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; }