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 Clang warnings in DRM code #2297

Closed
ChrisThrasher opened this issue Dec 14, 2022 · 1 comment · Fixed by #2298
Closed

Fix Clang warnings in DRM code #2297

ChrisThrasher opened this issue Dec 14, 2022 · 1 comment · Fixed by #2298

Comments

@ChrisThrasher
Copy link
Member

Subject of the issue

/home/thrasher/Projects/sfml/src/SFML/Window/DRM/InputImplUDev.cpp:415:36: error: implicit conversion changes signedness: 'sf::Keyboard::Key' to 'std::vector<bool, type-parameter-0-0>::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                            keyMap[kb] = inputEvent.value;
                            ~~~~~~ ^~
/home/thrasher/Projects/sfml/src/SFML/Window/DRM/InputImplUDev.cpp:496:39: error: use of old-style cast [-Werror,-Wold-style-cast]
        newTerminalConfig.c_lflag &= ~(tcflag_t)ICANON;
                                      ^         ~~~~~~
/home/thrasher/Projects/sfml/src/SFML/Window/DRM/InputImplUDev.cpp:567:19: error: implicit conversion changes signedness: 'Keyboard::Key' to 'std::vector<bool, type-parameter-0-0>::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    return keyMap[key];
           ~~~~~~ ^~~
/home/thrasher/Projects/sfml/src/SFML/Window/DRM/InputImplUDev.cpp:695:35: error: use of old-style cast [-Werror,-Wold-style-cast]
    newTerminalConfig.c_lflag &= ~(tcflag_t)ECHO;         // disable console feedback
                                  ^         ~~~~
/home/thrasher/Projects/sfml/src/SFML/Window/DRM/InputImplUDev.cpp:696:35: error: use of old-style cast [-Werror,-Wold-style-cast]
    newTerminalConfig.c_lflag &= ~(tcflag_t)ISIG;         // disable signals
                                  ^         ~~~~
5 errors generated.

Clang generates some warnings in the DRM code that GCC does not. It's just a matter of fixing some casts. The warnings are present in 2.6.x and master so let's fix this in 2.6.x so both branches can benefit from it.

@ChrisThrasher
Copy link
Member Author

Fixed in #2297

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.6.0
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant