1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Fix comparison between signed and unsigned integer

This commit is contained in:
Michael Steenbeek
2017-12-12 15:03:18 +01:00
parent a5d4e96aae
commit e9dff344e4
2 changed files with 3 additions and 3 deletions

View File

@@ -262,7 +262,7 @@ static bool is_changable_pixel(sint32 palette_index) {
}
static sint32 get_closest_palette_index(sint16 *colour){
uint32 smallest_error = -1;
uint32 smallest_error = (uint32)-1;
sint32 best_match = -1;
for (sint32 x = 0; x < 256; x++){
@@ -272,7 +272,7 @@ static sint32 get_closest_palette_index(sint16 *colour){
((sint16)(spriteFilePalette[x].g) - colour[1]) * ((sint16)(spriteFilePalette[x].g) - colour[1]) +
((sint16)(spriteFilePalette[x].b) - colour[2]) * ((sint16)(spriteFilePalette[x].b) - colour[2]);
if (smallest_error == -1 || smallest_error > error){
if (smallest_error == (uint32)-1 || smallest_error > error){
best_match = x;
smallest_error = error;
}

View File

@@ -133,7 +133,7 @@ void game_handle_input()
if (_inputFlags & INPUT_FLAG_5) {
game_handle_input_mouse(x, y, state);
} else if (x != 0x80000000) {
} else if (x != (sint32)0x80000000) {
sint32 screenWidth = context_get_width();
sint32 screenHeight = context_get_height();
x = Math::Clamp(0, x, screenWidth - 1);