Replace 0 as *const/mut T with ptr::null/null_mut()
This commit is contained in:
parent
378fb5846d
commit
2c2480df5d
19 changed files with 65 additions and 55 deletions
|
|
@ -327,7 +327,7 @@ pub fn write(w: &mut Writer) -> IoResult<()> {
|
|||
let image = arch::init_frame(&mut frame, &context);
|
||||
|
||||
// Initialize this process's symbols
|
||||
let ret = SymInitialize(process, 0 as *mut libc::c_void, libc::TRUE);
|
||||
let ret = SymInitialize(process, ptr::null_mut(), libc::TRUE);
|
||||
if ret != libc::TRUE { return Ok(()) }
|
||||
let _c = Cleanup { handle: process, SymCleanup: SymCleanup };
|
||||
|
||||
|
|
@ -335,10 +335,10 @@ pub fn write(w: &mut Writer) -> IoResult<()> {
|
|||
let mut i = 0i;
|
||||
try!(write!(w, "stack backtrace:\n"));
|
||||
while StackWalk64(image, process, thread, &mut frame, &mut context,
|
||||
0 as *mut libc::c_void,
|
||||
0 as *mut libc::c_void,
|
||||
0 as *mut libc::c_void,
|
||||
0 as *mut libc::c_void) == libc::TRUE{
|
||||
ptr::null_mut(),
|
||||
ptr::null_mut(),
|
||||
ptr::null_mut(),
|
||||
ptr::null_mut()) == libc::TRUE{
|
||||
let addr = frame.AddrPC.Offset;
|
||||
if addr == frame.AddrReturn.Offset || addr == 0 ||
|
||||
frame.AddrReturn.Offset == 0 { break }
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ unsafe fn init_dtors() {
|
|||
rt::at_exit(move|| {
|
||||
DTOR_LOCK.lock();
|
||||
let dtors = DTORS;
|
||||
DTORS = 0 as *mut _;
|
||||
DTORS = ptr::null_mut();
|
||||
mem::transmute::<_, Box<Vec<(Key, Dtor)>>>(dtors);
|
||||
assert!(DTORS.is_null()); // can't re-init after destructing
|
||||
DTOR_LOCK.unlock();
|
||||
|
|
@ -250,7 +250,7 @@ unsafe fn run_dtors() {
|
|||
for &(key, dtor) in dtors.iter() {
|
||||
let ptr = TlsGetValue(key);
|
||||
if !ptr.is_null() {
|
||||
TlsSetValue(key, 0 as *mut _);
|
||||
TlsSetValue(key, ptr::null_mut());
|
||||
dtor(ptr as *mut _);
|
||||
any_run = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue