Mesa (master): gallium/util: fix 'statement with no effect' warning
Brian Paul
brianp at kemper.freedesktop.org
Fri Feb 27 22:27:27 UTC 2015
Module: Mesa
Branch: master
Commit: b14cec0b8e98195679eab5afbdba3bb47badccf2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b14cec0b8e98195679eab5afbdba3bb47badccf2
Author: Brian Paul <brianp at vmware.com>
Date: Fri Feb 27 12:49:29 2015 -0700
gallium/util: fix 'statement with no effect' warning
Reviewed-by: José Fonseca <jfonseca at vmware.com>
---
src/gallium/auxiliary/util/u_math.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 959f76e..5400fce 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -581,8 +581,8 @@ util_bitcount(unsigned n)
* Requires only one iteration per set bit, instead of
* one iteration per bit less than highest set bit.
*/
- unsigned bits = 0;
- for (bits; n; bits++) {
+ unsigned bits;
+ for (bits = 0; n; bits++) {
n &= n - 1;
}
return bits;
More information about the mesa-commit
mailing list