summaryrefslogtreecommitdiff
path: root/src/dolphin
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-04-30 16:44:08 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2025-04-30 16:44:08 -0400
commit0237004eb30655d6f20510620e43b70353594d7b (patch)
tree092d9aecdbdd187e49f191729f60ddb2c240771c /src/dolphin
parentf2c603a4994d4e12e97c7fcd1f910798b19ffa71 (diff)
Fix some clang errors/warnings
Diffstat (limited to 'src/dolphin')
-rw-r--r--src/dolphin/dvd/dvd.c2
-rw-r--r--src/dolphin/dvd/dvdfs.c2
-rw-r--r--src/dolphin/dvd/dvdidutils.c1
-rw-r--r--src/dolphin/os/OS.c18
-rw-r--r--src/dolphin/os/OSAlarm.c2
-rw-r--r--src/dolphin/os/OSInterrupt.c9
-rw-r--r--src/dolphin/os/OSReset.c1
-rw-r--r--src/dolphin/os/__start.c3
8 files changed, 35 insertions, 3 deletions
diff --git a/src/dolphin/dvd/dvd.c b/src/dolphin/dvd/dvd.c
index 61a5f255..db5779c8 100644
--- a/src/dolphin/dvd/dvd.c
+++ b/src/dolphin/dvd/dvd.c
@@ -2,6 +2,8 @@
#include "dolphin/dvd/dvderror.h"
#include "dolphin/dvd/dvdfs.h"
#include "dolphin/dvd/dvdlow.h"
+#include "dolphin/dvd/dvdqueue.h"
+#include "dolphin/dvd/dvdFatal.h"
#include "dolphin/os/OS.h"
const char* __DVDVersion = "<< Dolphin SDK - DVD\trelease build: Sep 5 2002 05:34:06 (0x2301) >>";
diff --git a/src/dolphin/dvd/dvdfs.c b/src/dolphin/dvd/dvdfs.c
index 8ccb9f22..cc92ab04 100644
--- a/src/dolphin/dvd/dvdfs.c
+++ b/src/dolphin/dvd/dvdfs.c
@@ -177,6 +177,8 @@ BOOL DVDFastOpen(s32 entrynum, DVDFileInfo* fileInfo) {
return TRUE;
}
+BOOL DVDGetCurrentDir(char* path, u32 maxlen);
+
BOOL DVDOpen(const char* fileName, DVDFileInfo* fileInfo) {
s32 entry;
char currentDir[128];
diff --git a/src/dolphin/dvd/dvdidutils.c b/src/dolphin/dvd/dvdidutils.c
index 5493f537..3aea13c9 100644
--- a/src/dolphin/dvd/dvdidutils.c
+++ b/src/dolphin/dvd/dvdidutils.c
@@ -1,5 +1,6 @@
#include "dolphin/dvd/dvdidutils.h"
#include "dolphin/os/OS.h"
+#include <string.h>
static u32 strnlen(const char* str, u32 maxlen) {
u32 i;
diff --git a/src/dolphin/os/OS.c b/src/dolphin/os/OS.c
index e551627c..b3bf6e5f 100644
--- a/src/dolphin/os/OS.c
+++ b/src/dolphin/os/OS.c
@@ -7,6 +7,8 @@
#include "dolphin/db/db.h"
#include "dolphin/pad/Pad.h"
#include "dolphin/dvd/dvdfs.h"
+#include "dolphin/si/SIBios.h"
+#include <string.h>
// #include "TRK_MINNOW_DOLPHIN/Os/dolphin/dolphin_trk.h"
#define OS_BI2_DEBUG_ADDRESS 0x800000F4
@@ -45,6 +47,7 @@ extern f64 ZeroF;
f64 ZeroF;
ASM void __OSFPRInit(void) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -128,6 +131,7 @@ skip_ps_init:
mtfsf 0xff, f0
blr
// clang-format on
+#endif
}
static void DisableWriteGatherPipe(void)
@@ -173,15 +177,15 @@ static void ClearArena(void) {
if ((u32)OSGetArenaLo() < *(u32*)&__OSSavedRegionStart) {
if ((u32)OSGetArenaHi() <= *(u32*)&__OSSavedRegionStart) {
- memset((u32)OSGetArenaLo(), 0U, (u32)OSGetArenaHi() - (u32)OSGetArenaLo());
+ memset(OSGetArenaLo(), 0U, (u32)OSGetArenaHi() - (u32)OSGetArenaLo());
return;
}
memset(OSGetArenaLo(), 0U, *(u32*)&__OSSavedRegionStart - (u32)OSGetArenaLo());
if ((u32)OSGetArenaHi() > *(u32*)&__OSSavedRegionEnd) {
- memset(*(u32*)&__OSSavedRegionEnd, 0,
- (u32)OSGetArenaHi() - *(u32*)&__OSSavedRegionEnd);
+ memset(__OSSavedRegionEnd, 0,
+ (u8*)OSGetArenaHi() - (u8*)__OSSavedRegionEnd);
}
}
}
@@ -452,6 +456,7 @@ static void OSExceptionInit(void) {
}
ASM void __OSDBIntegrator(void) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -477,6 +482,7 @@ entry __OSDBJUMPSTART
bla 0x60
entry __OSDBJUMPEND
// clang-format on
+#endif
}
OSExceptionHandler __OSSetExceptionHandler(__OSException exception, OSExceptionHandler handler) {
@@ -490,6 +496,7 @@ OSExceptionHandler __OSGetExceptionHandler(__OSException exception) {
}
static ASM void OSExceptionVector(void) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -571,10 +578,12 @@ recoverable:
entry __OSEVEnd
nop
// clang-format on
+#endif
}
static ASM void OSDefaultExceptionHandler(register __OSException exception,
register OSContext* context) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -603,9 +612,11 @@ static ASM void OSDefaultExceptionHandler(register __OSException exception,
stwu r1, -8(r1)
b __OSUnhandledException
// clang-format on
+#endif
}
ASM void __OSPSInit(void){
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -626,6 +637,7 @@ ASM void __OSPSInit(void){
mtlr r0
blr
// clang-format on
+#endif
}
vu32 __DIRegs[16] AT_ADDRESS(0xCC006000);
diff --git a/src/dolphin/os/OSAlarm.c b/src/dolphin/os/OSAlarm.c
index 27e1a5f1..1988f1f7 100644
--- a/src/dolphin/os/OSAlarm.c
+++ b/src/dolphin/os/OSAlarm.c
@@ -179,6 +179,7 @@ static void DecrementerExceptionCallback(register __OSException exception,
static ASM void DecrementerExceptionHandler(register __OSException exception,
register OSContext* context) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -203,6 +204,7 @@ static ASM void DecrementerExceptionHandler(register __OSException exception,
stwu r1, -8(r1)
b DecrementerExceptionCallback
// clang-format on
+#endif
}
static BOOL OnReset(BOOL final) {
diff --git a/src/dolphin/os/OSInterrupt.c b/src/dolphin/os/OSInterrupt.c
index 4761ba92..e3fe7ce0 100644
--- a/src/dolphin/os/OSInterrupt.c
+++ b/src/dolphin/os/OSInterrupt.c
@@ -2,11 +2,13 @@
#include "dolphin/dsp.h"
#include "dolphin/exi/EXIBios.h"
#include "dolphin/os/OS.h"
+#include <string.h>
vu32 __PIRegs[12] AT_ADDRESS(0xCC003000);
vu16 __MEMRegs[64] AT_ADDRESS(0xCC004000);
ASM BOOL OSDisableInterrupts(void) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -23,9 +25,11 @@ ASM BOOL OSDisableInterrupts(void) {
rlwinm r3, r3, 17, 31, 31
blr
// clang-format on
+#endif
}
ASM BOOL OSEnableInterrupts(void) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -38,9 +42,11 @@ ASM BOOL OSEnableInterrupts(void) {
rlwinm r3, r3, 17, 31, 31
blr
// clang-format on
+#endif
}
ASM BOOL OSRestoreInterrupts(register BOOL status) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -62,6 +68,7 @@ set_msr:
rlwinm r3, r4, 17, 31, 31
blr
// clang-format on
+#endif
}
static __OSInterruptHandler* InterruptHandlerTable;
@@ -401,6 +408,7 @@ void __OSDispatchInterrupt(__OSException exception, OSContext* context) {
}
static ASM void ExternalInterruptHandler(register __OSInterrupt type, register OSContext* context) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -427,4 +435,5 @@ static ASM void ExternalInterruptHandler(register __OSInterrupt type, register O
stwu r1, -8(r1)
b __OSDispatchInterrupt
// clang-format on
+#endif
}
diff --git a/src/dolphin/os/OSReset.c b/src/dolphin/os/OSReset.c
index 7ce4e732..387865ad 100644
--- a/src/dolphin/os/OSReset.c
+++ b/src/dolphin/os/OSReset.c
@@ -1,5 +1,6 @@
#include "dolphin/os/OSReset.h"
#include "dolphin/os/OS.h"
+#include <string.h>
vu16 __VIRegs[59] AT_ADDRESS(0xCC002000);
OSThreadQueue __OSActiveThreadQueue AT_ADDRESS(OS_BASE_CACHED | 0x00DC);
diff --git a/src/dolphin/os/__start.c b/src/dolphin/os/__start.c
index f246cd2c..b029387c 100644
--- a/src/dolphin/os/__start.c
+++ b/src/dolphin/os/__start.c
@@ -1,6 +1,7 @@
#include "stdlib.h"
#include "global.h"
#include "dolphin/os/OS.h"
+#include <string.h>
#include "dolphin/os/__start.h"
void DBInit();
@@ -13,6 +14,7 @@ SECTION_INIT void __check_pad3(void) {
}
SECTION_INIT ASM void __start(void) {
+#ifdef __MWERKS__
// clang-format off
nofralloc
@@ -113,6 +115,7 @@ lbl_8000329C:
bl main
b exit
// clang-format on
+#endif
}
ASM static void __init_registers(void)