From b1cd76906a4c7e40e3eb3569450d2dbd3be9fcab Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 15 Feb 2015 00:10:19 +0300 Subject: Fix the fallout --- src/libstd/num/f32.rs | 14 +++++++------- src/libstd/num/f64.rs | 14 +++++++------- src/libstd/num/strconv.rs | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index 58b93665fe1..62ed824c3ba 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -369,7 +369,7 @@ impl Float for f32 { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_string(num: f32) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigAll, ExpNone, false); + num, 10, true, SignNeg, DigAll, ExpNone, false); r } @@ -382,7 +382,7 @@ pub fn to_string(num: f32) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_hex(num: f32) -> String { let (r, _) = strconv::float_to_str_common( - num, 16u, true, SignNeg, DigAll, ExpNone, false); + num, 16, true, SignNeg, DigAll, ExpNone, false); r } @@ -395,7 +395,7 @@ pub fn to_str_hex(num: f32) -> String { /// * radix - The base to use #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) { +pub fn to_str_radix_special(num: f32, rdx: u32) -> (String, bool) { strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false) } @@ -410,7 +410,7 @@ pub fn to_str_radix_special(num: f32, rdx: uint) -> (String, bool) { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_exact(num: f32, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigExact(dig), ExpNone, false); + num, 10, true, SignNeg, DigExact(dig), ExpNone, false); r } @@ -425,7 +425,7 @@ pub fn to_str_exact(num: f32, dig: uint) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_digits(num: f32, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigMax(dig), ExpNone, false); + num, 10, true, SignNeg, DigMax(dig), ExpNone, false); r } @@ -441,7 +441,7 @@ pub fn to_str_digits(num: f32, dig: uint) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper); + num, 10, true, SignNeg, DigExact(dig), ExpDec, upper); r } @@ -457,7 +457,7 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper); + num, 10, true, SignNeg, DigMax(dig), ExpDec, upper); r } diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index 8b17feeb70c..0e2ac97ca01 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -378,7 +378,7 @@ impl Float for f64 { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_string(num: f64) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigAll, ExpNone, false); + num, 10, true, SignNeg, DigAll, ExpNone, false); r } @@ -391,7 +391,7 @@ pub fn to_string(num: f64) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_hex(num: f64) -> String { let (r, _) = strconv::float_to_str_common( - num, 16u, true, SignNeg, DigAll, ExpNone, false); + num, 16, true, SignNeg, DigAll, ExpNone, false); r } @@ -404,7 +404,7 @@ pub fn to_str_hex(num: f64) -> String { /// * radix - The base to use #[inline] #[unstable(feature = "std_misc", reason = "may be removed or relocated")] -pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) { +pub fn to_str_radix_special(num: f64, rdx: u32) -> (String, bool) { strconv::float_to_str_common(num, rdx, true, SignNeg, DigAll, ExpNone, false) } @@ -419,7 +419,7 @@ pub fn to_str_radix_special(num: f64, rdx: uint) -> (String, bool) { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_exact(num: f64, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigExact(dig), ExpNone, false); + num, 10, true, SignNeg, DigExact(dig), ExpNone, false); r } @@ -434,7 +434,7 @@ pub fn to_str_exact(num: f64, dig: uint) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_digits(num: f64, dig: uint) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigMax(dig), ExpNone, false); + num, 10, true, SignNeg, DigMax(dig), ExpNone, false); r } @@ -450,7 +450,7 @@ pub fn to_str_digits(num: f64, dig: uint) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigExact(dig), ExpDec, upper); + num, 10, true, SignNeg, DigExact(dig), ExpDec, upper); r } @@ -466,7 +466,7 @@ pub fn to_str_exp_exact(num: f64, dig: uint, upper: bool) -> String { #[unstable(feature = "std_misc", reason = "may be removed or relocated")] pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> String { let (r, _) = strconv::float_to_str_common( - num, 10u, true, SignNeg, DigMax(dig), ExpDec, upper); + num, 10, true, SignNeg, DigMax(dig), ExpDec, upper); r } diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 4ae7d3437fd..cf5e1eb0eb7 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -182,7 +182,7 @@ fn int_to_str_bytes_common(num: T, radix: uint, sign: SignFormat, mut f: F /// - Panics if `radix` > 25 and `exp_format` is `ExpBin` due to conflict /// between digit and exponent sign `'p'`. pub fn float_to_str_bytes_common( - num: T, radix: uint, negative_zero: bool, + num: T, radix: u32, negative_zero: bool, sign: SignFormat, digits: SignificantDigits, exp_format: ExponentFormat, exp_upper: bool ) -> (Vec, bool) { assert!(2 <= radix && radix <= 36); @@ -253,7 +253,7 @@ pub fn float_to_str_bytes_common( deccum = deccum / radix_gen; deccum = deccum.trunc(); - buf.push(char::from_digit(current_digit.to_int().unwrap() as uint, radix) + buf.push(char::from_digit(current_digit.to_int().unwrap() as u32, radix) .unwrap() as u8); // No more digits to calculate for the non-fractional part -> break @@ -310,7 +310,7 @@ pub fn float_to_str_bytes_common( let current_digit = deccum.trunc().abs(); buf.push(char::from_digit( - current_digit.to_int().unwrap() as uint, radix).unwrap() as u8); + current_digit.to_int().unwrap() as u32, radix).unwrap() as u8); // Decrease the deccumulator one fractional digit at a time deccum = deccum.fract(); @@ -324,7 +324,7 @@ pub fn float_to_str_bytes_common( let ascii2value = |chr: u8| { (chr as char).to_digit(radix).unwrap() }; - let value2ascii = |val: uint| { + let value2ascii = |val: u32| { char::from_digit(val, radix).unwrap() as u8 }; @@ -412,7 +412,7 @@ pub fn float_to_str_bytes_common( /// `to_str_bytes_common()`, for details see there. #[inline] pub fn float_to_str_common( - num: T, radix: uint, negative_zero: bool, + num: T, radix: u32, negative_zero: bool, sign: SignFormat, digits: SignificantDigits, exp_format: ExponentFormat, exp_capital: bool ) -> (String, bool) { let (bytes, special) = float_to_str_bytes_common(num, radix, @@ -422,8 +422,8 @@ pub fn float_to_str_common( // Some constants for from_str_bytes_common's input validation, // they define minimum radix values for which the character is a valid digit. -static DIGIT_P_RADIX: uint = ('p' as uint) - ('a' as uint) + 11u; -static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u; +static DIGIT_P_RADIX: u32 = ('p' as u32) - ('a' as u32) + 11; +static DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11; #[cfg(test)] mod tests { -- cgit 1.4.1-3-g733a5