mirror of
https://github.com/zeldaret/oot
synced 2026-07-09 14:45:41 -04:00
Apply noreturn attribute where applicable (#1532)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
u32 gIsCtrlr2Valid = false;
|
||||
|
||||
void func_800D31A0(void) {
|
||||
NORETURN void func_800D31A0(void) {
|
||||
osSyncPrintf(VT_FGCOL(RED) "\n**** Freeze!! ****\n" VT_RST);
|
||||
while (true) {
|
||||
Sleep_Msec(1000);
|
||||
|
||||
+8
-2
@@ -1304,19 +1304,25 @@ void Fault_HungupFaultClient(const char* exp1, const char* exp2) {
|
||||
* error occurs. The parameters specify two messages detailing the error, one
|
||||
* or both may be NULL.
|
||||
*/
|
||||
void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2) {
|
||||
NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2) {
|
||||
FaultClient client;
|
||||
s32 pad;
|
||||
|
||||
Fault_AddClient(&client, Fault_HungupFaultClient, (void*)exp1, (void*)exp2);
|
||||
*(u32*)0x11111111 = 0; // trigger an exception via unaligned memory access
|
||||
|
||||
// Since the above line triggers an exception and transfers execution to the fault handler
|
||||
// this function does not return and the rest of the function is unreachable.
|
||||
#ifdef __GNUC__
|
||||
__builtin_unreachable();
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Like `Fault_AddHungupAndCrashImpl`, however provides a fixed message containing
|
||||
* filename and line number
|
||||
*/
|
||||
void Fault_AddHungupAndCrash(const char* file, s32 line) {
|
||||
NORETURN void Fault_AddHungupAndCrash(const char* file, s32 line) {
|
||||
char msg[256];
|
||||
|
||||
sprintf(msg, "HungUp %s:%d", file, line);
|
||||
|
||||
Reference in New Issue
Block a user