Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicated attribute #147

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions netcdf-sys/src/mmap.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#![cfg(feature = "has-mmap")]

use std::os::raw::{c_char, c_int, c_void};

#[repr(C)]
#[derive(Copy, Clone)]
#[cfg(all(feature = "has-mmap", feature = "1.6.2"))]
#[cfg(feature = "1.6.2")]
pub struct NC_memio {
size: usize,
memory: *mut c_void,
flags: c_int,
}

extern "C" {
#[cfg(feature = "has-mmap")]
pub fn nc_open_mem(
path: *const c_char,
mode: c_int,
Expand All @@ -21,21 +18,21 @@ extern "C" {
ncidp: *mut c_int,
) -> c_int;

#[cfg(all(feature = "has-mmap", feature = "1.6.2"))]
#[cfg(feature = "1.6.2")]
pub fn nc_create_mem(
path: *const c_char,
mode: c_int,
initialsize: usize,
ncidp: *mut c_int,
) -> c_int;
#[cfg(all(feature = "has-mmap", feature = "1.6.2"))]
#[cfg(feature = "1.6.2")]
pub fn nc_open_memio(
path: *const c_char,
mode: c_int,
info: *mut NC_memio,
ncidp: *mut c_int,
) -> c_int;

#[cfg(all(feature = "has-mmap", feature = "1.6.2"))]
#[cfg(feature = "1.6.2")]
pub fn nc_close_memio(ncid: c_int, info: *mut NC_memio) -> c_int;
}
2 changes: 1 addition & 1 deletion netcdf/src/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl<'g> VariableMut<'g> {
.iter()
.copied()
.fold(1_usize, usize::saturating_mul);
if len == usize::max_value() {
if len == usize::MAX {
return Err(error::Error::Overflow);
}
unsafe {
Expand Down
Loading