diff options
| author | Paul Eggert | 2011-05-31 19:49:12 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-05-31 19:49:12 -0700 |
| commit | ccd9a01aa7b67dd3d71b49e3c30df04dd39b4cae (patch) | |
| tree | 00b23405fddaa49b50ce942bc8775e96689176b1 /src/keymap.c | |
| parent | b9627cfb1d5b5b0914525a19cd9edb06f91a1665 (diff) | |
| download | emacs-ccd9a01aa7b67dd3d71b49e3c30df04dd39b4cae.tar.gz emacs-ccd9a01aa7b67dd3d71b49e3c30df04dd39b4cae.zip | |
Minor fixes for signed vs unsigned integers.
* character.h (MAYBE_UNIFY_CHAR):
* charset.c (maybe_unify_char):
* keyboard.c (read_char, reorder_modifiers):
XINT -> XFASTINT, since the integer must be nonnegative.
* ftfont.c (ftfont_spec_pattern):
* keymap.c (access_keymap, silly_event_symbol_error):
XUINT -> XFASTINT, since the integer must be nonnegative.
(Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
since it makes no difference and we prefer signed.
* keyboard.c (record_char): Use XUINT when all the neighbors do.
(access_keymap): NATNUMP -> INTEGERP, since the integer must be
nonnegative.
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/keymap.c b/src/keymap.c index 79481833bde..6ef2a716b6d 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -462,7 +462,7 @@ access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int au | |||
| 462 | XSETFASTINT (idx, XINT (idx) & (CHAR_META | (CHAR_META - 1))); | 462 | XSETFASTINT (idx, XINT (idx) & (CHAR_META | (CHAR_META - 1))); |
| 463 | 463 | ||
| 464 | /* Handle the special meta -> esc mapping. */ | 464 | /* Handle the special meta -> esc mapping. */ |
| 465 | if (INTEGERP (idx) && XUINT (idx) & meta_modifier) | 465 | if (INTEGERP (idx) && XFASTINT (idx) & meta_modifier) |
| 466 | { | 466 | { |
| 467 | /* See if there is a meta-map. If there's none, there is | 467 | /* See if there is a meta-map. If there's none, there is |
| 468 | no binding for IDX, unless a default binding exists in MAP. */ | 468 | no binding for IDX, unless a default binding exists in MAP. */ |
| @@ -480,7 +480,7 @@ access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int au | |||
| 480 | if (CONSP (event_meta_map)) | 480 | if (CONSP (event_meta_map)) |
| 481 | { | 481 | { |
| 482 | map = event_meta_map; | 482 | map = event_meta_map; |
| 483 | idx = make_number (XUINT (idx) & ~meta_modifier); | 483 | idx = make_number (XFASTINT (idx) & ~meta_modifier); |
| 484 | } | 484 | } |
| 485 | else if (t_ok) | 485 | else if (t_ok) |
| 486 | /* Set IDX to t, so that we only find a default binding. */ | 486 | /* Set IDX to t, so that we only find a default binding. */ |
| @@ -529,7 +529,7 @@ access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int au | |||
| 529 | } | 529 | } |
| 530 | else if (VECTORP (binding)) | 530 | else if (VECTORP (binding)) |
| 531 | { | 531 | { |
| 532 | if (NATNUMP (idx) && XFASTINT (idx) < ASIZE (binding)) | 532 | if (INTEGERP (idx) && XFASTINT (idx) < ASIZE (binding)) |
| 533 | val = AREF (binding, XFASTINT (idx)); | 533 | val = AREF (binding, XFASTINT (idx)); |
| 534 | } | 534 | } |
| 535 | else if (CHAR_TABLE_P (binding)) | 535 | else if (CHAR_TABLE_P (binding)) |
| @@ -537,7 +537,7 @@ access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int au | |||
| 537 | /* Character codes with modifiers | 537 | /* Character codes with modifiers |
| 538 | are not included in a char-table. | 538 | are not included in a char-table. |
| 539 | All character codes without modifiers are included. */ | 539 | All character codes without modifiers are included. */ |
| 540 | if (NATNUMP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) | 540 | if (INTEGERP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) |
| 541 | { | 541 | { |
| 542 | val = Faref (binding, idx); | 542 | val = Faref (binding, idx); |
| 543 | /* `nil' has a special meaning for char-tables, so | 543 | /* `nil' has a special meaning for char-tables, so |
| @@ -1357,7 +1357,7 @@ silly_event_symbol_error (Lisp_Object c) | |||
| 1357 | int modifiers; | 1357 | int modifiers; |
| 1358 | 1358 | ||
| 1359 | parsed = parse_modifiers (c); | 1359 | parsed = parse_modifiers (c); |
| 1360 | modifiers = (int) XUINT (XCAR (XCDR (parsed))); | 1360 | modifiers = XFASTINT (XCAR (XCDR (parsed))); |
| 1361 | base = XCAR (parsed); | 1361 | base = XCAR (parsed); |
| 1362 | name = Fsymbol_name (base); | 1362 | name = Fsymbol_name (base); |
| 1363 | /* This alist includes elements such as ("RET" . "\\r"). */ | 1363 | /* This alist includes elements such as ("RET" . "\\r"). */ |
| @@ -2416,7 +2416,7 @@ around function keys and event symbols. */) | |||
| 2416 | { | 2416 | { |
| 2417 | char tem[KEY_DESCRIPTION_SIZE]; | 2417 | char tem[KEY_DESCRIPTION_SIZE]; |
| 2418 | 2418 | ||
| 2419 | *push_key_description (XUINT (key), tem, 1) = 0; | 2419 | *push_key_description (XINT (key), tem, 1) = 0; |
| 2420 | return build_string (tem); | 2420 | return build_string (tem); |
| 2421 | } | 2421 | } |
| 2422 | else if (SYMBOLP (key)) /* Function key or event-symbol */ | 2422 | else if (SYMBOLP (key)) /* Function key or event-symbol */ |
| @@ -2515,7 +2515,7 @@ preferred_sequence_p (Lisp_Object seq) | |||
| 2515 | return 0; | 2515 | return 0; |
| 2516 | else | 2516 | else |
| 2517 | { | 2517 | { |
| 2518 | int modifiers = XUINT (elt) & (CHAR_MODIFIER_MASK & ~CHAR_META); | 2518 | int modifiers = XINT (elt) & (CHAR_MODIFIER_MASK & ~CHAR_META); |
| 2519 | if (modifiers == where_is_preferred_modifier) | 2519 | if (modifiers == where_is_preferred_modifier) |
| 2520 | result = 2; | 2520 | result = 2; |
| 2521 | else if (modifiers) | 2521 | else if (modifiers) |