@@ -75,7 +75,7 @@ pub struct S {
75
75
pub field4 : T ,
76
76
}
77
77
#[ no_mangle]
78
- pub static mut global: * mut S = 0 as * const S as * mut S ;
78
+ pub static mut global: * mut S = std :: ptr :: null_mut ( ) ;
79
79
#[ no_mangle]
80
80
pub unsafe extern "C" fn malloc_wrapper ( mut size : size_t ) -> * mut libc:: c_void {
81
81
return malloc ( size) ;
@@ -105,7 +105,7 @@ pub unsafe extern "C" fn simple() {
105
105
( * y) . field4 = T {
106
106
field : 0i32 ,
107
107
field2 : 0u64 ,
108
- field3 : 0 as * const S ,
108
+ field3 : std :: ptr :: null ( ) ,
109
109
field4 : 0i32 ,
110
110
} ;
111
111
let s = * y;
@@ -232,7 +232,7 @@ pub unsafe extern "C" fn fdevent_unregister(mut ev: *mut fdevents, mut fd: libc:
232
232
return ;
233
233
}
234
234
let ref mut fresh1 = * ( ( * ev) . fdarray ) . offset ( fd as isize ) ;
235
- * fresh1 = 0 as * mut fdnode ;
235
+ * fresh1 = std :: ptr :: null_mut ( ) ;
236
236
fdnode_free ( fdn) ;
237
237
}
238
238
unsafe extern "C" fn fdnode_free ( mut fdn : * mut fdnode ) {
@@ -345,7 +345,7 @@ pub unsafe extern "C" fn invalid() {
345
345
b"%i\n \x00 " as * const u8 as * const libc:: c_char ,
346
346
( * global) . field ,
347
347
) ;
348
- global = 0 as * mut S ;
348
+ global = std :: ptr :: null_mut ( ) ;
349
349
free ( s as * mut libc:: c_void ) ;
350
350
}
351
351
pub unsafe extern "C" fn testing ( ) {
@@ -416,14 +416,14 @@ pub unsafe extern "C" fn test_ref_field() {
416
416
let t = T {
417
417
field : 0i32 ,
418
418
field2 : 0u64 ,
419
- field3 : 0 as * const S ,
419
+ field3 : std :: ptr :: null ( ) ,
420
420
field4 : 0i32 ,
421
421
} ;
422
422
423
423
let ref mut s = S {
424
424
field : 0i32 ,
425
425
field2 : 0u64 ,
426
- field3 : 0 as * const S ,
426
+ field3 : std :: ptr :: null ( ) ,
427
427
field4 : t,
428
428
} ;
429
429
s. field4 . field4 = s. field4 . field4 ;
0 commit comments