Skip to content

Commit a80e985

Browse files
segevfinerzooba
authored andcommitted
bpo-9566: Change HANDLE argument parsing to unsigned in msvcrtmodule.c (#2904)
1 parent 2bc8f0e commit a80e985

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

PC/clinic/msvcrtmodule.c.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ msvcrt_open_osfhandle(PyObject *module, PyObject **args, Py_ssize_t nargs)
123123
int flags;
124124
long _return_value;
125125

126-
if (!_PyArg_ParseStack(args, nargs, ""_Py_PARSE_INTPTR"i:open_osfhandle",
126+
if (!_PyArg_ParseStack(args, nargs, ""_Py_PARSE_UINTPTR"i:open_osfhandle",
127127
&handle, &flags)) {
128128
goto exit;
129129
}
@@ -437,7 +437,7 @@ msvcrt_CrtSetReportFile(PyObject *module, PyObject **args, Py_ssize_t nargs)
437437
void *file;
438438
void *_return_value;
439439

440-
if (!_PyArg_ParseStack(args, nargs, "i"_Py_PARSE_INTPTR":CrtSetReportFile",
440+
if (!_PyArg_ParseStack(args, nargs, "i"_Py_PARSE_UINTPTR":CrtSetReportFile",
441441
&type, &file)) {
442442
goto exit;
443443
}
@@ -569,4 +569,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg)
569569
#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
570570
#define MSVCRT_SET_ERROR_MODE_METHODDEF
571571
#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
572-
/*[clinic end generated code: output=e86cf578e7f1ffd2 input=a9049054013a1b77]*/
572+
/*[clinic end generated code: output=66787cb934b8a3c2 input=a9049054013a1b77]*/

PC/msvcrtmodule.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/*[python input]
3636
class HANDLE_converter(CConverter):
3737
type = 'void *'
38-
format_unit = '"_Py_PARSE_INTPTR"'
38+
format_unit = '"_Py_PARSE_UINTPTR"'
3939
4040
class HANDLE_return_converter(CReturnConverter):
4141
type = 'void *'
@@ -65,7 +65,7 @@ class wchar_t_return_converter(CReturnConverter):
6565
data.return_conversion.append(
6666
'return_value = PyUnicode_FromOrdinal(_return_value);\n')
6767
[python start generated code]*/
68-
/*[python end generated code: output=da39a3ee5e6b4b0d input=2b25dc89e9e59534]*/
68+
/*[python end generated code: output=da39a3ee5e6b4b0d input=d102511df3cda2eb]*/
6969

7070
/*[clinic input]
7171
module msvcrt

0 commit comments

Comments
 (0)