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

VideoCommon/Statistics: Minor cleanup changes #8238

Merged
merged 4 commits into from Jul 11, 2019

Conversation

2 participants
@lioncash
Copy link
Member

commented Jul 11, 2019

Normalizes statistic variable names, and also renames the statistic global variable from stats to g_stats. The latter change makes it much more obvious in certain bits of code that a global variable is being accessed.

While we're at it, we can also make the functions in the Statistics interface non-static so that the behavior of the class itself is decoupled from the global variable (which also makes for less reading).

lioncash added some commits Jul 11, 2019

VideoCommon/Statistics: Normalize statistic variable names
Normalizes all variables related to statistics so that they follow our
coding style.

These are relatively low traffic areas, so this modification isn't too
noisy.
VideoCommon/Statistics: Make all member functions non-static
Rather than making Statistics' member functions operate on the global
variable instance of itself, we can make these functions member
functions and operate on a by-instance state, removing the direct
dependency on the global variable itself.

This also makes for less reading, as there's no need to repeat "stats."
for all variable accesses.
VideoCommon/Statistics: Rename stats global to g_stats
Makes the global variable follow our convention of prefixing g_ on
global variables to make it obvious in surrounding code that it's not a
local variable.
VideoCommon/Statistics: Remove unused DECSTAT macro
This isn't used anywhere, so it can be removed. This also potentially
fixes an underlying compilation error waiting to happen, given DECSTAT
could have potentially been used, someone disables statistics (for
whatever reason), then gets a compilation error due to the #else case
not containing an empty definition of DECSTAT.
@stenzek
Copy link
Contributor

left a comment

LGTM, we could probably drop the INCSTAT macro too, since it's not really doing anything special.. but that can be a separate change.

@stenzek stenzek merged commit 4c649d1 into dolphin-emu:master Jul 11, 2019

10 checks passed

default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details

@lioncash lioncash deleted the lioncash:video-stats branch Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.