You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/SFML/Window/Unix/InputImpl.cpp:205:31: warning: Value stored to 'result' is never read
case Mouse::Left: result = pointer->mask & XCB_BUTTON_MASK_1;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/SFML/Window/Unix/InputImpl.cpp:206:31: warning: Value stored to 'result' is never read
case Mouse::Right: result = pointer->mask & XCB_BUTTON_MASK_3;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/SFML/Window/Unix/InputImpl.cpp:207:31: warning: Value stored to 'result' is never read
case Mouse::Middle: result = pointer->mask & XCB_BUTTON_MASK_2;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/SFML/Window/Unix/WindowImplX11.cpp:538:73: warning: Use of memory after it is freed
err() << "Failed to set the window's icon: Error code " << (int)errptr->error_code << std::endl;
^~~~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
The first one is less obvious: the "break" statements are missing. It would be much better like this:
// Get pointer maskxcb_query_pointer_reply_t* pointer = xcb_query_pointer_reply(connection, xcb_query_pointer(connection, XDefaultRootWindow(display)), NULL);
uint16_t mask = pointer->mask;
free(pointer);
// Close the connection with the X serverCloseDisplay(display);
switch (button)
{
case Mouse::Left: return mask & XCB_BUTTON_MASK_1;
case Mouse::Right: return mask & XCB_BUTTON_MASK_3;
case Mouse::Middle: return mask & XCB_BUTTON_MASK_2;
case Mouse::XButton1: returnfalse; // not supported by Xcase Mouse::XButton2: returnfalse; // not supported by Xdefault: returnfalse;
}
Found with clang static code analyzer:
https://github.com/LaurentGomila/SFML/blob/master/src/SFML/Window/Unix/InputImpl.cpp#L205
https://github.com/LaurentGomila/SFML/blob/master/src/SFML/Window/Unix/WindowImplX11.cpp#L538
The text was updated successfully, but these errors were encountered: