Skip to content

Commit

Permalink
fix bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Mar 19, 2021
1 parent af33f44 commit c3750fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bitmagic"
version = "0.1.0+bitmagic.7.3.1"
version = "0.1.1+bitmagic.7.3.1"
authors = ["Luiz Irber <[email protected]>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion bitmagic-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bitmagic-sys"
version = "0.1.0+bitmagic.7.3.1"
version = "0.1.1+bitmagic.7.3.1"
authors = ["Luiz Irber <[email protected]>"]
edition = "2018"
build = "build.rs"
Expand Down
1 change: 1 addition & 0 deletions bitmagic-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ fn generate_bindings() {
let bindings = bindgen::Builder::default()
.clang_arg("-I./BitMagic/lang-maps/libbm")
.header("BitMagic/lang-maps/libbm/include/libbm.h")
.size_t_is_usize(true)
.generate()
.expect("Unable to generate bindings");

Expand Down
15 changes: 7 additions & 8 deletions bitmagic-sys/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ pub const BM_SIMD_SSE42: u32 = 2;
pub const BM_SIMD_AVX2: u32 = 5;
pub const BM_TRUE: u32 = 1;
pub const BM_FALSE: u32 = 0;
pub type size_t = ::std::os::raw::c_ulong;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(C)]
#[repr(align(16))]
Expand Down Expand Up @@ -82,10 +81,10 @@ fn bindgen_test_layout_max_align_t() {
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct BM_bvector_statistics {
pub bit_blocks: size_t,
pub gap_blocks: size_t,
pub max_serialize_mem: size_t,
pub memory_used: size_t,
pub bit_blocks: usize,
pub gap_blocks: usize,
pub max_serialize_mem: usize,
pub memory_used: usize,
}
#[test]
fn bindgen_test_layout_BM_bvector_statistics() {
Expand Down Expand Up @@ -520,15 +519,15 @@ extern "C" {
pub fn BM_bvector_serialize(
h: *mut ::std::os::raw::c_void,
buf: *mut ::std::os::raw::c_char,
buf_size: size_t,
pblob_size: *mut size_t,
buf_size: usize,
pblob_size: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn BM_bvector_deserialize(
h: *mut ::std::os::raw::c_void,
buf: *const ::std::os::raw::c_char,
buf_size: size_t,
buf_size: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl BVector {
res = bitmagic_sys::BM_bvector_serialize(
self.handle,
buf.as_mut_ptr() as *mut i8,
buf.len() as u64,
buf.len(),
&mut blob_size,
);
}
Expand Down Expand Up @@ -82,7 +82,7 @@ impl BVector {
res = bitmagic_sys::BM_bvector_deserialize(
bnew.handle,
buf.as_mut_ptr() as *mut i8,
buf.len() as u64,
buf.len(),
);
}
_check_res(res);
Expand Down

0 comments on commit c3750fa

Please sign in to comment.