From e2c62ff1d2cd3f99d8f88840c2931d341178aaf7 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 12 Apr 2013 16:52:00 +0200 Subject: [PATCH 1/4] Fix warning: pointer targets differ in signedness --- libImaging/JpegEncode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libImaging/JpegEncode.c b/libImaging/JpegEncode.c index 1caa50de5..221f8ccfa 100644 --- a/libImaging/JpegEncode.c +++ b/libImaging/JpegEncode.c @@ -221,7 +221,7 @@ ImagingJpegEncode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) context->extra_offset = context->extra_size; //add exif header if (context->rawExifLen > 0) - jpeg_write_marker(&context->cinfo, JPEG_APP0+1, context->rawExif, context->rawExifLen); + jpeg_write_marker(&context->cinfo, JPEG_APP0+1, (unsigned char*)context->rawExif, context->rawExifLen); break; default: @@ -229,7 +229,7 @@ ImagingJpegEncode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) jpeg_start_compress(&context->cinfo, TRUE); //add exif header if (context->rawExifLen > 0) - jpeg_write_marker(&context->cinfo, JPEG_APP0+1, context->rawExif, context->rawExifLen); + jpeg_write_marker(&context->cinfo, JPEG_APP0+1, (unsigned char*)context->rawExif, context->rawExifLen); break; } From 6c013c2d972e6a48f683acbf3d048840c0f1b334 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 12 Apr 2013 17:01:53 +0200 Subject: [PATCH 2/4] Fix warnings: passing argument from incompatible pointer type, pointer targets differ in signedness, unused variable --- _webp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/_webp.c b/_webp.c index 84418980c..cf53ff252 100644 --- a/_webp.c +++ b/_webp.c @@ -20,7 +20,7 @@ PyObject* WebPEncodeRGB_wrapper(PyObject* self, PyObject* args) return Py_None; } - PyBytes_AsStringAndSize((PyObject *) rgb_string, &rgb, &size); + PyBytes_AsStringAndSize((PyObject *) rgb_string, (char**)&rgb, &size); if (stride * height > size) { Py_INCREF(Py_None); @@ -29,7 +29,7 @@ PyObject* WebPEncodeRGB_wrapper(PyObject* self, PyObject* args) ret_size = WebPEncodeRGB(rgb, width, height, stride, quality_factor, &output); if (ret_size > 0) { - PyObject *ret = PyBytes_FromStringAndSize(output, ret_size); + PyObject *ret = PyBytes_FromStringAndSize((char*)output, ret_size); free(output); return ret; } @@ -41,7 +41,6 @@ PyObject* WebPEncodeRGB_wrapper(PyObject* self, PyObject* args) PyObject* WebPDecodeRGB_wrapper(PyObject* self, PyObject* args) { PyBytesObject *webp_string; - float quality_factor; int width; int height; uint8_t *webp; @@ -54,11 +53,11 @@ PyObject* WebPDecodeRGB_wrapper(PyObject* self, PyObject* args) return Py_None; } - PyBytes_AsStringAndSize((PyObject *) webp_string, &webp, &size); + PyBytes_AsStringAndSize((PyObject *) webp_string, (char**)&webp, &size); output = WebPDecodeRGB(webp, size, &width, &height); - ret = PyBytes_FromStringAndSize(output, width * height * 3); + ret = PyBytes_FromStringAndSize((char*)output, width * height * 3); free(output); return Py_BuildValue("Sii", ret, width, height); } @@ -90,7 +89,6 @@ PyInit__webp(void) { PyMODINIT_FUNC init_webp() { - PyObject* m; - m = Py_InitModule("_webp", webpMethods); + Py_InitModule("_webp", webpMethods); } #endif From 3b6392bbda12b744a07c2cbb59efb6c89c87a5da Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 12 Apr 2013 17:08:46 +0200 Subject: [PATCH 3/4] Fix warnings: _POSIX_C_SOURCE, _XOPEN_SOURCE redefined (caused by indirectly including system headers before Python.h) --- Tk/tkImaging.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tk/tkImaging.c b/Tk/tkImaging.c index 4234a7d2b..319645d56 100644 --- a/Tk/tkImaging.c +++ b/Tk/tkImaging.c @@ -48,9 +48,8 @@ for the Tcl_CreateCommand command. */ #define USE_COMPAT_CONST -#include "tk.h" - #include "Imaging.h" +#include "tk.h" #include From 0a8291e1a4000d1065179a08e7f0430a61f30936 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Fri, 12 Apr 2013 17:11:36 +0200 Subject: [PATCH 4/4] Fix warnings: variable set but not used --- Sane/_sane.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/Sane/_sane.c b/Sane/_sane.c index b424015a8..2001be421 100644 --- a/Sane/_sane.c +++ b/Sane/_sane.c @@ -408,7 +408,6 @@ static PyObject * SaneDev_set_auto_option(SaneDevObject *self, PyObject *args) { SANE_Status st; - const SANE_Option_Descriptor *d; SANE_Int i; int n; @@ -419,7 +418,6 @@ SaneDev_set_auto_option(SaneDevObject *self, PyObject *args) PyErr_SetString(ErrorObject, "SaneDev object is closed"); return NULL; } - d=sane_get_option_descriptor(self->h, n); st=sane_control_option(self->h, n, SANE_ACTION_SET_AUTO, NULL, &i); if (st) {return PySane_Error(st);}