Get rid of compiler warnings (gcc 3.3.4 on x86)

This commit is contained in:
Neal Norwitz 2006-02-16 06:21:57 +00:00
parent 15231548d2
commit 26efe402c2
5 changed files with 11 additions and 11 deletions

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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++) {

View File

@ -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;
}

View File

@ -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;
}