From 04866df7978decc61869638a49cb8f61e312fcf7 Mon Sep 17 00:00:00 2001 From: Maximus32 Date: Sat, 26 Dec 2020 16:22:42 +0100 Subject: [PATCH] ee_core: _strtoul returns u64 (gcc10 fix) --- ee_core/Makefile | 2 +- ee_core/include/util.h | 2 +- ee_core/src/util.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ee_core/Makefile b/ee_core/Makefile index 0c3e7e1b8..e11a97f3d 100644 --- a/ee_core/Makefile +++ b/ee_core/Makefile @@ -53,7 +53,7 @@ ifeq ($(PADEMU),1) EE_CFLAGS += -DPADEMU endif -EE_LIBS += -lkernel-nopatch +EE_LIBS += -lkernel-nopatch -lgcc $(EE_OBJS_DIR)%.o : $(EE_SRC_DIR)%.c @mkdir -p $(EE_OBJS_DIR) diff --git a/ee_core/include/util.h b/ee_core/include/util.h index 19157312f..39467a5b0 100644 --- a/ee_core/include/util.h +++ b/ee_core/include/util.h @@ -25,7 +25,7 @@ int _toupper(int c); int _memcmp(const void *s1, const void *s2, unsigned int length); unsigned int _strtoui(const char *p); int _strtoi(const char *p); -unsigned long int _strtoul(const char *p); +u64 _strtoul(const char *p); void set_ipconfig(void); u32 *find_pattern_with_mask(u32 *buf, unsigned int bufsize, const u32 *pattern, const u32 *mask, unsigned int len); void CopyToIop(void *eedata, unsigned int size, void *iopptr); diff --git a/ee_core/src/util.c b/ee_core/src/util.c index 013265ba3..7431d9c57 100644 --- a/ee_core/src/util.c +++ b/ee_core/src/util.c @@ -261,16 +261,16 @@ int _strtoi(const char *p) } /*----------------------------------------------------------------------------------------*/ -/* This function converts string to unsigned long integer. Stops on illegal characters. */ +/* This function converts string to u64. Stops on illegal characters. */ /* Put here because including atoi rises the size of loader.elf by another kilobyte */ /* and that causes some games to stop working. */ /*----------------------------------------------------------------------------------------*/ -unsigned long int _strtoul(const char *p) +u64 _strtoul(const char *p) { if (!p) return 0; - unsigned long int r = 0; + u64 r = 0; while (*p) { if ((*p < '0') || (*p > '9'))