+2011-06-01 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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.
+
2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
Use 'inline', not 'INLINE'.
Lisp_Object val; \
val = CHAR_TABLE_REF (Vchar_unify_table, c); \
if (INTEGERP (val)) \
- c = XINT (val); \
+ c = XFASTINT (val); \
else if (! NILP (val)) \
c = maybe_unify_char (c, val); \
} \
struct charset *charset;
if (INTEGERP (val))
- return XINT (val);
+ return XFASTINT (val);
if (NILP (val))
return c;
{
val = CHAR_TABLE_REF (Vchar_unify_table, c);
if (! NILP (val))
- c = XINT (val);
+ c = XFASTINT (val);
}
else
{
goto err;
for (chars = XCDR (chars); CONSP (chars); chars = XCDR (chars))
if (CHARACTERP (XCAR (chars))
- && ! FcCharSetAddChar (charset, XUINT (XCAR (chars))))
+ && ! FcCharSetAddChar (charset, XFASTINT (XCAR (chars))))
goto err;
}
}
c = Faref (Vexecuting_kbd_macro, make_number (executing_kbd_macro_index));
if (STRINGP (Vexecuting_kbd_macro)
- && (XINT (c) & 0x80) && (XUINT (c) <= 0xff))
- XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80));
+ && (XFASTINT (c) & 0x80) && (XFASTINT (c) <= 0xff))
+ XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));
executing_kbd_macro_index++;
if (INTEGERP (c))
{
if (XUINT (c) < 0x100)
- putc (XINT (c), dribble);
+ putc (XUINT (c), dribble);
else
fprintf (dribble, " 0x%"pI"x", XUINT (c));
}
Lisp_Object parsed;
parsed = parse_modifiers (symbol);
- return apply_modifiers ((int) XINT (XCAR (XCDR (parsed))),
+ return apply_modifiers (XFASTINT (XCAR (XCDR (parsed))),
XCAR (parsed));
}
XSETFASTINT (idx, XINT (idx) & (CHAR_META | (CHAR_META - 1)));
/* Handle the special meta -> esc mapping. */
- if (INTEGERP (idx) && XUINT (idx) & meta_modifier)
+ if (INTEGERP (idx) && XFASTINT (idx) & meta_modifier)
{
/* See if there is a meta-map. If there's none, there is
no binding for IDX, unless a default binding exists in MAP. */
if (CONSP (event_meta_map))
{
map = event_meta_map;
- idx = make_number (XUINT (idx) & ~meta_modifier);
+ idx = make_number (XFASTINT (idx) & ~meta_modifier);
}
else if (t_ok)
/* Set IDX to t, so that we only find a default binding. */
}
else if (VECTORP (binding))
{
- if (NATNUMP (idx) && XFASTINT (idx) < ASIZE (binding))
+ if (INTEGERP (idx) && XFASTINT (idx) < ASIZE (binding))
val = AREF (binding, XFASTINT (idx));
}
else if (CHAR_TABLE_P (binding))
/* Character codes with modifiers
are not included in a char-table.
All character codes without modifiers are included. */
- if (NATNUMP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0)
+ if (INTEGERP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0)
{
val = Faref (binding, idx);
/* `nil' has a special meaning for char-tables, so
int modifiers;
parsed = parse_modifiers (c);
- modifiers = (int) XUINT (XCAR (XCDR (parsed)));
+ modifiers = XFASTINT (XCAR (XCDR (parsed)));
base = XCAR (parsed);
name = Fsymbol_name (base);
/* This alist includes elements such as ("RET" . "\\r"). */
{
char tem[KEY_DESCRIPTION_SIZE];
- *push_key_description (XUINT (key), tem, 1) = 0;
+ *push_key_description (XINT (key), tem, 1) = 0;
return build_string (tem);
}
else if (SYMBOLP (key)) /* Function key or event-symbol */
return 0;
else
{
- int modifiers = XUINT (elt) & (CHAR_MODIFIER_MASK & ~CHAR_META);
+ int modifiers = XINT (elt) & (CHAR_MODIFIER_MASK & ~CHAR_META);
if (modifiers == where_is_preferred_modifier)
result = 2;
else if (modifiers)