diff options
| author | Graydon Hoare <[email protected]> | 2010-07-27 19:21:51 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-27 19:21:51 -0700 |
| commit | 80307576245aabf00285db020bbfbc4c3a891766 (patch) | |
| tree | 7e408956ca3e895844dd30a1afddf64d83157da0 /src/lib/_int.rs | |
| parent | Calm some LLVM indigestion of last change. (diff) | |
| download | rust-80307576245aabf00285db020bbfbc4c3a891766.tar.xz rust-80307576245aabf00285db020bbfbc4c3a891766.zip | |
Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as a cast notation. Closes #129.
Diffstat (limited to 'src/lib/_int.rs')
| -rw-r--r-- | src/lib/_int.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/_int.rs b/src/lib/_int.rs index b6399669..29144a82 100644 --- a/src/lib/_int.rs +++ b/src/lib/_int.rs @@ -23,19 +23,19 @@ iter range(mutable int lo, int hi) -> int { iter urange(mutable uint lo, uint hi) -> uint { while (lo < hi) { put lo; - lo += uint(1); + lo += 1u; } } fn next_power_of_two(uint n) -> uint { // FIXME change |* uint(4)| below to |* uint(8) / uint(2)| and watch the // world explode. - let uint halfbits = sys.rustrt.size_of[uint]() * uint(4); - let uint tmp = n - uint(1); - let uint shift = uint(1); + let uint halfbits = sys.rustrt.size_of[uint]() * 4u; + let uint tmp = n - 1u; + let uint shift = 1u; while (shift <= halfbits) { tmp |= tmp >> shift; - shift <<= uint(1); + shift <<= 1u; } - ret tmp + uint(1); + ret tmp + 1u; } |