diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-06-22 14:48:52 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-06-22 14:49:01 +0200 |
commit | 0deade2883dbbfe63b007fffef113565a56d3ba9 (patch) | |
tree | 596aee6342e3e99064736cea9c32b13a4abb3103 | |
parent | 3f0f7caa45a2243f231610883e09bcfb3a6ccd4b (diff) | |
download | serenity-0deade2883dbbfe63b007fffef113565a56d3ba9.zip |
WindowServer: Fix compiler warnings.
-rw-r--r-- | Servers/WindowServer/WSClientConnection.cpp | 6 | ||||
-rw-r--r-- | Servers/WindowServer/WSEventLoop.cpp | 8 | ||||
-rw-r--r-- | Servers/WindowServer/WSWindow.cpp | 4 | ||||
-rw-r--r-- | Servers/WindowServer/WSWindowManager.cpp | 2 | ||||
-rw-r--r-- | Servers/WindowServer/WSWindowManager.h | 2 |
5 files changed, 12 insertions, 10 deletions
diff --git a/Servers/WindowServer/WSClientConnection.cpp b/Servers/WindowServer/WSClientConnection.cpp index c112ebdd65..5ac8867d29 100644 --- a/Servers/WindowServer/WSClientConnection.cpp +++ b/Servers/WindowServer/WSClientConnection.cpp @@ -82,11 +82,11 @@ void WSClientConnection::post_message(const WSAPI_ServerMessage& message, const struct iovec iov[2]; int iov_count = 1; - iov[0].iov_base = (void*)&message; + iov[0].iov_base = const_cast<WSAPI_ServerMessage*>(&message); iov[0].iov_len = sizeof(message); if (!extra_data.is_empty()) { - iov[1].iov_base = (void*)extra_data.data(); + iov[1].iov_base = const_cast<byte*>(extra_data.data()); iov[1].iov_len = extra_data.size(); ++iov_count; } @@ -110,7 +110,7 @@ void WSClientConnection::post_message(const WSAPI_ServerMessage& message, const } } - ASSERT(nwritten == sizeof(message) + extra_data.size()); + ASSERT(nwritten == (int)(sizeof(message) + extra_data.size())); } void WSClientConnection::notify_about_new_screen_rect(const Rect& rect) diff --git a/Servers/WindowServer/WSEventLoop.cpp b/Servers/WindowServer/WSEventLoop.cpp index 7463ef4026..2758aaf213 100644 --- a/Servers/WindowServer/WSEventLoop.cpp +++ b/Servers/WindowServer/WSEventLoop.cpp @@ -103,14 +103,14 @@ void WSEventLoop::drain_keyboard() static Vector<Rect, 32> get_rects(const WSAPI_ClientMessage& message, const ByteBuffer& extra_data) { Vector<Rect, 32> rects; - if (message.rect_count > (WSAPI_ClientMessage::max_inline_rect_count + extra_data.size() / sizeof(WSAPI_Rect))) { + if (message.rect_count > (int)(WSAPI_ClientMessage::max_inline_rect_count + extra_data.size() / sizeof(WSAPI_Rect))) { return {}; } for (int i = 0; i < min(WSAPI_ClientMessage::max_inline_rect_count, message.rect_count); ++i) rects.append(message.rects[i]); if (!extra_data.is_empty()) { auto* extra_rects = reinterpret_cast<const WSAPI_Rect*>(extra_data.data()); - for (int i = 0; i < (extra_data.size() / sizeof(WSAPI_Rect)); ++i) + for (int i = 0; i < (int)(extra_data.size() / sizeof(WSAPI_Rect)); ++i) rects.append(extra_rects[i]); } return rects; @@ -378,8 +378,10 @@ void WSEventLoop::drain_client(WSClientConnection& client) extra_data = ByteBuffer::create_uninitialized(message.extra_size); // FIXME: We should allow this to time out. Maybe use a socket timeout? int extra_nread = read(client.fd(), extra_data.data(), extra_data.size()); - if (extra_nread != message.extra_size) { + if (extra_nread != (int)message.extra_size) { dbgprintf("extra_nread(%d) != extra_size(%d)\n", extra_nread, extra_data.size()); + if (extra_nread < 0) + perror("read"); return client.did_misbehave(); } } diff --git a/Servers/WindowServer/WSWindow.cpp b/Servers/WindowServer/WSWindow.cpp index ce03c90902..e69cd3ce07 100644 --- a/Servers/WindowServer/WSWindow.cpp +++ b/Servers/WindowServer/WSWindow.cpp @@ -234,7 +234,7 @@ void WSWindow::event(CEvent& event) server_message.wm.is_active = changed_event.is_active(); server_message.wm.is_minimized = changed_event.is_minimized(); server_message.wm.window_type = to_api(changed_event.window_type()); - ASSERT(changed_event.title().length() < sizeof(server_message.text)); + ASSERT(changed_event.title().length() < (int)sizeof(server_message.text)); memcpy(server_message.text, changed_event.title().characters(), changed_event.title().length()); server_message.text_length = changed_event.title().length(); server_message.wm.rect = changed_event.rect(); @@ -246,7 +246,7 @@ void WSWindow::event(CEvent& event) server_message.type = WSAPI_ServerMessage::Type::WM_WindowIconChanged; server_message.wm.client_id = changed_event.client_id(); server_message.wm.window_id = changed_event.window_id(); - ASSERT(changed_event.icon_path().length() < sizeof(server_message.text)); + ASSERT(changed_event.icon_path().length() < (int)sizeof(server_message.text)); memcpy(server_message.text, changed_event.icon_path().characters(), changed_event.icon_path().length()); server_message.text_length = changed_event.icon_path().length(); break; diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp index 9129f4c226..8cfa079e9a 100644 --- a/Servers/WindowServer/WSWindowManager.cpp +++ b/Servers/WindowServer/WSWindowManager.cpp @@ -66,7 +66,7 @@ WSWindowManager::WSWindowManager() m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, WSMenuItem::Separator)); m_system_menu->add_item(make<WSMenuItem>(*m_system_menu, 300, "Shutdown...")); m_system_menu->on_item_activation = [this, apps](WSMenuItem& item) { - if (item.identifier() >= 1 && item.identifier() <= 1 + apps.size() - 1) { + if (item.identifier() >= 1 && item.identifier() <= 1u + apps.size() - 1) { if (fork() == 0) { const auto& bin = apps[item.identifier() - 1].binary_name; execl(bin, bin, nullptr); diff --git a/Servers/WindowServer/WSWindowManager.h b/Servers/WindowServer/WSWindowManager.h index 2dad80a4df..6bd77b3eea 100644 --- a/Servers/WindowServer/WSWindowManager.h +++ b/Servers/WindowServer/WSWindowManager.h @@ -215,7 +215,7 @@ private: CElapsedTimer m_middle_click_clock; }; DoubleClickInfo m_double_click_info; - unsigned int m_double_click_speed; + int m_double_click_speed { 0 }; WeakPtr<WSWindow> m_active_window; WeakPtr<WSWindow> m_hovered_window; |