aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-11-08 12:05:27 -0800
committerPaul Eggert2011-11-08 12:05:27 -0800
commit09db192c23bc7205341a075b41d101a7bdf786ed (patch)
treedbf77a06e084bcc7853156f294a9946c6f38c8ad /src
parent0edcba87d0297124b988fb5c22b20a0c6ac13af1 (diff)
downloademacs-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/ChangeLog20
-rw-r--r--src/dispextern.h16
-rw-r--r--src/intervals.c19
-rw-r--r--src/xdisp.c16
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 @@
12011-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
12011-11-08 Chong Yidong <cyd@gnu.org> 212011-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);
3006void set_vertical_scroll_bar (struct window *); 3006void set_vertical_scroll_bar (struct window *);
3007#endif 3007#endif
3008int try_window (Lisp_Object, struct text_pos, int); 3008int try_window (Lisp_Object, struct text_pos, int);
3009extern void window_box (struct window *, int, int *, int *, int *, int *); 3009void window_box (struct window *, int, int *, int *, int *, int *);
3010extern int window_box_height (struct window *); 3010int window_box_height (struct window *);
3011extern int window_text_bottom_y (struct window *); 3011int window_text_bottom_y (struct window *);
3012extern int window_box_width (struct window *, int); 3012int window_box_width (struct window *, int);
3013extern int window_box_left (struct window *, int); 3013int window_box_left (struct window *, int);
3014extern int window_box_left_offset (struct window *, int); 3014int window_box_left_offset (struct window *, int);
3015extern int window_box_right (struct window *, int); 3015int window_box_right (struct window *, int);
3016extern int window_box_right_offset (struct window *, int); 3016int window_box_right_offset (struct window *, int);
3017int estimate_mode_line_height (struct frame *, enum face_id); 3017int estimate_mode_line_height (struct frame *, enum face_id);
3018void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, 3018void 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
55extern INTERVAL adjust_intervals_for_insertion (INTERVAL,
56 EMACS_INT, EMACS_INT);
57extern void adjust_intervals_for_deletion (struct buffer *,
58 EMACS_INT, EMACS_INT);
59
60static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); 55static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object);
61static INTERVAL merge_interval_right (INTERVAL); 56static INTERVAL merge_interval_right (INTERVAL);
62static INTERVAL reproduce_tree (INTERVAL, INTERVAL); 57static 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
806INTERVAL 801static INTERVAL
807adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, 802adjust_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
867INTERVAL 862static INTERVAL
868adjust_intervals_for_insertion (INTERVAL tree, 863adjust_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
1377void 1372static void
1378adjust_intervals_for_deletion (struct buffer *buffer, 1373adjust_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
1433inline void 1428void
1434offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) 1429offset_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
1885inline void 1880void
1886temp_set_point_both (struct buffer *buffer, 1881temp_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
1905inline void 1900void
1906temp_set_point (struct buffer *buffer, EMACS_INT charpos) 1901temp_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
2394inline void 2389void
2395copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, 2390copy_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
957inline int 957int
958window_text_bottom_y (struct window *w) 958window_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
971inline int 971int
972window_box_width (struct window *w, int area) 972window_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
1010inline int 1010int
1011window_box_height (struct window *w) 1011window_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
1057inline int 1057int
1058window_box_left_offset (struct window *w, int area) 1058window_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
1089inline int 1089int
1090window_box_right_offset (struct window *w, int area) 1090window_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
1099inline int 1099int
1100window_box_left (struct window *w, int area) 1100window_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
1119inline int 1119int
1120window_box_right (struct window *w, int area) 1120window_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
1132inline void 1132void
1133window_box (struct window *w, int area, int *box_x, int *box_y, 1133window_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{