diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-11-08 12:05:27 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-11-08 12:05:27 -0800 |
commit | 09db192c23bc7205341a075b41d101a7bdf786ed (patch) | |
tree | dbf77a06e084bcc7853156f294a9946c6f38c8ad | |
parent | 0edcba87d0297124b988fb5c22b20a0c6ac13af1 (diff) | |
download | emacs-09db192c23bc7205341a075b41d101a7bdf786ed.tar.gz |
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.
-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 @@ +2011-11-08 Paul Eggert <eggert@cs.ucla.edu> + + 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. + 2011-11-08 Chong Yidong <cyd@gnu.org> * 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); void set_vertical_scroll_bar (struct window *); #endif int try_window (Lisp_Object, struct text_pos, int); -extern void window_box (struct window *, int, int *, int *, int *, int *); -extern int window_box_height (struct window *); -extern int window_text_bottom_y (struct window *); -extern int window_box_width (struct window *, int); -extern int window_box_left (struct window *, int); -extern int window_box_left_offset (struct window *, int); -extern int window_box_right (struct window *, int); -extern int window_box_right_offset (struct window *, int); +void window_box (struct window *, int, int *, int *, int *, int *); +int window_box_height (struct window *); +int window_text_bottom_y (struct window *); +int window_box_width (struct window *, int); +int window_box_left (struct window *, int); +int window_box_left_offset (struct window *, int); +int window_box_right (struct window *, int); +int window_box_right_offset (struct window *, int); int estimate_mode_line_height (struct frame *, enum face_id); void pixel_to_glyph_coords (struct frame *, int, int, int *, int *, 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/>. */ #define TMEM(sym, set) (CONSP (set) ? ! NILP (Fmemq (sym, set)) : ! NILP (set)) -extern INTERVAL adjust_intervals_for_insertion (INTERVAL, - EMACS_INT, EMACS_INT); -extern void adjust_intervals_for_deletion (struct buffer *, - EMACS_INT, EMACS_INT); - static Lisp_Object merge_properties_sticky (Lisp_Object, Lisp_Object); static INTERVAL merge_interval_right (INTERVAL); static INTERVAL reproduce_tree (INTERVAL, INTERVAL); @@ -803,7 +798,7 @@ update_interval (register INTERVAL i, EMACS_INT pos) and check the hungry bits of both. Then add the length going back up to the root. */ -INTERVAL +static INTERVAL adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, EMACS_INT length) { @@ -864,7 +859,7 @@ adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, interval. Another possibility would be to create a new interval for this text, and make it have the merged properties of both ends. */ -INTERVAL +static INTERVAL adjust_intervals_for_insertion (INTERVAL tree, EMACS_INT position, EMACS_INT length) { @@ -1374,7 +1369,7 @@ interval_deletion_adjustment (register INTERVAL tree, register EMACS_INT from, text. The deletion is effected at position START (which is a buffer position, i.e. origin 1). */ -void +static void adjust_intervals_for_deletion (struct buffer *buffer, EMACS_INT start, EMACS_INT length) { @@ -1430,7 +1425,7 @@ adjust_intervals_for_deletion (struct buffer *buffer, compiler that does not allow calling a static function (here, adjust_intervals_for_deletion) from a non-static inline function. */ -inline void +void offset_intervals (struct buffer *buffer, EMACS_INT start, EMACS_INT length) { 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 /* Set point in BUFFER "temporarily" to CHARPOS, which corresponds to byte position BYTEPOS. */ -inline void +void temp_set_point_both (struct buffer *buffer, EMACS_INT charpos, EMACS_INT bytepos) { @@ -1902,7 +1897,7 @@ temp_set_point_both (struct buffer *buffer, /* Set point "temporarily", without checking any text properties. */ -inline void +void temp_set_point (struct buffer *buffer, EMACS_INT charpos) { temp_set_point_both (buffer, charpos, @@ -2391,7 +2386,7 @@ copy_intervals (INTERVAL tree, EMACS_INT start, EMACS_INT length) /* Give STRING the properties of BUFFER from POSITION to LENGTH. */ -inline void +void copy_intervals_to_string (Lisp_Object string, struct buffer *buffer, EMACS_INT position, EMACS_INT length) { 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); This is the height of W minus the height of a mode line, if any. */ -inline int +int window_text_bottom_y (struct window *w) { int height = WINDOW_TOTAL_HEIGHT (w); @@ -968,7 +968,7 @@ window_text_bottom_y (struct window *w) means return the total width of W, not including fringes to the left and right of the window. */ -inline int +int window_box_width (struct window *w, int area) { int cols = XFASTINT (w->total_cols); @@ -1007,7 +1007,7 @@ window_box_width (struct window *w, int area) /* Return the pixel height of the display area of window W, not including mode lines of W, if any. */ -inline int +int window_box_height (struct window *w) { struct frame *f = XFRAME (w->frame); @@ -1054,7 +1054,7 @@ window_box_height (struct window *w) area AREA of window W. AREA < 0 means return the left edge of the whole window, to the right of the left fringe of W. */ -inline int +int window_box_left_offset (struct window *w, int area) { int x; @@ -1086,7 +1086,7 @@ window_box_left_offset (struct window *w, int area) area AREA of window W. AREA < 0 means return the right edge of the whole window, to the left of the right fringe of W. */ -inline int +int window_box_right_offset (struct window *w, int area) { 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) area AREA of window W. AREA < 0 means return the left edge of the whole window, to the right of the left fringe of W. */ -inline int +int window_box_left (struct window *w, int area) { struct frame *f = XFRAME (w->frame); @@ -1116,7 +1116,7 @@ window_box_left (struct window *w, int area) area AREA of window W. AREA < 0 means return the right edge of the whole window, to the left of the right fringe of W. */ -inline int +int window_box_right (struct window *w, int area) { return window_box_left (w, area) + window_box_width (w, area); @@ -1129,7 +1129,7 @@ window_box_right (struct window *w, int area) coordinates of the upper-left corner of the box. Return in *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box. */ -inline void +void window_box (struct window *w, int area, int *box_x, int *box_y, int *box_width, int *box_height) { |