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
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 @@
{"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 @@
#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 @@
{
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 @@
#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 @@
#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]*/