Skip to content

Commit 80bfb4e

Browse files
committed
Changed 0 as * to ::std::ptr::null.
1 parent 1d80171 commit 80bfb4e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/device/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn info() {
7272
pub fn info_string(verbose: bool) -> String {
7373
let result: String;
7474
unsafe {
75-
let mut tmp: *mut c_char = 0 as *mut c_char;
75+
let mut tmp: *mut c_char = ::std::ptr::null_mut();
7676
let err_val = af_info_string(&mut tmp, verbose);
7777
HANDLE_ERROR(AfError::from(err_val));
7878
result = CStr::from_ptr(tmp).to_string_lossy().into_owned();

src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub fn get_size(value: DType) -> usize {
3232

3333
/// Allocates space using Arrayfire allocator in host memory
3434
pub fn alloc_host<T>(elements: usize, _type: DType) -> *const T {
35-
let ptr = 0 as *const T;
35+
let ptr: *const T = ::std::ptr::null();
3636
let bytes = (elements * get_size(_type)) as DimT;
3737
unsafe {
3838
let err_val = af_alloc_host(&mut (ptr as *const c_void), bytes);

0 commit comments

Comments
 (0)