emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r106330: Avoid some portability probl


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r106330: Avoid some portability problems by eschewing 'extern inline' functions.
Date: Tue, 08 Nov 2011 12:05:27 -0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 106330
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2011-11-08 12:05:27 -0800
message:
  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.
modified:
  src/ChangeLog
  src/dispextern.h
  src/intervals.c
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-11-08 07:25:56 +0000
+++ b/src/ChangeLog     2011-11-08 20:05:27 +0000
@@ -1,3 +1,23 @@
+2011-11-08  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.

=== modified file 'src/dispextern.h'
--- a/src/dispextern.h  2011-11-06 21:12:10 +0000
+++ b/src/dispextern.h  2011-11-08 20:05:27 +0000
@@ -3006,14 +3006,14 @@
 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);

=== modified file 'src/intervals.c'
--- a/src/intervals.c   2011-11-06 21:12:10 +0000
+++ b/src/intervals.c   2011-11-08 20:05:27 +0000
@@ -52,11 +52,6 @@
 
 #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 @@
    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 @@
    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 @@
    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 @@
    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 @@
 /* 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 @@
 
 /* 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 @@
 
 /* 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)
 {

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2011-11-06 18:21:52 +0000
+++ b/src/xdisp.c       2011-11-08 20:05:27 +0000
@@ -954,7 +954,7 @@
 
    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 @@
    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 @@
 /* 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 @@
    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 @@
    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 @@
    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 @@
    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 @@
    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)
 {


reply via email to

[Prev in Thread] Current Thread [Next in Thread]