Skip to content

Commit

Permalink
Cast to mutable void pointer to keep miri happy
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed Mar 30, 2023
1 parent 2d26066 commit c66eca1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "lonlat_bng"
description = "Convert longitude and latitude coordinates to BNG coordinates, and vice versa"
version = "0.6.31"
version = "0.6.32"
authors = ["Stephan Hügel <urschrei@gmail.com>"]
license = "MIT"
keywords = ["OSGB36", "BNG", "Geo", "ETRS89", "OSTN02", "OSTN15"]
Expand Down
2 changes: 1 addition & 1 deletion src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub extern "C" fn drop_float_array(lons: Array, lats: Array) {
impl<'a, T> From<&'a mut [T]> for Array {
fn from(sl: &mut [T]) -> Self {
Array {
data: sl.as_ptr().cast::<libc::c_void>(),
data: sl.as_mut_ptr().cast::<libc::c_void>(),
len: sl.len() as libc::size_t,
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ mod tests {
}

#[test]
#[cfg_attr(miri, ignore)]
fn test_drop_float_array() {
let lon_vec: &mut [f64] = &mut [-2.0183041005533306];
let lat_vec: &mut [f64] = &mut [54.589_097_162_646_14];
Expand Down Expand Up @@ -508,6 +509,7 @@ mod tests {
}

#[test]
#[cfg_attr(miri, ignore)]
fn test_bad_threaded_conversion() {
// above maximum longitude
let lon_vec: &mut [f64] = &mut [1.85];
Expand Down

0 comments on commit c66eca1

Please sign in to comment.