1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00

Fix cast warnings

This commit is contained in:
Ted John
2017-01-12 12:41:47 +00:00
parent 498c60ebb6
commit bd732b99c7
5 changed files with 6 additions and 5 deletions

View File

@@ -545,7 +545,7 @@ bool editor_check_park()
}
for (int i = 0; i < 4; i++) {
if (gParkEntranceX[i] != (sint16)0x8000)
if (gParkEntranceX[i] != MAP_LOCATION_NULL)
break;
if (i == 3) {
@@ -555,7 +555,7 @@ bool editor_check_park()
}
for (int i = 0; i < 4; i++) {
if (gParkEntranceX[i] == (sint16)0x8000)
if (gParkEntranceX[i] == MAP_LOCATION_NULL)
continue;
int x = gParkEntranceX[i];

View File

@@ -680,7 +680,7 @@ static void utf8_to_rct2_self(char *buffer, size_t length)
const char *src = tempBuffer;
char *dst = buffer;
while (*src != 0 && i < length - 1) {
if (*src == (char)0xFF) {
if (*src == (char)(uint8)0xFF) {
if (i < length - 3) {
*dst++ = *src++;
*dst++ = *src++;

View File

@@ -607,7 +607,7 @@ enum {
*/
#define FOR_ALL_PEEPS(sprite_index, peep) \
for (sprite_index = gSpriteListHead[SPRITE_LIST_PEEP]; sprite_index != SPRITE_INDEX_NULL; sprite_index = peep->next) \
if ((peep = GET_PEEP(sprite_index)) || 1)
if ((peep = GET_PEEP(sprite_index)) != NULL || 1)
#define FOR_ALL_GUESTS(sprite_index, peep) \
FOR_ALL_PEEPS(sprite_index, peep) \

View File

@@ -234,6 +234,7 @@ enum {
#define MAP_ELEMENT_SURFACE_TERRAIN_MASK 0xE0
#define MAP_MINIMUM_X_Y -256
#define MAP_LOCATION_NULL ((sint16)(uint16)0x8000)
#define MAX_MAP_ELEMENTS 196096
#define MAX_TILE_MAP_ELEMENT_POINTERS (256 * 256)

View File

@@ -22,7 +22,7 @@
#include "../ride/vehicle.h"
#define SPRITE_INDEX_NULL 0xFFFF
#define SPRITE_LOCATION_NULL ((sint16)0x8000)
#define SPRITE_LOCATION_NULL ((sint16)(uint16)0x8000)
#define MAX_SPRITES 10000
#define NUM_SPRITE_LISTS 6