chore: remove uneeded casts
This commit is contained in:
committed by
Chris Rizzitello
parent
f91df1639b
commit
6153f64fb7
@ -217,7 +217,7 @@ void EiKeyState::getKeyMap(deskflow::KeyMap &keyMap)
|
||||
|
||||
deskflow::KeyMap::KeyItem item{};
|
||||
xkb_keysym_t keysym = syms[0];
|
||||
KeySym sym = static_cast<KeyID>(keysym);
|
||||
KeySym sym = keysym;
|
||||
item.m_id = XWindowsUtil::mapKeySymToKeyID(sym);
|
||||
item.m_button = static_cast<KeyButton>(keycode) - 8; // X keycode offset
|
||||
item.m_group = group;
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -1576,7 +1576,7 @@ bool XWindowsUtil::getWindowProperty(
|
||||
*type = actualType;
|
||||
}
|
||||
if (format != nullptr) {
|
||||
*format = static_cast<int32_t>(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<KeyID>(index->second);
|
||||
return index->second;
|
||||
}
|
||||
|
||||
// unknown character
|
||||
|
||||
@ -504,11 +504,11 @@ float Server::mapToFraction(const BaseClientProxy *client, Direction dir, int32_
|
||||
using enum Direction;
|
||||
case Left:
|
||||
case Right:
|
||||
return static_cast<float>(y - sy + 0.5f) / static_cast<float>(sh);
|
||||
return (y - sy + 0.5f) / static_cast<float>(sh);
|
||||
|
||||
case Top:
|
||||
case Bottom:
|
||||
return static_cast<float>(x - sx + 0.5f) / static_cast<float>(sw);
|
||||
return (x - sx + 0.5f) / static_cast<float>(sw);
|
||||
|
||||
case NoDirection:
|
||||
assert(0 && "bad direction");
|
||||
|
||||
Reference in New Issue
Block a user