From 95f856c39e81e2b723065e757b4dcf577441c558 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 9 Sep 2017 18:17:09 -0500 Subject: more script_menu refactoring --- src/script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script.c') diff --git a/src/script.c b/src/script.c index 8f12da437..18abb6e84 100644 --- a/src/script.c +++ b/src/script.c @@ -40,7 +40,7 @@ u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr) return 1; } -void SetupNativeScript(struct ScriptContext *ctx, void *ptr) +void SetupNativeScript(struct ScriptContext *ctx, NativeScriptFunc ptr) { ctx->mode = 2; ctx->nativePtr = ptr; @@ -64,7 +64,7 @@ u8 RunScriptCommand(struct ScriptContext *ctx) case 2: if (ctx->nativePtr) { - if (ctx->nativePtr() == 1) + if (ctx->nativePtr() == TRUE) ctx->mode = 1; return 1; } -- cgit v1.2.3 From 66a148af9fea2a7029f5aae362e80b440686064e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sat, 9 Sep 2017 18:33:29 -0500 Subject: let's not mess around with typedefs now --- src/script.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script.c') diff --git a/src/script.c b/src/script.c index 18abb6e84..394085d4a 100644 --- a/src/script.c +++ b/src/script.c @@ -40,7 +40,7 @@ u8 SetupBytecodeScript(struct ScriptContext *ctx, const u8 *ptr) return 1; } -void SetupNativeScript(struct ScriptContext *ctx, NativeScriptFunc ptr) +void SetupNativeScript(struct ScriptContext *ctx, bool8 (*ptr)(void)) { ctx->mode = 2; ctx->nativePtr = ptr; -- cgit v1.2.3 From a185f8a26dc5e5a04908c272ab54bede7af8a10c Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 12 Sep 2017 16:53:04 -0500 Subject: lots more relabeling --- src/script.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/script.c') diff --git a/src/script.c b/src/script.c index 394085d4a..f049b96fc 100644 --- a/src/script.c +++ b/src/script.c @@ -228,16 +228,16 @@ void ScriptContext2_RunNewScript(const u8 *ptr) ; } -u8 *mapheader_get_tagged_pointer(u8 tag) +static u8 *mapheader_get_tagged_pointer(u8 tag) { u8 *mapScripts = gMapHeader.mapScripts; - if (!mapScripts) + if (mapScripts == NULL) return NULL; while (1) { - if (!*mapScripts) + if (*mapScripts == 0) return NULL; if (*mapScripts == tag) { @@ -248,14 +248,14 @@ u8 *mapheader_get_tagged_pointer(u8 tag) } } -void mapheader_run_script_by_tag(u8 tag) +static void mapheader_run_script_by_tag(u8 tag) { u8 *ptr = mapheader_get_tagged_pointer(tag); if (ptr) ScriptContext2_RunNewScript(ptr); } -u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag) +static u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag) { u8 *ptr = mapheader_get_tagged_pointer(tag); @@ -316,7 +316,7 @@ void mapheader_run_first_tag4_script_list_match(void) ScriptContext2_RunNewScript(ptr); } -u32 CalculateRamScriptChecksum(void) +static u32 CalculateRamScriptChecksum(void) { u32 i; u32 sum = 0; -- cgit v1.2.3