diff options
author | Segev Finer <segev208@gmail.com> | 2017-07-26 22:17:57 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2017-07-26 22:17:57 (GMT) |
commit | 679b566622ec811c5e5d580f6a538f7a43006e05 (patch) | |
tree | 52be9b1a2d2e0e567d8fa44c72a71659647460de /PC/clinic | |
parent | f0851910eb8e711bf8f22165cb0df33bb27b09d6 (diff) | |
download | cpython-679b566622ec811c5e5d580f6a538f7a43006e05.zip cpython-679b566622ec811c5e5d580f6a538f7a43006e05.tar.gz cpython-679b566622ec811c5e5d580f6a538f7a43006e05.tar.bz2 |
bpo-9566: Fix some Windows x64 compiler warnings (#2492)
* bpo-9566: Silence liblzma warnings
* bpo-9566: Silence tcl warnings
* bpo-9566: Silence tk warnings
* bpo-9566: Silence tix warnings
* bpo-9566: Fix some library warnings
* bpo-9566: Fix msvcrtmodule.c warnings
* bpo-9566: Silence _bz2 warnings
* bpo-9566: Fixed some _ssl warnings
* bpo-9566: Fix _msi warnings
* bpo-9566: Silence _ctypes warnings
* Revert "bpo-9566: Fixed some _ssl warnings"
This reverts commit a639001c949ba53338a9ee047d2ec1efd2505e6f.
* bpo-9566: Also consider NULL as a possible error in HANDLE_return_converter
* bpo-9566: whitespace fixes
Diffstat (limited to 'PC/clinic')
-rw-r--r-- | PC/clinic/msvcrtmodule.c.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index c6545ac..debd9b0 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -113,13 +113,13 @@ PyDoc_STRVAR(msvcrt_open_osfhandle__doc__, {"open_osfhandle", (PyCFunction)msvcrt_open_osfhandle, METH_FASTCALL, msvcrt_open_osfhandle__doc__}, static long -msvcrt_open_osfhandle_impl(PyObject *module, intptr_t handle, int flags); +msvcrt_open_osfhandle_impl(PyObject *module, void *handle, int flags); static PyObject * msvcrt_open_osfhandle(PyObject *module, PyObject **args, Py_ssize_t nargs) { PyObject *return_value = NULL; - intptr_t handle; + void *handle; int flags; long _return_value; @@ -148,7 +148,7 @@ PyDoc_STRVAR(msvcrt_get_osfhandle__doc__, #define MSVCRT_GET_OSFHANDLE_METHODDEF \ {"get_osfhandle", (PyCFunction)msvcrt_get_osfhandle, METH_O, msvcrt_get_osfhandle__doc__}, -static intptr_t +static void * msvcrt_get_osfhandle_impl(PyObject *module, int fd); static PyObject * @@ -156,16 +156,16 @@ msvcrt_get_osfhandle(PyObject *module, PyObject *arg) { PyObject *return_value = NULL; int fd; - intptr_t _return_value; + void *_return_value; if (!PyArg_Parse(arg, "i:get_osfhandle", &fd)) { goto exit; } _return_value = msvcrt_get_osfhandle_impl(module, fd); - if ((_return_value == -1) && PyErr_Occurred()) { + if ((_return_value == NULL || _return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) { goto exit; } - return_value = PyLong_FromVoidPtr((void *)_return_value); + return_value = PyLong_FromVoidPtr(_return_value); exit: return return_value; @@ -426,26 +426,26 @@ PyDoc_STRVAR(msvcrt_CrtSetReportFile__doc__, #define MSVCRT_CRTSETREPORTFILE_METHODDEF \ {"CrtSetReportFile", (PyCFunction)msvcrt_CrtSetReportFile, METH_FASTCALL, msvcrt_CrtSetReportFile__doc__}, -static long -msvcrt_CrtSetReportFile_impl(PyObject *module, int type, int file); +static void * +msvcrt_CrtSetReportFile_impl(PyObject *module, int type, void *file); static PyObject * msvcrt_CrtSetReportFile(PyObject *module, PyObject **args, Py_ssize_t nargs) { PyObject *return_value = NULL; int type; - int file; - long _return_value; + void *file; + void *_return_value; - if (!_PyArg_ParseStack(args, nargs, "ii:CrtSetReportFile", + if (!_PyArg_ParseStack(args, nargs, "i"_Py_PARSE_INTPTR":CrtSetReportFile", &type, &file)) { goto exit; } _return_value = msvcrt_CrtSetReportFile_impl(module, type, file); - if ((_return_value == -1) && PyErr_Occurred()) { + if ((_return_value == NULL || _return_value == INVALID_HANDLE_VALUE) && PyErr_Occurred()) { goto exit; } - return_value = PyLong_FromLong(_return_value); + return_value = PyLong_FromVoidPtr(_return_value); exit: return return_value; @@ -569,4 +569,4 @@ exit: #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=8e9e57c48c4defcc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e86cf578e7f1ffd2 input=a9049054013a1b77]*/ |