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

VertexLoaderTest: fix maybe-uninitialized warning #5168

Merged
merged 1 commit into from Mar 31, 2017

Conversation

ligfx
Copy link
Contributor

@ligfx ligfx commented Mar 26, 2017

Fixes warning:

../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:222:15: error: variable 'f' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
    ExpectOut(f * scale);
              ^
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:198:12: note: initialize the variable 'f' to silence this warning
    float f, g;
           ^
            = 0.0
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:223:15: error: variable 'g' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
    ExpectOut(g * scale);
              ^
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:198:15: note: initialize the variable 'g' to silence this warning
    float f, g;
              ^
               = 0.0

@@ -218,6 +218,8 @@ TEST_P(VertexLoaderParamTest, PositionAll)
f = *iter++;
g = *iter++;
break;
default:
FAIL() << "We shouldn't get here";

This comment was marked as off-topic.

@lioncash
Copy link
Member

Looks good once @Parlane's comment is addressed in some form.

Fixes warning:

```
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:222:15: error: variable 'f' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
    ExpectOut(f * scale);
              ^
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:198:12: note: initialize the variable 'f' to silence this warning
    float f, g;
           ^
            = 0.0
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:223:15: error: variable 'g' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
    ExpectOut(g * scale);
              ^
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:198:15: note: initialize the variable 'g' to silence this warning
    float f, g;
              ^
               = 0.0
```
@ligfx
Copy link
Contributor Author

ligfx commented Mar 31, 2017

@lioncash Whoops, that one got lost in the shuffle. Updated.

@ligfx ligfx force-pushed the vertexloadertestuninitialized branch from 9de92a7 to b305a6c Compare March 31, 2017 20:51
@lioncash lioncash merged commit 67e950d into dolphin-emu:master Mar 31, 2017
@ligfx ligfx deleted the vertexloadertestuninitialized branch May 24, 2017 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants