Global Variables #4262
Replies: 3 comments
-
Update: I've eliminated 38 Config definitions, e.g. Config globals
|
Beta Was this translation helpful? Give feedback.
-
Replace global Variables by non-global VariablesThe following steps might be used for the whole program, So if there are global variables that are used in many places of the program If some global variables are only used inside one C-file / compilation unit (and That there already is a globals.c I had not in mind, when writing these rather generic text. I: Awareness
II: Refactorings
III: Ideas on how to achieve these StepsSome existing tools might be used, which can help. For step 1:
For step 2:
For step 3:
For step 4:
For step 5:
For step 6:
|
Beta Was this translation helpful? Give feedback.
-
Regarding the use of
This is inspired by this discussion here: I just started with some of the first recommendations there, there is more that can be used to get more precise output. |
Beta Was this translation helpful? Give feedback.
-
NeoMutt has quite a lot of global variables.
That's not good.
Once you've filtered out the
const
"variables" (the fixed data), there are233195 left.By comparison, upstream Mutt has 430 non-
const
globals.NeoMutt's can be divided into 96 shared and
13799 static globals.If you can find a way to eliminate any of them, please let us know.
Thanks ❤️
Click to expand the lists:
Shared globals
Static globals
Beta Was this translation helpful? Give feedback.
All reactions