diff options
| author | Paul Eggert | 2014-09-24 11:25:04 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-09-24 11:25:04 -0700 |
| commit | cd812613c83e2d22a697a9312f9406a99bd8ae7d (patch) | |
| tree | 625bf083661d6c8ee0c2be920815df91ae1ba5f5 /src | |
| parent | 558eb84ff964453495099918a9689e769eb57838 (diff) | |
| download | emacs-cd812613c83e2d22a697a9312f9406a99bd8ae7d.tar.gz emacs-cd812613c83e2d22a697a9312f9406a99bd8ae7d.zip | |
* keyboard.c (make_lispy_event): Avoid unnecessary tests
of bit 28 and of whether an unsigned value is negative.
This simplifies the code a bit, and pacifies clang 3.4.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/keyboard.c | 43 |
2 files changed, 26 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9e4492d2c90..9ee4a3de1d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-09-24 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | * keyboard.c (make_lispy_event): Avoid unnecessary tests | ||
| 4 | of bit 28 and of whether an unsigned value is negative. | ||
| 5 | This simplifies the code a bit, and pacifies clang 3.4. | ||
| 6 | |||
| 1 | 2014-09-24 Eli Zaretskii <eliz@gnu.org> | 7 | 2014-09-24 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * systime.h (Time): Define as size_t, to be consistent with 64-bit | 9 | * systime.h (Time): Define as size_t, to be consistent with 64-bit |
diff --git a/src/keyboard.c b/src/keyboard.c index 7625586650f..718614f080a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5548,30 +5548,27 @@ make_lispy_event (struct input_event *event) | |||
| 5548 | ARRAYELTS (iso_lispy_function_keys)); | 5548 | ARRAYELTS (iso_lispy_function_keys)); |
| 5549 | #endif | 5549 | #endif |
| 5550 | 5550 | ||
| 5551 | /* Handle system-specific or unknown keysyms. */ | 5551 | if ((FUNCTION_KEY_OFFSET <= event->code |
| 5552 | if (event->code & (1 << 28) | 5552 | && (event->code |
| 5553 | || event->code - FUNCTION_KEY_OFFSET < 0 | 5553 | < FUNCTION_KEY_OFFSET + ARRAYELTS (lispy_function_keys))) |
| 5554 | || (event->code - FUNCTION_KEY_OFFSET | 5554 | && lispy_function_keys[event->code - FUNCTION_KEY_OFFSET]) |
| 5555 | >= ARRAYELTS (lispy_function_keys)) | 5555 | return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET, |
| 5556 | || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET]) | 5556 | event->modifiers, |
| 5557 | { | 5557 | Qfunction_key, Qnil, |
| 5558 | /* We need to use an alist rather than a vector as the cache | 5558 | lispy_function_keys, &func_key_syms, |
| 5559 | since we can't make a vector long enough. */ | 5559 | ARRAYELTS (lispy_function_keys)); |
| 5560 | if (NILP (KVAR (current_kboard, system_key_syms))) | 5560 | |
| 5561 | kset_system_key_syms (current_kboard, Fcons (Qnil, Qnil)); | 5561 | /* Handle system-specific or unknown keysyms. |
| 5562 | return modify_event_symbol (event->code, | 5562 | We need to use an alist rather than a vector as the cache |
| 5563 | event->modifiers, | 5563 | since we can't make a vector long enough. */ |
| 5564 | Qfunction_key, | 5564 | if (NILP (KVAR (current_kboard, system_key_syms))) |
| 5565 | KVAR (current_kboard, Vsystem_key_alist), | 5565 | kset_system_key_syms (current_kboard, Fcons (Qnil, Qnil)); |
| 5566 | 0, &KVAR (current_kboard, system_key_syms), | 5566 | return modify_event_symbol (event->code, |
| 5567 | PTRDIFF_MAX); | ||
| 5568 | } | ||
| 5569 | |||
| 5570 | return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET, | ||
| 5571 | event->modifiers, | 5567 | event->modifiers, |
| 5572 | Qfunction_key, Qnil, | 5568 | Qfunction_key, |
| 5573 | lispy_function_keys, &func_key_syms, | 5569 | KVAR (current_kboard, Vsystem_key_alist), |
| 5574 | ARRAYELTS (lispy_function_keys)); | 5570 | 0, &KVAR (current_kboard, system_key_syms), |
| 5571 | PTRDIFF_MAX); | ||
| 5575 | 5572 | ||
| 5576 | #ifdef HAVE_NTGUI | 5573 | #ifdef HAVE_NTGUI |
| 5577 | case MULTIMEDIA_KEY_EVENT: | 5574 | case MULTIMEDIA_KEY_EVENT: |