Skip to content

Commit a01ef8e

Browse files
committed
Change SmallBitv to use uint instead of u32
1 parent 91fae27 commit a01ef8e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/libstd/bitv.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@ use core::vec;
1616

1717
struct SmallBitv {
1818
/// only the lowest nbits of this value are used. the rest is undefined.
19-
bits: u32
19+
bits: uint
2020
}
2121

2222
/// a mask that has a 1 for each defined bit in a small_bitv, assuming n bits
2323
#[inline(always)]
24-
fn small_mask(nbits: uint) -> u32 {
24+
fn small_mask(nbits: uint) -> uint {
2525
(1 << nbits) - 1
2626
}
2727

2828
impl SmallBitv {
29-
static fn new(bits: u32) -> SmallBitv {
29+
static fn new(bits: uint) -> SmallBitv {
3030
SmallBitv {bits: bits}
3131
}
3232

3333
#[inline(always)]
34-
fn bits_op(&mut self, right_bits: u32, nbits: uint,
35-
f: fn(u32, u32) -> u32) -> bool {
34+
fn bits_op(&mut self, right_bits: uint, nbits: uint,
35+
f: fn(uint, uint) -> uint) -> bool {
3636
let mask = small_mask(nbits);
37-
let old_b: u32 = self.bits;
37+
let old_b: uint = self.bits;
3838
let new_b = f(old_b, right_bits);
3939
self.bits = new_b;
4040
mask & old_b != mask & new_b
@@ -71,7 +71,7 @@ impl SmallBitv {
7171
self.bits |= 1<<i;
7272
}
7373
else {
74-
self.bits &= !(1<<i as u32);
74+
self.bits &= !(1<<i as uint);
7575
}
7676
}
7777

@@ -259,7 +259,7 @@ priv impl Bitv {
259259
260260
impl Bitv {
261261
static fn new(nbits: uint, init: bool) -> Bitv {
262-
let rep = if nbits <= 32 {
262+
let rep = if nbits <= uint::bits {
263263
Small(~SmallBitv::new(if init {!0} else {0}))
264264
}
265265
else {

0 commit comments

Comments
 (0)