From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Benjamin Riefenstahl Newsgroups: gmane.emacs.bugs Subject: bug#22689: [PATCH] Add logcount Date: Sat, 30 Sep 2017 18:50:42 +0200 Message-ID: <87tvzk5dwd.fsf@blei.turtle-trading.net> 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1506790275 2605 195.159.176.226 (30 Sep 2017 16:51:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 30 Sep 2017 16:51:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) Cc: 22689@debbugs.gnu.org To: Mark Oteiza Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 30 18:51:12 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 1dyKys-0000Fl-UR for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 18:51:11 +0200 Original-Received: from localhost ([::1]:39849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyKz0-00051l-Az for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Sep 2017 12:51:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57323) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dyKyo-000507-RP for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 12:51:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dyKyk-0005bK-SE for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 12:51:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60919) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dyKyk-0005b4-Ns for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 12:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dyKyk-00007z-EM for bug-gnu-emacs@gnu.org; Sat, 30 Sep 2017 12:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Sep 2017 16:51: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.1506790252474 (code B ref 22689); Sat, 30 Sep 2017 16:51:02 +0000 Original-Received: (at 22689) by debbugs.gnu.org; 30 Sep 2017 16:50:52 +0000 Original-Received: from localhost ([127.0.0.1]:41367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyKya-00007a-36 for submit@debbugs.gnu.org; Sat, 30 Sep 2017 12:50:52 -0400 Original-Received: from odoacer.turtle-trading.net ([217.91.34.180]:45475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyKyY-00007L-Da for 22689@debbugs.gnu.org; Sat, 30 Sep 2017 12:50:50 -0400 Original-Received: from justinian.turtle-trading.net ([192.168.2.118]) by odoacer.turtle-trading.net with esmtp (Exim 4.80) (envelope-from ) id 1dyKyQ-0006Dc-FY; Sat, 30 Sep 2017 18:50:42 +0200 Original-Received: from benny by justinian.turtle-trading.net with local (Exim 4.84_2) (envelope-from ) id 1dyKyQ-0003Fe-CF; Sat, 30 Sep 2017 18:50:42 +0200 In-Reply-To: <20170930145525.kg2zh3jf5odx6g3s@logos.localdomain> (Mark Oteiza's message of "Sat, 30 Sep 2017 10:55:25 -0400") 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:137694 Archived-At: 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". benny