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:
@@ -18,8 +18,8 @@
|
||||
#include "../overviewer.h"
|
||||
|
||||
typedef struct {
|
||||
uint32_t min;
|
||||
uint32_t max;
|
||||
int32_t min;
|
||||
int32_t max;
|
||||
} PrimitiveDepth;
|
||||
|
||||
static bool
|
||||
|
||||
@@ -241,7 +241,7 @@ do_shading_with_mask(RenderPrimitiveLighting* self, RenderState* state,
|
||||
tint_with_mask(state->img, r, g, b, 255, mask, state->imgx, state->imgy, 0, 0);
|
||||
}
|
||||
|
||||
static int32_t
|
||||
static bool
|
||||
lighting_start(void* data, RenderState* state, PyObject* support) {
|
||||
RenderPrimitiveLighting* self;
|
||||
self = (RenderPrimitiveLighting*)data;
|
||||
|
||||
@@ -146,7 +146,7 @@ overlay_biomes_start(void* data, RenderState* state, PyObject* support) {
|
||||
for (i = 0; i < biomes_size; i++) {
|
||||
PyObject* biome = PyList_GET_ITEM(opt, i);
|
||||
char* tmpname = NULL;
|
||||
int32_t j = 0;
|
||||
uint32_t j = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(biome, "s(bbb)", &tmpname, &(biomes[i].r), &(biomes[i].g), &(biomes[i].b))) {
|
||||
free(biomes);
|
||||
|
||||
@@ -28,7 +28,7 @@ static void get_color(void* data, RenderState* state,
|
||||
*a = self->color->a;
|
||||
}
|
||||
|
||||
static int32_t
|
||||
static bool
|
||||
overlay_start(void* data, RenderState* state, PyObject* support) {
|
||||
PyObject* opt = NULL;
|
||||
OverlayColor* color = NULL;
|
||||
|
||||
@@ -198,8 +198,8 @@ smooth_lighting_finish(void* data, RenderState* state) {
|
||||
|
||||
static void
|
||||
smooth_lighting_draw(void* data, RenderState* state, PyObject* src, PyObject* mask, PyObject* mask_light) {
|
||||
bool light_top = true;
|
||||
bool light_left = true;
|
||||
bool light_top = true;
|
||||
bool light_left = true;
|
||||
bool light_right = true;
|
||||
RenderPrimitiveSmoothLighting* self = (RenderPrimitiveSmoothLighting*)data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user