mirror of
https://github.com/libretro/RetroArch
synced 2025-03-20 01:21:03 +00:00
(keyboard_event) Cleanups
This commit is contained in:
parent
498d43960d
commit
2a40cd5939
@ -49,18 +49,20 @@ static size_t conv_utf8_utf32(uint32_t *out,
|
||||
size_t ret = 0;
|
||||
while (in_size && out_chars)
|
||||
{
|
||||
unsigned ones, extra, shift;
|
||||
uint32_t c;
|
||||
uint8_t first = *in++;
|
||||
|
||||
unsigned ones = leading_ones(first);
|
||||
ones = leading_ones(first);
|
||||
if (ones > 6 || ones == 1) /* Invalid or desync. */
|
||||
break;
|
||||
|
||||
unsigned extra = ones ? ones - 1 : ones;
|
||||
extra = ones ? ones - 1 : ones;
|
||||
if (1 + extra > in_size) /* Overflow. */
|
||||
break;
|
||||
|
||||
unsigned shift = (extra - 1) * 6;
|
||||
uint32_t c = (first & ((1 << (7 - ones)) - 1)) << (6 * extra);
|
||||
shift = (extra - 1) * 6;
|
||||
c = (first & ((1 << (7 - ones)) - 1)) << (6 * extra);
|
||||
|
||||
for (i = 0; i < extra; i++, in++, shift -= 6)
|
||||
c |= (*in & 0x3f) << shift;
|
||||
|
@ -55,8 +55,7 @@ void handle_xkb(
|
||||
|
||||
if (*map_idx != XKB_MOD_INVALID)
|
||||
mod |= xkb_state_mod_index_is_active(
|
||||
xkb_state,
|
||||
*map_idx,
|
||||
xkb_state, *map_idx,
|
||||
(enum xkb_state_component)((XKB_STATE_MODS_EFFECTIVE) > 0)) ? *map_bit : 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user