aboutsummaryrefslogtreecommitdiff
path: root/src/lib/_uint.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/_uint.rs')
-rw-r--r--src/lib/_uint.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/_uint.rs b/src/lib/_uint.rs
index 5e8d4b97..f456b733 100644
--- a/src/lib/_uint.rs
+++ b/src/lib/_uint.rs
@@ -12,10 +12,11 @@ fn ne(uint x, uint y) -> bool { ret x != y; }
fn ge(uint x, uint y) -> bool { ret x >= y; }
fn gt(uint x, uint y) -> bool { ret x > y; }
-iter range(mutable uint lo, uint hi) -> uint {
- while (lo < hi) {
- put lo;
- lo += 1u;
+iter range(uint lo, uint hi) -> uint {
+ auto lo_ = lo;
+ while (lo_ < hi) {
+ put lo_;
+ lo_ += 1u;
}
}
@@ -32,8 +33,10 @@ fn next_power_of_two(uint n) -> uint {
ret tmp + 1u;
}
-fn to_str(mutable uint n, uint radix) -> str
+fn to_str(uint num, uint radix) -> str
{
+ auto n = num;
+
check (0u < radix && radix <= 16u);
fn digit(uint n) -> char {
alt (n) {