bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#35062: [PATCH v2] min_cols/rows is always 0, remove noop actions


From: Konstantin Kharlamov
Subject: bug#35062: [PATCH v2] min_cols/rows is always 0, remove noop actions
Date: Tue, 2 Apr 2019 03:23:27 +0300

* src/gtkutil.c:
    remove "always false" comparison
    remove multiplication by zero, it's a noop anyway
    remove min_cols and min_rows as it's now unused

Fixes LGTM warnings:
    * Comparison is always false because min_cols <= 0.
    * Comparison is always false because min_rows <= 0.
---
v2: remove the min_rows/min_cols whatsoever

 src/gtkutil.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4bd73b1a6d1..b130692c87a 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1401,7 +1401,6 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool 
user_position)
   GdkGeometry size_hints;
   gint hint_flags = 0;
   int base_width, base_height;
-  int min_rows = 0, min_cols = 0;
   int win_gravity = f->win_gravity;
   Lisp_Object fs_state, frame;
   int scale = xg_get_scale (f);
@@ -1450,13 +1449,10 @@ x_wm_set_size_hint (struct frame *f, long int flags, 
bool user_position)
   base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1)
     + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
 
-  if (min_cols > 0) --min_cols; /* We used one col in base_width = ... 1); */
-  if (min_rows > 0) --min_rows; /* We used one row in base_height = ... 1); */
-
   size_hints.base_width = base_width;
   size_hints.base_height = base_height;
-  size_hints.min_width  = base_width + min_cols * FRAME_COLUMN_WIDTH (f);
-  size_hints.min_height = base_height + min_rows * FRAME_LINE_HEIGHT (f);
+  size_hints.min_width  = base_width;
+  size_hints.min_height = base_height;
 
   /* These currently have a one to one mapping with the X values, but I
      don't think we should rely on that.  */
-- 
2.21.0






reply via email to

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