diff options
Diffstat (limited to 'src/libstd/sys_common')
| -rw-r--r-- | src/libstd/sys_common/backtrace.rs | 11 | ||||
| -rw-r--r-- | src/libstd/sys_common/gnu/libbacktrace.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys_common/thread.rs | 3 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/libstd/sys_common/backtrace.rs b/src/libstd/sys_common/backtrace.rs index 8f78c2e6f59..9f0214f5f05 100644 --- a/src/libstd/sys_common/backtrace.rs +++ b/src/libstd/sys_common/backtrace.rs @@ -14,7 +14,6 @@ use env; use io::prelude::*; use io; -use libc; use str; use sync::atomic::{self, Ordering}; use path::{self, Path}; @@ -39,9 +38,9 @@ pub const HEX_WIDTH: usize = 10; #[derive(Debug, Copy, Clone)] pub struct Frame { /// Exact address of the call that failed. - pub exact_position: *const libc::c_void, + pub exact_position: *const u8, /// Address of the enclosing function. - pub symbol_addr: *const libc::c_void, + pub symbol_addr: *const u8, } /// Max number of frames to print. @@ -201,8 +200,10 @@ fn output(w: &mut Write, idx: usize, frame: Frame, /// /// See also `output`. #[allow(dead_code)] -fn output_fileline(w: &mut Write, file: &[u8], line: libc::c_int, - format: PrintFormat) -> io::Result<()> { +fn output_fileline(w: &mut Write, + file: &[u8], + line: u32, + format: PrintFormat) -> io::Result<()> { // prior line: " ##: {:2$} - func" w.write_all(b"")?; match format { diff --git a/src/libstd/sys_common/gnu/libbacktrace.rs b/src/libstd/sys_common/gnu/libbacktrace.rs index 016c840d154..75c6bd5d2a2 100644 --- a/src/libstd/sys_common/gnu/libbacktrace.rs +++ b/src/libstd/sys_common/gnu/libbacktrace.rs @@ -20,13 +20,13 @@ use sys_common::backtrace::Frame; pub fn foreach_symbol_fileline<F>(frame: Frame, mut f: F, _: &BacktraceContext) -> io::Result<bool> -where F: FnMut(&[u8], libc::c_int) -> io::Result<()> +where F: FnMut(&[u8], u32) -> io::Result<()> { // pcinfo may return an arbitrary number of file:line pairs, // in the order of stack trace (i.e. inlined calls first). // in order to avoid allocation, we stack-allocate a fixed size of entries. const FILELINE_SIZE: usize = 32; - let mut fileline_buf = [(ptr::null(), -1); FILELINE_SIZE]; + let mut fileline_buf = [(ptr::null(), !0); FILELINE_SIZE]; let ret; let fileline_count = { let state = unsafe { init_state() }; @@ -136,7 +136,7 @@ extern { // helper callbacks //////////////////////////////////////////////////////////////////////// -type FileLine = (*const libc::c_char, libc::c_int); +type FileLine = (*const libc::c_char, u32); extern fn error_cb(_data: *mut libc::c_void, _msg: *const libc::c_char, _errnum: libc::c_int) { @@ -162,7 +162,7 @@ extern fn pcinfo_cb(data: *mut libc::c_void, // if the buffer is not full, add file:line to the buffer // and adjust the buffer for next possible calls to pcinfo_cb. if !buffer.is_empty() { - buffer[0] = (filename, lineno); + buffer[0] = (filename, lineno as u32); unsafe { ptr::write(slot, &mut buffer[1..]); } } } diff --git a/src/libstd/sys_common/thread.rs b/src/libstd/sys_common/thread.rs index 87fb34a9dec..c19424f2952 100644 --- a/src/libstd/sys_common/thread.rs +++ b/src/libstd/sys_common/thread.rs @@ -10,12 +10,11 @@ use env; use alloc::boxed::FnBox; -use libc; use sync::atomic::{self, Ordering}; use sys::stack_overflow; use sys::thread as imp; -pub unsafe fn start_thread(main: *mut libc::c_void) { +pub unsafe fn start_thread(main: *mut u8) { // Next, set up our stack overflow handler which may get triggered if we run // out of stack. let _handler = stack_overflow::Handler::new(); |
