From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#22689: [PATCH] Add logcount Date: Sat, 30 Sep 2017 12:59:04 -0400 Message-ID: <20170930165904.2mt53wuphermhs6q@logos.localdomain> References: <87h9h9pnof.fsf@udel.edu> <20170929174134.e6uxcr63dtyvd6f4@logos.localdomain> <83mv5c4dl0.fsf@gnu.org> <20170930131636.xe22lbwlea7yqelh@logos.localdomain> <83a81c478s.fsf@gnu.org> <20170930145525.kg2zh3jf5odx6g3s@logos.localdomain> <87tvzk5dwd.fsf@blei.turtle-trading.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1506790812 9924 195.159.176.226 (30 Sep 2017 17:00:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Sep 2017 17:00:12 +0000 (UTC) User-Agent: NeoMutt/20170912-48-0df7d3-dirty Cc: 22689@debbugs.gnu.org To: Benjamin Riefenstahl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 30 19:00:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyL7V-000203-8j for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 19:00:05 +0200 Original-Received: from localhost ([::1]:39867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyL7c-0006Qi-FZ for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 13:00:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyL7X-0006PE-KZ for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 13:00:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyL7T-00058O-62 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 13:00:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60923) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyL7T-00058D-20 for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 13:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dyL7S-0000Kn-KU for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 13:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2017 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22689 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22689-submit@debbugs.gnu.org id=B22689.15067907531195 (code B ref 22689); Sat, 30 Sep 2017 17:00:02 +0000 Original-Received: (at 22689) by debbugs.gnu.org; 30 Sep 2017 16:59:13 +0000 Original-Received: from localhost ([127.0.0.1]:41371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyL6e-0000JD-SG for submit@debbugs.gnu.org; Sat, 30 Sep 2017 12:59:13 -0400 Original-Received: from mail-qk0-f180.google.com ([209.85.220.180]:49478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyL6d-0000Iz-9q for 22689@debbugs.gnu.org; Sat, 30 Sep 2017 12:59:11 -0400 Original-Received: by mail-qk0-f180.google.com with SMTP id u67so2139431qkg.6 for <22689@debbugs.gnu.org>; Sat, 30 Sep 2017 09:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jtFAHv9iNQmWgXIUFJloBnDYj876DqiKQGr9xPNtDbk=; b=vHcx+dIXgi0iuInlJa/m4U1jTlX6VYPY+8nStaXbZNh7A3tAVQKtazPrCxpLDtewck ew9maVH8SCl3/GtzC2z/J/Wm04Q720Z6G6UdQQdGmp1V0L6BZotb/b6tnuiOFSAvF9iv 0gRCAYB32ZY208SbimrELwWwaEVZA8TyKbbCmkKRQsTp7Zzd7sb2DlRSixOOCgBgL3JX 2typnY1bvx9LsR+UXLIXtXe3vjOZObXJEP3a4zjYC/eUsrf7CmiU7zs284PY8++cW17q LrzxWIpkacWuJNXCk/hnkZWd2+QY+O2S8tTZ3BwgbmC7K9BZzZzUHV3dN7iJuJYRjYpC Kz1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jtFAHv9iNQmWgXIUFJloBnDYj876DqiKQGr9xPNtDbk=; b=AkoiF/rcKPVZm+NaF1K1ZfgX8gmwZUvzrxqd81NUz/QRJZJ+QCnVSXDuNCrszw1PQ1 obSqd7xuVKrvLEbpZiaMmfq1zu1o9UjdTvvA+EV7urSss6wLqF1S8iDHD+ljLulRmuds W4hLdXXJtpdt5slrBO8+uEyPuY8hhTEAg5BjkPK0/blD4RXKdCcuAyGvYau+6/SruwYZ N1vdzXicR3ssrmb8dIIae21hVrU5YXAiR1LHkjbPkMYbZud7R7k7pADhnpkT/h0J5k/O y6kSI5V6BFhV3LmFyEEClx+DZaI4kjt+eyRs5hIE/kVrPr9iFK7oFWKT1g2sMoB+Qp87 8neA== X-Gm-Message-State: AMCzsaXzvINENpEOmt+kPQVgGCMZd25tI/k4uSc0UngX0cHo6qYQOc++ bKFUeA3Q8J5Jv5vn/JQ1X0hRpA== X-Google-Smtp-Source: AOwi7QDMdl6wZXQXQQKLEIvgT0CddxHP1NAyfm3iopkTLRDLgJJ1htOKP5CjvNeYm485opNdVe1P2g== X-Received: by 10.55.99.144 with SMTP id x138mr8433918qkb.76.1506790745600; Sat, 30 Sep 2017 09:59:05 -0700 (PDT) Original-Received: from logos.localdomain (pool-173-67-36-61.bltmmd.fios.verizon.net. [173.67.36.61]) by smtp.gmail.com with ESMTPSA id w14sm3305123qkg.82.2017.09.30.09.59.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Sep 2017 09:59:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87tvzk5dwd.fsf@blei.turtle-trading.net> 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: 208.118.235.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:137695 Archived-At: On 30/09/17 at 06:50pm, Benjamin Riefenstahl wrote: > Hi Mark, > > Just a drive-by note: > > Mark Oteiza writes: > > + { > > + unsigned int count; > > + for (count = 0; v; count++) > > + { > > + v &= v - 1; > > + } > > + XSETINT (res, v); > > + } > > Isn't this a fancy way of just saying "XSETINT (res, 0)"? The variable > "count" is incremented but never used, so without it the loop > degenerates to > > while (v) > { > v &= v - 1; > } > > I other words, this just loops until "v == 0". > > Maybe that assignment should be "XSETINT (res, count)"? That would > actually use the variable "count". I think you're right, thank you.