Skip to content

Commit

Permalink
Code adjustments to fix warnings.
Browse files Browse the repository at this point in the history
Change-Id: Iba40752c6c5baaadc2a1b6a0fd03cbb0e3cde8a3
  • Loading branch information
TankOs committed Jan 5, 2015
1 parent 896bd51 commit 92ca32b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/X11/X11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int main()

while (running)
{
while (event = xcb_poll_for_event(xcbConnection))
while ((event = xcb_poll_for_event(xcbConnection)))
{
running = false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SFML/Window/Unix/InputImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ bool InputImpl::isKeyPressed(Keyboard::Key key)


////////////////////////////////////////////////////////////
void InputImpl::setVirtualKeyboardVisible(bool visible)
void InputImpl::setVirtualKeyboardVisible(bool /*visible*/)
{
// Not applicable
}
Expand Down
1 change: 0 additions & 1 deletion src/SFML/Window/Unix/VideoModeImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ VideoMode VideoModeImpl::getDesktopMode()
if (! errors)
{
// Get the current video mode
xcb_randr_rotation_t Rotation = (xcb_randr_rotation_t)config->rotation;
xcb_randr_mode_t currentMode = config->sizeID;

// Get the available screen sizes
Expand Down
20 changes: 5 additions & 15 deletions src/SFML/Window/Unix/WindowImplX11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ namespace
PointerMotionMask | KeyPressMask | KeyReleaseMask | StructureNotifyMask |
EnterWindowMask | LeaveWindowMask;

// Filter the events received by windows (only allow those matching a specific window)
Bool checkEvent(::Display*, XEvent* event, XPointer userData)
{
// Just check if the event matches the window
return event->xany.window == reinterpret_cast< ::Window >(userData);
}

// Find the name of the current executable
void findExecutableName(char* buffer, std::size_t bufferSize)
{
Expand Down Expand Up @@ -127,7 +120,7 @@ m_useSizeHints(false)
if (m_window)
{
// Make sure the window is listening to all the required events
const uint32_t value_list[] = {eventMask};
const uint32_t value_list[] = {static_cast<uint32_t>(eventMask)};

xcb_change_window_attributes(m_connection,
m_window,
Expand All @@ -141,7 +134,7 @@ m_useSizeHints(false)


////////////////////////////////////////////////////////////
WindowImplX11::WindowImplX11(VideoMode mode, const String& title, unsigned long style, const ContextSettings& settings) :
WindowImplX11::WindowImplX11(VideoMode mode, const String& title, unsigned long style, const ContextSettings& /*settings*/) :
m_window (0),
m_inputMethod (NULL),
m_inputContext(NULL),
Expand Down Expand Up @@ -184,11 +177,8 @@ m_useSizeHints(false)
if (fullscreen)
switchToFullscreen(mode);

// Choose the visual according to the context settings
XVisualInfo visualInfo = ContextType::selectBestVisual(m_display, mode.bitsPerPixel, settings);

// Define the window attributes
const uint32_t value_list[] = {fullscreen, eventMask};
const uint32_t value_list[] = {fullscreen, static_cast<uint32_t>(eventMask)};

// Create the window
m_window = xcb_generate_id(m_connection);
Expand Down Expand Up @@ -378,7 +368,7 @@ void WindowImplX11::processEvents()
xcb_key_release_event_t* lastKeyReleaseEvent = NULL;
uint8_t eventType = 0;

while(event = xcb_poll_for_event(m_connection))
while((event = xcb_poll_for_event(m_connection)))
{
eventType = event->response_type & ~0x80;

Expand Down Expand Up @@ -459,7 +449,7 @@ Vector2i WindowImplX11::getPosition() const
////////////////////////////////////////////////////////////
void WindowImplX11::setPosition(const Vector2i& position)
{
uint32_t values[] = {position.x, position.y};
uint32_t values[] = {static_cast<uint32_t>(position.x), static_cast<uint32_t>(position.y)};
xcb_configure_window(m_connection, m_window,
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y,
values);
Expand Down

0 comments on commit 92ca32b

Please sign in to comment.