};
#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
#undef strtoll
#define strtoll _strtoi64
#define strdup _strdup
- #define PRIi64 "I64i"
- #define PRIu64 "I64u"
- #define PRIi32 "I32i"
- #define PRIu32 "I32u"
#endif
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include <inttypes.h>
typedef short PyInt16;
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;
}
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);