From: Gerd Möllmann Date: Wed, 29 Jan 2025 07:34:43 +0000 (+0100) Subject: Replace two macros with functions in dispnew.c (bug#75056) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9bdb087e273fafe3f7f7e85fc0f7cde700f35ae5;p=emacs.git Replace two macros with functions in dispnew.c (bug#75056) * 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) --- diff --git a/src/dispnew.c b/src/dispnew.c index 09b937a24f4..cd5f2468f93 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -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 */ - - /********************************************************************** 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);