diff options
| author | Paul Eggert | 2011-11-08 12:05:27 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-11-08 12:05:27 -0800 |
| commit | 09db192c23bc7205341a075b41d101a7bdf786ed (patch) | |
| tree | dbf77a06e084bcc7853156f294a9946c6f38c8ad /src | |
| parent | 0edcba87d0297124b988fb5c22b20a0c6ac13af1 (diff) | |
| download | emacs-09db192c23bc7205341a075b41d101a7bdf786ed.tar.gz emacs-09db192c23bc7205341a075b41d101a7bdf786ed.zip | |
Avoid some portability problems by eschewing 'extern inline' functions.
The trivial performance wins aren't worth the portability hassles; see
<http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
et seq.
* dispextern.h (window_box, window_box_height, window_text_bottom_y)
(window_box_width, window_box_left, window_box_left_offset)
(window_box_right, window_box_right_offset): Undo previous change,
by removing the "extern"s.
* intervals.c (adjust_intervals_for_insertion)
(adjust_intervals_for_deletion): Undo previous change,
making these static again.
(offset_intervals, temp_set_point_both, temp_set_point)
(copy_intervals_to_string): No longer inline.
* xdisp.c (window_text_bottom_y, window_box_width)
(window_box_height, window_box_left_offset)
(window_box_right_offset, window_box_left, window_box_right)
(window_box): No longer inline.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 20 | ||||
| -rw-r--r-- | src/dispextern.h | 16 | ||||
| -rw-r--r-- | src/intervals.c | 19 | ||||
| -rw-r--r-- | src/xdisp.c | 16 |
4 files changed, 43 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8d413a21fa5..1325dd20bb2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,23 @@ | |||
| 1 | 2011-11-08 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Avoid some portability problems by eschewing 'extern inline' functions. | ||
| 4 | The trivial performance wins aren't worth the portability hassles; see | ||
| 5 | <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html> | ||
| 6 | et seq. | ||
| 7 | * dispextern.h (window_box, window_box_height, window_text_bottom_y) | ||
| 8 | (window_box_width, window_box_left, window_box_left_offset) | ||
| 9 | (window_box_right, window_box_right_offset): Undo previous change, | ||
| 10 | by removing the "extern"s. | ||
| 11 | * intervals.c (adjust_intervals_for_insertion) | ||
| 12 | (adjust_intervals_for_deletion): Undo previous change, | ||
| 13 | making these static again. | ||
| 14 | (offset_intervals, temp_set_point_both, temp_set_point) | ||
| 15 | (copy_intervals_to_string): No longer inline. | ||
| 16 | * xdisp.c (window_text_bottom_y, window_box_width) | ||
| 17 | (window_box_height, window_box_left_offset) | ||
| 18 | (window_box_right_offset, window_box_left, window_box_right) | ||
| 19 | (window_box): No longer inline. | ||
| 20 | |||
| 1 | 2011-11-08 Chong Yidong <cyd@gnu.org> | 21 | 2011-11-08 Chong Yidong <cyd@gnu.org> |
| 2 | 22 | ||
| 3 | * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix. | 23 | * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix. |
diff --git a/src/dispextern.h b/src/dispextern.h index fdc7f2f908d..5c60a5499da 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -3006,14 +3006,14 @@ int resize_mini_window (struct window *, int); | |||
| 3006 | void set_vertical_scroll_bar (struct window *); | 3006 | void set_vertical_scroll_bar (struct window *); |
| 3007 | #endif | 3007 | #endif |
| 3008 | int try_window (Lisp_Object, struct text_pos, int); | 3008 | int try_window (Lisp_Object, struct text_pos, int); |
| 3009 | extern void window_box (struct window *, int, int *, int *, int *, int *); | 3009 | void window_box (struct window *, int, int *, int *, int *, int *); |
| 3010 | extern int window_box_height (struct window *); | 3010 | int window_box_height (struct window *); |
| 3011 | extern int window_text_bottom_y (struct window *); | 3011 | int window_text_bottom_y (struct window *); |
| 3012 | extern int window_box_width (struct window *, int); | 3012 | int window_box_width (struct window *, int); |
| 3013 | extern int window_box_left (struct window *, int); | 3013 | int window_box_left (struct window *, int); |
| 3014 | extern int window_box_left_offset (struct window *, int); | 3014 | int window_box_left_offset (struct window *, int); |
| 3015 | extern int window_box_right (struct window *, int); | 3015 | int window_box_right (struct window *, int); |
| 3016 | extern int window_box_right_offset (struct window *, int); | 3016 | int window_box_right_offset (struct window *, int); |
| 3017 | int estimate_mode_line_height (struct frame *, enum face_id); | 3017 | int estimate_mode_line_height (struct frame *, enum face_id); |
| 3018 | void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, | 3018 | void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, |
| 3019 | NativeRectangle *, int); | 3019 | NativeRectangle *, int); |
diff --git a/src/intervals.c b/src/intervals.c index be1bdfb9056..a78c7f07f6c 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -52,11 +52,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 52 | 52 | ||
| 53 | #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) | 53 | #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) |
| 54 | 54 | ||
| 55 | extern INTERVAL adjust_intervals_for_insertion (INTERVAL, | ||
| 56 | EMACS_INT, EMACS_INT); | ||
| 57 | extern void adjust_intervals_for_deletion (struct buffer *, | ||
| 58 | EMACS_INT, EMACS_INT); | ||
| 59 | |||
| 60 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); | 55 | static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); |
| 61 | static INTERVAL merge_interval_right (INTERVAL); | 56 | static INTERVAL merge_interval_right (INTERVAL); |
| 62 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); | 57 | static INTERVAL reproduce_tree (INTERVAL, INTERVAL); |
| @@ -803,7 +798,7 @@ update_interval (register INTERVAL i, EMACS_INT pos) | |||
| 803 | and check the hungry bits of both. Then add the length going back up | 798 | and check the hungry bits of both. Then add the length going back up |
| 804 | to the root. */ | 799 | to the root. */ |
| 805 | 800 | ||
| 806 | INTERVAL | 801 | static INTERVAL |
| 807 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | 802 | adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, |
| 808 | EMACS_INT length) | 803 | EMACS_INT length) |
| 809 | { | 804 | { |
| @@ -864,7 +859,7 @@ adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, | |||
| 864 | interval. Another possibility would be to create a new interval for | 859 | interval. Another possibility would be to create a new interval for |
| 865 | this text, and make it have the merged properties of both ends. */ | 860 | this text, and make it have the merged properties of both ends. */ |
| 866 | 861 | ||
| 867 | INTERVAL | 862 | static INTERVAL |
| 868 | adjust_intervals_for_insertion (INTERVAL tree, | 863 | adjust_intervals_for_insertion (INTERVAL tree, |
| 869 | EMACS_INT position, EMACS_INT length) | 864 | EMACS_INT position, EMACS_INT length) |
| 870 | { | 865 | { |
| @@ -1374,7 +1369,7 @@ interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from, | |||
| 1374 | text. The deletion is effected at position START (which is a | 1369 | text. The deletion is effected at position START (which is a |
| 1375 | buffer position, i.e. origin 1). */ | 1370 | buffer position, i.e. origin 1). */ |
| 1376 | 1371 | ||
| 1377 | void | 1372 | static void |
| 1378 | adjust_intervals_for_deletion (struct buffer *buffer, | 1373 | adjust_intervals_for_deletion (struct buffer *buffer, |
| 1379 | EMACS_INT start, EMACS_INT length) | 1374 | EMACS_INT start, EMACS_INT length) |
| 1380 | { | 1375 | { |
| @@ -1430,7 +1425,7 @@ adjust_intervals_for_deletion (struct buffer *buffer, | |||
| 1430 | compiler that does not allow calling a static function (here, | 1425 | compiler that does not allow calling a static function (here, |
| 1431 | adjust_intervals_for_deletion) from a non-static inline function. */ | 1426 | adjust_intervals_for_deletion) from a non-static inline function. */ |
| 1432 | 1427 | ||
| 1433 | inline void | 1428 | void |
| 1434 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) | 1429 | offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) |
| 1435 | { | 1430 | { |
| 1436 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) | 1431 | if (NULL_INTERVAL_P (BUF_INTERVALS (buffer)) || length == 0) |
| @@ -1882,7 +1877,7 @@ lookup_char_property (Lisp_Object plist, register Lisp_Object prop, int textprop | |||
| 1882 | /* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to | 1877 | /* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to |
| 1883 | byte position BYTEPOS. */ | 1878 | byte position BYTEPOS. */ |
| 1884 | 1879 | ||
| 1885 | inline void | 1880 | void |
| 1886 | temp_set_point_both (struct buffer *buffer, | 1881 | temp_set_point_both (struct buffer *buffer, |
| 1887 | EMACS_INT charpos, EMACS_INT bytepos) | 1882 | EMACS_INT charpos, EMACS_INT bytepos) |
| 1888 | { | 1883 | { |
| @@ -1902,7 +1897,7 @@ temp_set_point_both (struct buffer *buffer, | |||
| 1902 | 1897 | ||
| 1903 | /* Set point "temporarily", without checking any text properties. */ | 1898 | /* Set point "temporarily", without checking any text properties. */ |
| 1904 | 1899 | ||
| 1905 | inline void | 1900 | void |
| 1906 | temp_set_point (struct buffer *buffer, EMACS_INT charpos) | 1901 | temp_set_point (struct buffer *buffer, EMACS_INT charpos) |
| 1907 | { | 1902 | { |
| 1908 | temp_set_point_both (buffer, charpos, | 1903 | temp_set_point_both (buffer, charpos, |
| @@ -2391,7 +2386,7 @@ copy_intervals (INTERVAL tree, EMACS_INT start, EMACS_INT length) | |||
| 2391 | 2386 | ||
| 2392 | /* Give STRING the properties of BUFFER from POSITION to LENGTH. */ | 2387 | /* Give STRING the properties of BUFFER from POSITION to LENGTH. */ |
| 2393 | 2388 | ||
| 2394 | inline void | 2389 | void |
| 2395 | copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, | 2390 | copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, |
| 2396 | EMACS_INT position, EMACS_INT length) | 2391 | EMACS_INT position, EMACS_INT length) |
| 2397 | { | 2392 | { |
diff --git a/src/xdisp.c b/src/xdisp.c index 197fb748598..b4eaef9d0c7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -954,7 +954,7 @@ static int coords_in_mouse_face_p (struct window *, int, int); | |||
| 954 | 954 | ||
| 955 | This is the height of W minus the height of a mode line, if any. */ | 955 | This is the height of W minus the height of a mode line, if any. */ |
| 956 | 956 | ||
| 957 | inline int | 957 | int |
| 958 | window_text_bottom_y (struct window *w) | 958 | window_text_bottom_y (struct window *w) |
| 959 | { | 959 | { |
| 960 | int height = WINDOW_TOTAL_HEIGHT (w); | 960 | int height = WINDOW_TOTAL_HEIGHT (w); |
| @@ -968,7 +968,7 @@ window_text_bottom_y (struct window *w) | |||
| 968 | means return the total width of W, not including fringes to | 968 | means return the total width of W, not including fringes to |
| 969 | the left and right of the window. */ | 969 | the left and right of the window. */ |
| 970 | 970 | ||
| 971 | inline int | 971 | int |
| 972 | window_box_width (struct window *w, int area) | 972 | window_box_width (struct window *w, int area) |
| 973 | { | 973 | { |
| 974 | int cols = XFASTINT (w->total_cols); | 974 | int cols = XFASTINT (w->total_cols); |
| @@ -1007,7 +1007,7 @@ window_box_width (struct window *w, int area) | |||
| 1007 | /* Return the pixel height of the display area of window W, not | 1007 | /* Return the pixel height of the display area of window W, not |
| 1008 | including mode lines of W, if any. */ | 1008 | including mode lines of W, if any. */ |
| 1009 | 1009 | ||
| 1010 | inline int | 1010 | int |
| 1011 | window_box_height (struct window *w) | 1011 | window_box_height (struct window *w) |
| 1012 | { | 1012 | { |
| 1013 | struct frame *f = XFRAME (w->frame); | 1013 | struct frame *f = XFRAME (w->frame); |
| @@ -1054,7 +1054,7 @@ window_box_height (struct window *w) | |||
| 1054 | area AREA of window W. AREA < 0 means return the left edge of the | 1054 | area AREA of window W. AREA < 0 means return the left edge of the |
| 1055 | whole window, to the right of the left fringe of W. */ | 1055 | whole window, to the right of the left fringe of W. */ |
| 1056 | 1056 | ||
| 1057 | inline int | 1057 | int |
| 1058 | window_box_left_offset (struct window *w, int area) | 1058 | window_box_left_offset (struct window *w, int area) |
| 1059 | { | 1059 | { |
| 1060 | int x; | 1060 | int x; |
| @@ -1086,7 +1086,7 @@ window_box_left_offset (struct window *w, int area) | |||
| 1086 | area AREA of window W. AREA < 0 means return the right edge of the | 1086 | area AREA of window W. AREA < 0 means return the right edge of the |
| 1087 | whole window, to the left of the right fringe of W. */ | 1087 | whole window, to the left of the right fringe of W. */ |
| 1088 | 1088 | ||
| 1089 | inline int | 1089 | int |
| 1090 | window_box_right_offset (struct window *w, int area) | 1090 | window_box_right_offset (struct window *w, int area) |
| 1091 | { | 1091 | { |
| 1092 | return window_box_left_offset (w, area) + window_box_width (w, area); | 1092 | return window_box_left_offset (w, area) + window_box_width (w, area); |
| @@ -1096,7 +1096,7 @@ window_box_right_offset (struct window *w, int area) | |||
| 1096 | area AREA of window W. AREA < 0 means return the left edge of the | 1096 | area AREA of window W. AREA < 0 means return the left edge of the |
| 1097 | whole window, to the right of the left fringe of W. */ | 1097 | whole window, to the right of the left fringe of W. */ |
| 1098 | 1098 | ||
| 1099 | inline int | 1099 | int |
| 1100 | window_box_left (struct window *w, int area) | 1100 | window_box_left (struct window *w, int area) |
| 1101 | { | 1101 | { |
| 1102 | struct frame *f = XFRAME (w->frame); | 1102 | struct frame *f = XFRAME (w->frame); |
| @@ -1116,7 +1116,7 @@ window_box_left (struct window *w, int area) | |||
| 1116 | area AREA of window W. AREA < 0 means return the right edge of the | 1116 | area AREA of window W. AREA < 0 means return the right edge of the |
| 1117 | whole window, to the left of the right fringe of W. */ | 1117 | whole window, to the left of the right fringe of W. */ |
| 1118 | 1118 | ||
| 1119 | inline int | 1119 | int |
| 1120 | window_box_right (struct window *w, int area) | 1120 | window_box_right (struct window *w, int area) |
| 1121 | { | 1121 | { |
| 1122 | return window_box_left (w, area) + window_box_width (w, area); | 1122 | return window_box_left (w, area) + window_box_width (w, area); |
| @@ -1129,7 +1129,7 @@ window_box_right (struct window *w, int area) | |||
| 1129 | coordinates of the upper-left corner of the box. Return in | 1129 | coordinates of the upper-left corner of the box. Return in |
| 1130 | *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */ | 1130 | *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */ |
| 1131 | 1131 | ||
| 1132 | inline void | 1132 | void |
| 1133 | window_box (struct window *w, int area, int *box_x, int *box_y, | 1133 | window_box (struct window *w, int area, int *box_x, int *box_y, |
| 1134 | int *box_width, int *box_height) | 1134 | int *box_width, int *box_height) |
| 1135 | { | 1135 | { |