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

NANCY: Silence variable shadowing warnings #2925

Merged
merged 1 commit into from Apr 13, 2021
Merged

Conversation

@criezy
Copy link
Member

@criezy criezy commented Apr 6, 2021

When compiling the nancy engine I get the following warnings:

In file included from engines/nancy/action/primaryvideo.cpp:29:
./engines/nancy/action/primaryvideo.h:41:29: warning: declaration shadows a variable in namespace
      'Nancy::Action' [-Wshadow]
enum ConditionType : byte { kNone = 0, kEventFlags = 1, kInventory = 2 };
                            ^
./engines/nancy/action/actionrecord.h:41:2: note: previous declaration is here
        kNone               = 0,
        ^
In file included from engines/nancy/action/primaryvideo.cpp:29:
./engines/nancy/action/primaryvideo.h:41:57: warning: declaration shadows a variable in namespace
      'Nancy::Action' [-Wshadow]
enum ConditionType : byte { kNone = 0, kEventFlags = 1, kInventory = 2 };
                                                        ^
./engines/nancy/action/actionrecord.h:42:2: note: previous declaration is here
        kInventory          = 1,
        ^

Since the engine is declared as using c++11 already, I opted to change the DependencyType enum into a scoped enum, which fixes those warnings.

@fracturehill
Copy link
Contributor

@fracturehill fracturehill commented Apr 13, 2021

Looks good, thank you :)

@fracturehill fracturehill merged commit 5dde667 into scummvm:master Apr 13, 2021
3 checks passed
3 checks passed
Codacy Static Code Analysis Codacy Static Code Analysis
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deepcode-ci-bot Well done, no issues found!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants