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

Use of non-static variables and functions #77

Open
JayFoxRox opened this issue May 25, 2019 · 0 comments
Open

Use of non-static variables and functions #77

JayFoxRox opened this issue May 25, 2019 · 0 comments
Labels
bug Something isn't working task

Comments

@JayFoxRox
Copy link
Contributor

There's many cases of non-static variables in the source-code:

int HLEErrorString(char *bufferTemp, SymbolDatabaseList *data, uint16_t buildVersion, uint32_t index)

void HLEError(SymbolDatabaseVerifyContext *context, uint16_t buildVersion, char *format, ...)

...

This also includes all of the OOVPA, which appear to use non-static variables via OOVPA_XREF:

XbSymbolDatabase/OOVPA.h

Lines 136 to 140 in 6820d3f

#define OOVPA_XREF(Name, Version, Count, XRefSaveIndex, XRefCount) \
LOOVPA Name##_##Version = { Count, XRefCount, (unsigned short)XRefSaveIndex, {
#define OOVPA_NO_XREF(Name, Version, Count) \
OOVPA_XREF(Name, Version, Count, XRefNoSaveIndex, XRefZero)


This pollutes the object files with many symbols with limited use-cases. It also hints to the compiler that it shouldn't optimize these functions as they could be called differently.

The project should probably only use non-static for what's found in XbSymbolDatabase.h

@RadWolfie RadWolfie added bug Something isn't working task labels Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working task
Projects
None yet
Development

No branches or pull requests

2 participants