diff --git a/src/comp/util/bits.rs b/src/comp/util/bits.rs index fd45601739d..1208f1f7560 100644 --- a/src/comp/util/bits.rs +++ b/src/comp/util/bits.rs @@ -9,18 +9,9 @@ import std._vec; state type t = rec(vec[mutable uint] storage, uint nbits); -// FIXME: we should bind std.max_int -fn is32bit() -> bool { - let uint n = 0xffffffffu; - ret (n + 1u) == 0u; -} - +// FIXME: this should be a constant once they work fn uint_bits() -> uint { - if (is32bit()) { - ret 31u; - } else { - ret 63u; - } + ret 32u + ((1u << 32u) >> 27u) - 1u; } // FIXME: this should be state @@ -36,8 +27,6 @@ fn create(uint nbits, bool init) -> t { nbits = nbits); } - - // FIXME: this should be state fn process(fn(uint, uint) -> uint op, t v0, t v1) -> bool { auto len = _vec.len[mutable uint](v1.storage);