From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#45562: [PATCH] Fix "comparison always the same" warnings found by lgtm Date: Thu, 31 Dec 2020 00:33:06 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000001ff11905b7be79de" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37213"; mail-complaints-to="usenet@ciao.gmane.io" To: 45562@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 31 09:34:26 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kutPe-0009YF-5V for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Dec 2020 09:34:26 +0100 Original-Received: from localhost ([::1]:33470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kutPc-0003Tw-JK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 31 Dec 2020 03:34:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kutPG-0003Tm-Vg for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2020 03:34:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41131) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kutPG-00078U-P8 for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2020 03:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kutPF-0007hz-Rz for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2020 03:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Dec 2020 08:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45562 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160940359629573 (code B ref -1); Thu, 31 Dec 2020 08:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Dec 2020 08:33:16 +0000 Original-Received: from localhost ([127.0.0.1]:52677 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kutOV-0007gv-Kv for submit@debbugs.gnu.org; Thu, 31 Dec 2020 03:33:15 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:55834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kutOT-0007gn-Ag for submit@debbugs.gnu.org; Thu, 31 Dec 2020 03:33:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kutOR-0003Rc-Hk for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2020 03:33:13 -0500 Original-Received: from mail-pf1-f170.google.com ([209.85.210.170]:47028) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kutOP-0006he-3F for bug-gnu-emacs@gnu.org; Thu, 31 Dec 2020 03:33:10 -0500 Original-Received: by mail-pf1-f170.google.com with SMTP id s21so10928836pfu.13 for ; Thu, 31 Dec 2020 00:33:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to; bh=WNzVrvvKRYce0xBmJirVUkTTYRWT5/p1HqMtPmZ5WlI=; b=IxI4yVNCdSXxb8Or6sVE+8BmdOPUoW/EDf5I4wXliROEnUYaHk5CROyaBCF5anlcvO Aqg7ti8Ek6LItL0Ee6sCkI+DRqI/BqvDG61PMdBMX1c80HS8Rmrlt2Q3of3xvToRDb0k KbIhEbvt0xMXRg6wRWcrroo+jgX3vORkw1WOHMs+IXp+XwAhk6mlOswaFiu8kmc8Kbxp 66MC3Fv2jTr3C+q8+MqlRDexQ1v5ccesbzUzTN7MTT5m1Caz6d3+284AKBNxaBn+HRD5 lR4fOOw1wb+PZAF6s8dLs4sBRrMgbrGC3dom8QwAAGrL6ur2I9cBb36OkocrpUskURKB BH6A== X-Gm-Message-State: AOAM532DX3PZmcHsLxFar1i3eeG2VY0lr6NNDmV7Ub6IcjZxxqNkrq6L N+MDqZ0p4OFXA7I2+K+rkjUbK2N4DdWffH5DFSoNkQG/im8= X-Google-Smtp-Source: ABdhPJzcywRG2J5Pjv0MF9CSvaXAtvXX0fj0MDl9LcWJ4M4jXf/hGykR154mJYuwM99ibgE/rXXhoPGwVSDW6yDlVM0= X-Received: by 2002:a62:e212:0:b029:19d:8cff:f179 with SMTP id a18-20020a62e2120000b029019d8cfff179mr51452449pfi.44.1609403587346; Thu, 31 Dec 2020 00:33:07 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 31 Dec 2020 00:33:06 -0800 Received-SPF: pass client-ip=209.85.210.170; envelope-from=stefankangas@gmail.com; helo=mail-pf1-f170.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197075 Archived-At: --0000000000001ff11905b7be79de Content-Type: text/plain; charset="UTF-8" Severity: wishlist The attached patch fixes some warnings found by lgtm.com. Does it look okay? Ref: https://lgtm.com/projects/g/emacs-mirror/emacs/ --0000000000001ff11905b7be79de Content-Type: text/x-diff; charset="US-ASCII"; name="0001-Fix-comparison-always-the-same-warnings-found-by-lgt.patch" Content-Disposition: attachment; filename="0001-Fix-comparison-always-the-same-warnings-found-by-lgt.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: 2de1db0659ca70fc_0.1 RnJvbSAzNDAyMDY4NjUzODNiMDc2NGE3ZDA3Y2M3NzcxZjRmYjg3NzNiMzAyIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBTdGVmYW4gS2FuZ2FzIDxzdGVmYW5AbWFyeGlzdC5zZT4KRGF0 ZTogVGh1LCAzMSBEZWMgMjAyMCAwODoxOTo0MSArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIEZpeCAi Y29tcGFyaXNvbiBhbHdheXMgdGhlIHNhbWUiIHdhcm5pbmdzIGZvdW5kIGJ5IGxndG0KCiogc3Jj L2FsbG9jLmMgKG1lbW9yeV9mdWxsKToKKiBzcmMvYnVmZmVyLmMgKGluaXRfYnVmZmVyX29uY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sX2Jhc2Vk IChMaXNwX09iamVjdCB3aW5kb3csIGludCBuLCBib29sIHdob2xlLCBib29sIG5vZXJyb3IpCiAJ CSAmJiBzdGFydF9wb3MgPiBCRUdWKQogCSAgICBtb3ZlX2l0X2J5X2xpbmVzICgmaXQsIC0xKTsK IAl9Ci0gICAgICBlbHNlIGlmIChkeSA+IDApCisgICAgICBlbHNlIC8qIGlmIChkeSA+IDApICov CiAJewogCSAgZ29hbF95ID0gaXQuY3VycmVudF95ICsgZHk7CiAJICBtb3ZlX2l0X3RvICgmaXQs IFpWLCAtMSwgZ29hbF95LCAtMSwgTU9WRV9UT19QT1MgfCBNT1ZFX1RPX1kpOwpkaWZmIC0tZ2l0 IGEvc3JjL3hmYWNlcy5jIGIvc3JjL3hmYWNlcy5jCmluZGV4IDczYTUzNmIxOWMuLmVhMGU5ZDZh MjggMTAwNjQ0Ci0tLSBhL3NyYy94ZmFjZXMuYworKysgYi9zcmMveGZhY2VzLmMKQEAgLTIyMjgs NyArMjIyOCw3IEBAIG1lcmdlX2ZhY2VfdmVjdG9ycyAoc3RydWN0IHdpbmRvdyAqdywKIAllbHNl IGlmIChpICE9IExGQUNFX0ZPTlRfSU5ERVggJiYgISBFUSAodG9baV0sIGZyb21baV0pKQogCSAg ewogCSAgICB0b1tpXSA9IGZyb21baV07Ci0JICAgIGlmIChpID49IExGQUNFX0ZBTUlMWV9JTkRF WCAmJiBpIDw9IExGQUNFX1NMQU5UX0lOREVYKQorCSAgICBpZiAoaSA8PSBMRkFDRV9TTEFOVF9J TkRFWCkKIAkgICAgICBmb250X2NsZWFyX3Byb3AgKHRvLAogCSAgICAgICAgICAgICAgICAgICAg ICAgKGkgPT0gTEZBQ0VfRkFNSUxZX0lOREVYID8gRk9OVF9GQU1JTFlfSU5ERVgKIAkJCSAgICAg ICAgOiBpID09IExGQUNFX0ZPVU5EUllfSU5ERVggPyBGT05UX0ZPVU5EUllfSU5ERVgKLS0gCjIu MjkuMgoK --0000000000001ff11905b7be79de--