mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-26 15:14:45 +03:00
Merge 37d9892d58
into 5e1a528eb2
This commit is contained in:
commit
d765fddd96
|
@ -406,11 +406,11 @@ getlist(PyObject* arg, Py_ssize_t* length, const char* wrong_length, int type)
|
||||||
// on this switch. And 3 fewer loops to copy/paste.
|
// on this switch. And 3 fewer loops to copy/paste.
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TYPE_UINT8:
|
case TYPE_UINT8:
|
||||||
itemp = PyInt_AsLong(op);
|
itemp = (int)PyInt_AsLong(op);
|
||||||
((UINT8*)list)[i] = CLIP8(itemp);
|
((UINT8*)list)[i] = CLIP8(itemp);
|
||||||
break;
|
break;
|
||||||
case TYPE_INT32:
|
case TYPE_INT32:
|
||||||
itemp = PyInt_AsLong(op);
|
itemp = (int)PyInt_AsLong(op);
|
||||||
((INT32*)list)[i] = itemp;
|
((INT32*)list)[i] = itemp;
|
||||||
break;
|
break;
|
||||||
case TYPE_FLOAT32:
|
case TYPE_FLOAT32:
|
||||||
|
@ -506,7 +506,7 @@ getink(PyObject* color, Imaging im, char* ink)
|
||||||
#else
|
#else
|
||||||
if (PyInt_Check(color) || PyLong_Check(color)) {
|
if (PyInt_Check(color) || PyLong_Check(color)) {
|
||||||
if (PyInt_Check(color))
|
if (PyInt_Check(color))
|
||||||
r = PyInt_AS_LONG(color);
|
r = (int)PyInt_AS_LONG(color);
|
||||||
else
|
else
|
||||||
r = PyLong_AsLongLong(color);
|
r = PyLong_AsLongLong(color);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1033,17 +1033,17 @@ _getxy(PyObject* xy, int* x, int *y)
|
||||||
|
|
||||||
value = PyTuple_GET_ITEM(xy, 0);
|
value = PyTuple_GET_ITEM(xy, 0);
|
||||||
if (PyInt_Check(value))
|
if (PyInt_Check(value))
|
||||||
*x = PyInt_AS_LONG(value);
|
*x = (int)PyInt_AS_LONG(value);
|
||||||
else if (PyFloat_Check(value))
|
else if (PyFloat_Check(value))
|
||||||
*x = (int) PyFloat_AS_DOUBLE(value);
|
*x = (int)PyFloat_AS_DOUBLE(value);
|
||||||
else
|
else
|
||||||
goto badval;
|
goto badval;
|
||||||
|
|
||||||
value = PyTuple_GET_ITEM(xy, 1);
|
value = PyTuple_GET_ITEM(xy, 1);
|
||||||
if (PyInt_Check(value))
|
if (PyInt_Check(value))
|
||||||
*y = PyInt_AS_LONG(value);
|
*y = (int)PyInt_AS_LONG(value);
|
||||||
else if (PyFloat_Check(value))
|
else if (PyFloat_Check(value))
|
||||||
*y = (int) PyFloat_AS_DOUBLE(value);
|
*y = (int)PyFloat_AS_DOUBLE(value);
|
||||||
else
|
else
|
||||||
goto badval;
|
goto badval;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user