@@ -16,25 +16,25 @@ use core::vec;
16
16
17
17
struct SmallBitv {
18
18
/// only the lowest nbits of this value are used. the rest is undefined.
19
- bits : u32
19
+ bits : uint
20
20
}
21
21
22
22
/// a mask that has a 1 for each defined bit in a small_bitv, assuming n bits
23
23
#[ inline( always) ]
24
- fn small_mask ( nbits : uint ) -> u32 {
24
+ fn small_mask ( nbits : uint ) -> uint {
25
25
( 1 << nbits) - 1
26
26
}
27
27
28
28
impl SmallBitv {
29
- static fn new( bits: u32 ) -> SmallBitv {
29
+ static fn new( bits: uint ) -> SmallBitv {
30
30
SmallBitv { bits : bits }
31
31
}
32
32
33
33
#[ 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 {
36
36
let mask = small_mask ( nbits) ;
37
- let old_b: u32 = self . bits ;
37
+ let old_b: uint = self . bits ;
38
38
let new_b = f ( old_b, right_bits) ;
39
39
self . bits = new_b;
40
40
mask & old_b != mask & new_b
@@ -71,7 +71,7 @@ impl SmallBitv {
71
71
self . bits |= 1 <<i;
72
72
}
73
73
else {
74
- self . bits &= !( 1 <<i as u32 ) ;
74
+ self . bits &= !( 1 <<i as uint ) ;
75
75
}
76
76
}
77
77
@@ -259,7 +259,7 @@ priv impl Bitv {
259
259
260
260
impl Bitv {
261
261
static fn new(nbits: uint, init: bool) -> Bitv {
262
- let rep = if nbits <= 32 {
262
+ let rep = if nbits <= uint::bits {
263
263
Small(~SmallBitv::new(if init {!0} else {0}))
264
264
}
265
265
else {
0 commit comments