Skip to content

Commit

Permalink
Merge pull request #147 from georust/bugfix/duplicated-attribute
Browse files Browse the repository at this point in the history
Remove duplicated attribute
  • Loading branch information
mulimoen authored Jun 17, 2024
2 parents a5669e4 + 6fa28af commit e1788c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
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

0 comments on commit e1788c1

Please sign in to comment.