History

{x11,wayland}_common: convert dead code to static sanity check

Kacper Michajłow committed 1 year ago

Commit 41d03dc1 parent dd107a12 files · +6 −8Browse files

Unified · Split

2 files
  1. video/out/wayland_common.c +3 −4
  2. video/out/x11_common.c +3 −4
video/out/wayland_common.c+3−4
@@ -2423,11 +2423,10 @@ static int lookupkey(int key) · 2422 unmodified lines
24232423 mpkey = lookup_keymap_table(keymap, key);
24242424
24252425 // XFree86 keysym range; typically contains obscure "extra" keys
2426− if (!mpkey && key >= 0x10080001 && key <= 0x1008FFFF) {
2426+ static_assert(MP_KEY_UNKNOWN_RESERVED_START + (0x1008FFFF - 0x10080000) <=
2427+ MP_KEY_UNKNOWN_RESERVED_LAST, "");
2428+ if (!mpkey && key >= 0x10080001 && key <= 0x1008FFFF)
24272429 mpkey = MP_KEY_UNKNOWN_RESERVED_START + (key - 0x10080000);
2428− if (mpkey > MP_KEY_UNKNOWN_RESERVED_LAST)
2429− mpkey = 0;
2430− }
24312430
24322431 return mpkey;
24332432 }
video/out/x11_common.c+3−4
@@ -831,11 +831,10 @@ static int vo_x11_lookupkey(int key) · 830 unmodified lines
831831 mpkey = lookup_keymap_table(keymap, key);
832832
833833 // XFree86 keysym range; typically contains obscure "extra" keys
834− if (!mpkey && key >= 0x10080001 && key <= 0x1008FFFF) {
834+ static_assert(MP_KEY_UNKNOWN_RESERVED_START + (0x1008FFFF - 0x10080000) <=
835+ MP_KEY_UNKNOWN_RESERVED_LAST, "");
836+ if (!mpkey && key >= 0x10080001 && key <= 0x1008FFFF)
835837 mpkey = MP_KEY_UNKNOWN_RESERVED_START + (key - 0x10080000);
836− if (mpkey > MP_KEY_UNKNOWN_RESERVED_LAST)
837− mpkey = 0;
838− }
839838
840839 return mpkey;
841840 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t