-
Notifications
You must be signed in to change notification settings - Fork 511
Fix some trivial warnings found by MSVC (NFC). And a bug with SpaceMouse. #532
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
Conversation
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'
That is not a potential bug, but certainly a real one. Not sure how this one has slipped through... |
I preferred to be polite ;-) |
Yes, but now I have to fix up the commit message, because when it says "potential" it's misleading. |
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'
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? |
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. |
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'