diff options
author | Sven Gothel <[email protected]> | 2015-08-02 01:13:48 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-02 01:13:48 +0200 |
commit | 8342d3bdbe2e14ad44dfc708e00daf721dae6a58 (patch) | |
tree | a61bcd89ae43c010d05ca40446176cde88bd9d05 /src/java/com/jogamp | |
parent | 047e9adaf2a5f51f7acfa194a744c99b6bfadaea (diff) |
IntBitfield: Fix units calculation ( +7 -> +31 for ceiling, using 32bits per unit)
Diffstat (limited to 'src/java/com/jogamp')
-rw-r--r-- | src/java/com/jogamp/common/util/IntBitfield.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/util/IntBitfield.java b/src/java/com/jogamp/common/util/IntBitfield.java index e7a9d70..6aad391 100644 --- a/src/java/com/jogamp/common/util/IntBitfield.java +++ b/src/java/com/jogamp/common/util/IntBitfield.java @@ -54,7 +54,7 @@ public class IntBitfield { * @param bitCount */ public IntBitfield(final long bitCount) { - final int units = (int) Math.max(1L, ( bitCount + 7L ) >>> UNIT_SHIFT_L); + final int units = (int) Math.max(1L, ( bitCount + 31L ) >>> UNIT_SHIFT_L); this.storage = new int[units]; this.bitsCountL = (long)units << UNIT_SHIFT_L ; this.bitsCountI = bitsCountL > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)bitsCountL; @@ -64,7 +64,7 @@ public class IntBitfield { * @param bitCount */ public IntBitfield(final int bitCount) { - final int units = Math.max(1, ( bitCount + 7 ) >>> UNIT_SHIFT_I); + final int units = Math.max(1, ( bitCount + 31 ) >>> UNIT_SHIFT_I); this.storage = new int[units]; this.bitsCountI = units << UNIT_SHIFT_I; this.bitsCountL = bitsCountI; |