Converted libcore/uint-template.rs to the new string functions.

- Moved ToStr implementation of unsigned integers to uint-template.rs.
- Marked the `str()` function as deprecated.
- Forwarded all conversion functions to `core::num::to_str_common()`
  and `core::num::from_str_common()`.
- Fixed most places in the codebase where `to_str()` is being used.
- Added uint-template to_str and from_str overflow tests.
This commit is contained in:
Marvin Löbel
2013-01-24 21:47:57 +01:00
committed by Brian Anderson
parent 26e72bf92b
commit eb19462104
14 changed files with 163 additions and 163 deletions

View File

@@ -2006,24 +2006,24 @@ pub fn print_literal(s: ps, &&lit: @ast::lit) {
ast::lit_int(i, t) => {
if i < 0_i64 {
word(s.s,
~"-" + u64::to_str(-i as u64, 10u)
~"-" + u64::to_str_radix(-i as u64, 10u)
+ ast_util::int_ty_to_str(t));
} else {
word(s.s,
u64::to_str(i as u64, 10u)
u64::to_str_radix(i as u64, 10u)
+ ast_util::int_ty_to_str(t));
}
}
ast::lit_uint(u, t) => {
word(s.s,
u64::to_str(u, 10u)
u64::to_str_radix(u, 10u)
+ ast_util::uint_ty_to_str(t));
}
ast::lit_int_unsuffixed(i) => {
if i < 0_i64 {
word(s.s, ~"-" + u64::to_str(-i as u64, 10u));
word(s.s, ~"-" + u64::to_str_radix(-i as u64, 10u));
} else {
word(s.s, u64::to_str(i as u64, 10u));
word(s.s, u64::to_str_radix(i as u64, 10u));
}
}
ast::lit_float(f, t) => {