diff --git a/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs b/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs index c90e99e..13ca6be 100644 --- a/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs +++ b/crates/open_jtalk-sys/src/generated/linux/aarch64/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.60.1 */ +/* automatically generated by rust-bindgen 0.62.0 */ pub const TRUE: u32 = 1; pub const FALSE: u32 = 0; @@ -27,6 +27,9 @@ pub struct mecab_dictionary_info_t { } #[test] fn bindgen_test_layout_mecab_dictionary_info_t() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 48usize, @@ -37,142 +40,86 @@ fn bindgen_test_layout_mecab_dictionary_info_t() { 8usize, concat!("Alignment of ", stringify!(mecab_dictionary_info_t)) ); - fn test_field_filename() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(filename) - ) - ); - } - test_field_filename(); - fn test_field_charset() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(charset) - ) - ); - } - test_field_charset(); - fn test_field_size() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(size) - ) - ); - } - test_field_size(); - fn test_field_type() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(type_) - ) - ); - } - test_field_type(); - fn test_field_lsize() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(lsize) - ) - ); - } - test_field_lsize(); - fn test_field_rsize() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(rsize) - ) - ); - } - test_field_rsize(); - fn test_field_version() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(version) - ) - ); - } - test_field_version(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_dictionary_info_t), - "::", - stringify!(next) - ) - ); - } - test_field_next(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).filename) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(filename) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).charset) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(charset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lsize) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(lsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rsize) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(rsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(mecab_dictionary_info_t), + "::", + stringify!(next) + ) + ); } #[doc = " Path structure"] #[repr(C)] @@ -193,6 +140,8 @@ pub struct mecab_path_t { } #[test] fn bindgen_test_layout_mecab_path_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 40usize, @@ -203,108 +152,66 @@ fn bindgen_test_layout_mecab_path_t() { 8usize, concat!("Alignment of ", stringify!(mecab_path_t)) ); - fn test_field_rnode() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnode) - ) - ); - } - test_field_rnode(); - fn test_field_rnext() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(rnext) - ) - ); - } - test_field_rnext(); - fn test_field_lnode() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnode) - ) - ); - } - test_field_lnode(); - fn test_field_lnext() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(lnext) - ) - ); - } - test_field_lnext(); - fn test_field_cost() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(cost) - ) - ); - } - test_field_cost(); - fn test_field_prob() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(mecab_path_t), - "::", - stringify!(prob) - ) - ); - } - test_field_prob(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rnode) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mecab_path_t), + "::", + stringify!(rnode) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rnext) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(mecab_path_t), + "::", + stringify!(rnext) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lnode) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(mecab_path_t), + "::", + stringify!(lnode) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lnext) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(mecab_path_t), + "::", + stringify!(lnext) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(mecab_path_t), + "::", + stringify!(cost) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(mecab_path_t), + "::", + stringify!(prob) + ) + ); } #[doc = " Node structure"] #[repr(C)] @@ -365,6 +272,8 @@ pub struct mecab_node_t { } #[test] fn bindgen_test_layout_mecab_node_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), 112usize, @@ -375,380 +284,226 @@ fn bindgen_test_layout_mecab_node_t() { 8usize, concat!("Alignment of ", stringify!(mecab_node_t)) ); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(next) - ) - ); - } - test_field_next(); - fn test_field_enext() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(enext) - ) - ); - } - test_field_enext(); - fn test_field_bnext() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(bnext) - ) - ); - } - test_field_bnext(); - fn test_field_rpath() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rpath) - ) - ); - } - test_field_rpath(); - fn test_field_lpath() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lpath) - ) - ); - } - test_field_lpath(); - fn test_field_surface() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(surface) - ) - ); - } - test_field_surface(); - fn test_field_feature() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(feature) - ) - ); - } - test_field_feature(); - fn test_field_id() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(id) - ) - ); - } - test_field_id(); - fn test_field_length() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize - }, - 68usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(length) - ) - ); - } - test_field_length(); - fn test_field_rlength() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize - }, - 70usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rlength) - ) - ); - } - test_field_rlength(); - fn test_field_rcAttr() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(rcAttr) - ) - ); - } - test_field_rcAttr(); - fn test_field_lcAttr() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize - }, - 74usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(lcAttr) - ) - ); - } - test_field_lcAttr(); - fn test_field_posid() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize - }, - 76usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(posid) - ) - ); - } - test_field_posid(); - fn test_field_char_type() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize - }, - 78usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(char_type) - ) - ); - } - test_field_char_type(); - fn test_field_stat() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize - }, - 79usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(stat) - ) - ); - } - test_field_stat(); - fn test_field_isbest() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(isbest) - ) - ); - } - test_field_isbest(); - fn test_field_alpha() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize - }, - 84usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(alpha) - ) - ); - } - test_field_alpha(); - fn test_field_beta() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(beta) - ) - ); - } - test_field_beta(); - fn test_field_prob() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize - }, - 92usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(prob) - ) - ); - } - test_field_prob(); - fn test_field_wcost() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(wcost) - ) - ); - } - test_field_wcost(); - fn test_field_cost() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(mecab_node_t), - "::", - stringify!(cost) - ) - ); - } - test_field_cost(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).enext) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(enext) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).bnext) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(bnext) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rpath) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(rpath) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lpath) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(lpath) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).surface) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(surface) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(feature) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).length) as usize - ptr as usize }, + 68usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(length) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rlength) as usize - ptr as usize }, + 70usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(rlength) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).rcAttr) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(rcAttr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lcAttr) as usize - ptr as usize }, + 74usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(lcAttr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).posid) as usize - ptr as usize }, + 76usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(posid) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).char_type) as usize - ptr as usize }, + 78usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(char_type) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).stat) as usize - ptr as usize }, + 79usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(stat) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).isbest) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(isbest) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(alpha) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).beta) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(beta) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prob) as usize - ptr as usize }, + 92usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(prob) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wcost) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(wcost) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cost) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(mecab_node_t), + "::", + stringify!(cost) + ) + ); } pub const MECAB_NOR_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_NOR_NODE; pub const MECAB_UNK_NODE: _bindgen_ty_1 = _bindgen_ty_1::MECAB_UNK_NODE; @@ -885,6 +640,8 @@ pub struct _IO_FILE { } #[test] fn bindgen_test_layout__IO_FILE() { + const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_IO_FILE>(), 216usize, @@ -895,499 +652,296 @@ fn bindgen_test_layout__IO_FILE() { 8usize, concat!("Alignment of ", stringify!(_IO_FILE)) ); - fn test_field__flags() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - } - test_field__flags(); - fn test_field__IO_read_ptr() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - } - test_field__IO_read_ptr(); - fn test_field__IO_read_end() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - } - test_field__IO_read_end(); - fn test_field__IO_read_base() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - } - test_field__IO_read_base(); - fn test_field__IO_write_base() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - } - test_field__IO_write_base(); - fn test_field__IO_write_ptr() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - } - test_field__IO_write_ptr(); - fn test_field__IO_write_end() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - } - test_field__IO_write_end(); - fn test_field__IO_buf_base() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - } - test_field__IO_buf_base(); - fn test_field__IO_buf_end() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - } - test_field__IO_buf_end(); - fn test_field__IO_save_base() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - } - test_field__IO_save_base(); - fn test_field__IO_backup_base() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - } - test_field__IO_backup_base(); - fn test_field__IO_save_end() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - } - test_field__IO_save_end(); - fn test_field__markers() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - } - test_field__markers(); - fn test_field__chain() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - } - test_field__chain(); - fn test_field__fileno() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize - }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - } - test_field__fileno(); - fn test_field__flags2() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize - }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - } - test_field__flags2(); - fn test_field__old_offset() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - } - test_field__old_offset(); - fn test_field__cur_column() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize - }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - } - test_field__cur_column(); - fn test_field__vtable_offset() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize - }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - } - test_field__vtable_offset(); - fn test_field__shortbuf() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize - }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - } - test_field__shortbuf(); - fn test_field__lock() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize - }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - } - test_field__lock(); - fn test_field__offset() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize - }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - } - test_field__offset(); - fn test_field__codecvt() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - } - test_field__codecvt(); - fn test_field__wide_data() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize - }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - } - test_field__wide_data(); - fn test_field__freeres_list() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize - }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - } - test_field__freeres_list(); - fn test_field__freeres_buf() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize - }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - } - test_field__freeres_buf(); - fn test_field___pad5() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize - }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - } - test_field___pad5(); - fn test_field__mode() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize - }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - } - test_field__mode(); - fn test_field__unused2() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_IO_FILE>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize - }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); - } - test_field__unused2(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_flags) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_read_ptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_read_end) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_read_base) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_write_base) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_write_ptr) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_write_end) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_buf_base) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_buf_end) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_save_base) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_backup_base) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_IO_save_end) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_markers) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_chain) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_fileno) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, + 116usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_flags2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_old_offset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_cur_column) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, + 130usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_vtable_offset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, + 131usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_shortbuf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_lock) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_offset) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_codecvt) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_wide_data) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_freeres_list) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, + 176usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_freeres_buf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(__pad5) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, + 192usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_mode) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, + 196usize, + concat!( + "Offset of field: ", + stringify!(_IO_FILE), + "::", + stringify!(_unused2) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -1909,7 +1463,7 @@ extern "C" { impl MeCab_Lattice { #[inline] pub unsafe fn create() -> *mut MeCab_Lattice { - MeCab_Lattice_create() + unsafe { MeCab_Lattice_create() } } } #[repr(C)] @@ -1965,18 +1519,18 @@ extern "C" { impl MeCab_Model { #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - MeCab_Model_version() + unsafe { MeCab_Model_version() } } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Model { - MeCab_Model_create(argc, argv) + unsafe { MeCab_Model_create(argc, argv) } } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Model { - MeCab_Model_create1(arg) + unsafe { MeCab_Model_create1(arg) } } } #[repr(C)] @@ -2046,22 +1600,22 @@ extern "C" { impl MeCab_Tagger { #[inline] pub unsafe fn parse(model: *const MeCab_Model, lattice: *mut MeCab_Lattice) -> bool { - MeCab_Tagger_parse(model, lattice) + unsafe { MeCab_Tagger_parse(model, lattice) } } #[inline] pub unsafe fn create( argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char, ) -> *mut MeCab_Tagger { - MeCab_Tagger_create(argc, argv) + unsafe { MeCab_Tagger_create(argc, argv) } } #[inline] pub unsafe fn create1(arg: *const ::std::os::raw::c_char) -> *mut MeCab_Tagger { - MeCab_Tagger_create1(arg) + unsafe { MeCab_Tagger_create1(arg) } } #[inline] pub unsafe fn version() -> *const ::std::os::raw::c_char { - MeCab_Tagger_version() + unsafe { MeCab_Tagger_version() } } } extern "C" { @@ -2143,6 +1697,8 @@ pub struct _Mecab { } #[test] fn bindgen_test_layout__Mecab() { + const UNINIT: ::std::mem::MaybeUninit<_Mecab> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_Mecab>(), 40usize, @@ -2153,91 +1709,56 @@ fn bindgen_test_layout__Mecab() { 8usize, concat!("Alignment of ", stringify!(_Mecab)) ); - fn test_field_feature() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_Mecab>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(feature) - ) - ); - } - test_field_feature(); - fn test_field_size() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_Mecab>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(size) - ) - ); - } - test_field_size(); - fn test_field_model() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_Mecab>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(model) - ) - ); - } - test_field_model(); - fn test_field_tagger() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_Mecab>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(tagger) - ) - ); - } - test_field_tagger(); - fn test_field_lattice() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_Mecab>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_Mecab), - "::", - stringify!(lattice) - ) - ); - } - test_field_lattice(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_Mecab), + "::", + stringify!(feature) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_Mecab), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).model) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_Mecab), + "::", + stringify!(model) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tagger) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_Mecab), + "::", + stringify!(tagger) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lattice) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_Mecab), + "::", + stringify!(lattice) + ) + ); } pub type Mecab = _Mecab; extern "C" { @@ -2299,6 +1820,8 @@ pub struct _NJDNode { } #[test] fn bindgen_test_layout__NJDNode() { + const UNINIT: ::std::mem::MaybeUninit<_NJDNode> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_NJDNode>(), 120usize, @@ -2309,278 +1832,166 @@ fn bindgen_test_layout__NJDNode() { 8usize, concat!("Alignment of ", stringify!(_NJDNode)) ); - fn test_field_string() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(string) - ) - ); - } - test_field_string(); - fn test_field_pos() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos) - ) - ); - } - test_field_pos(); - fn test_field_pos_group1() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group1) - ) - ); - } - test_field_pos_group1(); - fn test_field_pos_group2() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group2) - ) - ); - } - test_field_pos_group2(); - fn test_field_pos_group3() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pos_group3) - ) - ); - } - test_field_pos_group3(); - fn test_field_ctype() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(ctype) - ) - ); - } - test_field_ctype(); - fn test_field_cform() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(cform) - ) - ); - } - test_field_cform(); - fn test_field_orig() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(orig) - ) - ); - } - test_field_orig(); - fn test_field_read() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(read) - ) - ); - } - test_field_read(); - fn test_field_pron() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(pron) - ) - ); - } - test_field_pron(); - fn test_field_acc() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(acc) - ) - ); - } - test_field_acc(); - fn test_field_mora_size() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize - }, - 84usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(mora_size) - ) - ); - } - test_field_mora_size(); - fn test_field_chain_rule() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_rule) - ) - ); - } - test_field_chain_rule(); - fn test_field_chain_flag() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(chain_flag) - ) - ); - } - test_field_chain_flag(); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJDNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_NJDNode), - "::", - stringify!(next) - ) - ); - } - test_field_next(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).string) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(string) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pos_group1) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(pos_group1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pos_group2) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(pos_group2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pos_group3) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(pos_group3) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(ctype) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(cform) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).orig) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(orig) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(read) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(pron) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(acc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mora_size) as usize - ptr as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(mora_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).chain_rule) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(chain_rule) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(chain_flag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(_NJDNode), + "::", + stringify!(next) + ) + ); } pub type NJDNode = _NJDNode; extern "C" { @@ -2725,6 +2136,8 @@ pub struct _NJD { } #[test] fn bindgen_test_layout__NJD() { + const UNINIT: ::std::mem::MaybeUninit<_NJD> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_NJD>(), 16usize, @@ -2735,40 +2148,26 @@ fn bindgen_test_layout__NJD() { 8usize, concat!("Alignment of ", stringify!(_NJD)) ); - fn test_field_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJD>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(head) - ) - ); - } - test_field_head(); - fn test_field_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_NJD>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_NJD), - "::", - stringify!(tail) - ) - ); - } - test_field_tail(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_NJD), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_NJD), + "::", + stringify!(tail) + ) + ); } pub type NJD = _NJD; extern "C" { @@ -2821,6 +2220,9 @@ pub struct _JPCommonLabelPhoneme { } #[test] fn bindgen_test_layout__JPCommonLabelPhoneme() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelPhoneme> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommonLabelPhoneme>(), 32usize, @@ -2831,74 +2233,46 @@ fn bindgen_test_layout__JPCommonLabelPhoneme() { 8usize, concat!("Alignment of ", stringify!(_JPCommonLabelPhoneme)) ); - fn test_field_phoneme() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelPhoneme>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(phoneme) - ) - ); - } - test_field_phoneme(); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelPhoneme>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelPhoneme>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(next) - ) - ); - } - test_field_next(); - fn test_field_up() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelPhoneme>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelPhoneme), - "::", - stringify!(up) - ) - ); - } - test_field_up(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).phoneme) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelPhoneme), + "::", + stringify!(phoneme) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelPhoneme), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelPhoneme), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelPhoneme), + "::", + stringify!(up) + ) + ); } pub type JPCommonLabelPhoneme = _JPCommonLabelPhoneme; #[repr(C)] @@ -2913,6 +2287,8 @@ pub struct _JPCommonLabelMora { } #[test] fn bindgen_test_layout__JPCommonLabelMora() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelMora> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommonLabelMora>(), 48usize, @@ -2923,108 +2299,66 @@ fn bindgen_test_layout__JPCommonLabelMora() { 8usize, concat!("Alignment of ", stringify!(_JPCommonLabelMora)) ); - fn test_field_mora() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelMora>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(mora) - ) - ); - } - test_field_mora(); - fn test_field_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelMora>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(head) - ) - ); - } - test_field_head(); - fn test_field_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelMora>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(tail) - ) - ); - } - test_field_tail(); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelMora>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelMora>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(next) - ) - ); - } - test_field_next(); - fn test_field_up() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelMora>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelMora), - "::", - stringify!(up) - ) - ); - } - test_field_up(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mora) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelMora), + "::", + stringify!(mora) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelMora), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelMora), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelMora), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelMora), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelMora), + "::", + stringify!(up) + ) + ); } pub type JPCommonLabelMora = _JPCommonLabelMora; #[repr(C)] @@ -3042,6 +2376,8 @@ pub struct _JPCommonLabelWord { } #[test] fn bindgen_test_layout__JPCommonLabelWord() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelWord> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommonLabelWord>(), 72usize, @@ -3052,159 +2388,96 @@ fn bindgen_test_layout__JPCommonLabelWord() { 8usize, concat!("Alignment of ", stringify!(_JPCommonLabelWord)) ); - fn test_field_pron() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pron) - ) - ); - } - test_field_pron(); - fn test_field_pos() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(pos) - ) - ); - } - test_field_pos(); - fn test_field_ctype() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(ctype) - ) - ); - } - test_field_ctype(); - fn test_field_cform() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(cform) - ) - ); - } - test_field_cform(); - fn test_field_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(head) - ) - ); - } - test_field_head(); - fn test_field_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(tail) - ) - ); - } - test_field_tail(); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(next) - ) - ); - } - test_field_next(); - fn test_field_up() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelWord>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelWord), - "::", - stringify!(up) - ) - ); - } - test_field_up(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(pron) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(ctype) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(cform) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelWord), + "::", + stringify!(up) + ) + ); } pub type JPCommonLabelWord = _JPCommonLabelWord; #[repr(C)] @@ -3220,6 +2493,9 @@ pub struct _JPCommonLabelAccentPhrase { } #[test] fn bindgen_test_layout__JPCommonLabelAccentPhrase() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelAccentPhrase> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommonLabelAccentPhrase>(), 56usize, @@ -3230,125 +2506,76 @@ fn bindgen_test_layout__JPCommonLabelAccentPhrase() { 8usize, concat!("Alignment of ", stringify!(_JPCommonLabelAccentPhrase)) ); - fn test_field_accent() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelAccentPhrase>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(accent) - ) - ); - } - test_field_accent(); - fn test_field_emotion() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelAccentPhrase>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(emotion) - ) - ); - } - test_field_emotion(); - fn test_field_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelAccentPhrase>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(head) - ) - ); - } - test_field_head(); - fn test_field_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelAccentPhrase>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(tail) - ) - ); - } - test_field_tail(); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelAccentPhrase>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelAccentPhrase>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(next) - ) - ); - } - test_field_next(); - fn test_field_up() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelAccentPhrase>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelAccentPhrase), - "::", - stringify!(up) - ) - ); - } - test_field_up(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).accent) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelAccentPhrase), + "::", + stringify!(accent) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).emotion) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelAccentPhrase), + "::", + stringify!(emotion) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelAccentPhrase), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelAccentPhrase), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelAccentPhrase), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelAccentPhrase), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).up) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelAccentPhrase), + "::", + stringify!(up) + ) + ); } pub type JPCommonLabelAccentPhrase = _JPCommonLabelAccentPhrase; #[repr(C)] @@ -3361,6 +2588,9 @@ pub struct _JPCommonLabelBreathGroup { } #[test] fn bindgen_test_layout__JPCommonLabelBreathGroup() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabelBreathGroup> = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommonLabelBreathGroup>(), 32usize, @@ -3371,74 +2601,46 @@ fn bindgen_test_layout__JPCommonLabelBreathGroup() { 8usize, concat!("Alignment of ", stringify!(_JPCommonLabelBreathGroup)) ); - fn test_field_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelBreathGroup>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(head) - ) - ); - } - test_field_head(); - fn test_field_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelBreathGroup>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(tail) - ) - ); - } - test_field_tail(); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelBreathGroup>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabelBreathGroup>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabelBreathGroup), - "::", - stringify!(next) - ) - ); - } - test_field_next(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelBreathGroup), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelBreathGroup), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelBreathGroup), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabelBreathGroup), + "::", + stringify!(next) + ) + ); } pub type JPCommonLabelBreathGroup = _JPCommonLabelBreathGroup; #[repr(C)] @@ -3460,6 +2662,8 @@ pub struct _JPCommonLabel { } #[test] fn bindgen_test_layout__JPCommonLabel() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommonLabel> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommonLabel>(), 104usize, @@ -3470,227 +2674,136 @@ fn bindgen_test_layout__JPCommonLabel() { 8usize, concat!("Alignment of ", stringify!(_JPCommonLabel)) ); - fn test_field_size() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(size) - ) - ); - } - test_field_size(); - fn test_field_feature() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(feature) - ) - ); - } - test_field_feature(); - fn test_field_breath_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_head) - ) - ); - } - test_field_breath_head(); - fn test_field_breath_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(breath_tail) - ) - ); - } - test_field_breath_tail(); - fn test_field_accent_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_head) - ) - ); - } - test_field_accent_head(); - fn test_field_accent_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(accent_tail) - ) - ); - } - test_field_accent_tail(); - fn test_field_word_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_head) - ) - ); - } - test_field_word_head(); - fn test_field_word_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(word_tail) - ) - ); - } - test_field_word_tail(); - fn test_field_mora_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_head) - ) - ); - } - test_field_mora_head(); - fn test_field_mora_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(mora_tail) - ) - ); - } - test_field_mora_tail(); - fn test_field_phoneme_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_head) - ) - ); - } - test_field_phoneme_head(); - fn test_field_phoneme_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(phoneme_tail) - ) - ); - } - test_field_phoneme_tail(); - fn test_field_short_pause_flag() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonLabel>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize - }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonLabel), - "::", - stringify!(short_pause_flag) - ) - ); - } - test_field_short_pause_flag(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).feature) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(feature) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).breath_head) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(breath_head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).breath_tail) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(breath_tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).accent_head) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(accent_head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).accent_tail) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(accent_tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).word_head) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(word_head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).word_tail) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(word_tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mora_head) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(mora_head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mora_tail) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(mora_tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).phoneme_head) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(phoneme_head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).phoneme_tail) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(phoneme_tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).short_pause_flag) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonLabel), + "::", + stringify!(short_pause_flag) + ) + ); } pub type JPCommonLabel = _JPCommonLabel; extern "C" { @@ -3740,6 +2853,8 @@ pub struct _JPCommonNode { } #[test] fn bindgen_test_layout__JPCommonNode() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommonNode> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommonNode>(), 56usize, @@ -3750,142 +2865,86 @@ fn bindgen_test_layout__JPCommonNode() { 8usize, concat!("Alignment of ", stringify!(_JPCommonNode)) ); - fn test_field_pron() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pron) - ) - ); - } - test_field_pron(); - fn test_field_pos() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(pos) - ) - ); - } - test_field_pos(); - fn test_field_ctype() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(ctype) - ) - ); - } - test_field_ctype(); - fn test_field_cform() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(cform) - ) - ); - } - test_field_cform(); - fn test_field_acc() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(acc) - ) - ); - } - test_field_acc(); - fn test_field_chain_flag() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(chain_flag) - ) - ); - } - test_field_chain_flag(); - fn test_field_prev() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(prev) - ) - ); - } - test_field_prev(); - fn test_field_next() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommonNode>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_JPCommonNode), - "::", - stringify!(next) - ) - ); - } - test_field_next(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pron) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(pron) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(pos) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ctype) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(ctype) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).cform) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(cform) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).acc) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(acc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).chain_flag) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(chain_flag) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(_JPCommonNode), + "::", + stringify!(next) + ) + ); } pub type JPCommonNode = _JPCommonNode; extern "C" { @@ -3945,6 +3004,8 @@ pub struct _JPCommon { } #[test] fn bindgen_test_layout__JPCommon() { + const UNINIT: ::std::mem::MaybeUninit<_JPCommon> = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::<_JPCommon>(), 24usize, @@ -3955,57 +3016,36 @@ fn bindgen_test_layout__JPCommon() { 8usize, concat!("Alignment of ", stringify!(_JPCommon)) ); - fn test_field_head() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommon>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(head) - ) - ); - } - test_field_head(); - fn test_field_tail() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommon>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(tail) - ) - ); - } - test_field_tail(); - fn test_field_label() { - assert_eq!( - unsafe { - let uninit = ::std::mem::MaybeUninit::<_JPCommon>::uninit(); - let ptr = uninit.as_ptr(); - ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_JPCommon), - "::", - stringify!(label) - ) - ); - } - test_field_label(); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(_JPCommon), + "::", + stringify!(head) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(_JPCommon), + "::", + stringify!(tail) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).label) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(_JPCommon), + "::", + stringify!(label) + ) + ); } pub type JPCommon = _JPCommon; extern "C" {