Closed ghost closed 1 year ago
Firstly, you should've created an issue to report the problem in the first place (which, if I understand it correctly, is that command line arguments overwrite default values before the compiler prints them in function usage()
, e.g. if we invoke the compiler as pawncc -O0
it will print default: -O0
for option -O
, while it's supposed to print -O1
).
Secondly, hardcoding those values at the place of their use is a bad practice. If we'll need to change them for one reason or another, we'll have to modify them not only in function resetglobals()
, but also in usage()
. A good solution should involve keeping those values in one place, e.g.:
// somewhere at the top of sc1.c
#define sDEFAULT_DEBUG_LEVEL sCHKBOUNDS
// in initglobals():
sc_debug=sDEFAULT_DEBUG_LEVEL;
// in about():
pc_printf(" -d<num> debugging level (default=-d%d)\n", sDEFAULT_DEBUG_LEVEL);
What this PR does / why we need it: Changes default values in usage() to default values instead of current values. NOTE: I simply ran pawncc without arguments (and making sure no alias was set), used given values from there. Looking at initglobals() this could still not be 100% accurate:
AMX_COMPACTMARGIN hould be 64 by default, no idea what that does any futher (not that much into AMX). Seems like it should be fine though.
Which issue(s) this PR fixes: None opened
What kind of pull this is:
Additional Documentation: N/A