From 35a03482eda6afcb1362f2a4f72729746f719f8e Mon Sep 17 00:00:00 2001 From: Maschell Date: Wed, 21 Jan 2026 19:51:11 +0100 Subject: [PATCH] Fix compiler warnings --- Makefile | 2 +- src/function_patches.cpp | 2 +- src/gui/schrift.c | 6 +++--- src/utils/utils.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 3964ccb..f9fafc2 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ INCLUDES := src #------------------------------------------------------------------------------- # options for code generation #------------------------------------------------------------------------------- -CFLAGS := -Wall -Wextra -O2 -ffunction-sections\ +CFLAGS := -Wall -Wextra -Werror -O2 -ffunction-sections\ $(MACHDEP) CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ diff --git a/src/function_patches.cpp b/src/function_patches.cpp index 90c0066..40add3a 100644 --- a/src/function_patches.cpp +++ b/src/function_patches.cpp @@ -26,7 +26,7 @@ DECL_FUNCTION(void, GX2SetContextState, GX2ContextState *curContext) { DECL_FUNCTION(void, GX2SetupContextStateEx, GX2ContextState *state, BOOL unk1) { real_GX2SetupContextStateEx(state, unk1); gOriginalContextState = state; - DEBUG_FUNCTION_LINE_VERBOSE("gOriginalContextState = %08X", state); + DEBUG_FUNCTION_LINE_VERBOSE("gOriginalContextState = %p", state); } DECL_FUNCTION(void, GX2SetTVBuffer, void *buffer, uint32_t buffer_size, int32_t tv_render_mode, GX2SurfaceFormat surface_format, GX2BufferingMode buffering_mode) { diff --git a/src/gui/schrift.c b/src/gui/schrift.c index c1df05d..fffaea8 100644 --- a/src/gui/schrift.c +++ b/src/gui/schrift.c @@ -1110,11 +1110,11 @@ simple_outline(SFT_Font *font, uint_fast32_t offset, unsigned int numContours, O goto failure; } - endPts = calloc(sizeof(uint_fast16_t), numContours); + endPts = calloc(numContours, sizeof(uint_fast16_t)); if (endPts == NULL) { goto failure; } - flags = calloc(sizeof(uint8_t), numPts); + flags = calloc(numPts, sizeof(uint8_t)); if (flags == NULL) { goto failure; } @@ -1435,7 +1435,7 @@ render_outline(Outline *outl, double transform[6], SFT_Image image) { numPixels = (unsigned int) image.width * (unsigned int) image.height; - cells = calloc(sizeof(Cell), numPixels); + cells = calloc(numPixels, sizeof(Cell)); if (!cells) { return -1; } diff --git a/src/utils/utils.cpp b/src/utils/utils.cpp index 9fa4951..aed0505 100644 --- a/src/utils/utils.cpp +++ b/src/utils/utils.cpp @@ -10,7 +10,7 @@ void dumpHex(const void *data, size_t size) { char ascii[17]; size_t i, j; ascii[16] = '\0'; - DEBUG_FUNCTION_LINE("0x%08X (0x0000): ", data); + DEBUG_FUNCTION_LINE("0x%p (0x0000): ", data); for (i = 0; i < size; ++i) { WHBLogWritef("%02X ", ((unsigned char *) data)[i]); if (((unsigned char *) data)[i] >= ' ' && ((unsigned char *) data)[i] <= '~') {