diff --git a/arm9/source/godmode.c b/arm9/source/godmode.c index 7cf0f99..62f0b7d 100644 --- a/arm9/source/godmode.c +++ b/arm9/source/godmode.c @@ -691,7 +691,7 @@ u32 FileHexViewer(const char* path) { marked0 = (s32) found_offset - (offset + curr_pos); marked1 = marked0 + found_size; if (marked0 < 0) marked0 = 0; - if (marked1 > cols) marked1 = cols; + if (marked1 > (s32) cols) marked1 = (s32) cols; } // switch to bottom screen @@ -710,7 +710,7 @@ u32 FileHexViewer(const char* path) { COLOR_STD_BG, "%08X", (unsigned int) offset + curr_pos); if (x_ascii >= 0) { DrawString(screen, ascii, x_ascii - x0, y, COLOR_HVASCII, COLOR_STD_BG, false); - for (u32 i = marked0; i < marked1; i++) + for (u32 i = (u32) marked0; i < (u32) marked1; i++) DrawCharacter(screen, ascii[i % cols], x_ascii - x0 + (FONT_WIDTH_EXT * i), y, COLOR_MARKED, COLOR_STD_BG); if (edit_mode && ((u32) cursor / cols == row)) DrawCharacter(screen, ascii[cursor % cols], x_ascii - x0 + FONT_WIDTH_EXT * (cursor % cols), y, COLOR_RED, COLOR_STD_BG); @@ -720,7 +720,7 @@ u32 FileHexViewer(const char* path) { for (u32 col = 0; (col < cols) && (x_hex >= 0); col++) { u32 x = (x_hex + hlpad) + (((2*FONT_WIDTH_EXT) + hrpad + hlpad) * col) - x0; u32 hex_color = (edit_mode && ((u32) cursor == curr_pos + col)) ? COLOR_RED : - ((col >= marked0) && (col < marked1)) ? COLOR_MARKED : COLOR_HVHEX(col); + (((s32) col >= marked0) && ((s32) col < marked1)) ? COLOR_MARKED : COLOR_HVHEX(col); if (col < cutoff) DrawStringF(screen, x, y, hex_color, COLOR_STD_BG, "%02X", (unsigned int) data[curr_pos + col]); else DrawStringF(screen, x, y, hex_color, COLOR_STD_BG, " "); diff --git a/common/types.h b/common/types.h index 226429d..11c83e3 100644 --- a/common/types.h +++ b/common/types.h @@ -24,10 +24,10 @@ typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -typedef int64_t s8; -typedef int64_t s16; -typedef int64_t s32; -typedef int64_t s64; +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; typedef volatile u8 vu8; typedef volatile u16 vu16;