mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Fix warnings: passing argument from incompatible pointer type, pointer targets differ in signedness, unused variable
This commit is contained in:
parent
e2c62ff1d2
commit
6c013c2d97
12
_webp.c
12
_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
|
||||
|
|
Loading…
Reference in New Issue
Block a user