]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace two macros with functions in dispnew.c (bug#75056)
authorGerd Möllmann <gerd@gnu.org>
Wed, 29 Jan 2025 07:34:43 +0000 (08:34 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 30 Jan 2025 18:13:33 +0000 (19:13 +0100)
* src/dispnew.c (WINDOW_TO_FRAME_VPOS, WINDOW_TO_FRAME_VPOS): Macros
removed.
(window_to_frame_vpos, window_to_frame_vpos): Always define, and use
them instead of the removed macros.

(cherry picked from commit 7aacefba6bfe4c0e658f09d2ac7f025f9a9a827f)

src/dispnew.c

index 09b937a24f4ccb12a7bc50c60c7b796f8631b485..cd5f2468f93141ced6c33f44e4cf5db4a8504b73 100644 (file)
@@ -139,11 +139,6 @@ static int glyph_pool_count;
 
 #ifdef GLYPH_DEBUG
 
-static int window_to_frame_vpos (struct window *, int);
-static int window_to_frame_hpos (struct window *, int);
-#define WINDOW_TO_FRAME_VPOS(W, VPOS) window_to_frame_vpos (W, VPOS)
-#define WINDOW_TO_FRAME_HPOS(W, HPOS) window_to_frame_hpos (W, HPOS)
-
 /* One element of the ring buffer containing redisplay history
    information.  */
 
@@ -235,11 +230,6 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history,
 }
 
 
-#else /* not GLYPH_DEBUG */
-
-#define WINDOW_TO_FRAME_VPOS(W, VPOS) ((VPOS) + WINDOW_TOP_EDGE_LINE (W))
-#define WINDOW_TO_FRAME_HPOS(W, HPOS) ((HPOS) + WINDOW_LEFT_EDGE_COL (W))
-
 #endif /* GLYPH_DEBUG */
 
 
@@ -3164,8 +3154,6 @@ check_matrix_pointers (struct glyph_matrix *window_matrix,
                      VPOS and HPOS translations
  **********************************************************************/
 
-#ifdef GLYPH_DEBUG
-
 /* Translate vertical position VPOS which is relative to window W to a
    vertical position relative to W's frame.  */
 
@@ -3192,9 +3180,6 @@ window_to_frame_hpos (struct window *w, int hpos)
   return hpos;
 }
 
-#endif /* GLYPH_DEBUG */
-
-
 \f
 /**********************************************************************
                            Redrawing Frames
@@ -3876,8 +3861,8 @@ abs_cursor_pos (struct frame *f, int *x, int *y)
         a new cursor position has been computed.  */
       && w->cursor.vpos < WINDOW_TOTAL_LINES (w))
     {
-      int wx = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos);
-      int wy = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
+      int wx = window_to_frame_hpos (w, w->cursor.hpos);
+      int wy = window_to_frame_vpos (w, w->cursor.vpos);
 
       wx += max (0, w->left_margin_cols);
 
@@ -5661,8 +5646,8 @@ tty_set_cursor (struct frame *f)
             a new cursor position has been computed.  */
          && w->cursor.vpos < WINDOW_TOTAL_LINES (w))
        {
-         int x = WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos);
-         int y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
+         int x = window_to_frame_hpos (w, w->cursor.hpos);
+         int y = window_to_frame_vpos (w, w->cursor.vpos);
 
          x += max (0, w->left_margin_cols);
          cursor_to (f, y, x);