Mass rename uint/int to usize/isize

Now that support has been removed, all lingering use cases are renamed.
This commit is contained in:
Alex Crichton 2015-03-25 17:06:52 -07:00
parent 54f16b818b
commit 43bfaa4a33
1391 changed files with 5180 additions and 5238 deletions

View file

@ -1322,7 +1322,7 @@ pub enum Type {
/// For parameterized types, so the consumer of the JSON don't go
/// looking for types which don't exist anywhere.
Generic(String),
/// Primitives are the fixed-size numeric types (plus int/uint/float), char,
/// Primitives are the fixed-size numeric types (plus int/usize/float), char,
/// arrays, slices, and tuples.
Primitive(PrimitiveType),
/// extern "ABI" fn
@ -1383,12 +1383,12 @@ pub enum TypeKind {
impl PrimitiveType {
fn from_str(s: &str) -> Option<PrimitiveType> {
match s {
"isize" | "int" => Some(Isize),
"isize" => Some(Isize),
"i8" => Some(I8),
"i16" => Some(I16),
"i32" => Some(I32),
"i64" => Some(I64),
"usize" | "uint" => Some(Usize),
"usize" => Some(Usize),
"u8" => Some(U8),
"u16" => Some(U16),
"u32" => Some(U32),
@ -1516,12 +1516,12 @@ impl<'tcx> Clean<Type> for ty::Ty<'tcx> {
match self.sty {
ty::ty_bool => Primitive(Bool),
ty::ty_char => Primitive(Char),
ty::ty_int(ast::TyIs(_)) => Primitive(Isize),
ty::ty_int(ast::TyIs) => Primitive(Isize),
ty::ty_int(ast::TyI8) => Primitive(I8),
ty::ty_int(ast::TyI16) => Primitive(I16),
ty::ty_int(ast::TyI32) => Primitive(I32),
ty::ty_int(ast::TyI64) => Primitive(I64),
ty::ty_uint(ast::TyUs(_)) => Primitive(Usize),
ty::ty_uint(ast::TyUs) => Primitive(Usize),
ty::ty_uint(ast::TyU8) => Primitive(U8),
ty::ty_uint(ast::TyU16) => Primitive(U16),
ty::ty_uint(ast::TyU32) => Primitive(U32),
@ -1833,10 +1833,10 @@ impl Clean<VariantKind> for ast::VariantKind {
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
pub struct Span {
pub filename: String,
pub loline: uint,
pub locol: uint,
pub hiline: uint,
pub hicol: uint,
pub loline: usize,
pub locol: usize,
pub hiline: usize,
pub hicol: usize,
}
impl Span {
@ -2399,12 +2399,12 @@ fn resolve_type(cx: &DocContext,
ast::TyStr => return Primitive(Str),
ast::TyBool => return Primitive(Bool),
ast::TyChar => return Primitive(Char),
ast::TyInt(ast::TyIs(_)) => return Primitive(Isize),
ast::TyInt(ast::TyIs) => return Primitive(Isize),
ast::TyInt(ast::TyI8) => return Primitive(I8),
ast::TyInt(ast::TyI16) => return Primitive(I16),
ast::TyInt(ast::TyI32) => return Primitive(I32),
ast::TyInt(ast::TyI64) => return Primitive(I64),
ast::TyUint(ast::TyUs(_)) => return Primitive(Usize),
ast::TyUint(ast::TyUs) => return Primitive(Usize),
ast::TyUint(ast::TyU8) => return Primitive(U8),
ast::TyUint(ast::TyU16) => return Primitive(U16),
ast::TyUint(ast::TyU32) => return Primitive(U32),

View file

@ -185,7 +185,7 @@ fn stripped_filtered_line<'a>(s: &'a str) -> Option<&'a str> {
}
}
thread_local!(static USED_HEADER_MAP: RefCell<HashMap<String, uint>> = {
thread_local!(static USED_HEADER_MAP: RefCell<HashMap<String, usize>> = {
RefCell::new(HashMap::new())
});

View file

@ -498,7 +498,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::Result<String> {
try!(write!(&mut w, ","));
}
try!(write!(&mut w, r#"[{},"{}","{}",{}"#,
item.ty as uint, item.name, path,
item.ty as usize, item.name, path,
item.desc.to_json().to_string()));
match item.parent {
Some(nodeid) => {
@ -522,7 +522,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::Result<String> {
try!(write!(&mut w, ","));
}
try!(write!(&mut w, r#"[{},"{}"]"#,
short as uint, *fqp.last().unwrap()));
short as usize, *fqp.last().unwrap()));
}
try!(write!(&mut w, "]}};"));
@ -1572,7 +1572,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
let mut indices = (0..items.len()).filter(|i| {
!cx.ignore_private_item(&items[*i])
}).collect::<Vec<uint>>();
}).collect::<Vec<usize>>();
// the order of item types in the listing
fn reorder(ty: ItemType) -> u8 {
@ -1593,7 +1593,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
}
}
fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: uint, idx2: uint) -> Ordering {
fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering {
let ty1 = shortty(i1);
let ty2 = shortty(i2);
if ty1 == ty2 {

View file

@ -33,7 +33,7 @@ pub struct Toc {
}
impl Toc {
fn count_entries_with_level(&self, level: u32) -> uint {
fn count_entries_with_level(&self, level: u32) -> usize {
self.entries.iter().filter(|e| e.level == level).count()
}
}

View file

@ -16,16 +16,15 @@
#![crate_type = "dylib"]
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")]
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(exit_status)]
#![feature(int_uint)]
#![feature(set_stdio)]
#![feature(libc)]
#![feature(old_path)]
@ -195,7 +194,7 @@ pub fn usage(argv0: &str) {
&opts()));
}
pub fn main_args(args: &[String]) -> int {
pub fn main_args(args: &[String]) -> isize {
let matches = match getopts::getopts(args.tail(), &opts()) {
Ok(m) => m,
Err(err) => {

View file

@ -44,7 +44,7 @@ fn extract_leading_metadata<'a>(s: &'a str) -> (Vec<&'a str>, &'a str) {
/// Render `input` (e.g. "foo.md") into an HTML file in `output`
/// (e.g. output = "bar" => "bar/foo.html").
pub fn render(input: &str, mut output: PathBuf, matches: &getopts::Matches,
external_html: &ExternalHtml, include_toc: bool) -> int {
external_html: &ExternalHtml, include_toc: bool) -> isize {
let input_p = Path::new(input);
output.push(input_p.file_stem().unwrap());
output.set_extension("html");
@ -140,7 +140,7 @@ pub fn render(input: &str, mut output: PathBuf, matches: &getopts::Matches,
/// Run any tests/code examples in the markdown file `input`.
pub fn test(input: &str, libs: SearchPaths, externs: core::Externs,
mut test_args: Vec<String>) -> int {
mut test_args: Vec<String>) -> isize {
let input_str = load_or_return!(input, 1, 2);
let mut collector = Collector::new(input.to_string(), libs, externs, true, false);

View file

@ -45,7 +45,7 @@ pub fn run(input: &str,
externs: core::Externs,
mut test_args: Vec<String>,
crate_name: Option<String>)
-> int {
-> isize {
let input_path = PathBuf::from(input);
let input = config::Input::File(input_path.clone());
@ -321,7 +321,7 @@ pub struct Collector {
names: Vec<String>,
libs: SearchPaths,
externs: core::Externs,
cnt: uint,
cnt: usize,
use_headers: bool,
current_header: Option<String>,
cratename: String,