Explain why we use the unsigned int format for a signed int variable.

(Should 'code' be cast to the right pointer type?)
This commit is contained in:
Thomas Wouters 2006-03-02 17:58:27 +00:00
parent 4954b384e4
commit 857b300b2e
1 changed files with 4 additions and 0 deletions

View File

@ -96,6 +96,10 @@ static PyObject *
fcntl_ioctl(PyObject *self, PyObject *args)
{
int fd;
/* In PyArg_ParseTuple below, use the unsigned int 'I' format for
the signed int 'code' variable, because Python turns 0x8000000
into a large positive number (PyLong, or PyInt on 64-bit
platforms,) whereas C expects it to be a negative int */
int code;
int arg;
int ret;