diff --git a/src/lib/platform/EiKeyState.cpp b/src/lib/platform/EiKeyState.cpp index 93f0a032f..9baf5c9e1 100644 --- a/src/lib/platform/EiKeyState.cpp +++ b/src/lib/platform/EiKeyState.cpp @@ -217,7 +217,7 @@ void EiKeyState::getKeyMap(deskflow::KeyMap &keyMap) deskflow::KeyMap::KeyItem item{}; xkb_keysym_t keysym = syms[0]; - KeySym sym = static_cast(keysym); + KeySym sym = keysym; item.m_id = XWindowsUtil::mapKeySymToKeyID(sym); item.m_button = static_cast(keycode) - 8; // X keycode offset item.m_group = group; diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index 121b5479c..79263b528 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -1202,7 +1202,7 @@ void XWindowsScreen::handleSystemEvent(const Event &event) #ifdef HAVE_XI2 if (m_xi2detected) { // Process RawMotion - auto *cookie = (XGenericEventCookie *)&xevent->xcookie; + auto *cookie = &xevent->xcookie; if (XGetEventData(m_display, cookie) && cookie->type == GenericEvent && cookie->extension == xi_opcode) { if (cookie->evtype == XI_RawMotion) { // Get current pointer's position @@ -1343,7 +1343,7 @@ void XWindowsScreen::handleSystemEvent(const Event &event) case XkbStateNotify: LOG_INFO("group change: %d", xkbEvent->state.group); - m_keyState->setActiveGroup((int32_t)xkbEvent->state.group); + m_keyState->setActiveGroup(xkbEvent->state.group); return; default: diff --git a/src/lib/platform/XWindowsUtil.cpp b/src/lib/platform/XWindowsUtil.cpp index 5c2adb81d..25721c1cf 100644 --- a/src/lib/platform/XWindowsUtil.cpp +++ b/src/lib/platform/XWindowsUtil.cpp @@ -1576,7 +1576,7 @@ bool XWindowsUtil::getWindowProperty( *type = actualType; } if (format != nullptr) { - *format = static_cast(actualDatumSize); + *format = actualDatumSize; } if (okay) { @@ -1747,7 +1747,7 @@ KeyID XWindowsUtil::mapKeySymToKeyID(KeySym k) default: { // lookup character in table if (KeySymMap::const_iterator index = s_keySymToUCS4.find(k); index != s_keySymToUCS4.end()) { - return static_cast(index->second); + return index->second; } // unknown character diff --git a/src/lib/server/Server.cpp b/src/lib/server/Server.cpp index 570c28df5..9c0f26e99 100644 --- a/src/lib/server/Server.cpp +++ b/src/lib/server/Server.cpp @@ -504,11 +504,11 @@ float Server::mapToFraction(const BaseClientProxy *client, Direction dir, int32_ using enum Direction; case Left: case Right: - return static_cast(y - sy + 0.5f) / static_cast(sh); + return (y - sy + 0.5f) / static_cast(sh); case Top: case Bottom: - return static_cast(x - sx + 0.5f) / static_cast(sw); + return (x - sx + 0.5f) / static_cast(sw); case NoDirection: assert(0 && "bad direction");