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 0/4] Trivial code cleanups Date: Mon, 1 Apr 2019 01:37:38 +0300 Message-ID: <20190331223742.1351-1-Hi-Angel@yandex.ru> References: <1554071761.31929.0@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="152723"; 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 Mon Apr 01 00:38:55 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 1hAj6M-000dcJ-42 for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Apr 2019 00:38:54 +0200 Original-Received: from localhost ([127.0.0.1]:35698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAj6L-0007Ho-3C for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Mar 2019 18:38:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAj5Z-0006ta-3V for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 18:38:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAj5Y-0001in-4G for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 18:38:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53290) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAj5X-0001iT-UF for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 18:38:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hAj5X-0006nH-Pb for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2019 18:38:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <1554071761.31929.0@yandex.ru> Resent-From: Konstantin Kharlamov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Mar 2019 22:38:03 +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.155407187926059 (code B ref 35062); Sun, 31 Mar 2019 22:38:03 +0000 Original-Received: (at 35062) by debbugs.gnu.org; 31 Mar 2019 22:37:59 +0000 Original-Received: from localhost ([127.0.0.1]:38590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAj5S-0006ly-Vt for submit@debbugs.gnu.org; Sun, 31 Mar 2019 18:37:59 -0400 Original-Received: from forward101p.mail.yandex.net ([77.88.28.101]:46546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAj5Q-0006le-BY for 35062@debbugs.gnu.org; Sun, 31 Mar 2019 18:37:56 -0400 Original-Received: from mxback23g.mail.yandex.net (mxback23g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:323]) by forward101p.mail.yandex.net (Yandex) with ESMTP id CE50B3280B88 for <35062@debbugs.gnu.org>; Mon, 1 Apr 2019 01:37:49 +0300 (MSK) Original-Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback23g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WOw1tZgGSw-bnsuosZv; Mon, 01 Apr 2019 01:37:49 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1554071869; bh=f/IOk3iTVHrDU1xAg4pAFxPZnyN3aBFLOiEcLjgIlkg=; h=Subject:To:From:Date:Message-Id; b=RPpijObHfktxURIHsfnjgBoltO+6z9pYfpdwR+FMPBRNU5+gr7Depb5ACoUKMe34A Vprl6fhe2Xcqf1oNvAsLOPlgEUxso0tokvqQYvazdCpuf+v4ByezFQpfR32vGj7Gc3 hiHlxrovGOImy3CG1BWcFb+f0OjNIWyo6WZ4EUdA= Authentication-Results: mxback23g.mail.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id XiGbwCpRwI-bm6u8ciR; Mon, 01 Apr 2019 01:37:49 +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 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:156996 Archived-At: These are mostly fixes of some of LGTM warnings https://lgtm.com/projects/g/emacs-mirror/emacs/alerts/?mode=tree Except the second patch, where I initially wanted to fix one warning, and as part of it I had to constify a variable to see that it is indeed immutable. And then I figured I could search through the code and find more similar places, where variables weren't marked as const. I like this cleanup because it is simple and trivially testable (i.e. if it compiles, then it's fine). FTR: there's still lots of opportunities for constification, I just stopped at some point. Konstantin Kharlamov (4): Remove redundant comparison constify a bit of xterm.c min_cols/rows is always 0, don't check for it don't compare unsigned to less-than-zero src/gtkutil.c | 5 +---- src/pdumper.c | 2 -- src/xterm.c | 34 +++++++++++++++++----------------- 3 files changed, 18 insertions(+), 23 deletions(-) -- 2.21.0