Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--disable-qualifiers-hints flag #256

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AngheloAlf
Copy link
Contributor

Adds a flag to disable the static and extern qualifiers hints from functions and variables.

extern for variables is being special cased because not using it means migrating the variable with may not be desired.

Quick diff for this flag:

diff --git a/asdf.c b/asdf.c
index b88df7b..2a6c759 100644
--- a/asdf.c
+++ b/asdf.c
@@ -1,45 +1,31 @@
-? PlaySE(? *, ?, s32, s32);                         /* extern */
-s32 func_80001E98_usa(s32, s8 *, s32, s32);         /* extern */
-? func_80002FD0_usa(s32, s16, ?, ?);                /* extern */
-? func_80035504_usa(s32 *);                         /* extern */
-s32 func_800544D4_usa(s32);                         /* extern */
-? func_80058DF0_usa(?, ?, s32, s32);                /* extern */
-? func_8005DD3C_usa(s8 *);                          /* extern */
-? func_8005DDB4_usa(s8 *);                          /* extern */
-? func_8005DDF8_usa(s8 *);                          /* extern */
-? func_8006B628_usa(s8 *);                          /* extern */
-? func_8006B6A8_usa(s8 *);                          /* extern */
-? func_8006B730_usa(s8 *);                          /* extern */
-void func_80035B20_usa(void *arg0, s32 arg1, s32 arg2); /* static */
-void func_80035FF0_usa(void *arg0, s32 arg1, s32 arg2); /* static */
-void func_800364BC_usa();                           /* static */
-void func_800364FC_usa();                           /* static */
-void func_80036A68_usa();                           /* static */
-void func_8003722C_usa();                           /* static */
+? PlaySE(? *, ?, s32, s32);
+s32 func_80001E98_usa(s32, s8 *, s32, s32);
+? func_80002FD0_usa(s32, s16, ?, ?);
+? func_80035504_usa(s32 *);
+s32 func_800544D4_usa(s32);
+? func_80058DF0_usa(?, ?, s32, s32);
+? func_8005DD3C_usa(s8 *);
+? func_8005DDB4_usa(s8 *);
+? func_8005DDF8_usa(s8 *);
+? func_8006B628_usa(s8 *);
+? func_8006B6A8_usa(s8 *);
+? func_8006B730_usa(s8 *);
+void func_80035B20_usa(void *arg0, s32 arg1, s32 arg2);
+void func_80035FF0_usa(void *arg0, s32 arg1, s32 arg2);
+void func_800364BC_usa();
+void func_800364FC_usa();
+void func_80036A68_usa();
+void func_8003722C_usa();
 extern s32 B_8019CF98_usa;
 extern ? D_0101F378_usa;
 extern ? D_01023A68_usa;
 extern ? D_01023C68_usa;
 extern ? D_800B3AFC_usa;
 extern s32 last_song_handle;
-static ? D_800B3B11;                                /* unable to generate initializer */
-static ? D_800B3B15;                                /* unable to generate initializer */
-static ? D_800B3B34_usa;                            /* unable to generate initializer */
-static ? D_800B3B38_usa;                            /* unable to generate initializer */
-static ? D_800B3F04_usa;                            /* unable to generate initializer */
-static ? D_800B3F0C_usa;                            /* unable to generate initializer */
-static ? D_800B3F0E_usa;                            /* unable to generate initializer */
-static ? D_800B3F10_usa;                            /* unable to generate initializer */
-static ? D_800B3F12_usa;                            /* unable to generate initializer */
-static ? D_800B3F14_usa;                            /* unable to generate initializer */
-static ? D_800B3F20_usa;                            /* unable to generate initializer */
-static ? D_800B3F54_usa;                            /* unable to generate initializer */
-static ? D_800B3F88_usa;                            /* unable to generate initializer */
-static ? D_800B3F9C_usa;                            /* unable to generate initializer */
-static ? BGM_INIT_TABLE;                            /* unable to generate initializer */
-static ? SFX_INIT_TABLE;                            /* unable to generate initializer */
 f32 D_FLT_800B3B10_usa;                             /* unable to generate initializer */
+? D_800B3B11;                                       /* unable to generate initializer */
 f32 D_FLT_800B3B14_usa;                             /* unable to generate initializer */
+? D_800B3B15;                                       /* unable to generate initializer */
 u8 D_800B3B18_usa = 2;
 s16 DangerMusicBgmIndex = 1;
 s16 NormalMusicBgmIndex = 0;
@@ -51,6 +37,20 @@ s16 ts_ok_start_timer = 1;
 s16 ts_timer_counter = 0;
 s16 ts_current_alert = 0;
 s16 ts_old_alert = -1;
+? D_800B3B34_usa;                                   /* unable to generate initializer */
+? D_800B3B38_usa;                                   /* unable to generate initializer */
+? D_800B3F04_usa;                                   /* unable to generate initializer */
+? D_800B3F0C_usa;                                   /* unable to generate initializer */
+? D_800B3F0E_usa;                                   /* unable to generate initializer */
+? D_800B3F10_usa;                                   /* unable to generate initializer */
+? D_800B3F12_usa;                                   /* unable to generate initializer */
+? D_800B3F14_usa;                                   /* unable to generate initializer */
+? D_800B3F20_usa;                                   /* unable to generate initializer */
+? D_800B3F54_usa;                                   /* unable to generate initializer */
+? D_800B3F88_usa;                                   /* unable to generate initializer */
+? D_800B3F9C_usa;                                   /* unable to generate initializer */
+? BGM_INIT_TABLE;                                   /* unable to generate initializer */
+? SFX_INIT_TABLE;                                   /* unable to generate initializer */
 
 /*
 Decompilation failure in function func_8004B300_usa:

I noted some variables ended up being reordered, I haven't investigated further, but my guess is m2c is ordering the variables alphabetically and it was considering the static as part of the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant