Skip to content

Commit

Permalink
Fix some warnings from MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Sep 7, 2016
1 parent 35b40c6 commit a439191
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions Modules/_decimal/libmpdec/vccompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion Modules/audioop.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define PY_SSIZE_T_CLEAN

#include "Python.h"
#include <inttypes.h>

typedef short PyInt16;

Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Programs/_freeze_importlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a439191

Please sign in to comment.