Commit 8071c00f authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(map_char_table): Use an array of int for `indices' rather than

an array of Lisp_Objects (which are only ever integers anyway).
parent d47ecf8b
2007-07-10 Stefan Monnier <monnier@iro.umontreal.ca>
 
* fns.c (map_char_table): Use an array of int for `indices' rather than
an array of Lisp_Objects (which are only ever integers anyway).
(Fmap_char_table): Update caller.
* lisp.h: Update prototype.
* keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap):
* fontset.c (Ffontset_info):
* casetab.c (set_case_table): Update callers.
* editfns.c (Ftranspose_regions): Use EMACS_INT for positions.
* keymap.c (struct accessible_keymaps_data)
(struct where_is_internal_data): New structures.
(accessible_keymaps_1, where_is_internal_1): Use them to change
......@@ -17,9 +27,8 @@
(string_match_1, search_buffer, set_search_regs): Likewise.
(syms_of_search): Add Lisp level definition for
`inhibit-changing-match-data' and set it to nil.
(boyer_moore): If `inhibit-changing-match-data' is non-nil,
compute start and end of the match, instead of using values in
search_regs.
(boyer_moore): If `inhibit-changing-match-data' is non-nil, compute
start and end of the match, instead of using values in search_regs.
 
2007-07-01 Stefan Monnier <monnier@iro.umontreal.ca>
 
......
......@@ -126,7 +126,7 @@ set_case_table (table, standard)
int standard;
{
Lisp_Object up, canon, eqv;
Lisp_Object indices[3];
int indices[3];
check_case_table (table);
......
......@@ -2825,8 +2825,8 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table,
void
map_char_table (c_function, function, table, subtable, arg, depth, indices)
void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
Lisp_Object function, table, subtable, arg, *indices;
int depth;
Lisp_Object function, table, subtable, arg;
int depth, *indices;
{
int i, to;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
......@@ -2860,7 +2860,7 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices)
}
else
{
int charset = XFASTINT (indices[0]) - 128;
int charset = indices[0] - 128;
i = 32;
to = SUB_CHAR_TABLE_ORDINARY_SLOTS;
......@@ -2874,8 +2874,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices)
int charset;
elt = XCHAR_TABLE (subtable)->contents[i];
XSETFASTINT (indices[depth], i);
charset = XFASTINT (indices[0]) - 128;
indices[depth] = i;
charset = indices[0] - 128;
if (depth == 0
&& (!CHARSET_DEFINED_P (charset)
|| charset == CHARSET_8_BIT_CONTROL
......@@ -2892,8 +2892,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices)
{
int c1, c2, c;
c1 = depth >= 1 ? XFASTINT (indices[1]) : 0;
c2 = depth >= 2 ? XFASTINT (indices[2]) : 0;
c1 = depth >= 1 ? indices[1] : 0;
c2 = depth >= 2 ? indices[2] : 0;
c = MAKE_CHAR (charset, c1, c2);
if (NILP (elt))
......@@ -2927,14 +2927,14 @@ The key is always a possible IDX argument to `aref'. */)
Lisp_Object function, char_table;
{
/* The depth of char table is at most 3. */
Lisp_Object indices[3];
int indices[3];
CHECK_CHAR_TABLE (char_table);
/* When Lisp_Object is represented as a union, `call2' cannot directly
be passed to map_char_table because it returns a Lisp_Object rather
than returning nothing.
Casting leads to crashes on some architectures. -stef */
Casting leads to crashes on some architectures. --Stef */
map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices);
return Qnil;
}
......
......@@ -1437,7 +1437,7 @@ If FRAME is omitted, it defaults to the currently selected frame. */)
{
Lisp_Object fontset;
FRAME_PTR f;
Lisp_Object indices[3];
int indices[3];
Lisp_Object val, tail, elt;
Lisp_Object *realized;
struct font_info *fontp = NULL;
......
......@@ -429,7 +429,7 @@ Return PARENT. PARENT should be nil or another keymap. */)
if (CHAR_TABLE_P (XCAR (list)))
{
Lisp_Object indices[3];
int indices[3];
map_char_table (fix_submap_inheritance, Qnil,
XCAR (list), XCAR (list),
......@@ -728,7 +728,7 @@ map_keymap (map, fun, args, data, autoload)
}
else if (CHAR_TABLE_P (binding))
{
Lisp_Object indices[3];
int indices[3];
map_char_table (map_keymap_char_table_item, Qnil, binding, binding,
Fcons (make_save_value (fun, 0),
Fcons (make_save_value (data, 0),
......@@ -1079,7 +1079,7 @@ is not copied. */)
Lisp_Object elt = XCAR (keymap);
if (CHAR_TABLE_P (elt))
{
Lisp_Object indices[3];
int indices[3];
elt = Fcopy_sequence (elt);
map_char_table (copy_keymap_1, Qnil, elt, elt, elt, 0, indices);
}
......
......@@ -2428,7 +2428,7 @@ EXFUN (Fstring_lessp, 2);
extern int char_table_translate P_ ((Lisp_Object, int));
extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object, Lisp_Object),
Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int,
Lisp_Object *));
int *));
extern Lisp_Object char_table_ref_and_index P_ ((Lisp_Object, int, int *));
extern void syms_of_fns P_ ((void));
......@@ -3244,6 +3244,7 @@ EXFUN (Fx_file_dialog, 5);
#endif
/* Defined in xfaces.c */
EXFUN (Fclear_face_cache, 1);
extern void syms_of_xfaces P_ ((void));
#ifndef HAVE_GETLOADAVG
......@@ -3259,6 +3260,7 @@ extern void syms_of_xfns P_ ((void));
extern void syms_of_xsmfns P_ ((void));
/* Defined in xselect.c */
EXFUN (Fx_send_client_event, 6);
extern void syms_of_xselect P_ ((void));
/* Defined in xterm.c */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment