diff options
| author | Stefan Monnier | 2007-07-10 15:40:06 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-07-10 15:40:06 +0000 |
| commit | 8071c00f471b737c6f86255671705a2c40c189e4 (patch) | |
| tree | 89743db5af818099690551f297c68da78609f77f /src | |
| parent | d47ecf8be4c386627dca2f20d7bbba049740195f (diff) | |
| download | emacs-8071c00f471b737c6f86255671705a2c40c189e4.tar.gz emacs-8071c00f471b737c6f86255671705a2c40c189e4.zip | |
(map_char_table): Use an array of int for `indices' rather than
an array of Lisp_Objects (which are only ever integers anyway).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 15 | ||||
| -rw-r--r-- | src/casetab.c | 2 | ||||
| -rw-r--r-- | src/fns.c | 18 | ||||
| -rw-r--r-- | src/fontset.c | 2 | ||||
| -rw-r--r-- | src/keymap.c | 6 | ||||
| -rw-r--r-- | src/lisp.h | 4 |
6 files changed, 29 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8c4cbe1c214..e417ff9ee86 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,15 @@ | |||
| 1 | 2007-07-10 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-07-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * fns.c (map_char_table): Use an array of int for `indices' rather than | ||
| 4 | an array of Lisp_Objects (which are only ever integers anyway). | ||
| 5 | (Fmap_char_table): Update caller. | ||
| 6 | * lisp.h: Update prototype. | ||
| 7 | * keymap.c (Fset_keymap_parent, map_keymap, Fcopy_keymap): | ||
| 8 | * fontset.c (Ffontset_info): | ||
| 9 | * casetab.c (set_case_table): Update callers. | ||
| 10 | |||
| 11 | * editfns.c (Ftranspose_regions): Use EMACS_INT for positions. | ||
| 12 | |||
| 3 | * keymap.c (struct accessible_keymaps_data) | 13 | * keymap.c (struct accessible_keymaps_data) |
| 4 | (struct where_is_internal_data): New structures. | 14 | (struct where_is_internal_data): New structures. |
| 5 | (accessible_keymaps_1, where_is_internal_1): Use them to change | 15 | (accessible_keymaps_1, where_is_internal_1): Use them to change |
| @@ -17,9 +27,8 @@ | |||
| 17 | (string_match_1, search_buffer, set_search_regs): Likewise. | 27 | (string_match_1, search_buffer, set_search_regs): Likewise. |
| 18 | (syms_of_search): Add Lisp level definition for | 28 | (syms_of_search): Add Lisp level definition for |
| 19 | `inhibit-changing-match-data' and set it to nil. | 29 | `inhibit-changing-match-data' and set it to nil. |
| 20 | (boyer_moore): If `inhibit-changing-match-data' is non-nil, | 30 | (boyer_moore): If `inhibit-changing-match-data' is non-nil, compute |
| 21 | compute start and end of the match, instead of using values in | 31 | start and end of the match, instead of using values in search_regs. |
| 22 | search_regs. | ||
| 23 | 32 | ||
| 24 | 2007-07-01 Stefan Monnier <monnier@iro.umontreal.ca> | 33 | 2007-07-01 Stefan Monnier <monnier@iro.umontreal.ca> |
| 25 | 34 | ||
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) | |||
| 126 | int standard; | 126 | int standard; |
| 127 | { | 127 | { |
| 128 | Lisp_Object up, canon, eqv; | 128 | Lisp_Object up, canon, eqv; |
| 129 | Lisp_Object indices[3]; | 129 | int indices[3]; |
| 130 | 130 | ||
| 131 | check_case_table (table); | 131 | check_case_table (table); |
| 132 | 132 | ||
| @@ -2825,8 +2825,8 @@ DEFUN ("optimize-char-table", Foptimize_char_table, Soptimize_char_table, | |||
| 2825 | void | 2825 | void |
| 2826 | map_char_table (c_function, function, table, subtable, arg, depth, indices) | 2826 | map_char_table (c_function, function, table, subtable, arg, depth, indices) |
| 2827 | void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); | 2827 | void (*c_function) P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); |
| 2828 | Lisp_Object function, table, subtable, arg, *indices; | 2828 | Lisp_Object function, table, subtable, arg; |
| 2829 | int depth; | 2829 | int depth, *indices; |
| 2830 | { | 2830 | { |
| 2831 | int i, to; | 2831 | int i, to; |
| 2832 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 2832 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| @@ -2860,7 +2860,7 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices) | |||
| 2860 | } | 2860 | } |
| 2861 | else | 2861 | else |
| 2862 | { | 2862 | { |
| 2863 | int charset = XFASTINT (indices[0]) - 128; | 2863 | int charset = indices[0] - 128; |
| 2864 | 2864 | ||
| 2865 | i = 32; | 2865 | i = 32; |
| 2866 | to = SUB_CHAR_TABLE_ORDINARY_SLOTS; | 2866 | to = SUB_CHAR_TABLE_ORDINARY_SLOTS; |
| @@ -2874,8 +2874,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices) | |||
| 2874 | int charset; | 2874 | int charset; |
| 2875 | 2875 | ||
| 2876 | elt = XCHAR_TABLE (subtable)->contents[i]; | 2876 | elt = XCHAR_TABLE (subtable)->contents[i]; |
| 2877 | XSETFASTINT (indices[depth], i); | 2877 | indices[depth] = i; |
| 2878 | charset = XFASTINT (indices[0]) - 128; | 2878 | charset = indices[0] - 128; |
| 2879 | if (depth == 0 | 2879 | if (depth == 0 |
| 2880 | && (!CHARSET_DEFINED_P (charset) | 2880 | && (!CHARSET_DEFINED_P (charset) |
| 2881 | || charset == CHARSET_8_BIT_CONTROL | 2881 | || charset == CHARSET_8_BIT_CONTROL |
| @@ -2892,8 +2892,8 @@ map_char_table (c_function, function, table, subtable, arg, depth, indices) | |||
| 2892 | { | 2892 | { |
| 2893 | int c1, c2, c; | 2893 | int c1, c2, c; |
| 2894 | 2894 | ||
| 2895 | c1 = depth >= 1 ? XFASTINT (indices[1]) : 0; | 2895 | c1 = depth >= 1 ? indices[1] : 0; |
| 2896 | c2 = depth >= 2 ? XFASTINT (indices[2]) : 0; | 2896 | c2 = depth >= 2 ? indices[2] : 0; |
| 2897 | c = MAKE_CHAR (charset, c1, c2); | 2897 | c = MAKE_CHAR (charset, c1, c2); |
| 2898 | 2898 | ||
| 2899 | if (NILP (elt)) | 2899 | if (NILP (elt)) |
| @@ -2927,14 +2927,14 @@ The key is always a possible IDX argument to `aref'. */) | |||
| 2927 | Lisp_Object function, char_table; | 2927 | Lisp_Object function, char_table; |
| 2928 | { | 2928 | { |
| 2929 | /* The depth of char table is at most 3. */ | 2929 | /* The depth of char table is at most 3. */ |
| 2930 | Lisp_Object indices[3]; | 2930 | int indices[3]; |
| 2931 | 2931 | ||
| 2932 | CHECK_CHAR_TABLE (char_table); | 2932 | CHECK_CHAR_TABLE (char_table); |
| 2933 | 2933 | ||
| 2934 | /* When Lisp_Object is represented as a union, `call2' cannot directly | 2934 | /* When Lisp_Object is represented as a union, `call2' cannot directly |
| 2935 | be passed to map_char_table because it returns a Lisp_Object rather | 2935 | be passed to map_char_table because it returns a Lisp_Object rather |
| 2936 | than returning nothing. | 2936 | than returning nothing. |
| 2937 | Casting leads to crashes on some architectures. -stef */ | 2937 | Casting leads to crashes on some architectures. --Stef */ |
| 2938 | map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices); | 2938 | map_char_table (void_call2, Qnil, char_table, char_table, function, 0, indices); |
| 2939 | return Qnil; | 2939 | return Qnil; |
| 2940 | } | 2940 | } |
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. */) | |||
| 1437 | { | 1437 | { |
| 1438 | Lisp_Object fontset; | 1438 | Lisp_Object fontset; |
| 1439 | FRAME_PTR f; | 1439 | FRAME_PTR f; |
| 1440 | Lisp_Object indices[3]; | 1440 | int indices[3]; |
| 1441 | Lisp_Object val, tail, elt; | 1441 | Lisp_Object val, tail, elt; |
| 1442 | Lisp_Object *realized; | 1442 | Lisp_Object *realized; |
| 1443 | struct font_info *fontp = NULL; | 1443 | 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. */) | |||
| 429 | 429 | ||
| 430 | if (CHAR_TABLE_P (XCAR (list))) | 430 | if (CHAR_TABLE_P (XCAR (list))) |
| 431 | { | 431 | { |
| 432 | Lisp_Object indices[3]; | 432 | int indices[3]; |
| 433 | 433 | ||
| 434 | map_char_table (fix_submap_inheritance, Qnil, | 434 | map_char_table (fix_submap_inheritance, Qnil, |
| 435 | XCAR (list), XCAR (list), | 435 | XCAR (list), XCAR (list), |
| @@ -728,7 +728,7 @@ map_keymap (map, fun, args, data, autoload) | |||
| 728 | } | 728 | } |
| 729 | else if (CHAR_TABLE_P (binding)) | 729 | else if (CHAR_TABLE_P (binding)) |
| 730 | { | 730 | { |
| 731 | Lisp_Object indices[3]; | 731 | int indices[3]; |
| 732 | map_char_table (map_keymap_char_table_item, Qnil, binding, binding, | 732 | map_char_table (map_keymap_char_table_item, Qnil, binding, binding, |
| 733 | Fcons (make_save_value (fun, 0), | 733 | Fcons (make_save_value (fun, 0), |
| 734 | Fcons (make_save_value (data, 0), | 734 | Fcons (make_save_value (data, 0), |
| @@ -1079,7 +1079,7 @@ is not copied. */) | |||
| 1079 | Lisp_Object elt = XCAR (keymap); | 1079 | Lisp_Object elt = XCAR (keymap); |
| 1080 | if (CHAR_TABLE_P (elt)) | 1080 | if (CHAR_TABLE_P (elt)) |
| 1081 | { | 1081 | { |
| 1082 | Lisp_Object indices[3]; | 1082 | int indices[3]; |
| 1083 | elt = Fcopy_sequence (elt); | 1083 | elt = Fcopy_sequence (elt); |
| 1084 | map_char_table (copy_keymap_1, Qnil, elt, elt, elt, 0, indices); | 1084 | map_char_table (copy_keymap_1, Qnil, elt, elt, elt, 0, indices); |
| 1085 | } | 1085 | } |
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); | |||
| 2428 | extern int char_table_translate P_ ((Lisp_Object, int)); | 2428 | extern int char_table_translate P_ ((Lisp_Object, int)); |
| 2429 | extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object, Lisp_Object), | 2429 | extern void map_char_table P_ ((void (*) (Lisp_Object, Lisp_Object, Lisp_Object), |
| 2430 | Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int, | 2430 | Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int, |
| 2431 | Lisp_Object *)); | 2431 | int *)); |
| 2432 | extern Lisp_Object char_table_ref_and_index P_ ((Lisp_Object, int, int *)); | 2432 | extern Lisp_Object char_table_ref_and_index P_ ((Lisp_Object, int, int *)); |
| 2433 | extern void syms_of_fns P_ ((void)); | 2433 | extern void syms_of_fns P_ ((void)); |
| 2434 | 2434 | ||
| @@ -3244,6 +3244,7 @@ EXFUN (Fx_file_dialog, 5); | |||
| 3244 | #endif | 3244 | #endif |
| 3245 | 3245 | ||
| 3246 | /* Defined in xfaces.c */ | 3246 | /* Defined in xfaces.c */ |
| 3247 | EXFUN (Fclear_face_cache, 1); | ||
| 3247 | extern void syms_of_xfaces P_ ((void)); | 3248 | extern void syms_of_xfaces P_ ((void)); |
| 3248 | 3249 | ||
| 3249 | #ifndef HAVE_GETLOADAVG | 3250 | #ifndef HAVE_GETLOADAVG |
| @@ -3259,6 +3260,7 @@ extern void syms_of_xfns P_ ((void)); | |||
| 3259 | extern void syms_of_xsmfns P_ ((void)); | 3260 | extern void syms_of_xsmfns P_ ((void)); |
| 3260 | 3261 | ||
| 3261 | /* Defined in xselect.c */ | 3262 | /* Defined in xselect.c */ |
| 3263 | EXFUN (Fx_send_client_event, 6); | ||
| 3262 | extern void syms_of_xselect P_ ((void)); | 3264 | extern void syms_of_xselect P_ ((void)); |
| 3263 | 3265 | ||
| 3264 | /* Defined in xterm.c */ | 3266 | /* Defined in xterm.c */ |