chore: remove uneeded casts
This commit is contained in:
parent
f91df1639b
commit
6153f64fb7
4 changed files with 7 additions and 7 deletions
|
|
@ -217,7 +217,7 @@ void EiKeyState::getKeyMap(deskflow::KeyMap &keyMap)
|
||||||
|
|
||||||
deskflow::KeyMap::KeyItem item{};
|
deskflow::KeyMap::KeyItem item{};
|
||||||
xkb_keysym_t keysym = syms[0];
|
xkb_keysym_t keysym = syms[0];
|
||||||
KeySym sym = static_cast<KeyID>(keysym);
|
KeySym sym = keysym;
|
||||||
item.m_id = XWindowsUtil::mapKeySymToKeyID(sym);
|
item.m_id = XWindowsUtil::mapKeySymToKeyID(sym);
|
||||||
item.m_button = static_cast<KeyButton>(keycode) - 8; // X keycode offset
|
item.m_button = static_cast<KeyButton>(keycode) - 8; // X keycode offset
|
||||||
item.m_group = group;
|
item.m_group = group;
|
||||||
|
|
|
||||||
|
|
@ -1202,7 +1202,7 @@ void XWindowsScreen::handleSystemEvent(const Event &event)
|
||||||
#ifdef HAVE_XI2
|
#ifdef HAVE_XI2
|
||||||
if (m_xi2detected) {
|
if (m_xi2detected) {
|
||||||
// Process RawMotion
|
// Process RawMotion
|
||||||
auto *cookie = (XGenericEventCookie *)&xevent->xcookie;
|
auto *cookie = &xevent->xcookie;
|
||||||
if (XGetEventData(m_display, cookie) && cookie->type == GenericEvent && cookie->extension == xi_opcode) {
|
if (XGetEventData(m_display, cookie) && cookie->type == GenericEvent && cookie->extension == xi_opcode) {
|
||||||
if (cookie->evtype == XI_RawMotion) {
|
if (cookie->evtype == XI_RawMotion) {
|
||||||
// Get current pointer's position
|
// Get current pointer's position
|
||||||
|
|
@ -1343,7 +1343,7 @@ void XWindowsScreen::handleSystemEvent(const Event &event)
|
||||||
|
|
||||||
case XkbStateNotify:
|
case XkbStateNotify:
|
||||||
LOG_INFO("group change: %d", xkbEvent->state.group);
|
LOG_INFO("group change: %d", xkbEvent->state.group);
|
||||||
m_keyState->setActiveGroup((int32_t)xkbEvent->state.group);
|
m_keyState->setActiveGroup(xkbEvent->state.group);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -1576,7 +1576,7 @@ bool XWindowsUtil::getWindowProperty(
|
||||||
*type = actualType;
|
*type = actualType;
|
||||||
}
|
}
|
||||||
if (format != nullptr) {
|
if (format != nullptr) {
|
||||||
*format = static_cast<int32_t>(actualDatumSize);
|
*format = actualDatumSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (okay) {
|
if (okay) {
|
||||||
|
|
@ -1747,7 +1747,7 @@ KeyID XWindowsUtil::mapKeySymToKeyID(KeySym k)
|
||||||
default: {
|
default: {
|
||||||
// lookup character in table
|
// lookup character in table
|
||||||
if (KeySymMap::const_iterator index = s_keySymToUCS4.find(k); index != s_keySymToUCS4.end()) {
|
if (KeySymMap::const_iterator index = s_keySymToUCS4.find(k); index != s_keySymToUCS4.end()) {
|
||||||
return static_cast<KeyID>(index->second);
|
return index->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
// unknown character
|
// unknown character
|
||||||
|
|
|
||||||
|
|
@ -504,11 +504,11 @@ float Server::mapToFraction(const BaseClientProxy *client, Direction dir, int32_
|
||||||
using enum Direction;
|
using enum Direction;
|
||||||
case Left:
|
case Left:
|
||||||
case Right:
|
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 Top:
|
||||||
case Bottom:
|
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:
|
case NoDirection:
|
||||||
assert(0 && "bad direction");
|
assert(0 && "bad direction");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue