Skip to content

Commit ba12ea9

Browse files
committed
---
yaml --- r: 107654 b: refs/heads/dist-snap c: 60260b6 h: refs/heads/master v: v3
1 parent 4c2e659 commit ba12ea9

37 files changed

+445
-445
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 5d2ef31af97dca3cc2a13225b0e00c4fbcd90e49
9+
refs/heads/dist-snap: 60260b6d43053490b9bd46d3d5e0364290f80393
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/bitv.rs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -121,8 +121,8 @@ struct BigBitv {
121121
*/
122122
#[inline]
123123
fn big_mask(nbits: uint, elem: uint) -> uint {
124-
let rmd = nbits % uint::bits;
125-
let nelems = nbits/uint::bits + if rmd == 0 {0} else {1};
124+
let rmd = nbits % uint::BITS;
125+
let nelems = nbits/uint::BITS + if rmd == 0 {0} else {1};
126126

127127
if elem < nelems - 1 || rmd == 0 {
128128
!0
@@ -192,16 +192,16 @@ impl BigBitv {
192192

193193
#[inline]
194194
pub fn get(&self, i: uint) -> bool {
195-
let w = i / uint::bits;
196-
let b = i % uint::bits;
195+
let w = i / uint::BITS;
196+
let b = i % uint::BITS;
197197
let x = 1 & self.storage[w] >> b;
198198
x == 1
199199
}
200200

201201
#[inline]
202202
pub fn set(&mut self, i: uint, x: bool) {
203-
let w = i / uint::bits;
204-
let b = i % uint::bits;
203+
let w = i / uint::BITS;
204+
let b = i % uint::BITS;
205205
let flag = 1 << b;
206206
self.storage[w] = if x { self.storage[w] | flag }
207207
else { self.storage[w] & !flag };
@@ -269,20 +269,20 @@ impl Bitv {
269269

270270
impl Bitv {
271271
pub fn new(nbits: uint, init: bool) -> Bitv {
272-
let rep = if nbits < uint::bits {
272+
let rep = if nbits < uint::BITS {
273273
Small(SmallBitv::new(if init {(1<<nbits)-1} else {0}))
274-
} else if nbits == uint::bits {
274+
} else if nbits == uint::BITS {
275275
Small(SmallBitv::new(if init {!0} else {0}))
276276
} else {
277-
let exact = nbits % uint::bits == 0;
278-
let nelems = nbits/uint::bits + if exact {0} else {1};
277+
let exact = nbits % uint::BITS == 0;
278+
let nelems = nbits/uint::BITS + if exact {0} else {1};
279279
let s =
280280
if init {
281281
if exact {
282282
vec::from_elem(nelems, !0u)
283283
} else {
284284
let mut v = vec::from_elem(nelems-1, !0u);
285-
v.push((1<<nbits % uint::bits)-1);
285+
v.push((1<<nbits % uint::BITS)-1);
286286
v
287287
}
288288
} else { vec::from_elem(nelems, 0u)};
@@ -576,7 +576,7 @@ fn iterate_bits(base: uint, bits: uint, f: |uint| -> bool) -> bool {
576576
if bits == 0 {
577577
return true;
578578
}
579-
for i in range(0u, uint::bits) {
579+
for i in range(0u, uint::BITS) {
580580
if bits & (1 << i) != 0 {
581581
if !f(base + i) {
582582
return false;
@@ -680,7 +680,7 @@ impl BitvSet {
680680

681681
/// Returns the capacity in bits for this bit vector. Inserting any
682682
/// element less than this amount will not trigger a resizing.
683-
pub fn capacity(&self) -> uint { self.bitv.storage.len() * uint::bits }
683+
pub fn capacity(&self) -> uint { self.bitv.storage.len() * uint::BITS }
684684

685685
/// Consumes this set to return the underlying bit vector
686686
pub fn unwrap(self) -> Bitv {
@@ -693,7 +693,7 @@ impl BitvSet {
693693
fn other_op(&mut self, other: &BitvSet, f: |uint, uint| -> uint) {
694694
fn nbits(mut w: uint) -> uint {
695695
let mut bits = 0;
696-
for _ in range(0u, uint::bits) {
696+
for _ in range(0u, uint::BITS) {
697697
if w == 0 {
698698
break;
699699
}
@@ -703,7 +703,7 @@ impl BitvSet {
703703
return bits;
704704
}
705705
if self.capacity() < other.capacity() {
706-
self.bitv.storage.grow(other.capacity() / uint::bits, &0);
706+
self.bitv.storage.grow(other.capacity() / uint::BITS, &0);
707707
}
708708
for (i, &w) in other.bitv.storage.iter().enumerate() {
709709
let old = self.bitv.storage[i];
@@ -808,7 +808,7 @@ impl Mutable for BitvSet {
808808

809809
impl Set<uint> for BitvSet {
810810
fn contains(&self, value: &uint) -> bool {
811-
*value < self.bitv.storage.len() * uint::bits && self.bitv.get(*value)
811+
*value < self.bitv.storage.len() * uint::BITS && self.bitv.get(*value)
812812
}
813813

814814
fn is_disjoint(&self, other: &BitvSet) -> bool {
@@ -846,7 +846,7 @@ impl MutableSet<uint> for BitvSet {
846846
}
847847
let nbits = self.capacity();
848848
if value >= nbits {
849-
let newsize = num::max(value, nbits * 2) / uint::bits + 1;
849+
let newsize = num::max(value, nbits * 2) / uint::BITS + 1;
850850
assert!(newsize > self.bitv.storage.len());
851851
self.bitv.storage.grow(newsize, &0);
852852
}
@@ -884,7 +884,7 @@ impl BitvSet {
884884
let min = num::min(self.bitv.storage.len(), other.bitv.storage.len());
885885
self.bitv.storage.slice(0, min).iter().enumerate()
886886
.zip(Repeat::new(&other.bitv.storage))
887-
.map(|((i, &w), o_store)| (i * uint::bits, w, o_store[i]))
887+
.map(|((i, &w), o_store)| (i * uint::BITS, w, o_store[i]))
888888
}
889889

890890
/// Visits each word in `self` or `other` that extends beyond the other. This
@@ -903,11 +903,11 @@ impl BitvSet {
903903
if olen < slen {
904904
self.bitv.storage.slice_from(olen).iter().enumerate()
905905
.zip(Repeat::new(olen))
906-
.map(|((i, &w), min)| (true, (i + min) * uint::bits, w))
906+
.map(|((i, &w), min)| (true, (i + min) * uint::BITS, w))
907907
} else {
908908
other.bitv.storage.slice_from(slen).iter().enumerate()
909909
.zip(Repeat::new(slen))
910-
.map(|((i, &w), min)| (false, (i + min) * uint::bits, w))
910+
.map(|((i, &w), min)| (false, (i + min) * uint::BITS, w))
911911
}
912912
}
913913
}
@@ -1529,7 +1529,7 @@ mod tests {
15291529

15301530
assert!(a.insert(1000));
15311531
assert!(a.remove(&1000));
1532-
assert_eq!(a.capacity(), uint::bits);
1532+
assert_eq!(a.capacity(), uint::BITS);
15331533
}
15341534

15351535
#[test]
@@ -1561,16 +1561,16 @@ mod tests {
15611561
let mut r = rng();
15621562
let mut bitv = 0 as uint;
15631563
b.iter(|| {
1564-
bitv |= (1 << ((r.next_u32() as uint) % uint::bits));
1564+
bitv |= (1 << ((r.next_u32() as uint) % uint::BITS));
15651565
})
15661566
}
15671567

15681568
#[bench]
15691569
fn bench_small_bitv_small(b: &mut BenchHarness) {
15701570
let mut r = rng();
1571-
let mut bitv = SmallBitv::new(uint::bits);
1571+
let mut bitv = SmallBitv::new(uint::BITS);
15721572
b.iter(|| {
1573-
bitv.set((r.next_u32() as uint) % uint::bits, true);
1573+
bitv.set((r.next_u32() as uint) % uint::BITS, true);
15741574
})
15751575
}
15761576

@@ -1579,15 +1579,15 @@ mod tests {
15791579
let mut r = rng();
15801580
let mut bitv = BigBitv::new(~[0]);
15811581
b.iter(|| {
1582-
bitv.set((r.next_u32() as uint) % uint::bits, true);
1582+
bitv.set((r.next_u32() as uint) % uint::BITS, true);
15831583
})
15841584
}
15851585

15861586
#[bench]
15871587
fn bench_big_bitv_big(b: &mut BenchHarness) {
15881588
let mut r = rng();
15891589
let mut storage = ~[];
1590-
storage.grow(BENCH_BITS / uint::bits, &0u);
1590+
storage.grow(BENCH_BITS / uint::BITS, &0u);
15911591
let mut bitv = BigBitv::new(storage);
15921592
b.iter(|| {
15931593
bitv.set((r.next_u32() as uint) % BENCH_BITS, true);
@@ -1606,9 +1606,9 @@ mod tests {
16061606
#[bench]
16071607
fn bench_bitv_small(b: &mut BenchHarness) {
16081608
let mut r = rng();
1609-
let mut bitv = Bitv::new(uint::bits, false);
1609+
let mut bitv = Bitv::new(uint::BITS, false);
16101610
b.iter(|| {
1611-
bitv.set((r.next_u32() as uint) % uint::bits, true);
1611+
bitv.set((r.next_u32() as uint) % uint::BITS, true);
16121612
})
16131613
}
16141614

@@ -1617,7 +1617,7 @@ mod tests {
16171617
let mut r = rng();
16181618
let mut bitv = BitvSet::new();
16191619
b.iter(|| {
1620-
bitv.insert((r.next_u32() as uint) % uint::bits);
1620+
bitv.insert((r.next_u32() as uint) % uint::BITS);
16211621
})
16221622
}
16231623

@@ -1641,7 +1641,7 @@ mod tests {
16411641

16421642
#[bench]
16431643
fn bench_btv_small_iter(b: &mut BenchHarness) {
1644-
let bitv = Bitv::new(uint::bits, false);
1644+
let bitv = Bitv::new(uint::BITS, false);
16451645
b.iter(|| {
16461646
let mut _sum = 0;
16471647
for pres in bitv.iter() {

branches/dist-snap/src/libextra/ebml.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -364,7 +364,7 @@ pub mod reader {
364364
fn read_u8 (&mut self) -> u8 { doc_as_u8 (self.next_doc(EsU8 )) }
365365
fn read_uint(&mut self) -> uint {
366366
let v = doc_as_u64(self.next_doc(EsUint));
367-
if v > (::std::uint::max_value as u64) {
367+
if v > (::std::uint::MAX as u64) {
368368
fail!("uint {} too large for this architecture", v);
369369
}
370370
v as uint
@@ -384,7 +384,7 @@ pub mod reader {
384384
}
385385
fn read_int(&mut self) -> int {
386386
let v = doc_as_u64(self.next_doc(EsInt)) as i64;
387-
if v > (int::max_value as i64) || v < (int::min_value as i64) {
387+
if v > (int::MAX as i64) || v < (int::MIN as i64) {
388388
debug!("FIXME \\#6122: Removing this makes this function miscompile");
389389
fail!("int {} out of range for this architecture", v);
390390
}

branches/dist-snap/src/libextra/getopts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -848,7 +848,7 @@ pub mod groups {
848848
t("hello", 15, [~"hello"]);
849849
t("\nMary had a little lamb\nLittle lamb\n", 15,
850850
[~"Mary had a", ~"little lamb", ~"Little lamb"]);
851-
t("\nMary had a little lamb\nLittle lamb\n", ::std::uint::max_value,
851+
t("\nMary had a little lamb\nLittle lamb\n", ::std::uint::MAX,
852852
[~"Mary had a little lamb\nLittle lamb"]);
853853
}
854854
} // end groups module

0 commit comments

Comments
 (0)