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

Fix some trivial warnings found by MSVC (NFC). And a bug with SpaceMouse. #532

Merged
merged 2 commits into from Feb 20, 2020

Conversation

ruevs
Copy link
Member

@ruevs ruevs commented Dec 18, 2019

Found with /W4 by MSVC 2019 (Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28314)

A bunch of implicit casts 'double' to 'float' and one 'int64_t' to 'unsigned'.

.\src\platform\guiwin.cpp(1237): warning C4701: potentially uninitialized local variable 'cursorName' used
.\src\platform\guiwin.cpp(1237): warning C4703: potentially uninitialized local pointer variable 'cursorName' used

.\src\solvespace.cpp(805,30): warning C4456: declaration of 'gs' hides previous local declaration
.\src\solvespace.cpp(715,17): message : see declaration of 'gs'

.\src\solvespace.cpp(849,47): warning C4456: declaration of 'e' hides previous local declaration
.\src\solvespace.cpp(847,29): message : see declaration of 'e'

.\src\render\render.h(288,51): warning C4458: declaration of 'camera' hides class member
.\src\render\render.h(271,17): message : see declaration of 'SolveSpace::SurfaceRenderer::camera'

.\src\render\render.h(289,57): warning C4458: declaration of 'lighting' hides class member
.\src\render\render.h(272,17): message : see declaration of 'SolveSpace::SurfaceRenderer::lighting'

Fix a potential bug with 3Dconnexion: SpaceMouse

Another warning is an actual bug. How does the SpaceMouse (I do not have one) work at all?

.\src\platform\guiwin.cpp(1392,34): warning C4459: declaration of 'hSpaceWareDriverClass' hides global declaration
.\src\platform\guiwin.cpp(1389,13): message : see declaration of 'SolveSpace::Platform::hSpaceWareDriverClass'

Found with /W4 by MSVC 2019 (Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28314)

A bunch of implicit casts 'double' to 'float' and one 'int64_t' to 'unsigned'.

.\src\platform\guiwin.cpp(1237): warning C4701: potentially uninitialized local variable 'cursorName' used
.\src\platform\guiwin.cpp(1237): warning C4703: potentially uninitialized local pointer variable 'cursorName' used

.\src\solvespace.cpp(805,30): warning C4456: declaration of 'gs' hides previous local declaration
.\src\solvespace.cpp(715,17): message : see declaration of 'gs'

.\src\solvespace.cpp(849,47): warning C4456: declaration of 'e' hides previous local declaration
.\src\solvespace.cpp(847,29): message : see declaration of 'e'

.\src\render\render.h(288,51): warning C4458: declaration of 'camera' hides class member
.\src\render\render.h(271,17): message : see declaration of 'SolveSpace::SurfaceRenderer::camera'

.\src\render\render.h(289,57): warning C4458: declaration of 'lighting' hides class member
.\src\render\render.h(272,17): message : see declaration of 'SolveSpace::SurfaceRenderer::lighting'
@ruevs ruevs changed the title Fix some trivial warnings found by MSVC. NFC. Fix some trivial warnings found by MSVC. NFC. And a potential bug with SpeceMouse. Dec 18, 2019
@ruevs ruevs changed the title Fix some trivial warnings found by MSVC. NFC. And a potential bug with SpeceMouse. Fix some trivial warnings found by MSVC (NFC). And a potential bug with SpeceMouse. Dec 18, 2019
@whitequark
Copy link
Contributor

That is not a potential bug, but certainly a real one. Not sure how this one has slipped through...

@ruevs
Copy link
Member Author

ruevs commented Dec 18, 2019

I preferred to be polite ;-)

@whitequark
Copy link
Contributor

Yes, but now I have to fix up the commit message, because when it says "potential" it's misleading.

@ruevs
Copy link
Member Author

ruevs commented Dec 21, 2019

Sorry. I amended my commit.

A warning found with /W4 by MSVC 2019 (Microsoft (R) C/C++ Optimizing Compiler Version 19.24.28314)
is an actual bug. How does the SpaceMouse (I do not have one) work at all when the global `hSpaceWareDriverClass` is NULL?!

.\src\platform\guiwin.cpp(1392,34): warning C4459: declaration of 'hSpaceWareDriverClass' hides global declaration
.\src\platform\guiwin.cpp(1389,13): message : see declaration of 'SolveSpace::Platform::hSpaceWareDriverClass'
@ruevs ruevs changed the title Fix some trivial warnings found by MSVC (NFC). And a potential bug with SpeceMouse. Fix some trivial warnings found by MSVC (NFC). And a bug with SpeceMouse. Dec 23, 2019
@ruevs ruevs changed the title Fix some trivial warnings found by MSVC (NFC). And a bug with SpeceMouse. Fix some trivial warnings found by MSVC (NFC). And a bug with SpaceMouse. Feb 20, 2020
@ruevs
Copy link
Member Author

ruevs commented Feb 20, 2020

I split the PR into two commits - one for the trivial warnings and one for the SpaceMouse bug fix. Is there anything else I should do?

@whitequark whitequark merged commit 8ef3cac into solvespace:master Feb 20, 2020
@whitequark
Copy link
Contributor

Thank you, and sorry for the delay. I think GitHub doesn't always send emails once you update the PR, so a comment helps me notice that it's fixed.

@ruevs ruevs deleted the WarnFix branch February 20, 2020 14:55
@ruevs ruevs mentioned this pull request Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants