From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Konstantin Kharlamov Newsgroups: gmane.emacs.bugs Subject: bug#35062: [PATCH v2] min_cols/rows is always 0, remove noop actions Date: Tue, 2 Apr 2019 03:23:27 +0300 Message-ID: <20190402002327.28219-1-Hi-Angel@yandex.ru> References: <87ef6lic84.fsf@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="162362"; mail-complaints-to="usenet@blaine.gmane.org" To: 35062@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 02 02:25:33 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hB7F7-000g95-Dd for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Apr 2019 02:25:33 +0200 Original-Received: from localhost ([127.0.0.1]:38172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB7F6-00060F-FB for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Apr 2019 20:25:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hB7Dr-0005HI-W9 for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 20:24:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hB7Dn-0001fC-KS for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 20:24:13 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54807) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hB7De-0001Xj-Is for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 20:24:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hB7De-0004jF-Dl for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 20:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Apr 2019 00:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35062 X-GNU-PR-Package: emacs Original-Received: via spool by 35062-submit@debbugs.gnu.org id=B35062.155416462918153 (code B ref 35062); Tue, 02 Apr 2019 00:24:02 +0000 Original-Received: (at 35062) by debbugs.gnu.org; 2 Apr 2019 00:23:49 +0000 Original-Received: from localhost ([127.0.0.1]:40118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hB7DP-0004ih-Gq for submit@debbugs.gnu.org; Mon, 01 Apr 2019 20:23:49 -0400 Original-Received: from forward104p.mail.yandex.net ([77.88.28.107]:40129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hB7DK-0004iP-Bt for 35062@debbugs.gnu.org; Mon, 01 Apr 2019 20:23:43 -0400 Original-Received: from mxback21g.mail.yandex.net (mxback21g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:321]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 767A54B000A4 for <35062@debbugs.gnu.org>; Tue, 2 Apr 2019 03:23:34 +0300 (MSK) Original-Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback21g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id XO5GlqVeEv-NYJa7Gdc; Tue, 02 Apr 2019 03:23:34 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1554164614; bh=+2lFbc5g/7v3LzisGNWmqWo3BziB3ahw/RjXlRgfKpE=; h=In-Reply-To:Subject:To:From:References:Date:Message-Id; b=XumqfsGy77VB5+4Xb9Ie5R0mcjVQ5PJJMIuuhKy0CVePOw14wNZhsLnfXkjVIRtix oyigxJtOBtXLKALatqMa/Lz4PW/w2DtV6ziBmlSqlaZieRQx1AUtwdSr5HiL0AfL3b eMVUuGLVfMwWVTQtPnD/gZm/YC6XYT5c8JQV8C7U= Authentication-Results: mxback21g.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id g0irvuJrws-NXsKFwZj; Tue, 02 Apr 2019 03:23:33 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) X-Mailer: git-send-email 2.21.0 In-Reply-To: <87ef6lic84.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157065 Archived-At: * 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