diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-25 17:06:52 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-26 12:10:22 -0700 |
| commit | 43bfaa4a336095eb5697fb2df50909fd3c72ed14 (patch) | |
| tree | e10610e1ce9811c89e1291b786d7a49b63ee02d9 /src/libstd/rt | |
| parent | 54f16b818b58f6d6e81891b041fc751986e75155 (diff) | |
| download | rust-43bfaa4a336095eb5697fb2df50909fd3c72ed14.tar.gz rust-43bfaa4a336095eb5697fb2df50909fd3c72ed14.zip | |
Mass rename uint/int to usize/isize
Now that support has been removed, all lingering use cases are renamed.
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/args.rs | 8 | ||||
| -rw-r--r-- | src/libstd/rt/libunwind.rs | 14 | ||||
| -rw-r--r-- | src/libstd/rt/mod.rs | 14 | ||||
| -rw-r--r-- | src/libstd/rt/unwind.rs | 14 | ||||
| -rw-r--r-- | src/libstd/rt/util.rs | 2 |
5 files changed, 26 insertions, 26 deletions
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index 9da63405346..428bcaa49f7 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -23,7 +23,7 @@ use core::prelude::*; use vec::Vec; /// One-time global initialization. -pub unsafe fn init(argc: int, argv: *const *const u8) { imp::init(argc, argv) } +pub unsafe fn init(argc: isize, argv: *const *const u8) { imp::init(argc, argv) } /// One-time global cleanup. pub unsafe fn cleanup() { imp::cleanup() } @@ -54,10 +54,10 @@ mod imp { use sync::{StaticMutex, MUTEX_INIT}; - static mut GLOBAL_ARGS_PTR: uint = 0; + static mut GLOBAL_ARGS_PTR: usize = 0; static LOCK: StaticMutex = MUTEX_INIT; - pub unsafe fn init(argc: int, argv: *const *const u8) { + pub unsafe fn init(argc: isize, argv: *const *const u8) { let args = load_argc_and_argv(argc, argv); put(args); } @@ -146,7 +146,7 @@ mod imp { use core::prelude::*; use vec::Vec; - pub unsafe fn init(_argc: int, _argv: *const *const u8) { + pub unsafe fn init(_argc: isize, _argv: *const *const u8) { } pub fn cleanup() { diff --git a/src/libstd/rt/libunwind.rs b/src/libstd/rt/libunwind.rs index 3063d9d942a..b7769910564 100644 --- a/src/libstd/rt/libunwind.rs +++ b/src/libstd/rt/libunwind.rs @@ -64,25 +64,25 @@ pub type _Unwind_Exception_Class = u64; pub type _Unwind_Word = libc::uintptr_t; #[cfg(target_arch = "x86")] -pub const unwinder_private_data_size: uint = 5; +pub const unwinder_private_data_size: usize = 5; #[cfg(target_arch = "x86_64")] -pub const unwinder_private_data_size: uint = 6; +pub const unwinder_private_data_size: usize = 6; #[cfg(all(target_arch = "arm", not(target_os = "ios")))] -pub const unwinder_private_data_size: uint = 20; +pub const unwinder_private_data_size: usize = 20; #[cfg(all(target_arch = "arm", target_os = "ios"))] -pub const unwinder_private_data_size: uint = 5; +pub const unwinder_private_data_size: usize = 5; #[cfg(target_arch = "aarch64")] -pub const unwinder_private_data_size: uint = 2; +pub const unwinder_private_data_size: usize = 2; #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] -pub const unwinder_private_data_size: uint = 2; +pub const unwinder_private_data_size: usize = 2; #[cfg(target_arch = "powerpc")] -pub const unwinder_private_data_size: uint = 2; +pub const unwinder_private_data_size: usize = 2; #[repr(C)] pub struct _Unwind_Exception { diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index 497076cc6ac..696c7960c3e 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -48,16 +48,16 @@ mod libunwind; /// The default error code of the rust runtime if the main thread panics instead /// of exiting cleanly. -pub const DEFAULT_ERROR_CODE: int = 101; +pub const DEFAULT_ERROR_CODE: isize = 101; #[cfg(any(windows, android))] -const OS_DEFAULT_STACK_ESTIMATE: uint = 1 << 20; +const OS_DEFAULT_STACK_ESTIMATE: usize = 1 << 20; #[cfg(all(unix, not(android)))] -const OS_DEFAULT_STACK_ESTIMATE: uint = 2 * (1 << 20); +const OS_DEFAULT_STACK_ESTIMATE: usize = 2 * (1 << 20); #[cfg(not(test))] #[lang = "start"] -fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int { +fn lang_start(main: *const u8, argc: isize, argv: *const *const u8) -> isize { use prelude::v1::*; use mem; @@ -68,13 +68,13 @@ fn lang_start(main: *const u8, argc: int, argv: *const *const u8) -> int { use thread::Thread; let something_around_the_top_of_the_stack = 1; - let addr = &something_around_the_top_of_the_stack as *const _ as *const int; - let my_stack_top = addr as uint; + let addr = &something_around_the_top_of_the_stack as *const _ as *const isize; + let my_stack_top = addr as usize; // FIXME #11359 we just assume that this thread has a stack of a // certain size, and estimate that there's at most 20KB of stack // frames above our current position. - const TWENTY_KB: uint = 20000; + const TWENTY_KB: usize = 20000; // saturating-add to sidestep overflow let top_plus_spill = if usize::MAX - TWENTY_KB < my_stack_top { diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index 3ee3954ed64..e4927bbd3d2 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -78,12 +78,12 @@ struct Exception { cause: Option<Box<Any + Send + 'static>>, } -pub type Callback = fn(msg: &(Any + Send), file: &'static str, line: uint); +pub type Callback = fn(msg: &(Any + Send), file: &'static str, line: usize); // Variables used for invoking callbacks when a thread starts to unwind. // // For more information, see below. -const MAX_CALLBACKS: uint = 16; +const MAX_CALLBACKS: usize = 16; static CALLBACKS: [atomic::AtomicUsize; MAX_CALLBACKS] = [atomic::ATOMIC_USIZE_INIT, atomic::ATOMIC_USIZE_INIT, atomic::ATOMIC_USIZE_INIT, atomic::ATOMIC_USIZE_INIT, @@ -176,7 +176,7 @@ fn rust_panic(cause: Box<Any + Send + 'static>) -> ! { }; let exception_param = boxed::into_raw(exception) as *mut uw::_Unwind_Exception; let error = uw::_Unwind_RaiseException(exception_param); - rtabort!("Could not unwind stack, error = {}", error as int) + rtabort!("Could not unwind stack, error = {}", error as isize) } extern fn exception_cleanup(_unwind_code: uw::_Unwind_Reason_Code, @@ -484,7 +484,7 @@ pub mod eabi { /// Entry point of panic from the libcore crate. #[lang = "panic_fmt"] pub extern fn rust_begin_unwind(msg: fmt::Arguments, - file: &'static str, line: uint) -> ! { + file: &'static str, line: usize) -> ! { begin_unwind_fmt(msg, &(file, line)) } @@ -496,7 +496,7 @@ pub extern fn rust_begin_unwind(msg: fmt::Arguments, /// the actual formatting into this shared place. #[inline(never)] #[cold] #[stable(since = "1.0.0", feature = "rust1")] -pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, uint)) -> ! { +pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, usize)) -> ! { use fmt::Write; // We do two allocations here, unfortunately. But (a) they're @@ -512,7 +512,7 @@ pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, uint)) - /// This is the entry point of unwinding for panic!() and assert!(). #[inline(never)] #[cold] // avoid code bloat at the call sites as much as possible #[stable(since = "1.0.0", feature = "rust1")] -pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, uint)) -> ! { +pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, usize)) -> ! { // Note that this should be the only allocation performed in this code path. // Currently this means that panic!() on OOM will invoke this code path, // but then again we're not really ready for panic on OOM anyway. If @@ -535,7 +535,7 @@ pub fn begin_unwind<M: Any + Send>(msg: M, file_line: &(&'static str, uint)) -> /// }` from ~1900/3700 (-O/no opts) to 180/590. #[inline(never)] #[cold] // this is the slow path, please never inline this fn begin_unwind_inner(msg: Box<Any + Send>, - file_line: &(&'static str, uint)) -> ! { + file_line: &(&'static str, usize)) -> ! { // Make sure the default failure handler is registered before we look at the // callbacks. We also use a raw sys-based mutex here instead of a // `std::sync` one as accessing TLS can cause weird recursive problems (and diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs index cf627ca2548..5a482fbb50f 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -43,7 +43,7 @@ pub fn limit_thread_creation_due_to_osx_and_valgrind() -> bool { (cfg!(target_os="macos")) && running_on_valgrind() } -pub fn min_stack() -> uint { +pub fn min_stack() -> usize { static MIN: atomic::AtomicUsize = atomic::ATOMIC_USIZE_INIT; match MIN.load(Ordering::SeqCst) { 0 => {} |
