diff --git a/src/_webp.c b/src/_webp.c index a1b4dbc1a25..d46d3fc789c 100644 --- a/src/_webp.c +++ b/src/_webp.c @@ -873,7 +873,7 @@ WebPDecode_wrapper(PyObject *self, PyObject *args) { // Return the decoder's version number, packed in hexadecimal using 8bits for // each of major/minor/revision. E.g: v2.5.7 is 0x020507. PyObject * -WebPDecoderVersion_wrapper() { +WebPDecoderVersion_wrapper(PyObject *self, PyObject *Py_UNUSED(args)) { return Py_BuildValue("i", WebPGetDecoderVersion()); } @@ -901,7 +901,7 @@ WebPDecoderBuggyAlpha(void) { } PyObject * -WebPDecoderBuggyAlpha_wrapper() { +WebPDecoderBuggyAlpha_wrapper(PyObject *self, PyObject *Py_UNUSED(args)) { return Py_BuildValue("i", WebPDecoderBuggyAlpha()); } diff --git a/src/display.c b/src/display.c index ef2ff3754f1..6b66ddafb87 100644 --- a/src/display.c +++ b/src/display.c @@ -427,7 +427,6 @@ PyImaging_GrabScreenWin32(PyObject *self, PyObject *args) { PyObject * PyImaging_GrabClipboardWin32(PyObject *self, PyObject *args) { - int clip; HANDLE handle = NULL; int size; void *data; diff --git a/src/libImaging/Draw.c b/src/libImaging/Draw.c index 0ccf22d58dd..c83d05afa8b 100644 --- a/src/libImaging/Draw.c +++ b/src/libImaging/Draw.c @@ -34,6 +34,7 @@ #include "Imaging.h" +#define _USE_MATH_DEFINES #include #include diff --git a/src/libImaging/Imaging.h b/src/libImaging/Imaging.h index afcd2229bde..43350f07b4f 100644 --- a/src/libImaging/Imaging.h +++ b/src/libImaging/Imaging.h @@ -16,10 +16,6 @@ extern "C" { #endif -#ifndef M_PI -#define M_PI 3.1415926535897932384626433832795 -#endif - /* -------------------------------------------------------------------- */ /* diff --git a/src/libImaging/QuantOctree.c b/src/libImaging/QuantOctree.c index 5e79bce358a..cc96bb2fba1 100644 --- a/src/libImaging/QuantOctree.c +++ b/src/libImaging/QuantOctree.c @@ -367,7 +367,7 @@ map_image_pixels( uint32_t nPixels, const ColorCube lookupCube, uint32_t *pixelArray) { - long i; + unsigned long i; for (i = 0; i < nPixels; i++) { pixelArray[i] = lookup_color(lookupCube, &pixelData[i]); } @@ -393,7 +393,7 @@ quantize_octree( ColorBucket paletteBucketsFine = NULL; ColorBucket paletteBuckets = NULL; uint32_t *qp = NULL; - long i; + unsigned long i; unsigned long nCoarseColors, nFineColors, nAlreadySubtracted; const unsigned int *cubeBits; diff --git a/src/libImaging/Resample.c b/src/libImaging/Resample.c index cf79d8a4e4d..9da13352460 100644 --- a/src/libImaging/Resample.c +++ b/src/libImaging/Resample.c @@ -1,5 +1,6 @@ #include "Imaging.h" +#define _USE_MATH_DEFINES #include #define ROUND_UP(f) ((int)((f) >= 0.0 ? (f) + 0.5F : (f)-0.5F)) diff --git a/src/libImaging/TiffDecode.c b/src/libImaging/TiffDecode.c index e3b81590ec2..a8a2d2b24e1 100644 --- a/src/libImaging/TiffDecode.c +++ b/src/libImaging/TiffDecode.c @@ -973,7 +973,10 @@ ImagingLibTiffEncode(Imaging im, ImagingCodecState state, UINT8 *buffer, int byt } if (state->state == 1 && !clientstate->fp) { - int read = (int)_tiffReadProc(clientstate, (tdata_t)buffer, (tsize_t)bytes); + int read = (int)_tiffReadProc( + (thandle_t)clientstate, + (tdata_t)buffer, + (tsize_t)bytes); TRACE( ("Buffer: %p: %c%c%c%c\n", buffer,