From: Stefan Monnier Date: Tue, 10 Jul 2007 15:40:06 +0000 (+0000) Subject: (map_char_table): Use an array of int for `indices' rather than X-Git-Tag: emacs-pretest-23.0.90~11975 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8071c00f471b737c6f86255671705a2c40c189e4;p=emacs.git (map_char_table): Use an array of int for `indices' rather than an array of Lisp_Objects (which are only ever integers anyway). --- diff --git a/src/ChangeLog b/src/ChangeLog index 8c4cbe1c214..e417ff9ee86 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,15 @@ 2007-07-10 Stefan Monnier + * 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 diff --git a/src/casetab.c b/src/casetab.c index 42c268dd7c6..cc0e814c171 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -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); diff --git a/src/fns.c b/src/fns.c index 379b1321e08..3e0605bea29 100644 --- a/src/fns.c +++ b/src/fns.c @@ -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; } diff --git a/src/fontset.c b/src/fontset.c index 2df60a5afcc..349603f7bb9 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -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; diff --git a/src/keymap.c b/src/keymap.c index e008fceed99..566ab41872f 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -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); } diff --git a/src/lisp.h b/src/lisp.h index d380ba0d049..6e77bf3e1ac 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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 */