From: Gerd Möllmann Date: Fri, 18 Oct 2024 14:21:46 +0000 (+0200) Subject: Minor refactoring X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=74f551a8a7cb740f0c719b9d4f035fe37a757968;p=emacs.git Minor refactoring (cherry picked from commit 6aa203bb04fa75e7562064e9261d7760c1b6562a) --- diff --git a/src/frame.c b/src/frame.c index 52133b23879..b314e08f36c 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1435,23 +1435,23 @@ tty_child_size_param (struct frame *child, Lisp_Object key, } else if (FLOATP (val)) { - /* Width and height may be a float, in which case - it's a multiple of the parent's value. */ - struct frame *parent = FRAME_PARENT_FRAME (child); - int sz = (EQ (key, Qwidth) ? FRAME_TOTAL_COLS (parent) - : FRAME_TOTAL_LINES (parent)); - val = make_fixnum (XFLOAT_DATA (val) * sz); + /* Width and height may be a float, in which case + it's a multiple of the parent's value. */ + struct frame *parent = FRAME_PARENT_FRAME (child); + int sz = (EQ (key, Qwidth) ? FRAME_TOTAL_COLS (parent) + : FRAME_TOTAL_LINES (parent)); + val = make_fixnum (XFLOAT_DATA (val) * sz); } - if (FIXNUMP (val) && XFIXNUM (val) >= 0) + if (FIXNATP (val)) return XFIXNUM (val); } return dflt; } static void -child_frame_rect (struct frame *f, Lisp_Object params, - int *x, int *y, int *w, int *h) +tty_child_frame_rect (struct frame *f, Lisp_Object params, + int *x, int *y, int *w, int *h) { *x = tty_child_pos_param (f, Qleft, params, 0); *y = tty_child_pos_param (f, Qtop, params, 0); @@ -1585,7 +1585,7 @@ affects all frames on the same terminal device. */) terminal size). */ int x = 0, y = 0, width, height; if (FRAME_PARENT_FRAME (f)) - child_frame_rect (f, parms, &x, &y, &width, &height); + tty_child_frame_rect (f, parms, &x, &y, &width, &height); else get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height); adjust_frame_size (f, width, height - FRAME_TOP_MARGIN (f), 5, 0,