diff options
author | rubidium <rubidium@openttd.org> | 2007-09-01 08:31:36 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-09-01 08:31:36 +0000 |
commit | 56ab253307c128cd99342ab1b6809e02b3fe9dcc (patch) | |
tree | 6358623fdcb900c9c4bcb968c9388b48c33f1cb5 /src/misc.cpp | |
parent | 0df355bbda0e97edb0c642188db663620dd2e4f6 (diff) | |
download | openttd-56ab253307c128cd99342ab1b6809e02b3fe9dcc.tar.xz |
(svn r11031) -Codechange: reduce the amount of duplication of bit counting functions. Based on patches by skidd13, SmatZ and Belugas.
Diffstat (limited to 'src/misc.cpp')
-rw-r--r-- | src/misc.cpp | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/src/misc.cpp b/src/misc.cpp index b7c47fc9a..2e3bd2bff 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -273,22 +273,6 @@ int FindFirstBit(uint32 value) return i; } -int CountBitsSet(uint32 value) -{ - int num; - - /* This loop is only called once for every bit set by clearing the lowest - * bit in each loop. The number of bits is therefore equal to the number of - * times the loop was called. It was found at the following website: - * http://graphics.stanford.edu/~seander/bithacks.html */ - - for (num = 0; value != 0; num++) { - value &= value - 1; - } - - return num; -} - static void Save_NAME() { int i; |