We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a539a5 commit ce32246Copy full SHA for ce32246
src/comp/util/bits.rs
@@ -9,18 +9,9 @@ import std._vec;
9
10
state type t = rec(vec[mutable uint] storage, uint nbits);
11
12
-// FIXME: we should bind std.max_int
13
-fn is32bit() -> bool {
14
- let uint n = 0xffffffffu;
15
- ret (n + 1u) == 0u;
16
-}
17
-
+// FIXME: this should be a constant once they work
18
fn uint_bits() -> uint {
19
- if (is32bit()) {
20
- ret 31u;
21
- } else {
22
- ret 63u;
23
- }
+ ret 32u + ((1u << 32u) >> 27u) - 1u;
24
}
25
26
// FIXME: this should be state
@@ -36,8 +27,6 @@ fn create(uint nbits, bool init) -> t {
36
27
nbits = nbits);
37
28
38
29
39
40
41
30
42
31
fn process(fn(uint, uint) -> uint op, t v0, t v1) -> bool {
43
32
auto len = _vec.len[mutable uint](v1.storage);
0 commit comments