@@ -5014,11 +5014,7 @@ posix_spawnv(PyObject *self, PyObject *args)
50145014 if (spawnval == -1 )
50155015 return posix_error ();
50165016 else
5017- #if SIZEOF_LONG == SIZEOF_VOID_P
5018- return Py_BuildValue ("l" , (long ) spawnval );
5019- #else
5020- return Py_BuildValue ("L" , (PY_LONG_LONG ) spawnval );
5021- #endif
5017+ return Py_BuildValue (_Py_PARSE_INTPTR , spawnval );
50225018}
50235019
50245020
@@ -5104,11 +5100,7 @@ posix_spawnve(PyObject *self, PyObject *args)
51045100 if (spawnval == -1 )
51055101 (void ) posix_error ();
51065102 else
5107- #if SIZEOF_LONG == SIZEOF_VOID_P
5108- res = Py_BuildValue ("l" , (long ) spawnval );
5109- #else
5110- res = Py_BuildValue ("L" , (PY_LONG_LONG ) spawnval );
5111- #endif
5103+ res = Py_BuildValue (_Py_PARSE_INTPTR , spawnval );
51125104
51135105 while (-- envc >= 0 )
51145106 PyMem_DEL (envlist [envc ]);
@@ -6178,16 +6170,17 @@ static PyObject *
61786170win32_kill (PyObject * self , PyObject * args )
61796171{
61806172 PyObject * result ;
6181- DWORD pid , sig , err ;
6173+ pid_t pid ;
6174+ DWORD sig , err ;
61826175 HANDLE handle ;
61836176
6184- if (!PyArg_ParseTuple (args , "kk :kill" , & pid , & sig ))
6177+ if (!PyArg_ParseTuple (args , _Py_PARSE_PID "k :kill" , & pid , & sig ))
61856178 return NULL ;
61866179
61876180 /* Console processes which share a common console can be sent CTRL+C or
61886181 CTRL+BREAK events, provided they handle said events. */
61896182 if (sig == CTRL_C_EVENT || sig == CTRL_BREAK_EVENT ) {
6190- if (GenerateConsoleCtrlEvent (sig , pid ) == 0 ) {
6183+ if (GenerateConsoleCtrlEvent (sig , ( DWORD ) pid ) == 0 ) {
61916184 err = GetLastError ();
61926185 PyErr_SetFromWindowsErr (err );
61936186 }
@@ -6197,7 +6190,7 @@ win32_kill(PyObject *self, PyObject *args)
61976190
61986191 /* If the signal is outside of what GenerateConsoleCtrlEvent can use,
61996192 attempt to open and terminate the process. */
6200- handle = OpenProcess (PROCESS_ALL_ACCESS , FALSE, pid );
6193+ handle = OpenProcess (PROCESS_ALL_ACCESS , FALSE, ( DWORD ) pid );
62016194 if (handle == NULL ) {
62026195 err = GetLastError ();
62036196 return PyErr_SetFromWindowsErr (err );
@@ -6603,7 +6596,7 @@ posix_waitpid(PyObject *self, PyObject *args)
66036596 Py_intptr_t pid ;
66046597 int status , options ;
66056598
6606- if (!PyArg_ParseTuple (args , _Py_PARSE_PID "i:waitpid" , & pid , & options ))
6599+ if (!PyArg_ParseTuple (args , _Py_PARSE_INTPTR "i:waitpid" , & pid , & options ))
66076600 return NULL ;
66086601 Py_BEGIN_ALLOW_THREADS
66096602 pid = _cwait (& status , pid , options );
@@ -6612,7 +6605,7 @@ posix_waitpid(PyObject *self, PyObject *args)
66126605 return posix_error ();
66136606
66146607 /* shift the status left a byte so this is more like the POSIX waitpid */
6615- return Py_BuildValue (" Ni ", PyLong_FromPid ( pid ) , status << 8 );
6608+ return Py_BuildValue (_Py_PARSE_INTPTR " i ", pid , status << 8 );
66166609}
66176610#endif /* HAVE_WAITPID || HAVE_CWAIT */
66186611
0 commit comments