1- type T = uint ;
1+ pub type T = uint ;
22
33#[ cfg( target_arch = "x86" ) ]
44#[ cfg( target_arch = "arm" ) ]
5- const bits: uint = 32 ;
5+ pub const bits: uint = 32 ;
66
77#[ cfg( target_arch = "x86_64" ) ]
8- const bits: uint = 64 ;
8+ pub const bits: uint = 64 ;
99
1010/**
1111 * Divide two numbers, return the result, rounded up.
@@ -19,7 +19,7 @@ const bits: uint = 64;
1919 *
2020 * The smallest integer `q` such that `x/y <= q`.
2121 */
22- pure fn div_ceil ( x : uint , y : uint ) -> uint {
22+ pub pure fn div_ceil ( x : uint , y : uint ) -> uint {
2323 let div = x / y;
2424 if x % y == 0 u { div }
2525 else { div + 1 u }
@@ -37,7 +37,7 @@ pure fn div_ceil(x: uint, y: uint) -> uint {
3737 *
3838 * The integer `q` closest to `x/y`.
3939 */
40- pure fn div_round ( x : uint , y : uint ) -> uint {
40+ pub pure fn div_round ( x : uint , y : uint ) -> uint {
4141 let div = x / y;
4242 if x % y * 2 u < y { div }
4343 else { div + 1 u }
@@ -58,7 +58,7 @@ pure fn div_round(x: uint, y: uint) -> uint {
5858 * The smallest integer `q` such that `x/y <= q`. This
5959 * is either `x/y` or `x/y + 1`.
6060 */
61- pure fn div_floor ( x : uint , y : uint ) -> uint { return x / y; }
61+ pub pure fn div_floor ( x : uint , y : uint ) -> uint { return x / y; }
6262
6363/**
6464 * Iterate over the range [`lo`..`hi`), or stop when requested
@@ -75,7 +75,7 @@ pure fn div_floor(x: uint, y: uint) -> uint { return x / y; }
7575 * `true` If execution proceeded correctly, `false` if it was interrupted,
7676 * that is if `it` returned `false` at any point.
7777 */
78- pure fn iterate ( lo : uint , hi : uint , it : fn ( uint ) -> bool ) -> bool {
78+ pub pure fn iterate ( lo : uint , hi : uint , it : fn ( uint ) -> bool ) -> bool {
7979 let mut i = lo;
8080 while i < hi {
8181 if ( !it ( i) ) { return false ; }
@@ -86,7 +86,7 @@ pure fn iterate(lo: uint, hi: uint, it: fn(uint) -> bool) -> bool {
8686
8787/// Returns the smallest power of 2 greater than or equal to `n`
8888#[ inline( always) ]
89- fn next_power_of_two ( n : uint ) -> uint {
89+ pub fn next_power_of_two ( n : uint ) -> uint {
9090 let halfbits: uint = sys:: size_of :: < uint > ( ) * 4 u;
9191 let mut tmp: uint = n - 1 u;
9292 let mut shift: uint = 1 u;
0 commit comments