From f8f252343c1fe37c753596d481b6872799e2f109 Mon Sep 17 00:00:00 2001 From: Carsten Teibes Date: Mon, 22 Jun 2020 21:24:12 +0200 Subject: [PATCH] Cleanup some compiler warnings --- src/libc/string.c | 2 +- src/startup/crt0.c | 2 +- src/startup/prxexports.c | 6 +++--- tools/psp-fixup-imports.c | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/libc/string.c b/src/libc/string.c index 50406941..cf9f7e3e 100644 --- a/src/libc/string.c +++ b/src/libc/string.c @@ -454,7 +454,7 @@ char * strstr(const char * string, const char * substring) { char* strpos; - if (string == 0) + if (*string == 0) return 0; if (strlen(substring)==0) diff --git a/src/startup/crt0.c b/src/startup/crt0.c index 071f740e..1501eeb7 100644 --- a/src/startup/crt0.c +++ b/src/startup/crt0.c @@ -168,5 +168,5 @@ static const struct _library_entry { unsigned short funcCount; void * entrytable; } _library_entry __attribute__((section(".lib.ent"), used)) = { - NULL, 0, 0x8000, 4, 1, 1, &__entrytable + NULL, 0, 0x8000, 4, 1, 1, (unsigned int *) &__entrytable }; diff --git a/src/startup/prxexports.c b/src/startup/prxexports.c index a101f0ff..f975ebc4 100644 --- a/src/startup/prxexports.c +++ b/src/startup/prxexports.c @@ -11,8 +11,8 @@ #include #define NULL ((void *) 0) -void extern module_start; -void extern module_info; +extern int module_start; +extern struct SceModuleInfo module_info; static const unsigned int __syslib_exports[4] __attribute__((section(".rodata.sceResident"))) = { 0xD632ACDB, 0xF01D73A7, @@ -21,5 +21,5 @@ static const unsigned int __syslib_exports[4] __attribute__((section(".rodata.sc }; const struct _PspLibraryEntry __library_exports[1] __attribute__((section(".lib.ent"), used)) = { - { NULL, 0x0000, 0x8000, 4, 1, 1, &__syslib_exports }, + { NULL, 0x0000, 0x8000, 4, 1, 1, (unsigned int *) &__syslib_exports }, }; diff --git a/tools/psp-fixup-imports.c b/tools/psp-fixup-imports.c index d67bb081..c9d838b6 100644 --- a/tools/psp-fixup-imports.c +++ b/tools/psp-fixup-imports.c @@ -283,7 +283,6 @@ int validate_header(unsigned char *data) int load_sections(unsigned char *data) { int ret = 0; - int found_rel = 0; unsigned int load_addr = 0xFFFFFFFF; if(g_elfhead.iShnum > 0) @@ -336,7 +335,6 @@ int load_sections(unsigned char *data) && (g_elfsections[g_elfsections[i].iInfo].iFlags & SHF_ALLOC)) { g_elfsections[i].pRef = &g_elfsections[g_elfsections[i].iInfo]; - found_rel = 1; } }