fix: wrap qsort_r unsafe ptr calls in unsafe blocks (Rust 2024 edition)
This commit is contained in:
@@ -1157,10 +1157,10 @@ pub unsafe extern "C" fn qsort_r(
|
||||
if let Some(comp) = compar {
|
||||
for i in 0..nel {
|
||||
for j in (i + 1)..nel {
|
||||
let a = base.cast::<u8>().add(i * width).cast::<c_void>();
|
||||
let b = base.cast::<u8>().add(j * width).cast::<c_void>();
|
||||
let a = unsafe { base.cast::<u8>().add(i * width).cast::<c_void>() };
|
||||
let b = unsafe { base.cast::<u8>().add(j * width).cast::<c_void>() };
|
||||
if comp(a, b, arg) > 0 {
|
||||
ptr::swap_nonoverlapping(a.cast::<u8>(), b.cast::<u8>(), width);
|
||||
unsafe { ptr::swap_nonoverlapping(a.cast::<u8>(), b.cast::<u8>(), width) };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user