summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2016-09-07 02:09:15 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2016-09-07 02:09:15 (GMT)
commita439191efa9fee12ea3c17b23b0d3f748ff76997 (patch)
tree3641ca9e731f7247521e8d8b18329d952994e354
parent35b40c65f6a4d902d7dbff21a02e4d211b0952b1 (diff)
downloadcpython-a439191efa9fee12ea3c17b23b0d3f748ff76997.zip
cpython-a439191efa9fee12ea3c17b23b0d3f748ff76997.tar.gz
cpython-a439191efa9fee12ea3c17b23b0d3f748ff76997.tar.bz2
Fix some warnings from MSVC
-rw-r--r--Modules/_ctypes/_ctypes.c2
-rw-r--r--Modules/_decimal/libmpdec/vccompat.h4
-rw-r--r--Modules/audioop.c3
-rw-r--r--Programs/_freeze_importlib.c2
4 files changed, 4 insertions, 7 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 98433e1..f840729 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -3067,7 +3067,7 @@ static PyGetSetDef PyCFuncPtr_getsets[] = {
};
#ifdef MS_WIN32
-static PPROC FindAddress(void *handle, char *name, PyObject *type)
+static PPROC FindAddress(void *handle, const char *name, PyObject *type)
{
#ifdef MS_WIN64
/* win64 has no stdcall calling conv, so it should
diff --git a/Modules/_decimal/libmpdec/vccompat.h b/Modules/_decimal/libmpdec/vccompat.h
index 564eaa8..dd131d8 100644
--- a/Modules/_decimal/libmpdec/vccompat.h
+++ b/Modules/_decimal/libmpdec/vccompat.h
@@ -48,10 +48,6 @@
#undef strtoll
#define strtoll _strtoi64
#define strdup _strdup
- #define PRIi64 "I64i"
- #define PRIu64 "I64u"
- #define PRIi32 "I32i"
- #define PRIu32 "I32u"
#endif
diff --git a/Modules/audioop.c b/Modules/audioop.c
index c11506c..d715783 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -4,6 +4,7 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include <inttypes.h>
typedef short PyInt16;
@@ -448,7 +449,7 @@ audioop_max_impl(PyObject *module, Py_buffer *fragment, int width)
int val = GETRAWSAMPLE(width, fragment->buf, i);
/* Cast to unsigned before negating. Unsigned overflow is well-
defined, but signed overflow is not. */
- if (val < 0) absval = -(unsigned int)val;
+ if (val < 0) absval = (unsigned int)-(int64_t)val;
else absval = val;
if (absval > max) max = absval;
}
diff --git a/Programs/_freeze_importlib.c b/Programs/_freeze_importlib.c
index 0793984..1069966 100644
--- a/Programs/_freeze_importlib.c
+++ b/Programs/_freeze_importlib.c
@@ -58,7 +58,7 @@ main(int argc, char *argv[])
fprintf(stderr, "cannot fstat '%s'\n", inpath);
goto error;
}
- text_size = status.st_size;
+ text_size = (size_t)status.st_size;
text = (char *) malloc(text_size + 1);
if (text == NULL) {
fprintf(stderr, "could not allocate %ld bytes\n", (long) text_size);