summaryrefslogtreecommitdiffstats
path: root/PC/_msi.c
diff options
context:
space:
mode:
authorSegev Finer <segev208@gmail.com>2017-07-26 22:17:57 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2017-07-26 22:17:57 (GMT)
commit679b566622ec811c5e5d580f6a538f7a43006e05 (patch)
tree52be9b1a2d2e0e567d8fa44c72a71659647460de /PC/_msi.c
parentf0851910eb8e711bf8f22165cb0df33bb27b09d6 (diff)
downloadcpython-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/_msi.c')
-rw-r--r--PC/_msi.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/PC/_msi.c b/PC/_msi.c
index 9c3f9f6..c028a88 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -948,8 +948,8 @@ static PyTypeObject msidb_Type = {
};
#define Py_NOT_PERSIST(x, flag) \
- (x != (int)(flag) && \
- x != ((int)(flag) | MSIDBOPEN_PATCHFILE))
+ (x != (SIZE_T)(flag) && \
+ x != ((SIZE_T)(flag) | MSIDBOPEN_PATCHFILE))
#define Py_INVALID_PERSIST(x) \
(Py_NOT_PERSIST(x, MSIDBOPEN_READONLY) && \
@@ -972,7 +972,7 @@ static PyObject* msiopendb(PyObject *obj, PyObject *args)
behavior. */
if (Py_INVALID_PERSIST(persist))
return msierror(ERROR_INVALID_PARAMETER);
- status = MsiOpenDatabase(path, (LPCSTR)persist, &h);
+ status = MsiOpenDatabase(path, (LPCSTR)(SIZE_T)persist, &h);
if (status != ERROR_SUCCESS)
return msierror(status);
@@ -1038,12 +1038,12 @@ PyInit__msi(void)
if (m == NULL)
return NULL;
- PyModule_AddIntConstant(m, "MSIDBOPEN_CREATEDIRECT", (long)MSIDBOPEN_CREATEDIRECT);
- PyModule_AddIntConstant(m, "MSIDBOPEN_CREATE", (long)MSIDBOPEN_CREATE);
- PyModule_AddIntConstant(m, "MSIDBOPEN_DIRECT", (long)MSIDBOPEN_DIRECT);
- PyModule_AddIntConstant(m, "MSIDBOPEN_READONLY", (long)MSIDBOPEN_READONLY);
- PyModule_AddIntConstant(m, "MSIDBOPEN_TRANSACT", (long)MSIDBOPEN_TRANSACT);
- PyModule_AddIntConstant(m, "MSIDBOPEN_PATCHFILE", (long)MSIDBOPEN_PATCHFILE);
+ PyModule_AddIntConstant(m, "MSIDBOPEN_CREATEDIRECT", (long)(SIZE_T)MSIDBOPEN_CREATEDIRECT);
+ PyModule_AddIntConstant(m, "MSIDBOPEN_CREATE", (long)(SIZE_T)MSIDBOPEN_CREATE);
+ PyModule_AddIntConstant(m, "MSIDBOPEN_DIRECT", (long)(SIZE_T)MSIDBOPEN_DIRECT);
+ PyModule_AddIntConstant(m, "MSIDBOPEN_READONLY", (long)(SIZE_T)MSIDBOPEN_READONLY);
+ PyModule_AddIntConstant(m, "MSIDBOPEN_TRANSACT", (long)(SIZE_T)MSIDBOPEN_TRANSACT);
+ PyModule_AddIntConstant(m, "MSIDBOPEN_PATCHFILE", (long)(SIZE_T)MSIDBOPEN_PATCHFILE);
PyModule_AddIntMacro(m, MSICOLINFO_NAMES);
PyModule_AddIntMacro(m, MSICOLINFO_TYPES);