mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Rename variables to avoid C++ reserved "_[A-Z]" prefix
This commit is contained in:
@@ -24,8 +24,8 @@ std::unordered_set<std::string> purgedSymbols;
|
|||||||
|
|
||||||
static Symbol const *labelScope = nullptr; // Current section's label scope
|
static Symbol const *labelScope = nullptr; // Current section's label scope
|
||||||
static Symbol *PCSymbol;
|
static Symbol *PCSymbol;
|
||||||
static Symbol *_NARGSymbol;
|
static Symbol *NARGSymbol;
|
||||||
static Symbol *_RSSymbol;
|
static Symbol *RSSymbol;
|
||||||
static char savedTIME[256];
|
static char savedTIME[256];
|
||||||
static char savedDATE[256];
|
static char savedDATE[256];
|
||||||
static char savedTIMESTAMP_ISO8601_LOCAL[256];
|
static char savedTIMESTAMP_ISO8601_LOCAL[256];
|
||||||
@@ -41,7 +41,7 @@ void sym_ForEach(void (*callback)(Symbol &)) {
|
|||||||
callback(it.second);
|
callback(it.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t Callback_NARG() {
|
static int32_t NARGCallback() {
|
||||||
if (MacroArgs const *macroArgs = fstk_GetCurrentMacroArgs(); macroArgs) {
|
if (MacroArgs const *macroArgs = fstk_GetCurrentMacroArgs(); macroArgs) {
|
||||||
return macroArgs->nbArgs();
|
return macroArgs->nbArgs();
|
||||||
} else {
|
} else {
|
||||||
@@ -50,7 +50,7 @@ static int32_t Callback_NARG() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t CallbackPC() {
|
static int32_t PCCallback() {
|
||||||
return sect_GetSymbolSection()->org + sect_GetSymbolOffset();
|
return sect_GetSymbolSection()->org + sect_GetSymbolOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ Symbol *sym_FindScopedValidSymbol(std::string const &symName) {
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
// `_NARG` has no value outside of a macro
|
// `_NARG` has no value outside of a macro
|
||||||
if (sym == _NARGSymbol && !fstk_GetCurrentMacroArgs()) {
|
if (sym == NARGSymbol && !fstk_GetCurrentMacroArgs()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return sym;
|
return sym;
|
||||||
@@ -200,12 +200,12 @@ bool sym_IsPurgedScoped(std::string const &symName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t sym_GetRSValue() {
|
int32_t sym_GetRSValue() {
|
||||||
return _RSSymbol->getOutputValue();
|
return RSSymbol->getOutputValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sym_SetRSValue(int32_t value) {
|
void sym_SetRSValue(int32_t value) {
|
||||||
updateSymbolFilename(*_RSSymbol);
|
updateSymbolFilename(*RSSymbol);
|
||||||
_RSSymbol->data = value;
|
RSSymbol->data = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a constant symbol's value, assuming it's defined
|
// Return a constant symbol's value, assuming it's defined
|
||||||
@@ -555,16 +555,16 @@ void sym_SetExportAll(bool set) {
|
|||||||
void sym_Init(time_t now) {
|
void sym_Init(time_t now) {
|
||||||
PCSymbol = &createSymbol("@"s);
|
PCSymbol = &createSymbol("@"s);
|
||||||
PCSymbol->type = SYM_LABEL;
|
PCSymbol->type = SYM_LABEL;
|
||||||
PCSymbol->data = CallbackPC;
|
PCSymbol->data = PCCallback;
|
||||||
PCSymbol->isBuiltin = true;
|
PCSymbol->isBuiltin = true;
|
||||||
|
|
||||||
_NARGSymbol = &createSymbol("_NARG"s);
|
NARGSymbol = &createSymbol("_NARG"s);
|
||||||
_NARGSymbol->type = SYM_EQU;
|
NARGSymbol->type = SYM_EQU;
|
||||||
_NARGSymbol->data = Callback_NARG;
|
NARGSymbol->data = NARGCallback;
|
||||||
_NARGSymbol->isBuiltin = true;
|
NARGSymbol->isBuiltin = true;
|
||||||
|
|
||||||
_RSSymbol = sym_AddVar("_RS"s, 0);
|
RSSymbol = sym_AddVar("_RS"s, 0);
|
||||||
_RSSymbol->isBuiltin = true;
|
RSSymbol->isBuiltin = true;
|
||||||
|
|
||||||
sym_AddString("__RGBDS_VERSION__"s, std::make_shared<std::string>(get_package_version_string()))
|
sym_AddString("__RGBDS_VERSION__"s, std::make_shared<std::string>(get_package_version_string()))
|
||||||
->isBuiltin = true;
|
->isBuiltin = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user