[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#22689: [PATCH] Add logcount
From: |
Benjamin Riefenstahl |
Subject: |
bug#22689: [PATCH] Add logcount |
Date: |
Sat, 30 Sep 2017 18:50:42 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) |
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
- bug#22689: [PATCH] Add logcount, (continued)
- bug#22689: [PATCH] Add logcount, Eli Zaretskii, 2017/09/30
- bug#22689: [PATCH] Add logcount, Mark Oteiza, 2017/09/30
- bug#22689: [PATCH] Add logcount, Eli Zaretskii, 2017/09/30
- bug#22689: [PATCH] Add logcount, Mark Oteiza, 2017/09/30
- bug#22689: [PATCH] Add logcount, Eli Zaretskii, 2017/09/30
- bug#22689: [PATCH] Add logcount, Mark Oteiza, 2017/09/30
- bug#22689: [PATCH] Add logcount, Eli Zaretskii, 2017/09/30
- bug#22689: [PATCH] Add logcount, Mark Oteiza, 2017/09/30
- bug#22689: [PATCH] Add logcount, Eli Zaretskii, 2017/09/30
- bug#22689: [PATCH] Add logcount, Mark Oteiza, 2017/09/30
- bug#22689: [PATCH] Add logcount,
Benjamin Riefenstahl <=
- bug#22689: [PATCH] Add logcount, Mark Oteiza, 2017/09/30
bug#22689: [PATCH] Add logcount, Paul Eggert, 2017/09/30