diff options
| author | Florian Hahn <flo@fhahn.com> | 2013-12-12 22:27:26 +0100 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2014-01-22 19:20:47 +0100 |
| commit | 2eb4f05850e25863f05a56b60931e9eb03944b56 (patch) | |
| tree | dbbb1b2aeb64ff54abf331d7be7bb9ce6615c9e0 /src/libstd/rt/local_ptr.rs | |
| parent | 750d48b0ad1854b389ce1c209484f9146dc7aba0 (diff) | |
| download | rust-2eb4f05850e25863f05a56b60931e9eb03944b56.tar.gz rust-2eb4f05850e25863f05a56b60931e9eb03944b56.zip | |
Replace C types with Rust types in libstd, closes #7313
Diffstat (limited to 'src/libstd/rt/local_ptr.rs')
| -rw-r--r-- | src/libstd/rt/local_ptr.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libstd/rt/local_ptr.rs b/src/libstd/rt/local_ptr.rs index b89c06edda3..d4e57ab19b1 100644 --- a/src/libstd/rt/local_ptr.rs +++ b/src/libstd/rt/local_ptr.rs @@ -81,14 +81,13 @@ pub mod compiled { use cast; use option::{Option, Some, None}; use ptr::RawPtr; - #[cfg(not(test))] use libc::c_void; #[cfg(test)] pub use realstd::rt::shouldnt_be_public::RT_TLS_PTR; #[cfg(not(test))] #[thread_local] - pub static mut RT_TLS_PTR: *mut c_void = 0 as *mut c_void; + pub static mut RT_TLS_PTR: *mut u8 = 0 as *mut u8; pub fn init() {} @@ -230,7 +229,6 @@ pub mod compiled { /// thread-local value. pub mod native { use cast; - use libc::c_void; use option::{Option, Some, None}; use ptr; use ptr::RawPtr; @@ -259,7 +257,7 @@ pub mod native { #[inline] pub unsafe fn put<T>(sched: ~T) { let key = tls_key(); - let void_ptr: *mut c_void = cast::transmute(sched); + let void_ptr: *mut u8 = cast::transmute(sched); tls::set(key, void_ptr); } @@ -271,7 +269,7 @@ pub mod native { #[inline] pub unsafe fn take<T>() -> ~T { let key = tls_key(); - let void_ptr: *mut c_void = tls::get(key); + let void_ptr: *mut u8 = tls::get(key); if void_ptr.is_null() { rtabort!("thread-local pointer is null. bogus!"); } @@ -289,7 +287,7 @@ pub mod native { pub unsafe fn try_take<T>() -> Option<~T> { match maybe_tls_key() { Some(key) => { - let void_ptr: *mut c_void = tls::get(key); + let void_ptr: *mut u8 = tls::get(key); if void_ptr.is_null() { None } else { @@ -311,7 +309,7 @@ pub mod native { #[inline] pub unsafe fn unsafe_take<T>() -> ~T { let key = tls_key(); - let void_ptr: *mut c_void = tls::get(key); + let void_ptr: *mut u8 = tls::get(key); if void_ptr.is_null() { rtabort!("thread-local pointer is null. bogus!"); } |
