diff --git a/include/arm9/interrupt.h b/include/arm9/interrupt.h index c7c337b..13a52a1 100644 --- a/include/arm9/interrupt.h +++ b/include/arm9/interrupt.h @@ -46,7 +46,7 @@ void IRQ_registerHandler(Interrupt num, void (*irqHandler)(void)); void IRQ_unregisterHandler(Interrupt num); -static u32 enterCriticalSection(void) +inline u32 enterCriticalSection(void) { u32 tmp; __asm__ __volatile__("mrs %0, cpsr\n\t" : "=r" (tmp) : ); @@ -54,7 +54,7 @@ return tmp & 0x80u; } -static void leaveCriticalSection(u32 oldState) +inline void leaveCriticalSection(u32 oldState) { u32 tmp; __asm__ __volatile__("mrs %0, cpsr\n\t" : "=r" (tmp) : ); diff --git a/include/hid.h b/include/hid.h index 2c292d5..96e2a1f 100644 --- a/include/hid.h +++ b/include/hid.h @@ -21,7 +21,7 @@ KEY_Y = (1<<11), }; -#define HID_KEY_MASK_ALL (KEY_Y << 1) - 1 +#define HID_KEY_MASK_ALL ((KEY_Y << 1) - 1) void hidScanInput(void); diff --git a/source/arm9/debug.c b/source/arm9/debug.c index e9ef7ca..ecbebcb 100644 --- a/source/arm9/debug.c +++ b/source/arm9/debug.c @@ -31,7 +31,7 @@ consoleInit(0, NULL); - printf("\x1b[41m\x1b[0J\x1b[9C****PANIC!!!****\n\nlr = 0x%08"PRIX32"\n", lr); + printf("\x1b[41m\x1b[0J\x1b[9C****PANIC!!!****\n\nlr = 0x%08" PRIX32 "\n", lr); unmount_fs(); devs_close(); @@ -63,15 +63,15 @@ else realPc = excStack[1] - instSize; // Other printf("\x1b[41m\x1b[0J\x1b[9CGuru Meditation Error!\n\n%s:\n", typeStr[type]); - printf("CPSR: 0x%08"PRIX32"\n" - "r0 = 0x%08"PRIX32" r8 = 0x%08"PRIX32"\n" - "r1 = 0x%08"PRIX32" r9 = 0x%08"PRIX32"\n" - "r2 = 0x%08"PRIX32" r10 = 0x%08"PRIX32"\n" - "r3 = 0x%08"PRIX32" r11 = 0x%08"PRIX32"\n" - "r4 = 0x%08"PRIX32" r12 = 0x%08"PRIX32"\n" - "r5 = 0x%08"PRIX32" sp = 0x%08"PRIX32"\n" - "r6 = 0x%08"PRIX32" lr = 0x%08"PRIX32"\n" - "r7 = 0x%08"PRIX32" pc = 0x%08"PRIX32"\n\n", + printf("CPSR: 0x%08" PRIX32 "\n" + "r0 = 0x%08" PRIX32 " r8 = 0x%08" PRIX32 "\n" + "r1 = 0x%08" PRIX32 " r9 = 0x%08" PRIX32 "\n" + "r2 = 0x%08" PRIX32 " r10 = 0x%08" PRIX32 "\n" + "r3 = 0x%08" PRIX32 " r11 = 0x%08" PRIX32 "\n" + "r4 = 0x%08" PRIX32 " r12 = 0x%08" PRIX32 "\n" + "r5 = 0x%08" PRIX32 " sp = 0x%08" PRIX32 "\n" + "r6 = 0x%08" PRIX32 " lr = 0x%08" PRIX32 "\n" + "r7 = 0x%08" PRIX32 " pc = 0x%08" PRIX32 "\n\n", excStack[0], excStack[2], excStack[10], excStack[3], excStack[11], @@ -88,7 +88,8 @@ puts("Stack dump:"); for(u32 i = 0; i < 15; i++) { - printf("0x%08"PRIX32": %08"PRIX32" %08"PRIX32"\n", excStack[15], ((u32*)excStack[15])[0], ((u32*)excStack[15])[1]); + printf("0x%08" PRIX32 ": %08" PRIX32 " %08" PRIX32 "\n", excStack[15], + ((u32*)excStack[15])[0], ((u32*)excStack[15])[1]); excStack[15] += 8; } } diff --git a/source/arm9/menu_firmloader.c b/source/arm9/menu_firmloader.c index 967884f..983bcee 100644 --- a/source/arm9/menu_firmloader.c +++ b/source/arm9/menu_firmloader.c @@ -1,4 +1,5 @@ #include +#include #include #include "types.h" #include "mem_map.h" @@ -145,7 +146,7 @@ if(padValue != expectedPadValue) { printf("Skipping, right buttons are not pressed.\n"); - printf("%x %x\n", padValue, expectedPadValue); + printf("%" PRIX32 " %" PRIX32 "\n", padValue, expectedPadValue); continue; } } @@ -215,7 +216,7 @@ if(padValue != expectedPadValue) { printf("Skipping, right buttons are not pressed.\n"); - printf("%x %x\n", padValue, expectedPadValue); + printf("%" PRIX32 " %" PRIX32 "\n", padValue, expectedPadValue); continue; } }