Fix GCC signed-unsigned and pointer-warnings (#1608)
* Fix GCC signed-unsigned and pointer-warnings A lot of the signed/unsigned issues are related to the fact that I converted a lot of indexing values to use unsigned types, little did I know that a lot of other values used when indexing actually come from the python-end. Python does not have built-in unsigned types so all integers coming from Python are signed implicitly so a lot of things like image-size and x, y coordiantes are specially handling negative-integer cases. Guess we'll just take our `int32_t i = 0; i < blah; ++i` and like it. Code now compiles with no warnings or nagging.
This commit is contained in:
@@ -113,7 +113,8 @@ alpha_over_full(PyObject* dest, PyObject* src, PyObject* mask, float overall_alp
|
||||
/* source position */
|
||||
int32_t sx, sy;
|
||||
/* iteration variables */
|
||||
uint32_t x, y, i;
|
||||
int32_t x, y;
|
||||
uint32_t i;
|
||||
/* temporary calculation variables */
|
||||
int32_t tmp1, tmp2, tmp3;
|
||||
/* integer [0, 255] version of overall_alpha */
|
||||
@@ -289,7 +290,7 @@ tint_with_mask(PyObject* dest,
|
||||
/* source position */
|
||||
int32_t sx, sy;
|
||||
/* iteration variables */
|
||||
uint32_t x, y;
|
||||
int32_t x, y;
|
||||
/* temporary calculation variables */
|
||||
int32_t tmp1, tmp2;
|
||||
|
||||
@@ -517,7 +518,7 @@ resize_half(PyObject* dest, PyObject* src) {
|
||||
/* temp color variables */
|
||||
uint32_t r, g, b, a;
|
||||
/* size values for source and destination */
|
||||
int32_t src_width, src_height, dest_width, dest_height;
|
||||
uint32_t src_width, src_height, dest_width, dest_height;
|
||||
|
||||
imDest = imaging_python_to_c(dest);
|
||||
imSrc = imaging_python_to_c(src);
|
||||
|
||||
Reference in New Issue
Block a user