emacs-diffs
[Top][All Lists]
Advanced

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

scratch/tty-child-frames 6aa203bb04f 06/10: Minor refactoring


From: Gerd Moellmann
Subject: scratch/tty-child-frames 6aa203bb04f 06/10: Minor refactoring
Date: Tue, 22 Oct 2024 00:43:41 -0400 (EDT)

branch: scratch/tty-child-frames
commit 6aa203bb04fa75e7562064e9261d7760c1b6562a
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    Minor refactoring
---
 src/frame.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/frame.c b/src/frame.c
index 5f07f8e8976..69ffc53ebbf 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,



reply via email to

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