From 249e7d1834d8722beb2e24c2210e57a59e0dfc98 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 11 Jan 2026 19:37:54 +0000 Subject: [PATCH 1/3] Bump MSRV to 1.85.0 (will be required by jni 0.22) This re-generates the FFI bindings with `--rust-target '1.85.0'` --- .github/workflows/ci.yml | 2 +- Cargo.toml | 1 + android-activity/CHANGELOG.md | 2 +- android-activity/Cargo.toml | 5 +- android-activity/generate-bindings.sh | 2 +- .../src/game_activity/ffi_aarch64.rs | 4124 ++++--------- android-activity/src/game_activity/ffi_arm.rs | 4155 ++++--------- .../src/game_activity/ffi_i686.rs | 5455 +++++----------- .../src/game_activity/ffi_x86_64.rs | 5486 +++++------------ 9 files changed, 5558 insertions(+), 13674 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30c81330..3b104392 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: # See top README for MSRV policy - rust-version: [1.73.0, stable] + rust-version: [1.85.0, stable] steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index 5673fe47..c1f46d31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,3 +3,4 @@ resolver = "2" members = ["android-activity"] exclude = ["examples"] + diff --git a/android-activity/CHANGELOG.md b/android-activity/CHANGELOG.md index be0c1ac0..92d57552 100644 --- a/android-activity/CHANGELOG.md +++ b/android-activity/CHANGELOG.md @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > - `Source::is_xxx_class()` functions are replaced by querying `Source::class()` and comparing against variants from the returned `SourceClass` `bitflags` enum. > - `SourceFlags::TRACKBALL` (from `Source::is_trackball_class()`) is named `SourceClass::NAVIGATION` in the `ndk`. -- rust-version bumped to 1.73.0 ([#193](https://github.com/rust-mobile/android-activity/pull/193)) +- rust-version bumped to 1.85.0 ([#193](https://github.com/rust-mobile/android-activity/pull/193), TODO: link) - The `ndk` and `ndk-sys` crates are now re-exported under `android_activity::ndk` and `android_activity::ndk_sys` ([#194](https://github.com/rust-mobile/android-activity/pull/194)) - GameActivity updated to 4.0.0 (requires the corresponding 4.0.0 `.aar` release from Google) ([#191](https://github.com/rust-mobile/android-activity/pull/191)) diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index 276d1bdc..d8050c76 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -16,10 +16,7 @@ include = [ "/src", ] -# Even though we could technically still build with 1.69, 1.73 has a fix for the -# definition of the `stat` struct on Android, and so it seems worthwhile drawing -# a line under that to ensure android-activity applications have that fix. -rust-version = "1.73.0" +rust-version = "1.85.0" [features] # Note: we don't enable any backend by default since features diff --git a/android-activity/generate-bindings.sh b/android-activity/generate-bindings.sh index 8c1a4e97..d4805b01 100755 --- a/android-activity/generate-bindings.sh +++ b/android-activity/generate-bindings.sh @@ -15,7 +15,7 @@ while read ARCH && read TARGET ; do # --module-raw-line 'use ' bindgen game-activity-ffi.h -o src/game_activity/ffi_$ARCH.rs \ - --rust-target '1.73.0' \ + --rust-target '1.85.0' \ --blocklist-item 'JNI\w+' \ --blocklist-item 'C?_?JNIEnv' \ --blocklist-item '_?JavaVM' \ diff --git a/android-activity/src/game_activity/ffi_aarch64.rs b/android-activity/src/game_activity/ffi_aarch64.rs index 461f3775..c0c4f265 100644 --- a/android-activity/src/game_activity/ffi_aarch64.rs +++ b/android-activity/src/game_activity/ffi_aarch64.rs @@ -747,10 +747,10 @@ pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; -extern "C" { +unsafe extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn android_get_device_api_level() -> ::std::os::raw::c_int; } pub type wchar_t = ::std::os::raw::c_uint; @@ -762,31 +762,15 @@ pub struct max_align_t { pub __bindgen_padding_0: u64, pub __clang_max_align_nonce2: u128, } -#[test] -fn bindgen_test_layout_max_align_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of max_align_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - "Alignment of max_align_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, - 0usize, - "Offset of field: max_align_t::__clang_max_align_nonce1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, - 16usize, - "Offset of field: max_align_t::__clang_max_align_nonce2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of max_align_t"][::std::mem::size_of::() - 32usize]; + ["Alignment of max_align_t"][::std::mem::align_of::() - 16usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce1"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce2"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize]; +}; pub type __int8_t = ::std::os::raw::c_schar; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __int16_t = ::std::os::raw::c_short; @@ -828,26 +812,13 @@ pub type __u64 = ::std::os::raw::c_ulonglong; pub struct __kernel_fd_set { pub fds_bits: [::std::os::raw::c_ulong; 16usize], } -#[test] -fn bindgen_test_layout___kernel_fd_set() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fd_set>(), - 128usize, - "Size of __kernel_fd_set" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fd_set>(), - 8usize, - "Alignment of __kernel_fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fd_set::fds_bits" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fd_set"][::std::mem::size_of::<__kernel_fd_set>() - 128usize]; + ["Alignment of __kernel_fd_set"][::std::mem::align_of::<__kernel_fd_set>() - 8usize]; + ["Offset of field: __kernel_fd_set::fds_bits"] + [::std::mem::offset_of!(__kernel_fd_set, fds_bits) - 0usize]; +}; pub type __kernel_sighandler_t = ::std::option::Option; pub type __kernel_key_t = ::std::os::raw::c_int; @@ -875,26 +846,13 @@ pub type __kernel_ptrdiff_t = __kernel_long_t; pub struct __kernel_fsid_t { pub val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___kernel_fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fsid_t>(), - 8usize, - "Size of __kernel_fsid_t" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fsid_t>(), - 4usize, - "Alignment of __kernel_fsid_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fsid_t::val" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fsid_t"][::std::mem::size_of::<__kernel_fsid_t>() - 8usize]; + ["Alignment of __kernel_fsid_t"][::std::mem::align_of::<__kernel_fsid_t>() - 4usize]; + ["Offset of field: __kernel_fsid_t::val"] + [::std::mem::offset_of!(__kernel_fsid_t, val) - 0usize]; +}; pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; pub type __kernel_old_time_t = __kernel_long_t; @@ -1298,67 +1256,32 @@ pub struct JavaVMAttachArgs { pub name: *const ::std::os::raw::c_char, pub group: jobject, } -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of JavaVMAttachArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of JavaVMAttachArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMAttachArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMAttachArgs::name" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr as usize }, - 16usize, - "Offset of field: JavaVMAttachArgs::group" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMAttachArgs"][::std::mem::size_of::() - 24usize]; + ["Alignment of JavaVMAttachArgs"][::std::mem::align_of::() - 8usize]; + ["Offset of field: JavaVMAttachArgs::version"] + [::std::mem::offset_of!(JavaVMAttachArgs, version) - 0usize]; + ["Offset of field: JavaVMAttachArgs::name"] + [::std::mem::offset_of!(JavaVMAttachArgs, name) - 8usize]; + ["Offset of field: JavaVMAttachArgs::group"] + [::std::mem::offset_of!(JavaVMAttachArgs, group) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JavaVMOption { pub optionString: *const ::std::os::raw::c_char, pub extraInfo: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_JavaVMOption() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of JavaVMOption" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of JavaVMOption" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).optionString) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMOption::optionString" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMOption::extraInfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMOption"][::std::mem::size_of::() - 16usize]; + ["Alignment of JavaVMOption"][::std::mem::align_of::() - 8usize]; + ["Offset of field: JavaVMOption::optionString"] + [::std::mem::offset_of!(JavaVMOption, optionString) - 0usize]; + ["Offset of field: JavaVMOption::extraInfo"] + [::std::mem::offset_of!(JavaVMOption, extraInfo) - 8usize]; +}; #[repr(C)] pub struct JavaVMInitArgs { pub version: jint, @@ -1366,41 +1289,19 @@ pub struct JavaVMInitArgs { pub options: *mut JavaVMOption, pub ignoreUnrecognized: jboolean, } -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of JavaVMInitArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of JavaVMInitArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMInitArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMInitArgs::nOptions" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMInitArgs::options" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, - 16usize, - "Offset of field: JavaVMInitArgs::ignoreUnrecognized" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMInitArgs"][::std::mem::size_of::() - 24usize]; + ["Alignment of JavaVMInitArgs"][::std::mem::align_of::() - 8usize]; + ["Offset of field: JavaVMInitArgs::version"] + [::std::mem::offset_of!(JavaVMInitArgs, version) - 0usize]; + ["Offset of field: JavaVMInitArgs::nOptions"] + [::std::mem::offset_of!(JavaVMInitArgs, nOptions) - 4usize]; + ["Offset of field: JavaVMInitArgs::options"] + [::std::mem::offset_of!(JavaVMInitArgs, options) - 8usize]; + ["Offset of field: JavaVMInitArgs::ignoreUnrecognized"] + [::std::mem::offset_of!(JavaVMInitArgs, ignoreUnrecognized) - 16usize]; +}; pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; @@ -1583,226 +1484,226 @@ pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getDeviceId(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_release(event: *const AInputEvent); } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getFlags(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getKeyCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getScanCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getMetaState(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getRepeatCount(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getDownTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getMetaState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getButtonState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEdgeFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getDownTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEventTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, history_index: usize, ) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, @@ -1810,13 +1711,13 @@ extern "C" { history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; } #[repr(C)] @@ -1824,7 +1725,7 @@ extern "C" { pub struct AInputQueue { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_attachLooper( queue: *mut AInputQueue, looper: *mut ALooper, @@ -1833,26 +1734,26 @@ extern "C" { data: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_detachLooper(queue: *mut AInputQueue); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_hasEvents(queue: *mut AInputQueue) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_getEvent(queue: *mut AInputQueue, outEvent: *mut *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_preDispatchEvent(queue: *mut AInputQueue, event: *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_finishEvent( queue: *mut AInputQueue, event: *mut AInputEvent, handled: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; } #[repr(C)] @@ -1861,59 +1762,41 @@ pub struct imaxdiv_t { pub quot: intmax_t, pub rem: intmax_t, } -#[test] -fn bindgen_test_layout_imaxdiv_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of imaxdiv_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of imaxdiv_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, - 0usize, - "Offset of field: imaxdiv_t::quot" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, - 8usize, - "Offset of field: imaxdiv_t::rem" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of imaxdiv_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of imaxdiv_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: imaxdiv_t::quot"][::std::mem::offset_of!(imaxdiv_t, quot) - 0usize]; + ["Offset of field: imaxdiv_t::rem"][::std::mem::offset_of!(imaxdiv_t, rem) - 8usize]; +}; +unsafe extern "C" { pub fn imaxabs(__i: intmax_t) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn imaxdiv(__numerator: intmax_t, __denominator: intmax_t) -> imaxdiv_t; } -extern "C" { +unsafe extern "C" { pub fn strtoimax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn strtoumax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> uintmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoimax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoumax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, @@ -2084,61 +1967,27 @@ pub struct AHardwareBuffer_Desc { pub rfu0: u32, pub rfu1: u64, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Desc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - "Size of AHardwareBuffer_Desc" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of AHardwareBuffer_Desc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Desc::width" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Desc::height" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Desc::layers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 12usize, - "Offset of field: AHardwareBuffer_Desc::format" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, - 16usize, - "Offset of field: AHardwareBuffer_Desc::usage" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, - 24usize, - "Offset of field: AHardwareBuffer_Desc::stride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, - 28usize, - "Offset of field: AHardwareBuffer_Desc::rfu0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, - 32usize, - "Offset of field: AHardwareBuffer_Desc::rfu1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Desc"][::std::mem::size_of::() - 40usize]; + ["Alignment of AHardwareBuffer_Desc"][::std::mem::align_of::() - 8usize]; + ["Offset of field: AHardwareBuffer_Desc::width"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, width) - 0usize]; + ["Offset of field: AHardwareBuffer_Desc::height"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, height) - 4usize]; + ["Offset of field: AHardwareBuffer_Desc::layers"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, layers) - 8usize]; + ["Offset of field: AHardwareBuffer_Desc::format"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, format) - 12usize]; + ["Offset of field: AHardwareBuffer_Desc::usage"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, usage) - 16usize]; + ["Offset of field: AHardwareBuffer_Desc::stride"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, stride) - 24usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu0"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu0) - 28usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu1"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu1) - 32usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Plane { @@ -2146,93 +1995,58 @@ pub struct AHardwareBuffer_Plane { pub pixelStride: u32, pub rowStride: u32, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Plane() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of AHardwareBuffer_Plane" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of AHardwareBuffer_Plane" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Plane::data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Plane::pixelStride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, - 12usize, - "Offset of field: AHardwareBuffer_Plane::rowStride" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Plane"][::std::mem::size_of::() - 16usize]; + ["Alignment of AHardwareBuffer_Plane"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: AHardwareBuffer_Plane::data"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, data) - 0usize]; + ["Offset of field: AHardwareBuffer_Plane::pixelStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, pixelStride) - 8usize]; + ["Offset of field: AHardwareBuffer_Plane::rowStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, rowStride) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Planes { pub planeCount: u32, pub planes: [AHardwareBuffer_Plane; 4usize], } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Planes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 72usize, - "Size of AHardwareBuffer_Planes" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of AHardwareBuffer_Planes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Planes::planeCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Planes::planes" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Planes"][::std::mem::size_of::() - 72usize]; + ["Alignment of AHardwareBuffer_Planes"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: AHardwareBuffer_Planes::planeCount"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planeCount) - 0usize]; + ["Offset of field: AHardwareBuffer_Planes::planes"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planes) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_allocate( desc: *const AHardwareBuffer_Desc, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_acquire(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_release(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_describe( buffer: *const AHardwareBuffer, outDesc: *mut AHardwareBuffer_Desc, ); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lock( buffer: *mut AHardwareBuffer, usage: u64, @@ -2241,25 +2055,25 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, fence: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_sendHandleToUnixSocket( buffer: *const AHardwareBuffer, socketFd: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_recvHandleFromUnixSocket( socketFd: ::std::os::raw::c_int, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockPlanes( buffer: *mut AHardwareBuffer, usage: u64, @@ -2268,10 +2082,10 @@ extern "C" { outPlanes: *mut AHardwareBuffer_Planes, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockAndGetInfo( buffer: *mut AHardwareBuffer, usage: u64, @@ -2282,7 +2096,7 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_getId( buffer: *const AHardwareBuffer, outId: *mut u64, @@ -2298,56 +2112,32 @@ pub struct GameActivityPointerAxes { pub rawX: f32, pub rawY: f32, } -#[test] -fn bindgen_test_layout_GameActivityPointerAxes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 208usize, - "Size of GameActivityPointerAxes" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityPointerAxes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityPointerAxes::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityPointerAxes::toolType" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityPointerAxes::axisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, - 200usize, - "Offset of field: GameActivityPointerAxes::rawX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, - 204usize, - "Offset of field: GameActivityPointerAxes::rawY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityPointerAxes"] + [::std::mem::size_of::() - 208usize]; + ["Alignment of GameActivityPointerAxes"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityPointerAxes::id"] + [::std::mem::offset_of!(GameActivityPointerAxes, id) - 0usize]; + ["Offset of field: GameActivityPointerAxes::toolType"] + [::std::mem::offset_of!(GameActivityPointerAxes, toolType) - 4usize]; + ["Offset of field: GameActivityPointerAxes::axisValues"] + [::std::mem::offset_of!(GameActivityPointerAxes, axisValues) - 8usize]; + ["Offset of field: GameActivityPointerAxes::rawX"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawX) - 200usize]; + ["Offset of field: GameActivityPointerAxes::rawY"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawY) - 204usize]; +}; +unsafe extern "C" { #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_enableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_disableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] pub fn GameActivityPointerAxes_getAxisValue( pointerInfo: *const GameActivityPointerAxes, @@ -2378,118 +2168,52 @@ pub struct GameActivityMotionEvent { pub precisionX: f32, pub precisionY: f32, } -#[test] -fn bindgen_test_layout_GameActivityMotionEvent() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 1760usize, - "Size of GameActivityMotionEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityMotionEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityMotionEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityMotionEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityMotionEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityMotionEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityMotionEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityMotionEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityMotionEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityMotionEvent::actionButton" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityMotionEvent::buttonState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityMotionEvent::classification" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityMotionEvent::edgeFlags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityMotionEvent::pointerCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, - 60usize, - "Offset of field: GameActivityMotionEvent::pointers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, - 1724usize, - "Offset of field: GameActivityMotionEvent::historySize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, - 1728usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesMillis" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, - 1736usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesNanos" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, - 1744usize, - "Offset of field: GameActivityMotionEvent::historicalAxisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, - 1752usize, - "Offset of field: GameActivityMotionEvent::precisionX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, - 1756usize, - "Offset of field: GameActivityMotionEvent::precisionY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityMotionEvent"] + [::std::mem::size_of::() - 1760usize]; + ["Alignment of GameActivityMotionEvent"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityMotionEvent::deviceId"] + [::std::mem::offset_of!(GameActivityMotionEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityMotionEvent::source"] + [::std::mem::offset_of!(GameActivityMotionEvent, source) - 4usize]; + ["Offset of field: GameActivityMotionEvent::action"] + [::std::mem::offset_of!(GameActivityMotionEvent, action) - 8usize]; + ["Offset of field: GameActivityMotionEvent::eventTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, eventTime) - 16usize]; + ["Offset of field: GameActivityMotionEvent::downTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, downTime) - 24usize]; + ["Offset of field: GameActivityMotionEvent::flags"] + [::std::mem::offset_of!(GameActivityMotionEvent, flags) - 32usize]; + ["Offset of field: GameActivityMotionEvent::metaState"] + [::std::mem::offset_of!(GameActivityMotionEvent, metaState) - 36usize]; + ["Offset of field: GameActivityMotionEvent::actionButton"] + [::std::mem::offset_of!(GameActivityMotionEvent, actionButton) - 40usize]; + ["Offset of field: GameActivityMotionEvent::buttonState"] + [::std::mem::offset_of!(GameActivityMotionEvent, buttonState) - 44usize]; + ["Offset of field: GameActivityMotionEvent::classification"] + [::std::mem::offset_of!(GameActivityMotionEvent, classification) - 48usize]; + ["Offset of field: GameActivityMotionEvent::edgeFlags"] + [::std::mem::offset_of!(GameActivityMotionEvent, edgeFlags) - 52usize]; + ["Offset of field: GameActivityMotionEvent::pointerCount"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointerCount) - 56usize]; + ["Offset of field: GameActivityMotionEvent::pointers"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointers) - 60usize]; + ["Offset of field: GameActivityMotionEvent::historySize"] + [::std::mem::offset_of!(GameActivityMotionEvent, historySize) - 1724usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesMillis"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesMillis) - 1728usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesNanos"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesNanos) - 1736usize]; + ["Offset of field: GameActivityMotionEvent::historicalAxisValues"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalAxisValues) - 1744usize]; + ["Offset of field: GameActivityMotionEvent::precisionX"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionX) - 1752usize]; + ["Offset of field: GameActivityMotionEvent::precisionY"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionY) - 1756usize]; +}; +unsafe extern "C" { pub fn GameActivityMotionEvent_getHistoricalAxisValue( event: *const GameActivityMotionEvent, axis: ::std::os::raw::c_int, @@ -2497,7 +2221,7 @@ extern "C" { historyPos: ::std::os::raw::c_int, ) -> f32; } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } @@ -2517,76 +2241,33 @@ pub struct GameActivityKeyEvent { pub keyCode: i32, pub scanCode: i32, } -#[test] -fn bindgen_test_layout_GameActivityKeyEvent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - "Size of GameActivityKeyEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityKeyEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityKeyEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityKeyEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityKeyEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityKeyEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityKeyEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityKeyEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityKeyEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityKeyEvent::modifiers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityKeyEvent::repeatCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityKeyEvent::keyCode" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityKeyEvent::scanCode" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityKeyEvent"][::std::mem::size_of::() - 56usize]; + ["Alignment of GameActivityKeyEvent"][::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityKeyEvent::deviceId"] + [::std::mem::offset_of!(GameActivityKeyEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityKeyEvent::source"] + [::std::mem::offset_of!(GameActivityKeyEvent, source) - 4usize]; + ["Offset of field: GameActivityKeyEvent::action"] + [::std::mem::offset_of!(GameActivityKeyEvent, action) - 8usize]; + ["Offset of field: GameActivityKeyEvent::eventTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, eventTime) - 16usize]; + ["Offset of field: GameActivityKeyEvent::downTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, downTime) - 24usize]; + ["Offset of field: GameActivityKeyEvent::flags"] + [::std::mem::offset_of!(GameActivityKeyEvent, flags) - 32usize]; + ["Offset of field: GameActivityKeyEvent::metaState"] + [::std::mem::offset_of!(GameActivityKeyEvent, metaState) - 36usize]; + ["Offset of field: GameActivityKeyEvent::modifiers"] + [::std::mem::offset_of!(GameActivityKeyEvent, modifiers) - 40usize]; + ["Offset of field: GameActivityKeyEvent::repeatCount"] + [::std::mem::offset_of!(GameActivityKeyEvent, repeatCount) - 44usize]; + ["Offset of field: GameActivityKeyEvent::keyCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, keyCode) - 48usize]; + ["Offset of field: GameActivityKeyEvent::scanCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, scanCode) - 52usize]; +}; #[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2596,31 +2277,15 @@ pub struct GameTextInputSpan { #[doc = " The end of the region (exclusive)."] pub end: i32, } -#[test] -fn bindgen_test_layout_GameTextInputSpan() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of GameTextInputSpan" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameTextInputSpan" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputSpan::start" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, - 4usize, - "Offset of field: GameTextInputSpan::end" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputSpan"][::std::mem::size_of::() - 8usize]; + ["Alignment of GameTextInputSpan"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameTextInputSpan::start"] + [::std::mem::offset_of!(GameTextInputSpan, start) - 0usize]; + ["Offset of field: GameTextInputSpan::end"] + [::std::mem::offset_of!(GameTextInputSpan, end) - 4usize]; +}; pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; #[doc = " Values with special meaning in a GameTextInputSpan."] pub type GameTextInputSpanFlag = i32; @@ -2637,41 +2302,19 @@ pub struct GameTextInputState { #[doc = " A composing region defined on the text."] pub composingRegion: GameTextInputSpan, } -#[test] -fn bindgen_test_layout_GameTextInputState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of GameTextInputState" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameTextInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputState::text_UTF8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, - 8usize, - "Offset of field: GameTextInputState::text_length" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, - 12usize, - "Offset of field: GameTextInputState::selection" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, - 20usize, - "Offset of field: GameTextInputState::composingRegion" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputState"][::std::mem::size_of::() - 32usize]; + ["Alignment of GameTextInputState"][::std::mem::align_of::() - 8usize]; + ["Offset of field: GameTextInputState::text_UTF8"] + [::std::mem::offset_of!(GameTextInputState, text_UTF8) - 0usize]; + ["Offset of field: GameTextInputState::text_length"] + [::std::mem::offset_of!(GameTextInputState, text_length) - 8usize]; + ["Offset of field: GameTextInputState::selection"] + [::std::mem::offset_of!(GameTextInputState, selection) - 12usize]; + ["Offset of field: GameTextInputState::composingRegion"] + [::std::mem::offset_of!(GameTextInputState, composingRegion) - 20usize]; +}; #[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] pub type GameTextInputGetStateCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), @@ -2681,19 +2324,19 @@ pub type GameTextInputGetStateCallback = ::std::option::Option< pub struct GameTextInput { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; } -extern "C" { +unsafe extern "C" { #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_destroy(input: *mut GameTextInput); } @@ -2702,7 +2345,7 @@ pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_showIme."] pub type ShowImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); } @@ -2711,15 +2354,15 @@ pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_hideIme."] pub type HideImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_restartInput(input: *mut GameTextInput); } -extern "C" { +unsafe extern "C" { #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] pub fn GameTextInput_getState( input: *mut GameTextInput, @@ -2727,7 +2370,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); } @@ -2738,7 +2381,7 @@ pub type GameTextInputEventCallback = ::std::option::Option< current_state: *const GameTextInputState, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback.\n This function is deprecated. Don't perform any complex processing inside\n the callback other than copying the state variable. Using any synchronization\n primitives inside this callback may cause a deadlock."] pub fn GameTextInput_setEventCallback( input: *mut GameTextInput, @@ -2750,7 +2393,7 @@ extern "C" { pub type GameTextInputImeInsetsCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] pub fn GameTextInput_setImeInsetsCallback( input: *mut GameTextInput, @@ -2758,22 +2401,22 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] pub fn GameTextInputState_toJava( input: *const GameTextInput, state: *const GameTextInputState, ) -> jobject; } -extern "C" { +unsafe extern "C" { #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] pub fn GameTextInputState_fromJava( input: *const GameTextInput, @@ -2944,71 +2587,29 @@ pub struct GameActivity { #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] pub obbPath: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_GameActivity() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 80usize, - "Size of GameActivity" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivity::callbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivity::vm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivity::env" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivity::javaGameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivity::internalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivity::externalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivity::sdkVersion" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivity::instance" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, - 64usize, - "Offset of field: GameActivity::assetManager" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, - 72usize, - "Offset of field: GameActivity::obbPath" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivity"][::std::mem::size_of::() - 80usize]; + ["Alignment of GameActivity"][::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivity::callbacks"] + [::std::mem::offset_of!(GameActivity, callbacks) - 0usize]; + ["Offset of field: GameActivity::vm"][::std::mem::offset_of!(GameActivity, vm) - 8usize]; + ["Offset of field: GameActivity::env"][::std::mem::offset_of!(GameActivity, env) - 16usize]; + ["Offset of field: GameActivity::javaGameActivity"] + [::std::mem::offset_of!(GameActivity, javaGameActivity) - 24usize]; + ["Offset of field: GameActivity::internalDataPath"] + [::std::mem::offset_of!(GameActivity, internalDataPath) - 32usize]; + ["Offset of field: GameActivity::externalDataPath"] + [::std::mem::offset_of!(GameActivity, externalDataPath) - 40usize]; + ["Offset of field: GameActivity::sdkVersion"] + [::std::mem::offset_of!(GameActivity, sdkVersion) - 48usize]; + ["Offset of field: GameActivity::instance"] + [::std::mem::offset_of!(GameActivity, instance) - 56usize]; + ["Offset of field: GameActivity::assetManager"] + [::std::mem::offset_of!(GameActivity, assetManager) - 64usize]; + ["Offset of field: GameActivity::obbPath"] + [::std::mem::offset_of!(GameActivity, obbPath) - 72usize]; +}; #[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( @@ -3110,129 +2711,56 @@ pub struct GameActivityCallbacks { unsafe extern "C" fn(activity: *mut GameActivity, action: ::std::os::raw::c_int) -> bool, >, } -#[test] -fn bindgen_test_layout_GameActivityCallbacks() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 168usize, - "Size of GameActivityCallbacks" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityCallbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityCallbacks::onStart" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityCallbacks::onResume" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityCallbacks::onSaveInstanceState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityCallbacks::onPause" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityCallbacks::onStop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityCallbacks::onDestroy" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityCallbacks::onWindowFocusChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityCallbacks::onNativeWindowCreated" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, - 64usize, - "Offset of field: GameActivityCallbacks::onNativeWindowResized" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, - 72usize, - "Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, - 80usize, - "Offset of field: GameActivityCallbacks::onNativeWindowDestroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, - 88usize, - "Offset of field: GameActivityCallbacks::onConfigurationChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, - 96usize, - "Offset of field: GameActivityCallbacks::onTrimMemory" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, - 104usize, - "Offset of field: GameActivityCallbacks::onTouchEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, - 112usize, - "Offset of field: GameActivityCallbacks::onKeyDown" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, - 120usize, - "Offset of field: GameActivityCallbacks::onKeyUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, - 128usize, - "Offset of field: GameActivityCallbacks::onTextInputEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, - 136usize, - "Offset of field: GameActivityCallbacks::onWindowInsetsChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, - 144usize, - "Offset of field: GameActivityCallbacks::onContentRectChanged" - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).onSoftwareKeyboardVisibilityChanged) as usize - ptr as usize - }, - 152usize, - "Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onEditorAction) as usize - ptr as usize }, - 160usize, - "Offset of field: GameActivityCallbacks::onEditorAction" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityCallbacks"][::std::mem::size_of::() - 168usize]; + ["Alignment of GameActivityCallbacks"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityCallbacks::onStart"] + [::std::mem::offset_of!(GameActivityCallbacks, onStart) - 0usize]; + ["Offset of field: GameActivityCallbacks::onResume"] + [::std::mem::offset_of!(GameActivityCallbacks, onResume) - 8usize]; + ["Offset of field: GameActivityCallbacks::onSaveInstanceState"] + [::std::mem::offset_of!(GameActivityCallbacks, onSaveInstanceState) - 16usize]; + ["Offset of field: GameActivityCallbacks::onPause"] + [::std::mem::offset_of!(GameActivityCallbacks, onPause) - 24usize]; + ["Offset of field: GameActivityCallbacks::onStop"] + [::std::mem::offset_of!(GameActivityCallbacks, onStop) - 32usize]; + ["Offset of field: GameActivityCallbacks::onDestroy"] + [::std::mem::offset_of!(GameActivityCallbacks, onDestroy) - 40usize]; + ["Offset of field: GameActivityCallbacks::onWindowFocusChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowFocusChanged) - 48usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowCreated"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowCreated) - 56usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowResized"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowResized) - 64usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowRedrawNeeded) - 72usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowDestroyed"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowDestroyed) - 80usize]; + ["Offset of field: GameActivityCallbacks::onConfigurationChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onConfigurationChanged) - 88usize]; + ["Offset of field: GameActivityCallbacks::onTrimMemory"] + [::std::mem::offset_of!(GameActivityCallbacks, onTrimMemory) - 96usize]; + ["Offset of field: GameActivityCallbacks::onTouchEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTouchEvent) - 104usize]; + ["Offset of field: GameActivityCallbacks::onKeyDown"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyDown) - 112usize]; + ["Offset of field: GameActivityCallbacks::onKeyUp"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyUp) - 120usize]; + ["Offset of field: GameActivityCallbacks::onTextInputEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTextInputEvent) - 128usize]; + ["Offset of field: GameActivityCallbacks::onWindowInsetsChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowInsetsChanged) - 136usize]; + ["Offset of field: GameActivityCallbacks::onContentRectChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onContentRectChanged) - 144usize]; + ["Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged"][::std::mem::offset_of!( + GameActivityCallbacks, + onSoftwareKeyboardVisibilityChanged + ) - 152usize]; + ["Offset of field: GameActivityCallbacks::onEditorAction"] + [::std::mem::offset_of!(GameActivityCallbacks, onEditorAction) - 160usize]; +}; #[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( @@ -3241,7 +2769,7 @@ pub type GameActivity_createFunc = ::std::option::Option< savedStateSize: usize, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } @@ -3311,7 +2839,7 @@ pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; #[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, @@ -3327,22 +2855,22 @@ pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; #[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = u8; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n Note that this method can be called from *any* thread; it will send a message\n to the main thread of the process where the Java call will take place."] pub fn GameActivity_restartInput(activity: *mut GameActivity); } -extern "C" { +unsafe extern "C" { #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, @@ -3350,7 +2878,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } @@ -3362,11 +2890,11 @@ pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS GameActivityHideSoftInputFlags = 2; #[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = u16; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, @@ -3374,11 +2902,11 @@ extern "C" { insets: *mut ARect, ); } -extern "C" { +unsafe extern "C" { #[doc = " Tells whether the software keyboard is visible or not."] pub fn GameActivity_isSoftwareKeyboardVisible(activity: *mut GameActivity) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note: currently only TYPE_NULL AND TYPE_CLASS_NUMBER are supported."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, @@ -3387,70 +2915,70 @@ extern "C" { imeOptions: GameTextInputImeOptions, ); } -extern "C" { +unsafe extern "C" { #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontWeightAdjustment( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocalesCount(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getSmallestScreenWidthDp( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " The functions below return Java locale information.\n\n In simple cases there will be just one locale, but it's possible tha\n there are more than one locale objects. Users are encouraged to write code\n that handles all locales and not just the first one.\n\n The functions in the block below return string values in the provided buffer.\n Return value is zero if there were no errors, otherwise it's non-zero.\n If the return value is zero, `dst` will contain a null-terminated string:\n strlen(dst) <= dst_size - 1.\n If the return value is non-zero, the content of dst is undefined.\n\n Parameters:\n\n dst, dst_size: define a receiver buffer. Locale string can be something\n short like \"EN/EN\", but it may be longer. You should be safe with a buffer\n size of 256 bytes.\n\n If the buffer is too small, ENOBUFS is returned. Try allocating a larger\n buffer in this case.\n\n localeIdx must be between 0 and the value of GameActivity_getLocalesCount().\n If localeIdx is out of range, EINVAL is returned.\n\n Refer to Java documentation of locales for more information."] pub fn GameActivity_getLocaleLanguage( dst: *mut ::std::os::raw::c_char, @@ -3459,7 +2987,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleScript( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3467,7 +2995,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleCountry( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3475,7 +3003,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleVariant( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3577,32 +3105,14 @@ pub struct pollfd { pub events: ::std::os::raw::c_short, pub revents: ::std::os::raw::c_short, } -#[test] -fn bindgen_test_layout_pollfd() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of pollfd"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of pollfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, - 0usize, - "Offset of field: pollfd::fd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, - 4usize, - "Offset of field: pollfd::events" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, - 6usize, - "Offset of field: pollfd::revents" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pollfd"][::std::mem::size_of::() - 8usize]; + ["Alignment of pollfd"][::std::mem::align_of::() - 4usize]; + ["Offset of field: pollfd::fd"][::std::mem::offset_of!(pollfd, fd) - 0usize]; + ["Offset of field: pollfd::events"][::std::mem::offset_of!(pollfd, events) - 4usize]; + ["Offset of field: pollfd::revents"][::std::mem::offset_of!(pollfd, revents) - 6usize]; +}; #[repr(C)] #[repr(align(16))] #[derive(Debug, Copy, Clone)] @@ -3615,82 +3125,32 @@ pub struct sigcontext { pub __bindgen_padding_0: [u8; 8usize], pub __reserved: [__u8; 4096usize], } -#[test] -fn bindgen_test_layout_sigcontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4384usize, - "Size of sigcontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - "Alignment of sigcontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fault_address) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext::fault_address" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext::regs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, - 256usize, - "Offset of field: sigcontext::sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pc) as usize - ptr as usize }, - 264usize, - "Offset of field: sigcontext::pc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pstate) as usize - ptr as usize }, - 272usize, - "Offset of field: sigcontext::pstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, - 288usize, - "Offset of field: sigcontext::__reserved" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext"][::std::mem::size_of::() - 4384usize]; + ["Alignment of sigcontext"][::std::mem::align_of::() - 16usize]; + ["Offset of field: sigcontext::fault_address"] + [::std::mem::offset_of!(sigcontext, fault_address) - 0usize]; + ["Offset of field: sigcontext::regs"][::std::mem::offset_of!(sigcontext, regs) - 8usize]; + ["Offset of field: sigcontext::sp"][::std::mem::offset_of!(sigcontext, sp) - 256usize]; + ["Offset of field: sigcontext::pc"][::std::mem::offset_of!(sigcontext, pc) - 264usize]; + ["Offset of field: sigcontext::pstate"][::std::mem::offset_of!(sigcontext, pstate) - 272usize]; + ["Offset of field: sigcontext::__reserved"] + [::std::mem::offset_of!(sigcontext, __reserved) - 288usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _aarch64_ctx { pub magic: __u32, pub size: __u32, } -#[test] -fn bindgen_test_layout__aarch64_ctx() { - const UNINIT: ::std::mem::MaybeUninit<_aarch64_ctx> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_aarch64_ctx>(), - 8usize, - "Size of _aarch64_ctx" - ); - assert_eq!( - ::std::mem::align_of::<_aarch64_ctx>(), - 4usize, - "Alignment of _aarch64_ctx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 0usize, - "Offset of field: _aarch64_ctx::magic" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 4usize, - "Offset of field: _aarch64_ctx::size" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _aarch64_ctx"][::std::mem::size_of::<_aarch64_ctx>() - 8usize]; + ["Alignment of _aarch64_ctx"][::std::mem::align_of::<_aarch64_ctx>() - 4usize]; + ["Offset of field: _aarch64_ctx::magic"][::std::mem::offset_of!(_aarch64_ctx, magic) - 0usize]; + ["Offset of field: _aarch64_ctx::size"][::std::mem::offset_of!(_aarch64_ctx, size) - 4usize]; +}; #[repr(C)] #[repr(align(16))] #[derive(Debug, Copy, Clone)] @@ -3700,72 +3160,32 @@ pub struct fpsimd_context { pub fpcr: __u32, pub vregs: [__uint128_t; 32usize], } -#[test] -fn bindgen_test_layout_fpsimd_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 528usize, - "Size of fpsimd_context" - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - "Alignment of fpsimd_context" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - "Offset of field: fpsimd_context::head" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpsr) as usize - ptr as usize }, - 8usize, - "Offset of field: fpsimd_context::fpsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpcr) as usize - ptr as usize }, - 12usize, - "Offset of field: fpsimd_context::fpcr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vregs) as usize - ptr as usize }, - 16usize, - "Offset of field: fpsimd_context::vregs" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of fpsimd_context"][::std::mem::size_of::() - 528usize]; + ["Alignment of fpsimd_context"][::std::mem::align_of::() - 16usize]; + ["Offset of field: fpsimd_context::head"] + [::std::mem::offset_of!(fpsimd_context, head) - 0usize]; + ["Offset of field: fpsimd_context::fpsr"] + [::std::mem::offset_of!(fpsimd_context, fpsr) - 8usize]; + ["Offset of field: fpsimd_context::fpcr"] + [::std::mem::offset_of!(fpsimd_context, fpcr) - 12usize]; + ["Offset of field: fpsimd_context::vregs"] + [::std::mem::offset_of!(fpsimd_context, vregs) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct esr_context { pub head: _aarch64_ctx, pub esr: __u64, } -#[test] -fn bindgen_test_layout_esr_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of esr_context" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of esr_context" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - "Offset of field: esr_context::head" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).esr) as usize - ptr as usize }, - 8usize, - "Offset of field: esr_context::esr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of esr_context"][::std::mem::size_of::() - 16usize]; + ["Alignment of esr_context"][::std::mem::align_of::() - 8usize]; + ["Offset of field: esr_context::head"][::std::mem::offset_of!(esr_context, head) - 0usize]; + ["Offset of field: esr_context::esr"][::std::mem::offset_of!(esr_context, esr) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct extra_context { @@ -3774,41 +3194,17 @@ pub struct extra_context { pub size: __u32, pub __reserved: [__u32; 3usize], } -#[test] -fn bindgen_test_layout_extra_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of extra_context" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of extra_context" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - "Offset of field: extra_context::head" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).datap) as usize - ptr as usize }, - 8usize, - "Offset of field: extra_context::datap" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - "Offset of field: extra_context::size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, - 20usize, - "Offset of field: extra_context::__reserved" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of extra_context"][::std::mem::size_of::() - 32usize]; + ["Alignment of extra_context"][::std::mem::align_of::() - 8usize]; + ["Offset of field: extra_context::head"][::std::mem::offset_of!(extra_context, head) - 0usize]; + ["Offset of field: extra_context::datap"] + [::std::mem::offset_of!(extra_context, datap) - 8usize]; + ["Offset of field: extra_context::size"][::std::mem::offset_of!(extra_context, size) - 16usize]; + ["Offset of field: extra_context::__reserved"] + [::std::mem::offset_of!(extra_context, __reserved) - 20usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sve_context { @@ -3817,72 +3213,31 @@ pub struct sve_context { pub flags: __u16, pub __reserved: [__u16; 2usize], } -#[test] -fn bindgen_test_layout_sve_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of sve_context" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sve_context" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - "Offset of field: sve_context::head" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vl) as usize - ptr as usize }, - 8usize, - "Offset of field: sve_context::vl" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 10usize, - "Offset of field: sve_context::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, - 12usize, - "Offset of field: sve_context::__reserved" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sve_context"][::std::mem::size_of::() - 16usize]; + ["Alignment of sve_context"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sve_context::head"][::std::mem::offset_of!(sve_context, head) - 0usize]; + ["Offset of field: sve_context::vl"][::std::mem::offset_of!(sve_context, vl) - 8usize]; + ["Offset of field: sve_context::flags"][::std::mem::offset_of!(sve_context, flags) - 10usize]; + ["Offset of field: sve_context::__reserved"] + [::std::mem::offset_of!(sve_context, __reserved) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct tpidr2_context { pub head: _aarch64_ctx, pub tpidr2: __u64, } -#[test] -fn bindgen_test_layout_tpidr2_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of tpidr2_context" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of tpidr2_context" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - "Offset of field: tpidr2_context::head" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tpidr2) as usize - ptr as usize }, - 8usize, - "Offset of field: tpidr2_context::tpidr2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of tpidr2_context"][::std::mem::size_of::() - 16usize]; + ["Alignment of tpidr2_context"][::std::mem::align_of::() - 8usize]; + ["Offset of field: tpidr2_context::head"] + [::std::mem::offset_of!(tpidr2_context, head) - 0usize]; + ["Offset of field: tpidr2_context::tpidr2"] + [::std::mem::offset_of!(tpidr2_context, tpidr2) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct za_context { @@ -3890,36 +3245,15 @@ pub struct za_context { pub vl: __u16, pub __reserved: [__u16; 3usize], } -#[test] -fn bindgen_test_layout_za_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of za_context" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of za_context" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - "Offset of field: za_context::head" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vl) as usize - ptr as usize }, - 8usize, - "Offset of field: za_context::vl" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, - 10usize, - "Offset of field: za_context::__reserved" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of za_context"][::std::mem::size_of::() - 16usize]; + ["Alignment of za_context"][::std::mem::align_of::() - 4usize]; + ["Offset of field: za_context::head"][::std::mem::offset_of!(za_context, head) - 0usize]; + ["Offset of field: za_context::vl"][::std::mem::offset_of!(za_context, vl) - 8usize]; + ["Offset of field: za_context::__reserved"] + [::std::mem::offset_of!(za_context, __reserved) - 10usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct zt_context { @@ -3927,61 +3261,26 @@ pub struct zt_context { pub nregs: __u16, pub __reserved: [__u16; 3usize], } -#[test] -fn bindgen_test_layout_zt_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of zt_context" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of zt_context" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize }, - 0usize, - "Offset of field: zt_context::head" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nregs) as usize - ptr as usize }, - 8usize, - "Offset of field: zt_context::nregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, - 10usize, - "Offset of field: zt_context::__reserved" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of zt_context"][::std::mem::size_of::() - 16usize]; + ["Alignment of zt_context"][::std::mem::align_of::() - 4usize]; + ["Offset of field: zt_context::head"][::std::mem::offset_of!(zt_context, head) - 0usize]; + ["Offset of field: zt_context::nregs"][::std::mem::offset_of!(zt_context, nregs) - 8usize]; + ["Offset of field: zt_context::__reserved"] + [::std::mem::offset_of!(zt_context, __reserved) - 10usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigset_t { pub sig: [::std::os::raw::c_ulong; 1usize], } -#[test] -fn bindgen_test_layout_sigset_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigset_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigset_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sig) as usize - ptr as usize }, - 0usize, - "Offset of field: sigset_t::sig" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigset_t"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigset_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigset_t::sig"][::std::mem::offset_of!(sigset_t, sig) - 0usize]; +}; pub type old_sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -3995,41 +3294,19 @@ pub struct __kernel_sigaction { pub sa_restorer: __sigrestore_t, pub sa_mask: sigset_t, } -#[test] -fn bindgen_test_layout___kernel_sigaction() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sigaction>(), - 32usize, - "Size of __kernel_sigaction" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sigaction>(), - 8usize, - "Alignment of __kernel_sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 16usize, - "Offset of field: __kernel_sigaction::sa_restorer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 24usize, - "Offset of field: __kernel_sigaction::sa_mask" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sigaction"][::std::mem::size_of::<__kernel_sigaction>() - 32usize]; + ["Alignment of __kernel_sigaction"][::std::mem::align_of::<__kernel_sigaction>() - 8usize]; + ["Offset of field: __kernel_sigaction::sa_handler"] + [::std::mem::offset_of!(__kernel_sigaction, sa_handler) - 0usize]; + ["Offset of field: __kernel_sigaction::sa_flags"] + [::std::mem::offset_of!(__kernel_sigaction, sa_flags) - 8usize]; + ["Offset of field: __kernel_sigaction::sa_restorer"] + [::std::mem::offset_of!(__kernel_sigaction, sa_restorer) - 16usize]; + ["Offset of field: __kernel_sigaction::sa_mask"] + [::std::mem::offset_of!(__kernel_sigaction, sa_mask) - 24usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigaltstack { @@ -4037,36 +3314,16 @@ pub struct sigaltstack { pub ss_flags: ::std::os::raw::c_int, pub ss_size: __kernel_size_t, } -#[test] -fn bindgen_test_layout_sigaltstack() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of sigaltstack" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaltstack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaltstack::ss_sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaltstack::ss_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, - 16usize, - "Offset of field: sigaltstack::ss_size" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaltstack"][::std::mem::size_of::() - 24usize]; + ["Alignment of sigaltstack"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaltstack::ss_sp"][::std::mem::offset_of!(sigaltstack, ss_sp) - 0usize]; + ["Offset of field: sigaltstack::ss_flags"] + [::std::mem::offset_of!(sigaltstack, ss_flags) - 8usize]; + ["Offset of field: sigaltstack::ss_size"] + [::std::mem::offset_of!(sigaltstack, ss_size) - 16usize]; +}; pub type stack_t = sigaltstack; #[repr(C)] #[derive(Copy, Clone)] @@ -4074,27 +3331,13 @@ pub union sigval { pub sival_int: ::std::os::raw::c_int, pub sival_ptr: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of sigval"); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_int" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_ptr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigval"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigval::sival_int"][::std::mem::offset_of!(sigval, sival_int) - 0usize]; + ["Offset of field: sigval::sival_ptr"][::std::mem::offset_of!(sigval, sival_ptr) - 0usize]; +}; pub type sigval_t = sigval; #[repr(C)] #[derive(Copy, Clone)] @@ -4113,32 +3356,17 @@ pub struct __sifields__bindgen_ty_1 { pub _pid: __kernel_pid_t, pub _uid: __kernel_uid32_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_1>(), - 8usize, - "Size of __sifields__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_1::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_1::_uid" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_1>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_1::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_1::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _uid) - 4usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_2 { @@ -4147,42 +3375,21 @@ pub struct __sifields__bindgen_ty_2 { pub _sigval: sigval_t, pub _sys_private: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_2>(), - 24usize, - "Size of __sifields__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_2>(), - 8usize, - "Alignment of __sifields__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_2::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_2::_overrun" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_2::_sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_2::_sys_private" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_2>() - 24usize]; + ["Alignment of __sifields__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_2>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_2::_tid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _tid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_2::_overrun"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _overrun) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sigval) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sys_private"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sys_private) - 16usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_3 { @@ -4190,37 +3397,19 @@ pub struct __sifields__bindgen_ty_3 { pub _uid: __kernel_uid32_t, pub _sigval: sigval_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_3>(), - 16usize, - "Size of __sifields__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_3>(), - 8usize, - "Alignment of __sifields__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_3::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_3::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_3::_sigval" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_3>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_3>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_3::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_3::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_3::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _sigval) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_4 { @@ -4230,47 +3419,23 @@ pub struct __sifields__bindgen_ty_4 { pub _utime: __kernel_clock_t, pub _stime: __kernel_clock_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_4>(), - 32usize, - "Size of __sifields__bindgen_ty_4" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_4>(), - 8usize, - "Alignment of __sifields__bindgen_ty_4" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_4::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_4::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_4::_status" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_4::_utime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, - 24usize, - "Offset of field: __sifields__bindgen_ty_4::_stime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_4"] + [::std::mem::size_of::<__sifields__bindgen_ty_4>() - 32usize]; + ["Alignment of __sifields__bindgen_ty_4"] + [::std::mem::align_of::<__sifields__bindgen_ty_4>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_4::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_4::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_4::_status"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _status) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_4::_utime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _utime) - 16usize]; + ["Offset of field: __sifields__bindgen_ty_4::_stime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _stime) - 24usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_5 { @@ -4293,69 +3458,48 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { pub _lower: *mut ::std::os::raw::c_void, pub _upper: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 24usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 24usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _dummy_bnd + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _lower + ) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _upper + ) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { pub _dummy_pkey: [::std::os::raw::c_char; 8usize], pub _pkey: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _dummy_pkey + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _pkey + ) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { @@ -4363,131 +3507,68 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { pub _type: __u32, pub _flags: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 16usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._data) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._type) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 24usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5>(), - 32usize, - "Size of __sifields__bindgen_ty_5" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5::_addr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _data + ) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _type + ) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _flags + ) - 12usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 24usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _trapno) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_lsb) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_bnd) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_pkey) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _perf) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5"] + [::std::mem::size_of::<__sifields__bindgen_ty_5>() - 32usize]; + ["Alignment of __sifields__bindgen_ty_5"] + [::std::mem::align_of::<__sifields__bindgen_ty_5>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5::_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5, _addr) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_6 { pub _band: ::std::os::raw::c_long, pub _fd: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_6() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_6>(), - 16usize, - "Size of __sifields__bindgen_ty_6" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_6>(), - 8usize, - "Alignment of __sifields__bindgen_ty_6" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_6::_band" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_6::_fd" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_6"] + [::std::mem::size_of::<__sifields__bindgen_ty_6>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_6"] + [::std::mem::align_of::<__sifields__bindgen_ty_6>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_6::_band"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _band) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_6::_fd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _fd) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_7 { @@ -4495,87 +3576,34 @@ pub struct __sifields__bindgen_ty_7 { pub _syscall: ::std::os::raw::c_int, pub _arch: ::std::os::raw::c_uint, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_7() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_7>(), - 16usize, - "Size of __sifields__bindgen_ty_7" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_7>(), - 8usize, - "Alignment of __sifields__bindgen_ty_7" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_7::_call_addr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_7::_syscall" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_7::_arch" - ); -} -#[test] -fn bindgen_test_layout___sifields() { - const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields>(), - 32usize, - "Size of __sifields" - ); - assert_eq!( - ::std::mem::align_of::<__sifields>(), - 8usize, - "Alignment of __sifields" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_kill" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_timer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_rt" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigchld" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigfault" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigpoll" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigsys" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_7"] + [::std::mem::size_of::<__sifields__bindgen_ty_7>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_7"] + [::std::mem::align_of::<__sifields__bindgen_ty_7>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_7::_call_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _call_addr) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_7::_syscall"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _syscall) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_7::_arch"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _arch) - 12usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields"][::std::mem::size_of::<__sifields>() - 32usize]; + ["Alignment of __sifields"][::std::mem::align_of::<__sifields>() - 8usize]; + ["Offset of field: __sifields::_kill"][::std::mem::offset_of!(__sifields, _kill) - 0usize]; + ["Offset of field: __sifields::_timer"][::std::mem::offset_of!(__sifields, _timer) - 0usize]; + ["Offset of field: __sifields::_rt"][::std::mem::offset_of!(__sifields, _rt) - 0usize]; + ["Offset of field: __sifields::_sigchld"] + [::std::mem::offset_of!(__sifields, _sigchld) - 0usize]; + ["Offset of field: __sifields::_sigfault"] + [::std::mem::offset_of!(__sifields, _sigfault) - 0usize]; + ["Offset of field: __sifields::_sigpoll"] + [::std::mem::offset_of!(__sifields, _sigpoll) - 0usize]; + ["Offset of field: __sifields::_sigsys"][::std::mem::offset_of!(__sifields, _sigsys) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct siginfo { @@ -4595,76 +3623,34 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { pub si_code: ::std::os::raw::c_int, pub _sifields: __sifields, } -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - "Size of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, - 4usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, - 8usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, - 16usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields" - ); -} -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of siginfo__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1::_si_pad" - ); -} -#[test] -fn bindgen_test_layout_siginfo() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of siginfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 48usize]; + ["Alignment of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_signo) - 0usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_errno) - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_code) - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, _sifields) - 16usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1::_si_pad"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1, _si_pad) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo"][::std::mem::align_of::() - 8usize]; +}; pub type siginfo_t = siginfo; #[repr(C)] #[derive(Copy, Clone)] @@ -4687,98 +3673,41 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { pub _function: ::std::option::Option, pub _attribute: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, - 8usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute" - ); -} -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - "Size of sigevent__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigevent__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_pad" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_sigev_thread" - ); -} -#[test] -fn bindgen_test_layout_sigevent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - "Size of sigevent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigevent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent::sigev_value" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, - 8usize, - "Offset of field: sigevent::sigev_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, - 12usize, - "Offset of field: sigevent::sigev_notify" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, - 16usize, - "Offset of field: sigevent::_sigev_un" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _function) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _attribute) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1"][::std::mem::size_of::() - 48usize]; + ["Alignment of sigevent__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigevent__bindgen_ty_1::_pad"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _pad) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_tid"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _tid) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_sigev_thread"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _sigev_thread) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent"][::std::mem::size_of::() - 64usize]; + ["Alignment of sigevent"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigevent::sigev_value"] + [::std::mem::offset_of!(sigevent, sigev_value) - 0usize]; + ["Offset of field: sigevent::sigev_signo"] + [::std::mem::offset_of!(sigevent, sigev_signo) - 8usize]; + ["Offset of field: sigevent::sigev_notify"] + [::std::mem::offset_of!(sigevent, sigev_notify) - 12usize]; + ["Offset of field: sigevent::_sigev_un"][::std::mem::offset_of!(sigevent, _sigev_un) - 16usize]; +}; pub type sigevent_t = sigevent; pub type sig_atomic_t = ::std::os::raw::c_int; pub type sig_t = __sighandler_t; @@ -4804,62 +3733,25 @@ pub union sigaction__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigaction__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of sigaction" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 16usize, - "Offset of field: sigaction::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 24usize, - "Offset of field: sigaction::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigaction__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction"][::std::mem::size_of::() - 32usize]; + ["Alignment of sigaction"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction::sa_flags"][::std::mem::offset_of!(sigaction, sa_flags) - 0usize]; + ["Offset of field: sigaction::sa_mask"][::std::mem::offset_of!(sigaction, sa_mask) - 16usize]; + ["Offset of field: sigaction::sa_restorer"] + [::std::mem::offset_of!(sigaction, sa_restorer) - 24usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct sigaction64 { @@ -4880,93 +3772,41 @@ pub union sigaction64__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction64__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigaction64__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction64__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction64() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of sigaction64" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 16usize, - "Offset of field: sigaction64::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 24usize, - "Offset of field: sigaction64::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of sigaction64__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64"][::std::mem::size_of::() - 32usize]; + ["Alignment of sigaction64"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction64::sa_flags"] + [::std::mem::offset_of!(sigaction64, sa_flags) - 0usize]; + ["Offset of field: sigaction64::sa_mask"] + [::std::mem::offset_of!(sigaction64, sa_mask) - 16usize]; + ["Offset of field: sigaction64::sa_restorer"] + [::std::mem::offset_of!(sigaction64, sa_restorer) - 24usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_timespec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of timespec" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timespec"][::std::mem::size_of::() - 16usize]; + ["Alignment of timespec"][::std::mem::align_of::() - 8usize]; + ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize]; + ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_regs_struct { @@ -4975,41 +3815,19 @@ pub struct user_regs_struct { pub pc: u64, pub pstate: u64, } -#[test] -fn bindgen_test_layout_user_regs_struct() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 272usize, - "Size of user_regs_struct" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of user_regs_struct" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, - 0usize, - "Offset of field: user_regs_struct::regs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, - 248usize, - "Offset of field: user_regs_struct::sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pc) as usize - ptr as usize }, - 256usize, - "Offset of field: user_regs_struct::pc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pstate) as usize - ptr as usize }, - 264usize, - "Offset of field: user_regs_struct::pstate" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_regs_struct"][::std::mem::size_of::() - 272usize]; + ["Alignment of user_regs_struct"][::std::mem::align_of::() - 8usize]; + ["Offset of field: user_regs_struct::regs"] + [::std::mem::offset_of!(user_regs_struct, regs) - 0usize]; + ["Offset of field: user_regs_struct::sp"] + [::std::mem::offset_of!(user_regs_struct, sp) - 248usize]; + ["Offset of field: user_regs_struct::pc"] + [::std::mem::offset_of!(user_regs_struct, pc) - 256usize]; + ["Offset of field: user_regs_struct::pstate"] + [::std::mem::offset_of!(user_regs_struct, pstate) - 264usize]; +}; #[repr(C)] #[repr(align(16))] #[derive(Debug, Copy, Clone)] @@ -5018,36 +3836,17 @@ pub struct user_fpsimd_struct { pub fpsr: u32, pub fpcr: u32, } -#[test] -fn bindgen_test_layout_user_fpsimd_struct() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 528usize, - "Size of user_fpsimd_struct" - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - "Alignment of user_fpsimd_struct" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vregs) as usize - ptr as usize }, - 0usize, - "Offset of field: user_fpsimd_struct::vregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpsr) as usize - ptr as usize }, - 512usize, - "Offset of field: user_fpsimd_struct::fpsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpcr) as usize - ptr as usize }, - 516usize, - "Offset of field: user_fpsimd_struct::fpcr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_fpsimd_struct"][::std::mem::size_of::() - 528usize]; + ["Alignment of user_fpsimd_struct"][::std::mem::align_of::() - 16usize]; + ["Offset of field: user_fpsimd_struct::vregs"] + [::std::mem::offset_of!(user_fpsimd_struct, vregs) - 0usize]; + ["Offset of field: user_fpsimd_struct::fpsr"] + [::std::mem::offset_of!(user_fpsimd_struct, fpsr) - 512usize]; + ["Offset of field: user_fpsimd_struct::fpcr"] + [::std::mem::offset_of!(user_fpsimd_struct, fpcr) - 516usize]; +}; pub type greg_t = ::std::os::raw::c_ulong; pub type gregset_t = [greg_t; 34usize]; pub type fpregset_t = user_fpsimd_struct; @@ -5070,265 +3869,220 @@ pub union ucontext__bindgen_ty_1 { pub uc_sigmask: sigset_t, pub uc_sigmask64: sigset64_t, } -#[test] -fn bindgen_test_layout_ucontext__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of ucontext__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of ucontext__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1::uc_sigmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1::uc_sigmask64" - ); -} -#[test] -fn bindgen_test_layout_ucontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4560usize, - "Size of ucontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - "Alignment of ucontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext::uc_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, - 8usize, - "Offset of field: ucontext::uc_link" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, - 16usize, - "Offset of field: ucontext::uc_stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__padding) as usize - ptr as usize }, - 48usize, - "Offset of field: ucontext::__padding" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, - 176usize, - "Offset of field: ucontext::uc_mcontext" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; + ["Alignment of ucontext__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: ucontext__bindgen_ty_1::uc_sigmask"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1, uc_sigmask) - 0usize]; + ["Offset of field: ucontext__bindgen_ty_1::uc_sigmask64"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1, uc_sigmask64) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext"][::std::mem::size_of::() - 4560usize]; + ["Alignment of ucontext"][::std::mem::align_of::() - 16usize]; + ["Offset of field: ucontext::uc_flags"][::std::mem::offset_of!(ucontext, uc_flags) - 0usize]; + ["Offset of field: ucontext::uc_link"][::std::mem::offset_of!(ucontext, uc_link) - 8usize]; + ["Offset of field: ucontext::uc_stack"][::std::mem::offset_of!(ucontext, uc_stack) - 16usize]; + ["Offset of field: ucontext::__padding"][::std::mem::offset_of!(ucontext, __padding) - 48usize]; + ["Offset of field: ucontext::uc_mcontext"] + [::std::mem::offset_of!(ucontext, uc_mcontext) - 176usize]; +}; pub type ucontext_t = ucontext; -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmin() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmax() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static sys_siglist: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub static sys_signame: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub fn sigaction( __signal: ::std::os::raw::c_int, __new_action: *const sigaction, __old_action: *mut sigaction, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaction64( __signal: ::std::os::raw::c_int, __new_action: *const sigaction64, __old_action: *mut sigaction64, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn siginterrupt( __signal: ::std::os::raw::c_int, __flag: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn signal(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn sigaddset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaddset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember( __set: *const sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember64( __set: *const sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask( __how: ::std::os::raw::c_int, __new_set: *const sigset_t, __old_set: *mut sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask64( __how: ::std::os::raw::c_int, __new_set: *const sigset64_t, __old_set: *mut sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend(__mask: *const sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend64(__mask: *const sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait( __set: *const sigset_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait64( __set: *const sigset64_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sighold(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigignore(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpause(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigrelse(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigset(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn raise(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn kill(__pid: pid_t, __signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn killpg( __pgrp: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn tgkill( __tgid: ::std::os::raw::c_int, __tid: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaltstack( __new_signal_stack: *const stack_t, __old_signal_stack: *mut stack_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn psiginfo(__info: *const siginfo_t, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn sigqueue( __pid: pid_t, __signal: ::std::os::raw::c_int, __value: sigval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait( __set: *const sigset_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait64( __set: *const sigset64_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo(__set: *const sigset_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo64(__set: *const sigset64_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } @@ -5338,282 +4092,145 @@ pub struct __kernel_timespec { pub tv_sec: __kernel_time64_t, pub tv_nsec: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout___kernel_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_timespec>(), - 16usize, - "Size of __kernel_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_timespec>(), - 8usize, - "Alignment of __kernel_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_timespec"][::std::mem::size_of::<__kernel_timespec>() - 16usize]; + ["Alignment of __kernel_timespec"][::std::mem::align_of::<__kernel_timespec>() - 8usize]; + ["Offset of field: __kernel_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_itimerspec { pub it_interval: __kernel_timespec, pub it_value: __kernel_timespec, } -#[test] -fn bindgen_test_layout___kernel_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_itimerspec>(), - 32usize, - "Size of __kernel_itimerspec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_itimerspec>(), - 8usize, - "Alignment of __kernel_itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: __kernel_itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_itimerspec"][::std::mem::size_of::<__kernel_itimerspec>() - 32usize]; + ["Alignment of __kernel_itimerspec"][::std::mem::align_of::<__kernel_itimerspec>() - 8usize]; + ["Offset of field: __kernel_itimerspec::it_interval"] + [::std::mem::offset_of!(__kernel_itimerspec, it_interval) - 0usize]; + ["Offset of field: __kernel_itimerspec::it_value"] + [::std::mem::offset_of!(__kernel_itimerspec, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_old_timespec { pub tv_sec: __kernel_old_time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout___kernel_old_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), - 16usize, - "Size of __kernel_old_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), - 8usize, - "Alignment of __kernel_old_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_old_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_old_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_old_timespec"][::std::mem::size_of::<__kernel_old_timespec>() - 16usize]; + ["Alignment of __kernel_old_timespec"] + [::std::mem::align_of::<__kernel_old_timespec>() - 8usize]; + ["Offset of field: __kernel_old_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_old_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_sock_timeval { pub tv_sec: __s64, pub tv_usec: __s64, } -#[test] -fn bindgen_test_layout___kernel_sock_timeval() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sock_timeval>(), - 16usize, - "Size of __kernel_sock_timeval" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sock_timeval>(), - 8usize, - "Alignment of __kernel_sock_timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sock_timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sock_timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sock_timeval"][::std::mem::size_of::<__kernel_sock_timeval>() - 16usize]; + ["Alignment of __kernel_sock_timeval"] + [::std::mem::align_of::<__kernel_sock_timeval>() - 8usize]; + ["Offset of field: __kernel_sock_timeval::tv_sec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_sec) - 0usize]; + ["Offset of field: __kernel_sock_timeval::tv_usec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_usec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } -#[test] -fn bindgen_test_layout_timeval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 16usize, "Size of timeval"); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - "Offset of field: timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timeval"][::std::mem::size_of::() - 16usize]; + ["Alignment of timeval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: timeval::tv_sec"][::std::mem::offset_of!(timeval, tv_sec) - 0usize]; + ["Offset of field: timeval::tv_usec"][::std::mem::offset_of!(timeval, tv_usec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, } -#[test] -fn bindgen_test_layout_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of itimerspec" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerspec"][::std::mem::size_of::() - 32usize]; + ["Alignment of itimerspec"][::std::mem::align_of::() - 8usize]; + ["Offset of field: itimerspec::it_interval"] + [::std::mem::offset_of!(itimerspec, it_interval) - 0usize]; + ["Offset of field: itimerspec::it_value"] + [::std::mem::offset_of!(itimerspec, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerval { pub it_interval: timeval, pub it_value: timeval, } -#[test] -fn bindgen_test_layout_itimerval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of itimerval" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of itimerval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerval::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: itimerval::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerval"][::std::mem::size_of::() - 32usize]; + ["Alignment of itimerval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: itimerval::it_interval"] + [::std::mem::offset_of!(itimerval, it_interval) - 0usize]; + ["Offset of field: itimerval::it_value"][::std::mem::offset_of!(itimerval, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timezone { pub tz_minuteswest: ::std::os::raw::c_int, pub tz_dsttime: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_timezone() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of timezone" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timezone" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, - 0usize, - "Offset of field: timezone::tz_minuteswest" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr as usize }, - 4usize, - "Offset of field: timezone::tz_dsttime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timezone"][::std::mem::size_of::() - 8usize]; + ["Alignment of timezone"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timezone::tz_minuteswest"] + [::std::mem::offset_of!(timezone, tz_minuteswest) - 0usize]; + ["Offset of field: timezone::tz_dsttime"] + [::std::mem::offset_of!(timezone, tz_dsttime) - 4usize]; +}; pub type fd_mask = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct fd_set { pub fds_bits: [fd_mask; 16usize], } -#[test] -fn bindgen_test_layout_fd_set() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 128usize, "Size of fd_set"); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: fd_set::fds_bits" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of fd_set"][::std::mem::size_of::() - 128usize]; + ["Alignment of fd_set"][::std::mem::align_of::() - 8usize]; + ["Offset of field: fd_set::fds_bits"][::std::mem::offset_of!(fd_set, fds_bits) - 0usize]; +}; +unsafe extern "C" { pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, arg3: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn select( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -5622,7 +4239,7 @@ extern "C" { __timeout: *mut timeval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -5632,7 +4249,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect64( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -5642,26 +4259,26 @@ extern "C" { __mask: *const sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn gettimeofday(__tv: *mut timeval, __tz: *mut timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn settimeofday(__tv: *const timeval, __tz: *const timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn getitimer( __which: ::std::os::raw::c_int, __current_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn setitimer( __which: ::std::os::raw::c_int, __new_value: *const itimerval, __old_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn utimes( __path: *const ::std::os::raw::c_char, __times: *const timeval, @@ -5673,13 +4290,13 @@ pub struct __locale_t { _unused: [u8; 0], } pub type locale_t = *mut __locale_t; -extern "C" { +unsafe extern "C" { pub static mut tzname: [*mut ::std::os::raw::c_char; 0usize]; } -extern "C" { +unsafe extern "C" { pub static mut daylight: ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static mut timezone: ::std::os::raw::c_long; } #[repr(C)] @@ -5697,118 +4314,72 @@ pub struct tm { pub tm_gmtoff: ::std::os::raw::c_long, pub tm_zone: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_tm() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 56usize, "Size of tm"); - assert_eq!(::std::mem::align_of::(), 8usize, "Alignment of tm"); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: tm::tm_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, - 4usize, - "Offset of field: tm::tm_min" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, - 8usize, - "Offset of field: tm::tm_hour" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, - 12usize, - "Offset of field: tm::tm_mday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, - 16usize, - "Offset of field: tm::tm_mon" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, - 20usize, - "Offset of field: tm::tm_year" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, - 24usize, - "Offset of field: tm::tm_wday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, - 28usize, - "Offset of field: tm::tm_yday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, - 32usize, - "Offset of field: tm::tm_isdst" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, - 40usize, - "Offset of field: tm::tm_gmtoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, - 48usize, - "Offset of field: tm::tm_zone" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of tm"][::std::mem::size_of::() - 56usize]; + ["Alignment of tm"][::std::mem::align_of::() - 8usize]; + ["Offset of field: tm::tm_sec"][::std::mem::offset_of!(tm, tm_sec) - 0usize]; + ["Offset of field: tm::tm_min"][::std::mem::offset_of!(tm, tm_min) - 4usize]; + ["Offset of field: tm::tm_hour"][::std::mem::offset_of!(tm, tm_hour) - 8usize]; + ["Offset of field: tm::tm_mday"][::std::mem::offset_of!(tm, tm_mday) - 12usize]; + ["Offset of field: tm::tm_mon"][::std::mem::offset_of!(tm, tm_mon) - 16usize]; + ["Offset of field: tm::tm_year"][::std::mem::offset_of!(tm, tm_year) - 20usize]; + ["Offset of field: tm::tm_wday"][::std::mem::offset_of!(tm, tm_wday) - 24usize]; + ["Offset of field: tm::tm_yday"][::std::mem::offset_of!(tm, tm_yday) - 28usize]; + ["Offset of field: tm::tm_isdst"][::std::mem::offset_of!(tm, tm_isdst) - 32usize]; + ["Offset of field: tm::tm_gmtoff"][::std::mem::offset_of!(tm, tm_gmtoff) - 40usize]; + ["Offset of field: tm::tm_zone"][::std::mem::offset_of!(tm, tm_zone) - 48usize]; +}; +unsafe extern "C" { pub fn time(__t: *mut time_t) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn nanosleep( __request: *const timespec, __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn asctime(__tm: *const tm) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn asctime_r( __tm: *const tm, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn difftime(__lhs: time_t, __rhs: time_t) -> f64; } -extern "C" { +unsafe extern "C" { pub fn mktime(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn localtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn localtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timelocal(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn gmtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn gmtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timegm(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn strptime( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, __tm: *mut tm, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strptime_l( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, @@ -5816,7 +4387,7 @@ extern "C" { __l: locale_t, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -5824,7 +4395,7 @@ extern "C" { __tm: *const tm, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -5833,31 +4404,31 @@ extern "C" { __l: locale_t, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn ctime_r( __t: *const time_t, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn tzset(); } -extern "C" { +unsafe extern "C" { pub fn clock() -> clock_t; } -extern "C" { +unsafe extern "C" { pub fn clock_getcpuclockid(__pid: pid_t, __clock: *mut clockid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_getres(__clock: clockid_t, __resolution: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_gettime(__clock: clockid_t, __ts: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_nanosleep( __clock: clockid_t, __flags: ::std::os::raw::c_int, @@ -5865,20 +4436,20 @@ extern "C" { __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_settime(__clock: clockid_t, __ts: *const timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_create( __clock: clockid_t, __event: *mut sigevent, __timer_ptr: *mut timer_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_delete(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_settime( __timer: timer_t, __flags: ::std::os::raw::c_int, @@ -5886,33 +4457,33 @@ extern "C" { __old_value: *mut itimerspec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_gettime(_timer: timer_t, __ts: *mut itimerspec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_getoverrun(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_get( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_getres( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } pub type nfds_t = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn poll( __fds: *mut pollfd, __count: nfds_t, __timeout_ms: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll( __fds: *mut pollfd, __count: nfds_t, @@ -5920,7 +4491,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll64( __fds: *mut pollfd, __count: nfds_t, @@ -5943,127 +4514,65 @@ pub struct clone_args { pub set_tid_size: __u64, pub cgroup: __u64, } -#[test] -fn bindgen_test_layout_clone_args() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of clone_args" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of clone_args" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 0usize, - "Offset of field: clone_args::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, - 8usize, - "Offset of field: clone_args::pidfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, - 16usize, - "Offset of field: clone_args::child_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, - 24usize, - "Offset of field: clone_args::parent_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, - 32usize, - "Offset of field: clone_args::exit_signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, - 40usize, - "Offset of field: clone_args::stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, - 48usize, - "Offset of field: clone_args::stack_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 56usize, - "Offset of field: clone_args::tls" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, - 64usize, - "Offset of field: clone_args::set_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, - 72usize, - "Offset of field: clone_args::set_tid_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, - 80usize, - "Offset of field: clone_args::cgroup" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of clone_args"][::std::mem::size_of::() - 88usize]; + ["Alignment of clone_args"][::std::mem::align_of::() - 8usize]; + ["Offset of field: clone_args::flags"][::std::mem::offset_of!(clone_args, flags) - 0usize]; + ["Offset of field: clone_args::pidfd"][::std::mem::offset_of!(clone_args, pidfd) - 8usize]; + ["Offset of field: clone_args::child_tid"] + [::std::mem::offset_of!(clone_args, child_tid) - 16usize]; + ["Offset of field: clone_args::parent_tid"] + [::std::mem::offset_of!(clone_args, parent_tid) - 24usize]; + ["Offset of field: clone_args::exit_signal"] + [::std::mem::offset_of!(clone_args, exit_signal) - 32usize]; + ["Offset of field: clone_args::stack"][::std::mem::offset_of!(clone_args, stack) - 40usize]; + ["Offset of field: clone_args::stack_size"] + [::std::mem::offset_of!(clone_args, stack_size) - 48usize]; + ["Offset of field: clone_args::tls"][::std::mem::offset_of!(clone_args, tls) - 56usize]; + ["Offset of field: clone_args::set_tid"][::std::mem::offset_of!(clone_args, set_tid) - 64usize]; + ["Offset of field: clone_args::set_tid_size"] + [::std::mem::offset_of!(clone_args, set_tid_size) - 72usize]; + ["Offset of field: clone_args::cgroup"][::std::mem::offset_of!(clone_args, cgroup) - 80usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sched_param { pub sched_priority: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_sched_param() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sched_param" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sched_param" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, - 0usize, - "Offset of field: sched_param::sched_priority" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sched_param"][::std::mem::size_of::() - 4usize]; + ["Alignment of sched_param"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sched_param::sched_priority"] + [::std::mem::offset_of!(sched_param, sched_priority) - 0usize]; +}; +unsafe extern "C" { pub fn sched_setscheduler( __pid: pid_t, __policy: ::std::os::raw::c_int, __param: *const sched_param, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getscheduler(__pid: pid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_yield() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_max(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_min(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_setparam(__pid: pid_t, __param: *const sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getparam(__pid: pid_t, __param: *mut sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_22 = 0; @@ -6084,44 +4593,25 @@ pub struct __pthread_cleanup_t { ::std::option::Option, pub __cleanup_arg: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___pthread_cleanup_t() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cleanup_t>(), - 24usize, - "Size of __pthread_cleanup_t" - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cleanup_t>(), - 8usize, - "Alignment of __pthread_cleanup_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, - 0usize, - "Offset of field: __pthread_cleanup_t::__cleanup_prev" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, - 8usize, - "Offset of field: __pthread_cleanup_t::__cleanup_routine" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, - 16usize, - "Offset of field: __pthread_cleanup_t::__cleanup_arg" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __pthread_cleanup_t"][::std::mem::size_of::<__pthread_cleanup_t>() - 24usize]; + ["Alignment of __pthread_cleanup_t"][::std::mem::align_of::<__pthread_cleanup_t>() - 8usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_prev"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_prev) - 0usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_routine"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_routine) - 8usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_arg"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_arg) - 16usize]; +}; +unsafe extern "C" { pub fn __pthread_cleanup_push( c: *mut __pthread_cleanup_t, arg1: ::std::option::Option, arg2: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } #[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] @@ -6137,36 +4627,17 @@ pub struct android_poll_source { unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } -#[test] -fn bindgen_test_layout_android_poll_source() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of android_poll_source" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_poll_source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: android_poll_source::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, - 8usize, - "Offset of field: android_poll_source::app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, - 16usize, - "Offset of field: android_poll_source::process" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_poll_source"][::std::mem::size_of::() - 24usize]; + ["Alignment of android_poll_source"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_poll_source::id"] + [::std::mem::offset_of!(android_poll_source, id) - 0usize]; + ["Offset of field: android_poll_source::app"] + [::std::mem::offset_of!(android_poll_source, app) - 8usize]; + ["Offset of field: android_poll_source::process"] + [::std::mem::offset_of!(android_poll_source, process) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { @@ -6183,51 +4654,23 @@ pub struct android_input_buffer { #[doc = " The size of the `keyEvents` buffer."] pub keyEventsBufferSize: u64, } -#[test] -fn bindgen_test_layout_android_input_buffer() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - "Size of android_input_buffer" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_input_buffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, - 0usize, - "Offset of field: android_input_buffer::motionEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, - 8usize, - "Offset of field: android_input_buffer::motionEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, - 16usize, - "Offset of field: android_input_buffer::motionEventsBufferSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, - 24usize, - "Offset of field: android_input_buffer::keyEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, - 32usize, - "Offset of field: android_input_buffer::keyEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, - 40usize, - "Offset of field: android_input_buffer::keyEventsBufferSize" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_input_buffer"][::std::mem::size_of::() - 48usize]; + ["Alignment of android_input_buffer"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_input_buffer::motionEvents"] + [::std::mem::offset_of!(android_input_buffer, motionEvents) - 0usize]; + ["Offset of field: android_input_buffer::motionEventsCount"] + [::std::mem::offset_of!(android_input_buffer, motionEventsCount) - 8usize]; + ["Offset of field: android_input_buffer::motionEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, motionEventsBufferSize) - 16usize]; + ["Offset of field: android_input_buffer::keyEvents"] + [::std::mem::offset_of!(android_input_buffer, keyEvents) - 24usize]; + ["Offset of field: android_input_buffer::keyEventsCount"] + [::std::mem::offset_of!(android_input_buffer, keyEventsCount) - 32usize]; + ["Offset of field: android_input_buffer::keyEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, keyEventsBufferSize) - 40usize]; +}; #[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; @@ -6286,181 +4729,70 @@ pub struct android_app { pub inputAvailableWakeUp: bool, pub inputSwapPending: bool, } -#[test] -fn bindgen_test_layout_android_app() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 392usize, - "Size of android_app" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, - 0usize, - "Offset of field: android_app::userData" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, - 8usize, - "Offset of field: android_app::onAppCmd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, - 16usize, - "Offset of field: android_app::activity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, - 24usize, - "Offset of field: android_app::config" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, - 32usize, - "Offset of field: android_app::savedState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, - 40usize, - "Offset of field: android_app::savedStateSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, - 48usize, - "Offset of field: android_app::looper" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, - 56usize, - "Offset of field: android_app::window" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, - 64usize, - "Offset of field: android_app::contentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).softwareKeyboardVisible) as usize - ptr as usize }, - 80usize, - "Offset of field: android_app::softwareKeyboardVisible" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).editorAction) as usize - ptr as usize }, - 84usize, - "Offset of field: android_app::editorAction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, - 88usize, - "Offset of field: android_app::activityState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, - 92usize, - "Offset of field: android_app::destroyRequested" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, - 96usize, - "Offset of field: android_app::inputBuffers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, - 192usize, - "Offset of field: android_app::currentInputBuffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, - 196usize, - "Offset of field: android_app::textInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, - 200usize, - "Offset of field: android_app::mutex" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, - 240usize, - "Offset of field: android_app::cond" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, - 288usize, - "Offset of field: android_app::msgread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, - 292usize, - "Offset of field: android_app::msgwrite" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, - 296usize, - "Offset of field: android_app::thread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, - 304usize, - "Offset of field: android_app::cmdPollSource" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, - 328usize, - "Offset of field: android_app::running" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, - 332usize, - "Offset of field: android_app::stateSaved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, - 336usize, - "Offset of field: android_app::destroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, - 340usize, - "Offset of field: android_app::redrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, - 344usize, - "Offset of field: android_app::pendingWindow" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, - 352usize, - "Offset of field: android_app::pendingContentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, - 368usize, - "Offset of field: android_app::keyEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, - 376usize, - "Offset of field: android_app::motionEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, - 384usize, - "Offset of field: android_app::inputAvailableWakeUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, - 385usize, - "Offset of field: android_app::inputSwapPending" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_app"][::std::mem::size_of::() - 392usize]; + ["Alignment of android_app"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_app::userData"] + [::std::mem::offset_of!(android_app, userData) - 0usize]; + ["Offset of field: android_app::onAppCmd"] + [::std::mem::offset_of!(android_app, onAppCmd) - 8usize]; + ["Offset of field: android_app::activity"] + [::std::mem::offset_of!(android_app, activity) - 16usize]; + ["Offset of field: android_app::config"][::std::mem::offset_of!(android_app, config) - 24usize]; + ["Offset of field: android_app::savedState"] + [::std::mem::offset_of!(android_app, savedState) - 32usize]; + ["Offset of field: android_app::savedStateSize"] + [::std::mem::offset_of!(android_app, savedStateSize) - 40usize]; + ["Offset of field: android_app::looper"][::std::mem::offset_of!(android_app, looper) - 48usize]; + ["Offset of field: android_app::window"][::std::mem::offset_of!(android_app, window) - 56usize]; + ["Offset of field: android_app::contentRect"] + [::std::mem::offset_of!(android_app, contentRect) - 64usize]; + ["Offset of field: android_app::softwareKeyboardVisible"] + [::std::mem::offset_of!(android_app, softwareKeyboardVisible) - 80usize]; + ["Offset of field: android_app::editorAction"] + [::std::mem::offset_of!(android_app, editorAction) - 84usize]; + ["Offset of field: android_app::activityState"] + [::std::mem::offset_of!(android_app, activityState) - 88usize]; + ["Offset of field: android_app::destroyRequested"] + [::std::mem::offset_of!(android_app, destroyRequested) - 92usize]; + ["Offset of field: android_app::inputBuffers"] + [::std::mem::offset_of!(android_app, inputBuffers) - 96usize]; + ["Offset of field: android_app::currentInputBuffer"] + [::std::mem::offset_of!(android_app, currentInputBuffer) - 192usize]; + ["Offset of field: android_app::textInputState"] + [::std::mem::offset_of!(android_app, textInputState) - 196usize]; + ["Offset of field: android_app::mutex"][::std::mem::offset_of!(android_app, mutex) - 200usize]; + ["Offset of field: android_app::cond"][::std::mem::offset_of!(android_app, cond) - 240usize]; + ["Offset of field: android_app::msgread"] + [::std::mem::offset_of!(android_app, msgread) - 288usize]; + ["Offset of field: android_app::msgwrite"] + [::std::mem::offset_of!(android_app, msgwrite) - 292usize]; + ["Offset of field: android_app::thread"] + [::std::mem::offset_of!(android_app, thread) - 296usize]; + ["Offset of field: android_app::cmdPollSource"] + [::std::mem::offset_of!(android_app, cmdPollSource) - 304usize]; + ["Offset of field: android_app::running"] + [::std::mem::offset_of!(android_app, running) - 328usize]; + ["Offset of field: android_app::stateSaved"] + [::std::mem::offset_of!(android_app, stateSaved) - 332usize]; + ["Offset of field: android_app::destroyed"] + [::std::mem::offset_of!(android_app, destroyed) - 336usize]; + ["Offset of field: android_app::redrawNeeded"] + [::std::mem::offset_of!(android_app, redrawNeeded) - 340usize]; + ["Offset of field: android_app::pendingWindow"] + [::std::mem::offset_of!(android_app, pendingWindow) - 344usize]; + ["Offset of field: android_app::pendingContentRect"] + [::std::mem::offset_of!(android_app, pendingContentRect) - 352usize]; + ["Offset of field: android_app::keyEventFilter"] + [::std::mem::offset_of!(android_app, keyEventFilter) - 368usize]; + ["Offset of field: android_app::motionEventFilter"] + [::std::mem::offset_of!(android_app, motionEventFilter) - 376usize]; + ["Offset of field: android_app::inputAvailableWakeUp"] + [::std::mem::offset_of!(android_app, inputAvailableWakeUp) - 384usize]; + ["Offset of field: android_app::inputSwapPending"] + [::std::mem::offset_of!(android_app, inputSwapPending) - 385usize]; +}; #[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; #[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] @@ -6507,55 +4839,55 @@ pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 16; pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 17; #[doc = " Commands passed from the application's main Java thread to the game's thread.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub type NativeAppGlueAppCmd = i8; -extern "C" { +unsafe extern "C" { #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " You can send your custom events using the function below.\n\n Make sure your custom codes do not overlap with this library's ones.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Determines if a looper wake up was due to new input becoming available"] pub fn android_app_input_available_wake_up(app: *mut android_app) -> bool; } diff --git a/android-activity/src/game_activity/ffi_arm.rs b/android-activity/src/game_activity/ffi_arm.rs index de717f5c..5475fe65 100644 --- a/android-activity/src/game_activity/ffi_arm.rs +++ b/android-activity/src/game_activity/ffi_arm.rs @@ -808,10 +808,10 @@ pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; -extern "C" { +unsafe extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn android_get_device_api_level() -> ::std::os::raw::c_int; } pub type wchar_t = ::std::os::raw::c_uint; @@ -821,31 +821,15 @@ pub struct max_align_t { pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, pub __clang_max_align_nonce2: f64, } -#[test] -fn bindgen_test_layout_max_align_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of max_align_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of max_align_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, - 0usize, - "Offset of field: max_align_t::__clang_max_align_nonce1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, - 8usize, - "Offset of field: max_align_t::__clang_max_align_nonce2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of max_align_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of max_align_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce1"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce2"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 8usize]; +}; pub type __int8_t = ::std::os::raw::c_schar; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __int16_t = ::std::os::raw::c_short; @@ -887,26 +871,13 @@ pub type __u64 = ::std::os::raw::c_ulonglong; pub struct __kernel_fd_set { pub fds_bits: [::std::os::raw::c_ulong; 32usize], } -#[test] -fn bindgen_test_layout___kernel_fd_set() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fd_set>(), - 128usize, - "Size of __kernel_fd_set" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fd_set>(), - 4usize, - "Alignment of __kernel_fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fd_set::fds_bits" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fd_set"][::std::mem::size_of::<__kernel_fd_set>() - 128usize]; + ["Alignment of __kernel_fd_set"][::std::mem::align_of::<__kernel_fd_set>() - 4usize]; + ["Offset of field: __kernel_fd_set::fds_bits"] + [::std::mem::offset_of!(__kernel_fd_set, fds_bits) - 0usize]; +}; pub type __kernel_sighandler_t = ::std::option::Option; pub type __kernel_key_t = ::std::os::raw::c_int; @@ -934,26 +905,13 @@ pub type __kernel_ptrdiff_t = ::std::os::raw::c_int; pub struct __kernel_fsid_t { pub val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___kernel_fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fsid_t>(), - 8usize, - "Size of __kernel_fsid_t" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fsid_t>(), - 4usize, - "Alignment of __kernel_fsid_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fsid_t::val" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fsid_t"][::std::mem::size_of::<__kernel_fsid_t>() - 8usize]; + ["Alignment of __kernel_fsid_t"][::std::mem::align_of::<__kernel_fsid_t>() - 4usize]; + ["Offset of field: __kernel_fsid_t::val"] + [::std::mem::offset_of!(__kernel_fsid_t, val) - 0usize]; +}; pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; pub type __kernel_old_time_t = __kernel_long_t; @@ -1357,67 +1315,32 @@ pub struct JavaVMAttachArgs { pub name: *const ::std::os::raw::c_char, pub group: jobject, } -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of JavaVMAttachArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of JavaVMAttachArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMAttachArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMAttachArgs::name" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMAttachArgs::group" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMAttachArgs"][::std::mem::size_of::() - 12usize]; + ["Alignment of JavaVMAttachArgs"][::std::mem::align_of::() - 4usize]; + ["Offset of field: JavaVMAttachArgs::version"] + [::std::mem::offset_of!(JavaVMAttachArgs, version) - 0usize]; + ["Offset of field: JavaVMAttachArgs::name"] + [::std::mem::offset_of!(JavaVMAttachArgs, name) - 4usize]; + ["Offset of field: JavaVMAttachArgs::group"] + [::std::mem::offset_of!(JavaVMAttachArgs, group) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JavaVMOption { pub optionString: *const ::std::os::raw::c_char, pub extraInfo: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_JavaVMOption() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of JavaVMOption" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of JavaVMOption" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).optionString) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMOption::optionString" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMOption::extraInfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMOption"][::std::mem::size_of::() - 8usize]; + ["Alignment of JavaVMOption"][::std::mem::align_of::() - 4usize]; + ["Offset of field: JavaVMOption::optionString"] + [::std::mem::offset_of!(JavaVMOption, optionString) - 0usize]; + ["Offset of field: JavaVMOption::extraInfo"] + [::std::mem::offset_of!(JavaVMOption, extraInfo) - 4usize]; +}; #[repr(C)] pub struct JavaVMInitArgs { pub version: jint, @@ -1425,41 +1348,19 @@ pub struct JavaVMInitArgs { pub options: *mut JavaVMOption, pub ignoreUnrecognized: jboolean, } -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of JavaVMInitArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of JavaVMInitArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMInitArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMInitArgs::nOptions" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMInitArgs::options" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, - 12usize, - "Offset of field: JavaVMInitArgs::ignoreUnrecognized" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMInitArgs"][::std::mem::size_of::() - 16usize]; + ["Alignment of JavaVMInitArgs"][::std::mem::align_of::() - 4usize]; + ["Offset of field: JavaVMInitArgs::version"] + [::std::mem::offset_of!(JavaVMInitArgs, version) - 0usize]; + ["Offset of field: JavaVMInitArgs::nOptions"] + [::std::mem::offset_of!(JavaVMInitArgs, nOptions) - 4usize]; + ["Offset of field: JavaVMInitArgs::options"] + [::std::mem::offset_of!(JavaVMInitArgs, options) - 8usize]; + ["Offset of field: JavaVMInitArgs::ignoreUnrecognized"] + [::std::mem::offset_of!(JavaVMInitArgs, ignoreUnrecognized) - 12usize]; +}; pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; @@ -1642,226 +1543,226 @@ pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getDeviceId(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_release(event: *const AInputEvent); } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getFlags(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getKeyCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getScanCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getMetaState(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getRepeatCount(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getDownTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getMetaState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getButtonState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEdgeFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getDownTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEventTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, history_index: usize, ) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, @@ -1869,13 +1770,13 @@ extern "C" { history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; } #[repr(C)] @@ -1883,7 +1784,7 @@ extern "C" { pub struct AInputQueue { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_attachLooper( queue: *mut AInputQueue, looper: *mut ALooper, @@ -1892,26 +1793,26 @@ extern "C" { data: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_detachLooper(queue: *mut AInputQueue); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_hasEvents(queue: *mut AInputQueue) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_getEvent(queue: *mut AInputQueue, outEvent: *mut *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_preDispatchEvent(queue: *mut AInputQueue, event: *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_finishEvent( queue: *mut AInputQueue, event: *mut AInputEvent, handled: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; } #[repr(C)] @@ -1920,59 +1821,41 @@ pub struct imaxdiv_t { pub quot: intmax_t, pub rem: intmax_t, } -#[test] -fn bindgen_test_layout_imaxdiv_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of imaxdiv_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of imaxdiv_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, - 0usize, - "Offset of field: imaxdiv_t::quot" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, - 8usize, - "Offset of field: imaxdiv_t::rem" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of imaxdiv_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of imaxdiv_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: imaxdiv_t::quot"][::std::mem::offset_of!(imaxdiv_t, quot) - 0usize]; + ["Offset of field: imaxdiv_t::rem"][::std::mem::offset_of!(imaxdiv_t, rem) - 8usize]; +}; +unsafe extern "C" { pub fn imaxabs(__i: intmax_t) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn imaxdiv(__numerator: intmax_t, __denominator: intmax_t) -> imaxdiv_t; } -extern "C" { +unsafe extern "C" { pub fn strtoimax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn strtoumax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> uintmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoimax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoumax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, @@ -2143,61 +2026,27 @@ pub struct AHardwareBuffer_Desc { pub rfu0: u32, pub rfu1: u64, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Desc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - "Size of AHardwareBuffer_Desc" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of AHardwareBuffer_Desc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Desc::width" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Desc::height" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Desc::layers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 12usize, - "Offset of field: AHardwareBuffer_Desc::format" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, - 16usize, - "Offset of field: AHardwareBuffer_Desc::usage" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, - 24usize, - "Offset of field: AHardwareBuffer_Desc::stride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, - 28usize, - "Offset of field: AHardwareBuffer_Desc::rfu0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, - 32usize, - "Offset of field: AHardwareBuffer_Desc::rfu1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Desc"][::std::mem::size_of::() - 40usize]; + ["Alignment of AHardwareBuffer_Desc"][::std::mem::align_of::() - 8usize]; + ["Offset of field: AHardwareBuffer_Desc::width"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, width) - 0usize]; + ["Offset of field: AHardwareBuffer_Desc::height"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, height) - 4usize]; + ["Offset of field: AHardwareBuffer_Desc::layers"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, layers) - 8usize]; + ["Offset of field: AHardwareBuffer_Desc::format"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, format) - 12usize]; + ["Offset of field: AHardwareBuffer_Desc::usage"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, usage) - 16usize]; + ["Offset of field: AHardwareBuffer_Desc::stride"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, stride) - 24usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu0"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu0) - 28usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu1"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu1) - 32usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Plane { @@ -2205,93 +2054,58 @@ pub struct AHardwareBuffer_Plane { pub pixelStride: u32, pub rowStride: u32, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Plane() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of AHardwareBuffer_Plane" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of AHardwareBuffer_Plane" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Plane::data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Plane::pixelStride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Plane::rowStride" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Plane"][::std::mem::size_of::() - 12usize]; + ["Alignment of AHardwareBuffer_Plane"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: AHardwareBuffer_Plane::data"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, data) - 0usize]; + ["Offset of field: AHardwareBuffer_Plane::pixelStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, pixelStride) - 4usize]; + ["Offset of field: AHardwareBuffer_Plane::rowStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, rowStride) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Planes { pub planeCount: u32, pub planes: [AHardwareBuffer_Plane; 4usize], } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Planes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - "Size of AHardwareBuffer_Planes" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of AHardwareBuffer_Planes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Planes::planeCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Planes::planes" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Planes"][::std::mem::size_of::() - 52usize]; + ["Alignment of AHardwareBuffer_Planes"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: AHardwareBuffer_Planes::planeCount"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planeCount) - 0usize]; + ["Offset of field: AHardwareBuffer_Planes::planes"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planes) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_allocate( desc: *const AHardwareBuffer_Desc, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_acquire(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_release(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_describe( buffer: *const AHardwareBuffer, outDesc: *mut AHardwareBuffer_Desc, ); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lock( buffer: *mut AHardwareBuffer, usage: u64, @@ -2300,25 +2114,25 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, fence: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_sendHandleToUnixSocket( buffer: *const AHardwareBuffer, socketFd: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_recvHandleFromUnixSocket( socketFd: ::std::os::raw::c_int, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockPlanes( buffer: *mut AHardwareBuffer, usage: u64, @@ -2327,10 +2141,10 @@ extern "C" { outPlanes: *mut AHardwareBuffer_Planes, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockAndGetInfo( buffer: *mut AHardwareBuffer, usage: u64, @@ -2341,7 +2155,7 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_getId( buffer: *const AHardwareBuffer, outId: *mut u64, @@ -2357,56 +2171,32 @@ pub struct GameActivityPointerAxes { pub rawX: f32, pub rawY: f32, } -#[test] -fn bindgen_test_layout_GameActivityPointerAxes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 208usize, - "Size of GameActivityPointerAxes" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityPointerAxes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityPointerAxes::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityPointerAxes::toolType" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityPointerAxes::axisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, - 200usize, - "Offset of field: GameActivityPointerAxes::rawX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, - 204usize, - "Offset of field: GameActivityPointerAxes::rawY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityPointerAxes"] + [::std::mem::size_of::() - 208usize]; + ["Alignment of GameActivityPointerAxes"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityPointerAxes::id"] + [::std::mem::offset_of!(GameActivityPointerAxes, id) - 0usize]; + ["Offset of field: GameActivityPointerAxes::toolType"] + [::std::mem::offset_of!(GameActivityPointerAxes, toolType) - 4usize]; + ["Offset of field: GameActivityPointerAxes::axisValues"] + [::std::mem::offset_of!(GameActivityPointerAxes, axisValues) - 8usize]; + ["Offset of field: GameActivityPointerAxes::rawX"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawX) - 200usize]; + ["Offset of field: GameActivityPointerAxes::rawY"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawY) - 204usize]; +}; +unsafe extern "C" { #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_enableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_disableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] pub fn GameActivityPointerAxes_getAxisValue( pointerInfo: *const GameActivityPointerAxes, @@ -2437,118 +2227,52 @@ pub struct GameActivityMotionEvent { pub precisionX: f32, pub precisionY: f32, } -#[test] -fn bindgen_test_layout_GameActivityMotionEvent() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 1752usize, - "Size of GameActivityMotionEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityMotionEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityMotionEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityMotionEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityMotionEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityMotionEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityMotionEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityMotionEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityMotionEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityMotionEvent::actionButton" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityMotionEvent::buttonState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityMotionEvent::classification" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityMotionEvent::edgeFlags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityMotionEvent::pointerCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, - 60usize, - "Offset of field: GameActivityMotionEvent::pointers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, - 1724usize, - "Offset of field: GameActivityMotionEvent::historySize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, - 1728usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesMillis" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, - 1732usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesNanos" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, - 1736usize, - "Offset of field: GameActivityMotionEvent::historicalAxisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, - 1740usize, - "Offset of field: GameActivityMotionEvent::precisionX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, - 1744usize, - "Offset of field: GameActivityMotionEvent::precisionY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityMotionEvent"] + [::std::mem::size_of::() - 1752usize]; + ["Alignment of GameActivityMotionEvent"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityMotionEvent::deviceId"] + [::std::mem::offset_of!(GameActivityMotionEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityMotionEvent::source"] + [::std::mem::offset_of!(GameActivityMotionEvent, source) - 4usize]; + ["Offset of field: GameActivityMotionEvent::action"] + [::std::mem::offset_of!(GameActivityMotionEvent, action) - 8usize]; + ["Offset of field: GameActivityMotionEvent::eventTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, eventTime) - 16usize]; + ["Offset of field: GameActivityMotionEvent::downTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, downTime) - 24usize]; + ["Offset of field: GameActivityMotionEvent::flags"] + [::std::mem::offset_of!(GameActivityMotionEvent, flags) - 32usize]; + ["Offset of field: GameActivityMotionEvent::metaState"] + [::std::mem::offset_of!(GameActivityMotionEvent, metaState) - 36usize]; + ["Offset of field: GameActivityMotionEvent::actionButton"] + [::std::mem::offset_of!(GameActivityMotionEvent, actionButton) - 40usize]; + ["Offset of field: GameActivityMotionEvent::buttonState"] + [::std::mem::offset_of!(GameActivityMotionEvent, buttonState) - 44usize]; + ["Offset of field: GameActivityMotionEvent::classification"] + [::std::mem::offset_of!(GameActivityMotionEvent, classification) - 48usize]; + ["Offset of field: GameActivityMotionEvent::edgeFlags"] + [::std::mem::offset_of!(GameActivityMotionEvent, edgeFlags) - 52usize]; + ["Offset of field: GameActivityMotionEvent::pointerCount"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointerCount) - 56usize]; + ["Offset of field: GameActivityMotionEvent::pointers"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointers) - 60usize]; + ["Offset of field: GameActivityMotionEvent::historySize"] + [::std::mem::offset_of!(GameActivityMotionEvent, historySize) - 1724usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesMillis"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesMillis) - 1728usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesNanos"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesNanos) - 1732usize]; + ["Offset of field: GameActivityMotionEvent::historicalAxisValues"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalAxisValues) - 1736usize]; + ["Offset of field: GameActivityMotionEvent::precisionX"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionX) - 1740usize]; + ["Offset of field: GameActivityMotionEvent::precisionY"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionY) - 1744usize]; +}; +unsafe extern "C" { pub fn GameActivityMotionEvent_getHistoricalAxisValue( event: *const GameActivityMotionEvent, axis: ::std::os::raw::c_int, @@ -2556,7 +2280,7 @@ extern "C" { historyPos: ::std::os::raw::c_int, ) -> f32; } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } @@ -2576,76 +2300,33 @@ pub struct GameActivityKeyEvent { pub keyCode: i32, pub scanCode: i32, } -#[test] -fn bindgen_test_layout_GameActivityKeyEvent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - "Size of GameActivityKeyEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityKeyEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityKeyEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityKeyEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityKeyEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityKeyEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityKeyEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityKeyEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityKeyEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityKeyEvent::modifiers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityKeyEvent::repeatCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityKeyEvent::keyCode" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityKeyEvent::scanCode" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityKeyEvent"][::std::mem::size_of::() - 56usize]; + ["Alignment of GameActivityKeyEvent"][::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityKeyEvent::deviceId"] + [::std::mem::offset_of!(GameActivityKeyEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityKeyEvent::source"] + [::std::mem::offset_of!(GameActivityKeyEvent, source) - 4usize]; + ["Offset of field: GameActivityKeyEvent::action"] + [::std::mem::offset_of!(GameActivityKeyEvent, action) - 8usize]; + ["Offset of field: GameActivityKeyEvent::eventTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, eventTime) - 16usize]; + ["Offset of field: GameActivityKeyEvent::downTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, downTime) - 24usize]; + ["Offset of field: GameActivityKeyEvent::flags"] + [::std::mem::offset_of!(GameActivityKeyEvent, flags) - 32usize]; + ["Offset of field: GameActivityKeyEvent::metaState"] + [::std::mem::offset_of!(GameActivityKeyEvent, metaState) - 36usize]; + ["Offset of field: GameActivityKeyEvent::modifiers"] + [::std::mem::offset_of!(GameActivityKeyEvent, modifiers) - 40usize]; + ["Offset of field: GameActivityKeyEvent::repeatCount"] + [::std::mem::offset_of!(GameActivityKeyEvent, repeatCount) - 44usize]; + ["Offset of field: GameActivityKeyEvent::keyCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, keyCode) - 48usize]; + ["Offset of field: GameActivityKeyEvent::scanCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, scanCode) - 52usize]; +}; #[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2655,31 +2336,15 @@ pub struct GameTextInputSpan { #[doc = " The end of the region (exclusive)."] pub end: i32, } -#[test] -fn bindgen_test_layout_GameTextInputSpan() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of GameTextInputSpan" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameTextInputSpan" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputSpan::start" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, - 4usize, - "Offset of field: GameTextInputSpan::end" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputSpan"][::std::mem::size_of::() - 8usize]; + ["Alignment of GameTextInputSpan"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameTextInputSpan::start"] + [::std::mem::offset_of!(GameTextInputSpan, start) - 0usize]; + ["Offset of field: GameTextInputSpan::end"] + [::std::mem::offset_of!(GameTextInputSpan, end) - 4usize]; +}; pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; #[doc = " Values with special meaning in a GameTextInputSpan."] pub type GameTextInputSpanFlag = i32; @@ -2696,41 +2361,19 @@ pub struct GameTextInputState { #[doc = " A composing region defined on the text."] pub composingRegion: GameTextInputSpan, } -#[test] -fn bindgen_test_layout_GameTextInputState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of GameTextInputState" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameTextInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputState::text_UTF8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, - 4usize, - "Offset of field: GameTextInputState::text_length" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, - 8usize, - "Offset of field: GameTextInputState::selection" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, - 16usize, - "Offset of field: GameTextInputState::composingRegion" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputState"][::std::mem::size_of::() - 24usize]; + ["Alignment of GameTextInputState"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameTextInputState::text_UTF8"] + [::std::mem::offset_of!(GameTextInputState, text_UTF8) - 0usize]; + ["Offset of field: GameTextInputState::text_length"] + [::std::mem::offset_of!(GameTextInputState, text_length) - 4usize]; + ["Offset of field: GameTextInputState::selection"] + [::std::mem::offset_of!(GameTextInputState, selection) - 8usize]; + ["Offset of field: GameTextInputState::composingRegion"] + [::std::mem::offset_of!(GameTextInputState, composingRegion) - 16usize]; +}; #[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] pub type GameTextInputGetStateCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), @@ -2740,19 +2383,19 @@ pub type GameTextInputGetStateCallback = ::std::option::Option< pub struct GameTextInput { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; } -extern "C" { +unsafe extern "C" { #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_destroy(input: *mut GameTextInput); } @@ -2761,7 +2404,7 @@ pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_showIme."] pub type ShowImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); } @@ -2770,15 +2413,15 @@ pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_hideIme."] pub type HideImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_restartInput(input: *mut GameTextInput); } -extern "C" { +unsafe extern "C" { #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] pub fn GameTextInput_getState( input: *mut GameTextInput, @@ -2786,7 +2429,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); } @@ -2797,7 +2440,7 @@ pub type GameTextInputEventCallback = ::std::option::Option< current_state: *const GameTextInputState, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback.\n This function is deprecated. Don't perform any complex processing inside\n the callback other than copying the state variable. Using any synchronization\n primitives inside this callback may cause a deadlock."] pub fn GameTextInput_setEventCallback( input: *mut GameTextInput, @@ -2809,7 +2452,7 @@ extern "C" { pub type GameTextInputImeInsetsCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] pub fn GameTextInput_setImeInsetsCallback( input: *mut GameTextInput, @@ -2817,22 +2460,22 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] pub fn GameTextInputState_toJava( input: *const GameTextInput, state: *const GameTextInputState, ) -> jobject; } -extern "C" { +unsafe extern "C" { #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] pub fn GameTextInputState_fromJava( input: *const GameTextInput, @@ -3003,71 +2646,29 @@ pub struct GameActivity { #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] pub obbPath: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_GameActivity() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - "Size of GameActivity" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivity::callbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivity::vm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivity::env" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, - 12usize, - "Offset of field: GameActivity::javaGameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivity::internalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, - 20usize, - "Offset of field: GameActivity::externalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivity::sdkVersion" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, - 28usize, - "Offset of field: GameActivity::instance" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivity::assetManager" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivity::obbPath" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivity"][::std::mem::size_of::() - 40usize]; + ["Alignment of GameActivity"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivity::callbacks"] + [::std::mem::offset_of!(GameActivity, callbacks) - 0usize]; + ["Offset of field: GameActivity::vm"][::std::mem::offset_of!(GameActivity, vm) - 4usize]; + ["Offset of field: GameActivity::env"][::std::mem::offset_of!(GameActivity, env) - 8usize]; + ["Offset of field: GameActivity::javaGameActivity"] + [::std::mem::offset_of!(GameActivity, javaGameActivity) - 12usize]; + ["Offset of field: GameActivity::internalDataPath"] + [::std::mem::offset_of!(GameActivity, internalDataPath) - 16usize]; + ["Offset of field: GameActivity::externalDataPath"] + [::std::mem::offset_of!(GameActivity, externalDataPath) - 20usize]; + ["Offset of field: GameActivity::sdkVersion"] + [::std::mem::offset_of!(GameActivity, sdkVersion) - 24usize]; + ["Offset of field: GameActivity::instance"] + [::std::mem::offset_of!(GameActivity, instance) - 28usize]; + ["Offset of field: GameActivity::assetManager"] + [::std::mem::offset_of!(GameActivity, assetManager) - 32usize]; + ["Offset of field: GameActivity::obbPath"] + [::std::mem::offset_of!(GameActivity, obbPath) - 36usize]; +}; #[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( @@ -3169,129 +2770,56 @@ pub struct GameActivityCallbacks { unsafe extern "C" fn(activity: *mut GameActivity, action: ::std::os::raw::c_int) -> bool, >, } -#[test] -fn bindgen_test_layout_GameActivityCallbacks() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 84usize, - "Size of GameActivityCallbacks" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityCallbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityCallbacks::onStart" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityCallbacks::onResume" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityCallbacks::onSaveInstanceState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, - 12usize, - "Offset of field: GameActivityCallbacks::onPause" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityCallbacks::onStop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, - 20usize, - "Offset of field: GameActivityCallbacks::onDestroy" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityCallbacks::onWindowFocusChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, - 28usize, - "Offset of field: GameActivityCallbacks::onNativeWindowCreated" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityCallbacks::onNativeWindowResized" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityCallbacks::onNativeWindowDestroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityCallbacks::onConfigurationChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityCallbacks::onTrimMemory" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityCallbacks::onTouchEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityCallbacks::onKeyDown" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, - 60usize, - "Offset of field: GameActivityCallbacks::onKeyUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, - 64usize, - "Offset of field: GameActivityCallbacks::onTextInputEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, - 68usize, - "Offset of field: GameActivityCallbacks::onWindowInsetsChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, - 72usize, - "Offset of field: GameActivityCallbacks::onContentRectChanged" - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).onSoftwareKeyboardVisibilityChanged) as usize - ptr as usize - }, - 76usize, - "Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onEditorAction) as usize - ptr as usize }, - 80usize, - "Offset of field: GameActivityCallbacks::onEditorAction" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityCallbacks"][::std::mem::size_of::() - 84usize]; + ["Alignment of GameActivityCallbacks"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityCallbacks::onStart"] + [::std::mem::offset_of!(GameActivityCallbacks, onStart) - 0usize]; + ["Offset of field: GameActivityCallbacks::onResume"] + [::std::mem::offset_of!(GameActivityCallbacks, onResume) - 4usize]; + ["Offset of field: GameActivityCallbacks::onSaveInstanceState"] + [::std::mem::offset_of!(GameActivityCallbacks, onSaveInstanceState) - 8usize]; + ["Offset of field: GameActivityCallbacks::onPause"] + [::std::mem::offset_of!(GameActivityCallbacks, onPause) - 12usize]; + ["Offset of field: GameActivityCallbacks::onStop"] + [::std::mem::offset_of!(GameActivityCallbacks, onStop) - 16usize]; + ["Offset of field: GameActivityCallbacks::onDestroy"] + [::std::mem::offset_of!(GameActivityCallbacks, onDestroy) - 20usize]; + ["Offset of field: GameActivityCallbacks::onWindowFocusChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowFocusChanged) - 24usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowCreated"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowCreated) - 28usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowResized"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowResized) - 32usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowRedrawNeeded) - 36usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowDestroyed"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowDestroyed) - 40usize]; + ["Offset of field: GameActivityCallbacks::onConfigurationChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onConfigurationChanged) - 44usize]; + ["Offset of field: GameActivityCallbacks::onTrimMemory"] + [::std::mem::offset_of!(GameActivityCallbacks, onTrimMemory) - 48usize]; + ["Offset of field: GameActivityCallbacks::onTouchEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTouchEvent) - 52usize]; + ["Offset of field: GameActivityCallbacks::onKeyDown"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyDown) - 56usize]; + ["Offset of field: GameActivityCallbacks::onKeyUp"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyUp) - 60usize]; + ["Offset of field: GameActivityCallbacks::onTextInputEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTextInputEvent) - 64usize]; + ["Offset of field: GameActivityCallbacks::onWindowInsetsChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowInsetsChanged) - 68usize]; + ["Offset of field: GameActivityCallbacks::onContentRectChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onContentRectChanged) - 72usize]; + ["Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged"][::std::mem::offset_of!( + GameActivityCallbacks, + onSoftwareKeyboardVisibilityChanged + ) - 76usize]; + ["Offset of field: GameActivityCallbacks::onEditorAction"] + [::std::mem::offset_of!(GameActivityCallbacks, onEditorAction) - 80usize]; +}; #[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( @@ -3300,7 +2828,7 @@ pub type GameActivity_createFunc = ::std::option::Option< savedStateSize: usize, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } @@ -3370,7 +2898,7 @@ pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; #[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, @@ -3386,22 +2914,22 @@ pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; #[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = u8; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n Note that this method can be called from *any* thread; it will send a message\n to the main thread of the process where the Java call will take place."] pub fn GameActivity_restartInput(activity: *mut GameActivity); } -extern "C" { +unsafe extern "C" { #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, @@ -3409,7 +2937,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } @@ -3421,11 +2949,11 @@ pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS GameActivityHideSoftInputFlags = 2; #[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = u16; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, @@ -3433,11 +2961,11 @@ extern "C" { insets: *mut ARect, ); } -extern "C" { +unsafe extern "C" { #[doc = " Tells whether the software keyboard is visible or not."] pub fn GameActivity_isSoftwareKeyboardVisible(activity: *mut GameActivity) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note: currently only TYPE_NULL AND TYPE_CLASS_NUMBER are supported."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, @@ -3446,70 +2974,70 @@ extern "C" { imeOptions: GameTextInputImeOptions, ); } -extern "C" { +unsafe extern "C" { #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontWeightAdjustment( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocalesCount(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getSmallestScreenWidthDp( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " The functions below return Java locale information.\n\n In simple cases there will be just one locale, but it's possible tha\n there are more than one locale objects. Users are encouraged to write code\n that handles all locales and not just the first one.\n\n The functions in the block below return string values in the provided buffer.\n Return value is zero if there were no errors, otherwise it's non-zero.\n If the return value is zero, `dst` will contain a null-terminated string:\n strlen(dst) <= dst_size - 1.\n If the return value is non-zero, the content of dst is undefined.\n\n Parameters:\n\n dst, dst_size: define a receiver buffer. Locale string can be something\n short like \"EN/EN\", but it may be longer. You should be safe with a buffer\n size of 256 bytes.\n\n If the buffer is too small, ENOBUFS is returned. Try allocating a larger\n buffer in this case.\n\n localeIdx must be between 0 and the value of GameActivity_getLocalesCount().\n If localeIdx is out of range, EINVAL is returned.\n\n Refer to Java documentation of locales for more information."] pub fn GameActivity_getLocaleLanguage( dst: *mut ::std::os::raw::c_char, @@ -3518,7 +3046,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleScript( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3526,7 +3054,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleCountry( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3534,7 +3062,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleVariant( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3636,32 +3164,14 @@ pub struct pollfd { pub events: ::std::os::raw::c_short, pub revents: ::std::os::raw::c_short, } -#[test] -fn bindgen_test_layout_pollfd() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of pollfd"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of pollfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, - 0usize, - "Offset of field: pollfd::fd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, - 4usize, - "Offset of field: pollfd::events" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, - 6usize, - "Offset of field: pollfd::revents" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pollfd"][::std::mem::size_of::() - 8usize]; + ["Alignment of pollfd"][::std::mem::align_of::() - 4usize]; + ["Offset of field: pollfd::fd"][::std::mem::offset_of!(pollfd, fd) - 0usize]; + ["Offset of field: pollfd::events"][::std::mem::offset_of!(pollfd, events) - 4usize]; + ["Offset of field: pollfd::revents"][::std::mem::offset_of!(pollfd, revents) - 6usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigcontext { @@ -3687,126 +3197,35 @@ pub struct sigcontext { pub arm_cpsr: ::std::os::raw::c_ulong, pub fault_address: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout_sigcontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 84usize, - "Size of sigcontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigcontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).trap_no) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext::trap_no" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, - 4usize, - "Offset of field: sigcontext::error_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r0) as usize - ptr as usize }, - 12usize, - "Offset of field: sigcontext::arm_r0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r1) as usize - ptr as usize }, - 16usize, - "Offset of field: sigcontext::arm_r1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r2) as usize - ptr as usize }, - 20usize, - "Offset of field: sigcontext::arm_r2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r3) as usize - ptr as usize }, - 24usize, - "Offset of field: sigcontext::arm_r3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r4) as usize - ptr as usize }, - 28usize, - "Offset of field: sigcontext::arm_r4" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r5) as usize - ptr as usize }, - 32usize, - "Offset of field: sigcontext::arm_r5" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r6) as usize - ptr as usize }, - 36usize, - "Offset of field: sigcontext::arm_r6" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r7) as usize - ptr as usize }, - 40usize, - "Offset of field: sigcontext::arm_r7" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r8) as usize - ptr as usize }, - 44usize, - "Offset of field: sigcontext::arm_r8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r9) as usize - ptr as usize }, - 48usize, - "Offset of field: sigcontext::arm_r9" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_r10) as usize - ptr as usize }, - 52usize, - "Offset of field: sigcontext::arm_r10" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_fp) as usize - ptr as usize }, - 56usize, - "Offset of field: sigcontext::arm_fp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_ip) as usize - ptr as usize }, - 60usize, - "Offset of field: sigcontext::arm_ip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_sp) as usize - ptr as usize }, - 64usize, - "Offset of field: sigcontext::arm_sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_lr) as usize - ptr as usize }, - 68usize, - "Offset of field: sigcontext::arm_lr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_pc) as usize - ptr as usize }, - 72usize, - "Offset of field: sigcontext::arm_pc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm_cpsr) as usize - ptr as usize }, - 76usize, - "Offset of field: sigcontext::arm_cpsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fault_address) as usize - ptr as usize }, - 80usize, - "Offset of field: sigcontext::fault_address" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext"][::std::mem::size_of::() - 84usize]; + ["Alignment of sigcontext"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigcontext::trap_no"][::std::mem::offset_of!(sigcontext, trap_no) - 0usize]; + ["Offset of field: sigcontext::error_code"] + [::std::mem::offset_of!(sigcontext, error_code) - 4usize]; + ["Offset of field: sigcontext::oldmask"][::std::mem::offset_of!(sigcontext, oldmask) - 8usize]; + ["Offset of field: sigcontext::arm_r0"][::std::mem::offset_of!(sigcontext, arm_r0) - 12usize]; + ["Offset of field: sigcontext::arm_r1"][::std::mem::offset_of!(sigcontext, arm_r1) - 16usize]; + ["Offset of field: sigcontext::arm_r2"][::std::mem::offset_of!(sigcontext, arm_r2) - 20usize]; + ["Offset of field: sigcontext::arm_r3"][::std::mem::offset_of!(sigcontext, arm_r3) - 24usize]; + ["Offset of field: sigcontext::arm_r4"][::std::mem::offset_of!(sigcontext, arm_r4) - 28usize]; + ["Offset of field: sigcontext::arm_r5"][::std::mem::offset_of!(sigcontext, arm_r5) - 32usize]; + ["Offset of field: sigcontext::arm_r6"][::std::mem::offset_of!(sigcontext, arm_r6) - 36usize]; + ["Offset of field: sigcontext::arm_r7"][::std::mem::offset_of!(sigcontext, arm_r7) - 40usize]; + ["Offset of field: sigcontext::arm_r8"][::std::mem::offset_of!(sigcontext, arm_r8) - 44usize]; + ["Offset of field: sigcontext::arm_r9"][::std::mem::offset_of!(sigcontext, arm_r9) - 48usize]; + ["Offset of field: sigcontext::arm_r10"][::std::mem::offset_of!(sigcontext, arm_r10) - 52usize]; + ["Offset of field: sigcontext::arm_fp"][::std::mem::offset_of!(sigcontext, arm_fp) - 56usize]; + ["Offset of field: sigcontext::arm_ip"][::std::mem::offset_of!(sigcontext, arm_ip) - 60usize]; + ["Offset of field: sigcontext::arm_sp"][::std::mem::offset_of!(sigcontext, arm_sp) - 64usize]; + ["Offset of field: sigcontext::arm_lr"][::std::mem::offset_of!(sigcontext, arm_lr) - 68usize]; + ["Offset of field: sigcontext::arm_pc"][::std::mem::offset_of!(sigcontext, arm_pc) - 72usize]; + ["Offset of field: sigcontext::arm_cpsr"] + [::std::mem::offset_of!(sigcontext, arm_cpsr) - 76usize]; + ["Offset of field: sigcontext::fault_address"] + [::std::mem::offset_of!(sigcontext, fault_address) - 80usize]; +}; pub type sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -3832,67 +3251,30 @@ pub union __kernel_sigaction__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sigaction__bindgen_ty_1>(), - 4usize, - "Size of __kernel_sigaction__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sigaction__bindgen_ty_1>(), - 4usize, - "Alignment of __kernel_sigaction__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout___kernel_sigaction() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sigaction>(), - 16usize, - "Size of __kernel_sigaction" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sigaction>(), - 4usize, - "Alignment of __kernel_sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._u) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction::_u" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 4usize, - "Offset of field: __kernel_sigaction::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 12usize, - "Offset of field: __kernel_sigaction::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sigaction__bindgen_ty_1"] + [::std::mem::size_of::<__kernel_sigaction__bindgen_ty_1>() - 4usize]; + ["Alignment of __kernel_sigaction__bindgen_ty_1"] + [::std::mem::align_of::<__kernel_sigaction__bindgen_ty_1>() - 4usize]; + ["Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_handler"] + [::std::mem::offset_of!(__kernel_sigaction__bindgen_ty_1, _sa_handler) - 0usize]; + ["Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_sigaction"] + [::std::mem::offset_of!(__kernel_sigaction__bindgen_ty_1, _sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sigaction"][::std::mem::size_of::<__kernel_sigaction>() - 16usize]; + ["Alignment of __kernel_sigaction"][::std::mem::align_of::<__kernel_sigaction>() - 4usize]; + ["Offset of field: __kernel_sigaction::_u"] + [::std::mem::offset_of!(__kernel_sigaction, _u) - 0usize]; + ["Offset of field: __kernel_sigaction::sa_mask"] + [::std::mem::offset_of!(__kernel_sigaction, sa_mask) - 4usize]; + ["Offset of field: __kernel_sigaction::sa_flags"] + [::std::mem::offset_of!(__kernel_sigaction, sa_flags) - 8usize]; + ["Offset of field: __kernel_sigaction::sa_restorer"] + [::std::mem::offset_of!(__kernel_sigaction, sa_restorer) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigaltstack { @@ -3900,36 +3282,16 @@ pub struct sigaltstack { pub ss_flags: ::std::os::raw::c_int, pub ss_size: __kernel_size_t, } -#[test] -fn bindgen_test_layout_sigaltstack() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of sigaltstack" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaltstack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaltstack::ss_sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, - 4usize, - "Offset of field: sigaltstack::ss_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaltstack::ss_size" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaltstack"][::std::mem::size_of::() - 12usize]; + ["Alignment of sigaltstack"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaltstack::ss_sp"][::std::mem::offset_of!(sigaltstack, ss_sp) - 0usize]; + ["Offset of field: sigaltstack::ss_flags"] + [::std::mem::offset_of!(sigaltstack, ss_flags) - 4usize]; + ["Offset of field: sigaltstack::ss_size"] + [::std::mem::offset_of!(sigaltstack, ss_size) - 8usize]; +}; pub type stack_t = sigaltstack; #[repr(C)] #[derive(Copy, Clone)] @@ -3937,27 +3299,13 @@ pub union sigval { pub sival_int: ::std::os::raw::c_int, pub sival_ptr: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 4usize, "Size of sigval"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_int" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_ptr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigval"][::std::mem::size_of::() - 4usize]; + ["Alignment of sigval"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigval::sival_int"][::std::mem::offset_of!(sigval, sival_int) - 0usize]; + ["Offset of field: sigval::sival_ptr"][::std::mem::offset_of!(sigval, sival_ptr) - 0usize]; +}; pub type sigval_t = sigval; #[repr(C)] #[derive(Copy, Clone)] @@ -3976,32 +3324,17 @@ pub struct __sifields__bindgen_ty_1 { pub _pid: __kernel_pid_t, pub _uid: __kernel_uid32_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_1>(), - 8usize, - "Size of __sifields__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_1::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_1::_uid" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_1>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_1::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_1::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _uid) - 4usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_2 { @@ -4010,42 +3343,21 @@ pub struct __sifields__bindgen_ty_2 { pub _sigval: sigval_t, pub _sys_private: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_2>(), - 16usize, - "Size of __sifields__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_2>(), - 4usize, - "Alignment of __sifields__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_2::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_2::_overrun" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_2::_sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_2::_sys_private" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_2>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_2>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_2::_tid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _tid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_2::_overrun"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _overrun) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sigval) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sys_private"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sys_private) - 12usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_3 { @@ -4053,37 +3365,19 @@ pub struct __sifields__bindgen_ty_3 { pub _uid: __kernel_uid32_t, pub _sigval: sigval_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_3>(), - 12usize, - "Size of __sifields__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_3>(), - 4usize, - "Alignment of __sifields__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_3::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_3::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_3::_sigval" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_3>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_3>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_3::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_3::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_3::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _sigval) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_4 { @@ -4093,47 +3387,23 @@ pub struct __sifields__bindgen_ty_4 { pub _utime: __kernel_clock_t, pub _stime: __kernel_clock_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_4>(), - 20usize, - "Size of __sifields__bindgen_ty_4" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_4>(), - 4usize, - "Alignment of __sifields__bindgen_ty_4" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_4::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_4::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_4::_status" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_4::_utime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_4::_stime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_4"] + [::std::mem::size_of::<__sifields__bindgen_ty_4>() - 20usize]; + ["Alignment of __sifields__bindgen_ty_4"] + [::std::mem::align_of::<__sifields__bindgen_ty_4>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_4::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_4::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_4::_status"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _status) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_4::_utime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _utime) - 12usize]; + ["Offset of field: __sifields__bindgen_ty_4::_stime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _stime) - 16usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_5 { @@ -4156,69 +3426,48 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { pub _lower: *mut ::std::os::raw::c_void, pub _upper: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _dummy_bnd + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _lower + ) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _upper + ) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { pub _dummy_pkey: [::std::os::raw::c_char; 4usize], pub _pkey: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 8usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _dummy_pkey + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _pkey + ) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { @@ -4226,131 +3475,68 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { pub _type: __u32, pub _flags: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._data) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._type) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5>(), - 16usize, - "Size of __sifields__bindgen_ty_5" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5::_addr" - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sifields__bindgen_ty_6 { - pub _band: ::std::os::raw::c_long, - pub _fd: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_6() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_6>(), - 8usize, - "Size of __sifields__bindgen_ty_6" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_6>(), - 4usize, - "Alignment of __sifields__bindgen_ty_6" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_6::_band" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_6::_fd" - ); +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _data + ) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _type + ) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _flags + ) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _trapno) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_lsb) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_bnd) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_pkey) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _perf) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5"] + [::std::mem::size_of::<__sifields__bindgen_ty_5>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_5"] + [::std::mem::align_of::<__sifields__bindgen_ty_5>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5::_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5, _addr) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sifields__bindgen_ty_6 { + pub _band: ::std::os::raw::c_long, + pub _fd: ::std::os::raw::c_int, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_6"] + [::std::mem::size_of::<__sifields__bindgen_ty_6>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_6"] + [::std::mem::align_of::<__sifields__bindgen_ty_6>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_6::_band"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _band) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_6::_fd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _fd) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_7 { @@ -4358,87 +3544,34 @@ pub struct __sifields__bindgen_ty_7 { pub _syscall: ::std::os::raw::c_int, pub _arch: ::std::os::raw::c_uint, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_7() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_7>(), - 12usize, - "Size of __sifields__bindgen_ty_7" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_7>(), - 4usize, - "Alignment of __sifields__bindgen_ty_7" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_7::_call_addr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_7::_syscall" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_7::_arch" - ); -} -#[test] -fn bindgen_test_layout___sifields() { - const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields>(), - 20usize, - "Size of __sifields" - ); - assert_eq!( - ::std::mem::align_of::<__sifields>(), - 4usize, - "Alignment of __sifields" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_kill" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_timer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_rt" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigchld" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigfault" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigpoll" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigsys" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_7"] + [::std::mem::size_of::<__sifields__bindgen_ty_7>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_7"] + [::std::mem::align_of::<__sifields__bindgen_ty_7>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_7::_call_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _call_addr) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_7::_syscall"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _syscall) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_7::_arch"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _arch) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields"][::std::mem::size_of::<__sifields>() - 20usize]; + ["Alignment of __sifields"][::std::mem::align_of::<__sifields>() - 4usize]; + ["Offset of field: __sifields::_kill"][::std::mem::offset_of!(__sifields, _kill) - 0usize]; + ["Offset of field: __sifields::_timer"][::std::mem::offset_of!(__sifields, _timer) - 0usize]; + ["Offset of field: __sifields::_rt"][::std::mem::offset_of!(__sifields, _rt) - 0usize]; + ["Offset of field: __sifields::_sigchld"] + [::std::mem::offset_of!(__sifields, _sigchld) - 0usize]; + ["Offset of field: __sifields::_sigfault"] + [::std::mem::offset_of!(__sifields, _sigfault) - 0usize]; + ["Offset of field: __sifields::_sigpoll"] + [::std::mem::offset_of!(__sifields, _sigpoll) - 0usize]; + ["Offset of field: __sifields::_sigsys"][::std::mem::offset_of!(__sifields, _sigsys) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct siginfo { @@ -4458,76 +3591,34 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { pub si_code: ::std::os::raw::c_int, pub _sifields: __sifields, } -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, - 4usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, - 8usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, - 12usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields" - ); -} -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of siginfo__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1::_si_pad" - ); -} -#[test] -fn bindgen_test_layout_siginfo() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of siginfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_signo) - 0usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_errno) - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_code) - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, _sifields) - 12usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1::_si_pad"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1, _si_pad) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo"][::std::mem::align_of::() - 4usize]; +}; pub type siginfo_t = siginfo; #[repr(C)] #[derive(Copy, Clone)] @@ -4550,98 +3641,41 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { pub _function: ::std::option::Option, pub _attribute: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, - 4usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute" - ); -} -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - "Size of sigevent__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigevent__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_pad" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_sigev_thread" - ); -} -#[test] -fn bindgen_test_layout_sigevent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - "Size of sigevent" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigevent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent::sigev_value" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, - 4usize, - "Offset of field: sigevent::sigev_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, - 8usize, - "Offset of field: sigevent::sigev_notify" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, - 12usize, - "Offset of field: sigevent::_sigev_un" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _function) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _attribute) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1"][::std::mem::size_of::() - 52usize]; + ["Alignment of sigevent__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigevent__bindgen_ty_1::_pad"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _pad) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_tid"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _tid) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_sigev_thread"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _sigev_thread) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent"][::std::mem::size_of::() - 64usize]; + ["Alignment of sigevent"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigevent::sigev_value"] + [::std::mem::offset_of!(sigevent, sigev_value) - 0usize]; + ["Offset of field: sigevent::sigev_signo"] + [::std::mem::offset_of!(sigevent, sigev_signo) - 4usize]; + ["Offset of field: sigevent::sigev_notify"] + [::std::mem::offset_of!(sigevent, sigev_notify) - 8usize]; + ["Offset of field: sigevent::_sigev_un"][::std::mem::offset_of!(sigevent, _sigev_un) - 12usize]; +}; pub type sigevent_t = sigevent; pub type sig_atomic_t = ::std::os::raw::c_int; pub type sig_t = __sighandler_t; @@ -4651,26 +3685,12 @@ pub type sighandler_t = __sighandler_t; pub struct sigset64_t { pub __bits: [::std::os::raw::c_ulong; 2usize], } -#[test] -fn bindgen_test_layout_sigset64_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigset64_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigset64_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__bits) as usize - ptr as usize }, - 0usize, - "Offset of field: sigset64_t::__bits" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigset64_t"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigset64_t"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigset64_t::__bits"][::std::mem::offset_of!(sigset64_t, __bits) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct sigaction { @@ -4691,62 +3711,25 @@ pub union sigaction__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sigaction__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of sigaction" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 4usize, - "Offset of field: sigaction::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 12usize, - "Offset of field: sigaction::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; + ["Alignment of sigaction__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction"][::std::mem::size_of::() - 16usize]; + ["Alignment of sigaction"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction::sa_mask"][::std::mem::offset_of!(sigaction, sa_mask) - 4usize]; + ["Offset of field: sigaction::sa_flags"][::std::mem::offset_of!(sigaction, sa_flags) - 8usize]; + ["Offset of field: sigaction::sa_restorer"] + [::std::mem::offset_of!(sigaction, sa_restorer) - 12usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct sigaction64 { @@ -4767,93 +3750,41 @@ pub union sigaction64__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction64__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sigaction64__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction64__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction64() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - "Size of sigaction64" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 4usize, - "Offset of field: sigaction64::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaction64::sa_restorer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 12usize, - "Offset of field: sigaction64::sa_mask" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64__bindgen_ty_1"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of sigaction64__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64"][::std::mem::size_of::() - 20usize]; + ["Alignment of sigaction64"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction64::sa_flags"] + [::std::mem::offset_of!(sigaction64, sa_flags) - 4usize]; + ["Offset of field: sigaction64::sa_restorer"] + [::std::mem::offset_of!(sigaction64, sa_restorer) - 8usize]; + ["Offset of field: sigaction64::sa_mask"] + [::std::mem::offset_of!(sigaction64, sa_mask) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_timespec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of timespec" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 4usize, - "Offset of field: timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timespec"][::std::mem::size_of::() - 8usize]; + ["Alignment of timespec"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize]; + ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_fpregs { @@ -4869,19 +3800,11 @@ pub struct user_fpregs_fp_reg { pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 12usize]>, } -#[test] -fn bindgen_test_layout_user_fpregs_fp_reg() { - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of user_fpregs_fp_reg" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of user_fpregs_fp_reg" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_fpregs_fp_reg"][::std::mem::size_of::() - 12usize]; + ["Alignment of user_fpregs_fp_reg"][::std::mem::align_of::() - 4usize]; +}; impl user_fpregs_fp_reg { #[inline] pub fn sign1(&self) -> ::std::os::raw::c_uint { @@ -5156,36 +4079,15 @@ impl user_fpregs_fp_reg { __bindgen_bitfield_unit } } -#[test] -fn bindgen_test_layout_user_fpregs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 116usize, - "Size of user_fpregs" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of user_fpregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, - 0usize, - "Offset of field: user_fpregs::fpregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ftype) as usize - ptr as usize }, - 104usize, - "Offset of field: user_fpregs::ftype" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).init_flag) as usize - ptr as usize }, - 112usize, - "Offset of field: user_fpregs::init_flag" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_fpregs"][::std::mem::size_of::() - 116usize]; + ["Alignment of user_fpregs"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user_fpregs::fpregs"][::std::mem::offset_of!(user_fpregs, fpregs) - 0usize]; + ["Offset of field: user_fpregs::ftype"][::std::mem::offset_of!(user_fpregs, ftype) - 104usize]; + ["Offset of field: user_fpregs::init_flag"] + [::std::mem::offset_of!(user_fpregs, init_flag) - 112usize]; +}; impl user_fpregs { #[inline] pub fn fpsr(&self) -> ::std::os::raw::c_uint { @@ -5275,57 +4177,25 @@ impl user_fpregs { pub struct user_regs { pub uregs: [::std::os::raw::c_ulong; 18usize], } -#[test] -fn bindgen_test_layout_user_regs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 72usize, - "Size of user_regs" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of user_regs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uregs) as usize - ptr as usize }, - 0usize, - "Offset of field: user_regs::uregs" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_regs"][::std::mem::size_of::() - 72usize]; + ["Alignment of user_regs"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user_regs::uregs"][::std::mem::offset_of!(user_regs, uregs) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_vfp { pub fpregs: [::std::os::raw::c_ulonglong; 32usize], pub fpscr: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout_user_vfp() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 264usize, - "Size of user_vfp" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of user_vfp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, - 0usize, - "Offset of field: user_vfp::fpregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpscr) as usize - ptr as usize }, - 256usize, - "Offset of field: user_vfp::fpscr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_vfp"][::std::mem::size_of::() - 264usize]; + ["Alignment of user_vfp"][::std::mem::align_of::() - 8usize]; + ["Offset of field: user_vfp::fpregs"][::std::mem::offset_of!(user_vfp, fpregs) - 0usize]; + ["Offset of field: user_vfp::fpscr"][::std::mem::offset_of!(user_vfp, fpscr) - 256usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_vfp_exc { @@ -5333,36 +4203,16 @@ pub struct user_vfp_exc { pub fpinst: ::std::os::raw::c_ulong, pub fpinst2: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout_user_vfp_exc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of user_vfp_exc" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of user_vfp_exc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpexc) as usize - ptr as usize }, - 0usize, - "Offset of field: user_vfp_exc::fpexc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpinst) as usize - ptr as usize }, - 4usize, - "Offset of field: user_vfp_exc::fpinst" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpinst2) as usize - ptr as usize }, - 8usize, - "Offset of field: user_vfp_exc::fpinst2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_vfp_exc"][::std::mem::size_of::() - 12usize]; + ["Alignment of user_vfp_exc"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user_vfp_exc::fpexc"][::std::mem::offset_of!(user_vfp_exc, fpexc) - 0usize]; + ["Offset of field: user_vfp_exc::fpinst"] + [::std::mem::offset_of!(user_vfp_exc, fpinst) - 4usize]; + ["Offset of field: user_vfp_exc::fpinst2"] + [::std::mem::offset_of!(user_vfp_exc, fpinst2) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user { @@ -5382,88 +4232,26 @@ pub struct user { pub u_fp: user_fpregs, pub u_fp0: *mut user_fpregs, } -#[test] -fn bindgen_test_layout_user() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 296usize, "Size of user"); - assert_eq!(::std::mem::align_of::(), 4usize, "Alignment of user"); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, - 0usize, - "Offset of field: user::regs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_fpvalid) as usize - ptr as usize }, - 72usize, - "Offset of field: user::u_fpvalid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_tsize) as usize - ptr as usize }, - 76usize, - "Offset of field: user::u_tsize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_dsize) as usize - ptr as usize }, - 80usize, - "Offset of field: user::u_dsize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_ssize) as usize - ptr as usize }, - 84usize, - "Offset of field: user::u_ssize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_code) as usize - ptr as usize }, - 88usize, - "Offset of field: user::start_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_stack) as usize - ptr as usize }, - 92usize, - "Offset of field: user::start_stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).signal) as usize - ptr as usize }, - 96usize, - "Offset of field: user::signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 100usize, - "Offset of field: user::reserved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_ar0) as usize - ptr as usize }, - 104usize, - "Offset of field: user::u_ar0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 108usize, - "Offset of field: user::magic" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_comm) as usize - ptr as usize }, - 112usize, - "Offset of field: user::u_comm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_debugreg) as usize - ptr as usize }, - 144usize, - "Offset of field: user::u_debugreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_fp) as usize - ptr as usize }, - 176usize, - "Offset of field: user::u_fp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_fp0) as usize - ptr as usize }, - 292usize, - "Offset of field: user::u_fp0" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user"][::std::mem::size_of::() - 296usize]; + ["Alignment of user"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user::regs"][::std::mem::offset_of!(user, regs) - 0usize]; + ["Offset of field: user::u_fpvalid"][::std::mem::offset_of!(user, u_fpvalid) - 72usize]; + ["Offset of field: user::u_tsize"][::std::mem::offset_of!(user, u_tsize) - 76usize]; + ["Offset of field: user::u_dsize"][::std::mem::offset_of!(user, u_dsize) - 80usize]; + ["Offset of field: user::u_ssize"][::std::mem::offset_of!(user, u_ssize) - 84usize]; + ["Offset of field: user::start_code"][::std::mem::offset_of!(user, start_code) - 88usize]; + ["Offset of field: user::start_stack"][::std::mem::offset_of!(user, start_stack) - 92usize]; + ["Offset of field: user::signal"][::std::mem::offset_of!(user, signal) - 96usize]; + ["Offset of field: user::reserved"][::std::mem::offset_of!(user, reserved) - 100usize]; + ["Offset of field: user::u_ar0"][::std::mem::offset_of!(user, u_ar0) - 104usize]; + ["Offset of field: user::magic"][::std::mem::offset_of!(user, magic) - 108usize]; + ["Offset of field: user::u_comm"][::std::mem::offset_of!(user, u_comm) - 112usize]; + ["Offset of field: user::u_debugreg"][::std::mem::offset_of!(user, u_debugreg) - 144usize]; + ["Offset of field: user::u_fp"][::std::mem::offset_of!(user, u_fp) - 176usize]; + ["Offset of field: user::u_fp0"][::std::mem::offset_of!(user, u_fp0) - 292usize]; +}; pub const REG_R0: _bindgen_ty_22 = 0; pub const REG_R1: _bindgen_ty_22 = 1; pub const REG_R2: _bindgen_ty_22 = 2; @@ -5509,291 +4297,234 @@ pub struct ucontext__bindgen_ty_1__bindgen_ty_1 { pub uc_sigmask: sigset_t, pub __padding_rt_sigset: u32, } -#[test] -fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of ucontext__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of ucontext__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::uc_sigmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__padding_rt_sigset) as usize - ptr as usize }, - 4usize, - "Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::__padding_rt_sigset" - ); -} -#[test] -fn bindgen_test_layout_ucontext__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of ucontext__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of ucontext__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1::uc_sigmask64" - ); -} -#[test] -fn bindgen_test_layout_ucontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 744usize, - "Size of ucontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of ucontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext::uc_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, - 4usize, - "Offset of field: ucontext::uc_link" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, - 8usize, - "Offset of field: ucontext::uc_stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, - 20usize, - "Offset of field: ucontext::uc_mcontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__padding) as usize - ptr as usize }, - 112usize, - "Offset of field: ucontext::__padding" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_regspace) as usize - ptr as usize }, - 232usize, - "Offset of field: ucontext::uc_regspace" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of ucontext__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::uc_sigmask"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1__bindgen_ty_1, uc_sigmask) - 0usize]; + ["Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::__padding_rt_sigset"][::std::mem::offset_of!( + ucontext__bindgen_ty_1__bindgen_ty_1, + __padding_rt_sigset + ) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; + ["Alignment of ucontext__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ucontext__bindgen_ty_1::uc_sigmask64"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1, uc_sigmask64) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext"][::std::mem::size_of::() - 744usize]; + ["Alignment of ucontext"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ucontext::uc_flags"][::std::mem::offset_of!(ucontext, uc_flags) - 0usize]; + ["Offset of field: ucontext::uc_link"][::std::mem::offset_of!(ucontext, uc_link) - 4usize]; + ["Offset of field: ucontext::uc_stack"][::std::mem::offset_of!(ucontext, uc_stack) - 8usize]; + ["Offset of field: ucontext::uc_mcontext"] + [::std::mem::offset_of!(ucontext, uc_mcontext) - 20usize]; + ["Offset of field: ucontext::__padding"] + [::std::mem::offset_of!(ucontext, __padding) - 112usize]; + ["Offset of field: ucontext::uc_regspace"] + [::std::mem::offset_of!(ucontext, uc_regspace) - 232usize]; +}; pub type ucontext_t = ucontext; -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmin() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmax() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static sys_siglist: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub static sys_signame: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub fn sigaction( __signal: ::std::os::raw::c_int, __new_action: *const sigaction, __old_action: *mut sigaction, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaction64( __signal: ::std::os::raw::c_int, __new_action: *const sigaction64, __old_action: *mut sigaction64, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn siginterrupt( __signal: ::std::os::raw::c_int, __flag: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn signal(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn sigaddset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaddset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember( __set: *const sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember64( __set: *const sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask( __how: ::std::os::raw::c_int, __new_set: *const sigset_t, __old_set: *mut sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask64( __how: ::std::os::raw::c_int, __new_set: *const sigset64_t, __old_set: *mut sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend(__mask: *const sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend64(__mask: *const sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait( __set: *const sigset_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait64( __set: *const sigset64_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sighold(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigignore(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpause(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigrelse(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigset(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn raise(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn kill(__pid: pid_t, __signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn killpg( __pgrp: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn tgkill( __tgid: ::std::os::raw::c_int, __tid: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaltstack( __new_signal_stack: *const stack_t, __old_signal_stack: *mut stack_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn psiginfo(__info: *const siginfo_t, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn sigqueue( __pid: pid_t, __signal: ::std::os::raw::c_int, __value: sigval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait( __set: *const sigset_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait64( __set: *const sigset64_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo(__set: *const sigset_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo64(__set: *const sigset64_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } @@ -5803,282 +4534,145 @@ pub struct __kernel_timespec { pub tv_sec: __kernel_time64_t, pub tv_nsec: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout___kernel_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_timespec>(), - 16usize, - "Size of __kernel_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_timespec>(), - 8usize, - "Alignment of __kernel_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_timespec"][::std::mem::size_of::<__kernel_timespec>() - 16usize]; + ["Alignment of __kernel_timespec"][::std::mem::align_of::<__kernel_timespec>() - 8usize]; + ["Offset of field: __kernel_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_itimerspec { pub it_interval: __kernel_timespec, pub it_value: __kernel_timespec, } -#[test] -fn bindgen_test_layout___kernel_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_itimerspec>(), - 32usize, - "Size of __kernel_itimerspec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_itimerspec>(), - 8usize, - "Alignment of __kernel_itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: __kernel_itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_itimerspec"][::std::mem::size_of::<__kernel_itimerspec>() - 32usize]; + ["Alignment of __kernel_itimerspec"][::std::mem::align_of::<__kernel_itimerspec>() - 8usize]; + ["Offset of field: __kernel_itimerspec::it_interval"] + [::std::mem::offset_of!(__kernel_itimerspec, it_interval) - 0usize]; + ["Offset of field: __kernel_itimerspec::it_value"] + [::std::mem::offset_of!(__kernel_itimerspec, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_old_timespec { pub tv_sec: __kernel_old_time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout___kernel_old_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), - 8usize, - "Size of __kernel_old_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), - 4usize, - "Alignment of __kernel_old_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_old_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 4usize, - "Offset of field: __kernel_old_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_old_timespec"][::std::mem::size_of::<__kernel_old_timespec>() - 8usize]; + ["Alignment of __kernel_old_timespec"] + [::std::mem::align_of::<__kernel_old_timespec>() - 4usize]; + ["Offset of field: __kernel_old_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_old_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_nsec) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_sock_timeval { pub tv_sec: __s64, pub tv_usec: __s64, } -#[test] -fn bindgen_test_layout___kernel_sock_timeval() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sock_timeval>(), - 16usize, - "Size of __kernel_sock_timeval" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sock_timeval>(), - 8usize, - "Alignment of __kernel_sock_timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sock_timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sock_timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sock_timeval"][::std::mem::size_of::<__kernel_sock_timeval>() - 16usize]; + ["Alignment of __kernel_sock_timeval"] + [::std::mem::align_of::<__kernel_sock_timeval>() - 8usize]; + ["Offset of field: __kernel_sock_timeval::tv_sec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_sec) - 0usize]; + ["Offset of field: __kernel_sock_timeval::tv_usec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_usec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } -#[test] -fn bindgen_test_layout_timeval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of timeval"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 4usize, - "Offset of field: timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timeval"][::std::mem::size_of::() - 8usize]; + ["Alignment of timeval"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timeval::tv_sec"][::std::mem::offset_of!(timeval, tv_sec) - 0usize]; + ["Offset of field: timeval::tv_usec"][::std::mem::offset_of!(timeval, tv_usec) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, } -#[test] -fn bindgen_test_layout_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of itimerspec" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 8usize, - "Offset of field: itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerspec"][::std::mem::size_of::() - 16usize]; + ["Alignment of itimerspec"][::std::mem::align_of::() - 4usize]; + ["Offset of field: itimerspec::it_interval"] + [::std::mem::offset_of!(itimerspec, it_interval) - 0usize]; + ["Offset of field: itimerspec::it_value"] + [::std::mem::offset_of!(itimerspec, it_value) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerval { pub it_interval: timeval, pub it_value: timeval, } -#[test] -fn bindgen_test_layout_itimerval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of itimerval" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of itimerval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerval::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 8usize, - "Offset of field: itimerval::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerval"][::std::mem::size_of::() - 16usize]; + ["Alignment of itimerval"][::std::mem::align_of::() - 4usize]; + ["Offset of field: itimerval::it_interval"] + [::std::mem::offset_of!(itimerval, it_interval) - 0usize]; + ["Offset of field: itimerval::it_value"][::std::mem::offset_of!(itimerval, it_value) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timezone { pub tz_minuteswest: ::std::os::raw::c_int, pub tz_dsttime: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_timezone() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of timezone" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timezone" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, - 0usize, - "Offset of field: timezone::tz_minuteswest" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr as usize }, - 4usize, - "Offset of field: timezone::tz_dsttime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timezone"][::std::mem::size_of::() - 8usize]; + ["Alignment of timezone"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timezone::tz_minuteswest"] + [::std::mem::offset_of!(timezone, tz_minuteswest) - 0usize]; + ["Offset of field: timezone::tz_dsttime"] + [::std::mem::offset_of!(timezone, tz_dsttime) - 4usize]; +}; pub type fd_mask = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct fd_set { pub fds_bits: [fd_mask; 32usize], } -#[test] -fn bindgen_test_layout_fd_set() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 128usize, "Size of fd_set"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: fd_set::fds_bits" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of fd_set"][::std::mem::size_of::() - 128usize]; + ["Alignment of fd_set"][::std::mem::align_of::() - 4usize]; + ["Offset of field: fd_set::fds_bits"][::std::mem::offset_of!(fd_set, fds_bits) - 0usize]; +}; +unsafe extern "C" { pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, arg3: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn select( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6087,7 +4681,7 @@ extern "C" { __timeout: *mut timeval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6097,7 +4691,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect64( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6107,26 +4701,26 @@ extern "C" { __mask: *const sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn gettimeofday(__tv: *mut timeval, __tz: *mut timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn settimeofday(__tv: *const timeval, __tz: *const timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn getitimer( __which: ::std::os::raw::c_int, __current_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn setitimer( __which: ::std::os::raw::c_int, __new_value: *const itimerval, __old_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn utimes( __path: *const ::std::os::raw::c_char, __times: *const timeval, @@ -6138,13 +4732,13 @@ pub struct __locale_t { _unused: [u8; 0], } pub type locale_t = *mut __locale_t; -extern "C" { +unsafe extern "C" { pub static mut tzname: [*mut ::std::os::raw::c_char; 0usize]; } -extern "C" { +unsafe extern "C" { pub static mut daylight: ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static mut timezone: ::std::os::raw::c_long; } #[repr(C)] @@ -6162,118 +4756,72 @@ pub struct tm { pub tm_gmtoff: ::std::os::raw::c_long, pub tm_zone: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_tm() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 44usize, "Size of tm"); - assert_eq!(::std::mem::align_of::(), 4usize, "Alignment of tm"); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: tm::tm_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, - 4usize, - "Offset of field: tm::tm_min" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, - 8usize, - "Offset of field: tm::tm_hour" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, - 12usize, - "Offset of field: tm::tm_mday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, - 16usize, - "Offset of field: tm::tm_mon" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, - 20usize, - "Offset of field: tm::tm_year" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, - 24usize, - "Offset of field: tm::tm_wday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, - 28usize, - "Offset of field: tm::tm_yday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, - 32usize, - "Offset of field: tm::tm_isdst" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, - 36usize, - "Offset of field: tm::tm_gmtoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, - 40usize, - "Offset of field: tm::tm_zone" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of tm"][::std::mem::size_of::() - 44usize]; + ["Alignment of tm"][::std::mem::align_of::() - 4usize]; + ["Offset of field: tm::tm_sec"][::std::mem::offset_of!(tm, tm_sec) - 0usize]; + ["Offset of field: tm::tm_min"][::std::mem::offset_of!(tm, tm_min) - 4usize]; + ["Offset of field: tm::tm_hour"][::std::mem::offset_of!(tm, tm_hour) - 8usize]; + ["Offset of field: tm::tm_mday"][::std::mem::offset_of!(tm, tm_mday) - 12usize]; + ["Offset of field: tm::tm_mon"][::std::mem::offset_of!(tm, tm_mon) - 16usize]; + ["Offset of field: tm::tm_year"][::std::mem::offset_of!(tm, tm_year) - 20usize]; + ["Offset of field: tm::tm_wday"][::std::mem::offset_of!(tm, tm_wday) - 24usize]; + ["Offset of field: tm::tm_yday"][::std::mem::offset_of!(tm, tm_yday) - 28usize]; + ["Offset of field: tm::tm_isdst"][::std::mem::offset_of!(tm, tm_isdst) - 32usize]; + ["Offset of field: tm::tm_gmtoff"][::std::mem::offset_of!(tm, tm_gmtoff) - 36usize]; + ["Offset of field: tm::tm_zone"][::std::mem::offset_of!(tm, tm_zone) - 40usize]; +}; +unsafe extern "C" { pub fn time(__t: *mut time_t) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn nanosleep( __request: *const timespec, __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn asctime(__tm: *const tm) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn asctime_r( __tm: *const tm, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn difftime(__lhs: time_t, __rhs: time_t) -> f64; } -extern "C" { +unsafe extern "C" { pub fn mktime(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn localtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn localtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timelocal(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn gmtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn gmtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timegm(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn strptime( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, __tm: *mut tm, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strptime_l( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, @@ -6281,7 +4829,7 @@ extern "C" { __l: locale_t, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -6289,7 +4837,7 @@ extern "C" { __tm: *const tm, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -6298,31 +4846,31 @@ extern "C" { __l: locale_t, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn ctime_r( __t: *const time_t, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn tzset(); } -extern "C" { +unsafe extern "C" { pub fn clock() -> clock_t; } -extern "C" { +unsafe extern "C" { pub fn clock_getcpuclockid(__pid: pid_t, __clock: *mut clockid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_getres(__clock: clockid_t, __resolution: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_gettime(__clock: clockid_t, __ts: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_nanosleep( __clock: clockid_t, __flags: ::std::os::raw::c_int, @@ -6330,20 +4878,20 @@ extern "C" { __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_settime(__clock: clockid_t, __ts: *const timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_create( __clock: clockid_t, __event: *mut sigevent, __timer_ptr: *mut timer_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_delete(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_settime( __timer: timer_t, __flags: ::std::os::raw::c_int, @@ -6351,33 +4899,33 @@ extern "C" { __old_value: *mut itimerspec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_gettime(_timer: timer_t, __ts: *mut itimerspec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_getoverrun(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_get( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_getres( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } pub type nfds_t = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn poll( __fds: *mut pollfd, __count: nfds_t, __timeout_ms: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll( __fds: *mut pollfd, __count: nfds_t, @@ -6385,7 +4933,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll64( __fds: *mut pollfd, __count: nfds_t, @@ -6408,127 +4956,65 @@ pub struct clone_args { pub set_tid_size: __u64, pub cgroup: __u64, } -#[test] -fn bindgen_test_layout_clone_args() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of clone_args" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of clone_args" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 0usize, - "Offset of field: clone_args::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, - 8usize, - "Offset of field: clone_args::pidfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, - 16usize, - "Offset of field: clone_args::child_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, - 24usize, - "Offset of field: clone_args::parent_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, - 32usize, - "Offset of field: clone_args::exit_signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, - 40usize, - "Offset of field: clone_args::stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, - 48usize, - "Offset of field: clone_args::stack_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 56usize, - "Offset of field: clone_args::tls" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, - 64usize, - "Offset of field: clone_args::set_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, - 72usize, - "Offset of field: clone_args::set_tid_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, - 80usize, - "Offset of field: clone_args::cgroup" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of clone_args"][::std::mem::size_of::() - 88usize]; + ["Alignment of clone_args"][::std::mem::align_of::() - 8usize]; + ["Offset of field: clone_args::flags"][::std::mem::offset_of!(clone_args, flags) - 0usize]; + ["Offset of field: clone_args::pidfd"][::std::mem::offset_of!(clone_args, pidfd) - 8usize]; + ["Offset of field: clone_args::child_tid"] + [::std::mem::offset_of!(clone_args, child_tid) - 16usize]; + ["Offset of field: clone_args::parent_tid"] + [::std::mem::offset_of!(clone_args, parent_tid) - 24usize]; + ["Offset of field: clone_args::exit_signal"] + [::std::mem::offset_of!(clone_args, exit_signal) - 32usize]; + ["Offset of field: clone_args::stack"][::std::mem::offset_of!(clone_args, stack) - 40usize]; + ["Offset of field: clone_args::stack_size"] + [::std::mem::offset_of!(clone_args, stack_size) - 48usize]; + ["Offset of field: clone_args::tls"][::std::mem::offset_of!(clone_args, tls) - 56usize]; + ["Offset of field: clone_args::set_tid"][::std::mem::offset_of!(clone_args, set_tid) - 64usize]; + ["Offset of field: clone_args::set_tid_size"] + [::std::mem::offset_of!(clone_args, set_tid_size) - 72usize]; + ["Offset of field: clone_args::cgroup"][::std::mem::offset_of!(clone_args, cgroup) - 80usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sched_param { pub sched_priority: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_sched_param() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sched_param" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sched_param" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, - 0usize, - "Offset of field: sched_param::sched_priority" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sched_param"][::std::mem::size_of::() - 4usize]; + ["Alignment of sched_param"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sched_param::sched_priority"] + [::std::mem::offset_of!(sched_param, sched_priority) - 0usize]; +}; +unsafe extern "C" { pub fn sched_setscheduler( __pid: pid_t, __policy: ::std::os::raw::c_int, __param: *const sched_param, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getscheduler(__pid: pid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_yield() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_max(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_min(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_setparam(__pid: pid_t, __param: *const sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getparam(__pid: pid_t, __param: *mut sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_23 = 0; @@ -6549,44 +5035,25 @@ pub struct __pthread_cleanup_t { ::std::option::Option, pub __cleanup_arg: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___pthread_cleanup_t() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cleanup_t>(), - 12usize, - "Size of __pthread_cleanup_t" - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cleanup_t>(), - 4usize, - "Alignment of __pthread_cleanup_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, - 0usize, - "Offset of field: __pthread_cleanup_t::__cleanup_prev" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, - 4usize, - "Offset of field: __pthread_cleanup_t::__cleanup_routine" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, - 8usize, - "Offset of field: __pthread_cleanup_t::__cleanup_arg" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __pthread_cleanup_t"][::std::mem::size_of::<__pthread_cleanup_t>() - 12usize]; + ["Alignment of __pthread_cleanup_t"][::std::mem::align_of::<__pthread_cleanup_t>() - 4usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_prev"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_prev) - 0usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_routine"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_routine) - 4usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_arg"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_arg) - 8usize]; +}; +unsafe extern "C" { pub fn __pthread_cleanup_push( c: *mut __pthread_cleanup_t, arg1: ::std::option::Option, arg2: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } #[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] @@ -6602,36 +5069,17 @@ pub struct android_poll_source { unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } -#[test] -fn bindgen_test_layout_android_poll_source() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of android_poll_source" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of android_poll_source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: android_poll_source::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, - 4usize, - "Offset of field: android_poll_source::app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, - 8usize, - "Offset of field: android_poll_source::process" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_poll_source"][::std::mem::size_of::() - 12usize]; + ["Alignment of android_poll_source"][::std::mem::align_of::() - 4usize]; + ["Offset of field: android_poll_source::id"] + [::std::mem::offset_of!(android_poll_source, id) - 0usize]; + ["Offset of field: android_poll_source::app"] + [::std::mem::offset_of!(android_poll_source, app) - 4usize]; + ["Offset of field: android_poll_source::process"] + [::std::mem::offset_of!(android_poll_source, process) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { @@ -6648,51 +5096,23 @@ pub struct android_input_buffer { #[doc = " The size of the `keyEvents` buffer."] pub keyEventsBufferSize: u64, } -#[test] -fn bindgen_test_layout_android_input_buffer() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - "Size of android_input_buffer" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_input_buffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, - 0usize, - "Offset of field: android_input_buffer::motionEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, - 8usize, - "Offset of field: android_input_buffer::motionEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, - 16usize, - "Offset of field: android_input_buffer::motionEventsBufferSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, - 24usize, - "Offset of field: android_input_buffer::keyEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, - 32usize, - "Offset of field: android_input_buffer::keyEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, - 40usize, - "Offset of field: android_input_buffer::keyEventsBufferSize" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_input_buffer"][::std::mem::size_of::() - 48usize]; + ["Alignment of android_input_buffer"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_input_buffer::motionEvents"] + [::std::mem::offset_of!(android_input_buffer, motionEvents) - 0usize]; + ["Offset of field: android_input_buffer::motionEventsCount"] + [::std::mem::offset_of!(android_input_buffer, motionEventsCount) - 8usize]; + ["Offset of field: android_input_buffer::motionEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, motionEventsBufferSize) - 16usize]; + ["Offset of field: android_input_buffer::keyEvents"] + [::std::mem::offset_of!(android_input_buffer, keyEvents) - 24usize]; + ["Offset of field: android_input_buffer::keyEventsCount"] + [::std::mem::offset_of!(android_input_buffer, keyEventsCount) - 32usize]; + ["Offset of field: android_input_buffer::keyEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, keyEventsBufferSize) - 40usize]; +}; #[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; @@ -6751,181 +5171,70 @@ pub struct android_app { pub inputAvailableWakeUp: bool, pub inputSwapPending: bool, } -#[test] -fn bindgen_test_layout_android_app() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 248usize, - "Size of android_app" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, - 0usize, - "Offset of field: android_app::userData" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, - 4usize, - "Offset of field: android_app::onAppCmd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, - 8usize, - "Offset of field: android_app::activity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, - 12usize, - "Offset of field: android_app::config" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, - 16usize, - "Offset of field: android_app::savedState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, - 20usize, - "Offset of field: android_app::savedStateSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, - 24usize, - "Offset of field: android_app::looper" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, - 28usize, - "Offset of field: android_app::window" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, - 32usize, - "Offset of field: android_app::contentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).softwareKeyboardVisible) as usize - ptr as usize }, - 48usize, - "Offset of field: android_app::softwareKeyboardVisible" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).editorAction) as usize - ptr as usize }, - 52usize, - "Offset of field: android_app::editorAction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, - 56usize, - "Offset of field: android_app::activityState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, - 60usize, - "Offset of field: android_app::destroyRequested" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, - 64usize, - "Offset of field: android_app::inputBuffers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, - 160usize, - "Offset of field: android_app::currentInputBuffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, - 164usize, - "Offset of field: android_app::textInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, - 168usize, - "Offset of field: android_app::mutex" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, - 172usize, - "Offset of field: android_app::cond" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, - 176usize, - "Offset of field: android_app::msgread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, - 180usize, - "Offset of field: android_app::msgwrite" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, - 184usize, - "Offset of field: android_app::thread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, - 188usize, - "Offset of field: android_app::cmdPollSource" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, - 200usize, - "Offset of field: android_app::running" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, - 204usize, - "Offset of field: android_app::stateSaved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, - 208usize, - "Offset of field: android_app::destroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, - 212usize, - "Offset of field: android_app::redrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, - 216usize, - "Offset of field: android_app::pendingWindow" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, - 220usize, - "Offset of field: android_app::pendingContentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, - 236usize, - "Offset of field: android_app::keyEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, - 240usize, - "Offset of field: android_app::motionEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, - 244usize, - "Offset of field: android_app::inputAvailableWakeUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, - 245usize, - "Offset of field: android_app::inputSwapPending" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_app"][::std::mem::size_of::() - 248usize]; + ["Alignment of android_app"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_app::userData"] + [::std::mem::offset_of!(android_app, userData) - 0usize]; + ["Offset of field: android_app::onAppCmd"] + [::std::mem::offset_of!(android_app, onAppCmd) - 4usize]; + ["Offset of field: android_app::activity"] + [::std::mem::offset_of!(android_app, activity) - 8usize]; + ["Offset of field: android_app::config"][::std::mem::offset_of!(android_app, config) - 12usize]; + ["Offset of field: android_app::savedState"] + [::std::mem::offset_of!(android_app, savedState) - 16usize]; + ["Offset of field: android_app::savedStateSize"] + [::std::mem::offset_of!(android_app, savedStateSize) - 20usize]; + ["Offset of field: android_app::looper"][::std::mem::offset_of!(android_app, looper) - 24usize]; + ["Offset of field: android_app::window"][::std::mem::offset_of!(android_app, window) - 28usize]; + ["Offset of field: android_app::contentRect"] + [::std::mem::offset_of!(android_app, contentRect) - 32usize]; + ["Offset of field: android_app::softwareKeyboardVisible"] + [::std::mem::offset_of!(android_app, softwareKeyboardVisible) - 48usize]; + ["Offset of field: android_app::editorAction"] + [::std::mem::offset_of!(android_app, editorAction) - 52usize]; + ["Offset of field: android_app::activityState"] + [::std::mem::offset_of!(android_app, activityState) - 56usize]; + ["Offset of field: android_app::destroyRequested"] + [::std::mem::offset_of!(android_app, destroyRequested) - 60usize]; + ["Offset of field: android_app::inputBuffers"] + [::std::mem::offset_of!(android_app, inputBuffers) - 64usize]; + ["Offset of field: android_app::currentInputBuffer"] + [::std::mem::offset_of!(android_app, currentInputBuffer) - 160usize]; + ["Offset of field: android_app::textInputState"] + [::std::mem::offset_of!(android_app, textInputState) - 164usize]; + ["Offset of field: android_app::mutex"][::std::mem::offset_of!(android_app, mutex) - 168usize]; + ["Offset of field: android_app::cond"][::std::mem::offset_of!(android_app, cond) - 172usize]; + ["Offset of field: android_app::msgread"] + [::std::mem::offset_of!(android_app, msgread) - 176usize]; + ["Offset of field: android_app::msgwrite"] + [::std::mem::offset_of!(android_app, msgwrite) - 180usize]; + ["Offset of field: android_app::thread"] + [::std::mem::offset_of!(android_app, thread) - 184usize]; + ["Offset of field: android_app::cmdPollSource"] + [::std::mem::offset_of!(android_app, cmdPollSource) - 188usize]; + ["Offset of field: android_app::running"] + [::std::mem::offset_of!(android_app, running) - 200usize]; + ["Offset of field: android_app::stateSaved"] + [::std::mem::offset_of!(android_app, stateSaved) - 204usize]; + ["Offset of field: android_app::destroyed"] + [::std::mem::offset_of!(android_app, destroyed) - 208usize]; + ["Offset of field: android_app::redrawNeeded"] + [::std::mem::offset_of!(android_app, redrawNeeded) - 212usize]; + ["Offset of field: android_app::pendingWindow"] + [::std::mem::offset_of!(android_app, pendingWindow) - 216usize]; + ["Offset of field: android_app::pendingContentRect"] + [::std::mem::offset_of!(android_app, pendingContentRect) - 220usize]; + ["Offset of field: android_app::keyEventFilter"] + [::std::mem::offset_of!(android_app, keyEventFilter) - 236usize]; + ["Offset of field: android_app::motionEventFilter"] + [::std::mem::offset_of!(android_app, motionEventFilter) - 240usize]; + ["Offset of field: android_app::inputAvailableWakeUp"] + [::std::mem::offset_of!(android_app, inputAvailableWakeUp) - 244usize]; + ["Offset of field: android_app::inputSwapPending"] + [::std::mem::offset_of!(android_app, inputSwapPending) - 245usize]; +}; #[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; #[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] @@ -6972,55 +5281,55 @@ pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 16; pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 17; #[doc = " Commands passed from the application's main Java thread to the game's thread.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub type NativeAppGlueAppCmd = i8; -extern "C" { +unsafe extern "C" { #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " You can send your custom events using the function below.\n\n Make sure your custom codes do not overlap with this library's ones.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Determines if a looper wake up was due to new input becoming available"] pub fn android_app_input_available_wake_up(app: *mut android_app) -> bool; } diff --git a/android-activity/src/game_activity/ffi_i686.rs b/android-activity/src/game_activity/ffi_i686.rs index 42426aad..04b159fc 100644 --- a/android-activity/src/game_activity/ffi_i686.rs +++ b/android-activity/src/game_activity/ffi_i686.rs @@ -671,10 +671,10 @@ pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; -extern "C" { +unsafe extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn android_get_device_api_level() -> ::std::os::raw::c_int; } pub type wchar_t = ::std::os::raw::c_int; @@ -685,31 +685,15 @@ pub struct max_align_t { pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, pub __clang_max_align_nonce2: f64, } -#[test] -fn bindgen_test_layout_max_align_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of max_align_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of max_align_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, - 0usize, - "Offset of field: max_align_t::__clang_max_align_nonce1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, - 8usize, - "Offset of field: max_align_t::__clang_max_align_nonce2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of max_align_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of max_align_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce1"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce2"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 8usize]; +}; pub type __int8_t = ::std::os::raw::c_schar; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __int16_t = ::std::os::raw::c_short; @@ -751,26 +735,13 @@ pub type __u64 = ::std::os::raw::c_ulonglong; pub struct __kernel_fd_set { pub fds_bits: [::std::os::raw::c_ulong; 32usize], } -#[test] -fn bindgen_test_layout___kernel_fd_set() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fd_set>(), - 128usize, - "Size of __kernel_fd_set" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fd_set>(), - 4usize, - "Alignment of __kernel_fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fd_set::fds_bits" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fd_set"][::std::mem::size_of::<__kernel_fd_set>() - 128usize]; + ["Alignment of __kernel_fd_set"][::std::mem::align_of::<__kernel_fd_set>() - 4usize]; + ["Offset of field: __kernel_fd_set::fds_bits"] + [::std::mem::offset_of!(__kernel_fd_set, fds_bits) - 0usize]; +}; pub type __kernel_sighandler_t = ::std::option::Option; pub type __kernel_key_t = ::std::os::raw::c_int; @@ -798,26 +769,13 @@ pub type __kernel_ptrdiff_t = ::std::os::raw::c_int; pub struct __kernel_fsid_t { pub val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___kernel_fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fsid_t>(), - 8usize, - "Size of __kernel_fsid_t" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fsid_t>(), - 4usize, - "Alignment of __kernel_fsid_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fsid_t::val" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fsid_t"][::std::mem::size_of::<__kernel_fsid_t>() - 8usize]; + ["Alignment of __kernel_fsid_t"][::std::mem::align_of::<__kernel_fsid_t>() - 4usize]; + ["Offset of field: __kernel_fsid_t::val"] + [::std::mem::offset_of!(__kernel_fsid_t, val) - 0usize]; +}; pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; pub type __kernel_old_time_t = __kernel_long_t; @@ -1221,67 +1179,32 @@ pub struct JavaVMAttachArgs { pub name: *const ::std::os::raw::c_char, pub group: jobject, } -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of JavaVMAttachArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of JavaVMAttachArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMAttachArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMAttachArgs::name" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMAttachArgs::group" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMAttachArgs"][::std::mem::size_of::() - 12usize]; + ["Alignment of JavaVMAttachArgs"][::std::mem::align_of::() - 4usize]; + ["Offset of field: JavaVMAttachArgs::version"] + [::std::mem::offset_of!(JavaVMAttachArgs, version) - 0usize]; + ["Offset of field: JavaVMAttachArgs::name"] + [::std::mem::offset_of!(JavaVMAttachArgs, name) - 4usize]; + ["Offset of field: JavaVMAttachArgs::group"] + [::std::mem::offset_of!(JavaVMAttachArgs, group) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JavaVMOption { pub optionString: *const ::std::os::raw::c_char, pub extraInfo: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_JavaVMOption() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of JavaVMOption" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of JavaVMOption" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).optionString) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMOption::optionString" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMOption::extraInfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMOption"][::std::mem::size_of::() - 8usize]; + ["Alignment of JavaVMOption"][::std::mem::align_of::() - 4usize]; + ["Offset of field: JavaVMOption::optionString"] + [::std::mem::offset_of!(JavaVMOption, optionString) - 0usize]; + ["Offset of field: JavaVMOption::extraInfo"] + [::std::mem::offset_of!(JavaVMOption, extraInfo) - 4usize]; +}; #[repr(C)] pub struct JavaVMInitArgs { pub version: jint, @@ -1289,41 +1212,19 @@ pub struct JavaVMInitArgs { pub options: *mut JavaVMOption, pub ignoreUnrecognized: jboolean, } -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of JavaVMInitArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of JavaVMInitArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMInitArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMInitArgs::nOptions" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMInitArgs::options" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, - 12usize, - "Offset of field: JavaVMInitArgs::ignoreUnrecognized" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMInitArgs"][::std::mem::size_of::() - 16usize]; + ["Alignment of JavaVMInitArgs"][::std::mem::align_of::() - 4usize]; + ["Offset of field: JavaVMInitArgs::version"] + [::std::mem::offset_of!(JavaVMInitArgs, version) - 0usize]; + ["Offset of field: JavaVMInitArgs::nOptions"] + [::std::mem::offset_of!(JavaVMInitArgs, nOptions) - 4usize]; + ["Offset of field: JavaVMInitArgs::options"] + [::std::mem::offset_of!(JavaVMInitArgs, options) - 8usize]; + ["Offset of field: JavaVMInitArgs::ignoreUnrecognized"] + [::std::mem::offset_of!(JavaVMInitArgs, ignoreUnrecognized) - 12usize]; +}; pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; @@ -1506,226 +1407,226 @@ pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getDeviceId(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_release(event: *const AInputEvent); } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getFlags(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getKeyCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getScanCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getMetaState(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getRepeatCount(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getDownTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getMetaState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getButtonState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEdgeFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getDownTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEventTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, history_index: usize, ) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, @@ -1733,13 +1634,13 @@ extern "C" { history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; } #[repr(C)] @@ -1747,7 +1648,7 @@ extern "C" { pub struct AInputQueue { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_attachLooper( queue: *mut AInputQueue, looper: *mut ALooper, @@ -1756,26 +1657,26 @@ extern "C" { data: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_detachLooper(queue: *mut AInputQueue); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_hasEvents(queue: *mut AInputQueue) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_getEvent(queue: *mut AInputQueue, outEvent: *mut *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_preDispatchEvent(queue: *mut AInputQueue, event: *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_finishEvent( queue: *mut AInputQueue, event: *mut AInputEvent, handled: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; } #[repr(C)] @@ -1784,59 +1685,41 @@ pub struct imaxdiv_t { pub quot: intmax_t, pub rem: intmax_t, } -#[test] -fn bindgen_test_layout_imaxdiv_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of imaxdiv_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of imaxdiv_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, - 0usize, - "Offset of field: imaxdiv_t::quot" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, - 8usize, - "Offset of field: imaxdiv_t::rem" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of imaxdiv_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of imaxdiv_t"][::std::mem::align_of::() - 4usize]; + ["Offset of field: imaxdiv_t::quot"][::std::mem::offset_of!(imaxdiv_t, quot) - 0usize]; + ["Offset of field: imaxdiv_t::rem"][::std::mem::offset_of!(imaxdiv_t, rem) - 8usize]; +}; +unsafe extern "C" { pub fn imaxabs(__i: intmax_t) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn imaxdiv(__numerator: intmax_t, __denominator: intmax_t) -> imaxdiv_t; } -extern "C" { +unsafe extern "C" { pub fn strtoimax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn strtoumax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> uintmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoimax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoumax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, @@ -2007,61 +1890,27 @@ pub struct AHardwareBuffer_Desc { pub rfu0: u32, pub rfu1: u64, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Desc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - "Size of AHardwareBuffer_Desc" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of AHardwareBuffer_Desc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Desc::width" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Desc::height" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Desc::layers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 12usize, - "Offset of field: AHardwareBuffer_Desc::format" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, - 16usize, - "Offset of field: AHardwareBuffer_Desc::usage" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, - 24usize, - "Offset of field: AHardwareBuffer_Desc::stride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, - 28usize, - "Offset of field: AHardwareBuffer_Desc::rfu0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, - 32usize, - "Offset of field: AHardwareBuffer_Desc::rfu1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Desc"][::std::mem::size_of::() - 40usize]; + ["Alignment of AHardwareBuffer_Desc"][::std::mem::align_of::() - 4usize]; + ["Offset of field: AHardwareBuffer_Desc::width"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, width) - 0usize]; + ["Offset of field: AHardwareBuffer_Desc::height"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, height) - 4usize]; + ["Offset of field: AHardwareBuffer_Desc::layers"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, layers) - 8usize]; + ["Offset of field: AHardwareBuffer_Desc::format"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, format) - 12usize]; + ["Offset of field: AHardwareBuffer_Desc::usage"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, usage) - 16usize]; + ["Offset of field: AHardwareBuffer_Desc::stride"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, stride) - 24usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu0"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu0) - 28usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu1"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu1) - 32usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Plane { @@ -2069,93 +1918,58 @@ pub struct AHardwareBuffer_Plane { pub pixelStride: u32, pub rowStride: u32, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Plane() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of AHardwareBuffer_Plane" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of AHardwareBuffer_Plane" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Plane::data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Plane::pixelStride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Plane::rowStride" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Plane"][::std::mem::size_of::() - 12usize]; + ["Alignment of AHardwareBuffer_Plane"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: AHardwareBuffer_Plane::data"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, data) - 0usize]; + ["Offset of field: AHardwareBuffer_Plane::pixelStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, pixelStride) - 4usize]; + ["Offset of field: AHardwareBuffer_Plane::rowStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, rowStride) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Planes { pub planeCount: u32, pub planes: [AHardwareBuffer_Plane; 4usize], } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Planes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - "Size of AHardwareBuffer_Planes" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of AHardwareBuffer_Planes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Planes::planeCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Planes::planes" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Planes"][::std::mem::size_of::() - 52usize]; + ["Alignment of AHardwareBuffer_Planes"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: AHardwareBuffer_Planes::planeCount"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planeCount) - 0usize]; + ["Offset of field: AHardwareBuffer_Planes::planes"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planes) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_allocate( desc: *const AHardwareBuffer_Desc, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_acquire(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_release(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_describe( buffer: *const AHardwareBuffer, outDesc: *mut AHardwareBuffer_Desc, ); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lock( buffer: *mut AHardwareBuffer, usage: u64, @@ -2164,25 +1978,25 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, fence: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_sendHandleToUnixSocket( buffer: *const AHardwareBuffer, socketFd: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_recvHandleFromUnixSocket( socketFd: ::std::os::raw::c_int, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockPlanes( buffer: *mut AHardwareBuffer, usage: u64, @@ -2191,10 +2005,10 @@ extern "C" { outPlanes: *mut AHardwareBuffer_Planes, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockAndGetInfo( buffer: *mut AHardwareBuffer, usage: u64, @@ -2205,7 +2019,7 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_getId( buffer: *const AHardwareBuffer, outId: *mut u64, @@ -2221,56 +2035,32 @@ pub struct GameActivityPointerAxes { pub rawX: f32, pub rawY: f32, } -#[test] -fn bindgen_test_layout_GameActivityPointerAxes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 208usize, - "Size of GameActivityPointerAxes" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityPointerAxes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityPointerAxes::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityPointerAxes::toolType" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityPointerAxes::axisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, - 200usize, - "Offset of field: GameActivityPointerAxes::rawX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, - 204usize, - "Offset of field: GameActivityPointerAxes::rawY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityPointerAxes"] + [::std::mem::size_of::() - 208usize]; + ["Alignment of GameActivityPointerAxes"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityPointerAxes::id"] + [::std::mem::offset_of!(GameActivityPointerAxes, id) - 0usize]; + ["Offset of field: GameActivityPointerAxes::toolType"] + [::std::mem::offset_of!(GameActivityPointerAxes, toolType) - 4usize]; + ["Offset of field: GameActivityPointerAxes::axisValues"] + [::std::mem::offset_of!(GameActivityPointerAxes, axisValues) - 8usize]; + ["Offset of field: GameActivityPointerAxes::rawX"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawX) - 200usize]; + ["Offset of field: GameActivityPointerAxes::rawY"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawY) - 204usize]; +}; +unsafe extern "C" { #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_enableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_disableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] pub fn GameActivityPointerAxes_getAxisValue( pointerInfo: *const GameActivityPointerAxes, @@ -2301,118 +2091,52 @@ pub struct GameActivityMotionEvent { pub precisionX: f32, pub precisionY: f32, } -#[test] -fn bindgen_test_layout_GameActivityMotionEvent() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 1744usize, - "Size of GameActivityMotionEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityMotionEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityMotionEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityMotionEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityMotionEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 12usize, - "Offset of field: GameActivityMotionEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 20usize, - "Offset of field: GameActivityMotionEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 28usize, - "Offset of field: GameActivityMotionEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityMotionEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityMotionEvent::actionButton" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityMotionEvent::buttonState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityMotionEvent::classification" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityMotionEvent::edgeFlags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityMotionEvent::pointerCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityMotionEvent::pointers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, - 1720usize, - "Offset of field: GameActivityMotionEvent::historySize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, - 1724usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesMillis" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, - 1728usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesNanos" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, - 1732usize, - "Offset of field: GameActivityMotionEvent::historicalAxisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, - 1736usize, - "Offset of field: GameActivityMotionEvent::precisionX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, - 1740usize, - "Offset of field: GameActivityMotionEvent::precisionY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityMotionEvent"] + [::std::mem::size_of::() - 1744usize]; + ["Alignment of GameActivityMotionEvent"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityMotionEvent::deviceId"] + [::std::mem::offset_of!(GameActivityMotionEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityMotionEvent::source"] + [::std::mem::offset_of!(GameActivityMotionEvent, source) - 4usize]; + ["Offset of field: GameActivityMotionEvent::action"] + [::std::mem::offset_of!(GameActivityMotionEvent, action) - 8usize]; + ["Offset of field: GameActivityMotionEvent::eventTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, eventTime) - 12usize]; + ["Offset of field: GameActivityMotionEvent::downTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, downTime) - 20usize]; + ["Offset of field: GameActivityMotionEvent::flags"] + [::std::mem::offset_of!(GameActivityMotionEvent, flags) - 28usize]; + ["Offset of field: GameActivityMotionEvent::metaState"] + [::std::mem::offset_of!(GameActivityMotionEvent, metaState) - 32usize]; + ["Offset of field: GameActivityMotionEvent::actionButton"] + [::std::mem::offset_of!(GameActivityMotionEvent, actionButton) - 36usize]; + ["Offset of field: GameActivityMotionEvent::buttonState"] + [::std::mem::offset_of!(GameActivityMotionEvent, buttonState) - 40usize]; + ["Offset of field: GameActivityMotionEvent::classification"] + [::std::mem::offset_of!(GameActivityMotionEvent, classification) - 44usize]; + ["Offset of field: GameActivityMotionEvent::edgeFlags"] + [::std::mem::offset_of!(GameActivityMotionEvent, edgeFlags) - 48usize]; + ["Offset of field: GameActivityMotionEvent::pointerCount"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointerCount) - 52usize]; + ["Offset of field: GameActivityMotionEvent::pointers"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointers) - 56usize]; + ["Offset of field: GameActivityMotionEvent::historySize"] + [::std::mem::offset_of!(GameActivityMotionEvent, historySize) - 1720usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesMillis"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesMillis) - 1724usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesNanos"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesNanos) - 1728usize]; + ["Offset of field: GameActivityMotionEvent::historicalAxisValues"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalAxisValues) - 1732usize]; + ["Offset of field: GameActivityMotionEvent::precisionX"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionX) - 1736usize]; + ["Offset of field: GameActivityMotionEvent::precisionY"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionY) - 1740usize]; +}; +unsafe extern "C" { pub fn GameActivityMotionEvent_getHistoricalAxisValue( event: *const GameActivityMotionEvent, axis: ::std::os::raw::c_int, @@ -2420,7 +2144,7 @@ extern "C" { historyPos: ::std::os::raw::c_int, ) -> f32; } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } @@ -2440,76 +2164,33 @@ pub struct GameActivityKeyEvent { pub keyCode: i32, pub scanCode: i32, } -#[test] -fn bindgen_test_layout_GameActivityKeyEvent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - "Size of GameActivityKeyEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityKeyEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityKeyEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityKeyEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityKeyEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 12usize, - "Offset of field: GameActivityKeyEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 20usize, - "Offset of field: GameActivityKeyEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 28usize, - "Offset of field: GameActivityKeyEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityKeyEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityKeyEvent::modifiers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityKeyEvent::repeatCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityKeyEvent::keyCode" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityKeyEvent::scanCode" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityKeyEvent"][::std::mem::size_of::() - 52usize]; + ["Alignment of GameActivityKeyEvent"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityKeyEvent::deviceId"] + [::std::mem::offset_of!(GameActivityKeyEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityKeyEvent::source"] + [::std::mem::offset_of!(GameActivityKeyEvent, source) - 4usize]; + ["Offset of field: GameActivityKeyEvent::action"] + [::std::mem::offset_of!(GameActivityKeyEvent, action) - 8usize]; + ["Offset of field: GameActivityKeyEvent::eventTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, eventTime) - 12usize]; + ["Offset of field: GameActivityKeyEvent::downTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, downTime) - 20usize]; + ["Offset of field: GameActivityKeyEvent::flags"] + [::std::mem::offset_of!(GameActivityKeyEvent, flags) - 28usize]; + ["Offset of field: GameActivityKeyEvent::metaState"] + [::std::mem::offset_of!(GameActivityKeyEvent, metaState) - 32usize]; + ["Offset of field: GameActivityKeyEvent::modifiers"] + [::std::mem::offset_of!(GameActivityKeyEvent, modifiers) - 36usize]; + ["Offset of field: GameActivityKeyEvent::repeatCount"] + [::std::mem::offset_of!(GameActivityKeyEvent, repeatCount) - 40usize]; + ["Offset of field: GameActivityKeyEvent::keyCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, keyCode) - 44usize]; + ["Offset of field: GameActivityKeyEvent::scanCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, scanCode) - 48usize]; +}; #[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2519,31 +2200,15 @@ pub struct GameTextInputSpan { #[doc = " The end of the region (exclusive)."] pub end: i32, } -#[test] -fn bindgen_test_layout_GameTextInputSpan() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of GameTextInputSpan" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameTextInputSpan" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputSpan::start" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, - 4usize, - "Offset of field: GameTextInputSpan::end" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputSpan"][::std::mem::size_of::() - 8usize]; + ["Alignment of GameTextInputSpan"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameTextInputSpan::start"] + [::std::mem::offset_of!(GameTextInputSpan, start) - 0usize]; + ["Offset of field: GameTextInputSpan::end"] + [::std::mem::offset_of!(GameTextInputSpan, end) - 4usize]; +}; pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; #[doc = " Values with special meaning in a GameTextInputSpan."] pub type GameTextInputSpanFlag = i32; @@ -2560,41 +2225,19 @@ pub struct GameTextInputState { #[doc = " A composing region defined on the text."] pub composingRegion: GameTextInputSpan, } -#[test] -fn bindgen_test_layout_GameTextInputState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of GameTextInputState" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameTextInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputState::text_UTF8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, - 4usize, - "Offset of field: GameTextInputState::text_length" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, - 8usize, - "Offset of field: GameTextInputState::selection" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, - 16usize, - "Offset of field: GameTextInputState::composingRegion" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputState"][::std::mem::size_of::() - 24usize]; + ["Alignment of GameTextInputState"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameTextInputState::text_UTF8"] + [::std::mem::offset_of!(GameTextInputState, text_UTF8) - 0usize]; + ["Offset of field: GameTextInputState::text_length"] + [::std::mem::offset_of!(GameTextInputState, text_length) - 4usize]; + ["Offset of field: GameTextInputState::selection"] + [::std::mem::offset_of!(GameTextInputState, selection) - 8usize]; + ["Offset of field: GameTextInputState::composingRegion"] + [::std::mem::offset_of!(GameTextInputState, composingRegion) - 16usize]; +}; #[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] pub type GameTextInputGetStateCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), @@ -2604,19 +2247,19 @@ pub type GameTextInputGetStateCallback = ::std::option::Option< pub struct GameTextInput { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; } -extern "C" { +unsafe extern "C" { #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_destroy(input: *mut GameTextInput); } @@ -2625,7 +2268,7 @@ pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_showIme."] pub type ShowImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); } @@ -2634,15 +2277,15 @@ pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_hideIme."] pub type HideImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_restartInput(input: *mut GameTextInput); } -extern "C" { +unsafe extern "C" { #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] pub fn GameTextInput_getState( input: *mut GameTextInput, @@ -2650,7 +2293,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); } @@ -2661,7 +2304,7 @@ pub type GameTextInputEventCallback = ::std::option::Option< current_state: *const GameTextInputState, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback.\n This function is deprecated. Don't perform any complex processing inside\n the callback other than copying the state variable. Using any synchronization\n primitives inside this callback may cause a deadlock."] pub fn GameTextInput_setEventCallback( input: *mut GameTextInput, @@ -2673,7 +2316,7 @@ extern "C" { pub type GameTextInputImeInsetsCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] pub fn GameTextInput_setImeInsetsCallback( input: *mut GameTextInput, @@ -2681,22 +2324,22 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] pub fn GameTextInputState_toJava( input: *const GameTextInput, state: *const GameTextInputState, ) -> jobject; } -extern "C" { +unsafe extern "C" { #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] pub fn GameTextInputState_fromJava( input: *const GameTextInput, @@ -2867,71 +2510,29 @@ pub struct GameActivity { #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] pub obbPath: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_GameActivity() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - "Size of GameActivity" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivity::callbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivity::vm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivity::env" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, - 12usize, - "Offset of field: GameActivity::javaGameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivity::internalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, - 20usize, - "Offset of field: GameActivity::externalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivity::sdkVersion" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, - 28usize, - "Offset of field: GameActivity::instance" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivity::assetManager" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivity::obbPath" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivity"][::std::mem::size_of::() - 40usize]; + ["Alignment of GameActivity"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivity::callbacks"] + [::std::mem::offset_of!(GameActivity, callbacks) - 0usize]; + ["Offset of field: GameActivity::vm"][::std::mem::offset_of!(GameActivity, vm) - 4usize]; + ["Offset of field: GameActivity::env"][::std::mem::offset_of!(GameActivity, env) - 8usize]; + ["Offset of field: GameActivity::javaGameActivity"] + [::std::mem::offset_of!(GameActivity, javaGameActivity) - 12usize]; + ["Offset of field: GameActivity::internalDataPath"] + [::std::mem::offset_of!(GameActivity, internalDataPath) - 16usize]; + ["Offset of field: GameActivity::externalDataPath"] + [::std::mem::offset_of!(GameActivity, externalDataPath) - 20usize]; + ["Offset of field: GameActivity::sdkVersion"] + [::std::mem::offset_of!(GameActivity, sdkVersion) - 24usize]; + ["Offset of field: GameActivity::instance"] + [::std::mem::offset_of!(GameActivity, instance) - 28usize]; + ["Offset of field: GameActivity::assetManager"] + [::std::mem::offset_of!(GameActivity, assetManager) - 32usize]; + ["Offset of field: GameActivity::obbPath"] + [::std::mem::offset_of!(GameActivity, obbPath) - 36usize]; +}; #[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( @@ -3033,129 +2634,56 @@ pub struct GameActivityCallbacks { unsafe extern "C" fn(activity: *mut GameActivity, action: ::std::os::raw::c_int) -> bool, >, } -#[test] -fn bindgen_test_layout_GameActivityCallbacks() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 84usize, - "Size of GameActivityCallbacks" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityCallbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityCallbacks::onStart" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityCallbacks::onResume" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityCallbacks::onSaveInstanceState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, - 12usize, - "Offset of field: GameActivityCallbacks::onPause" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityCallbacks::onStop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, - 20usize, - "Offset of field: GameActivityCallbacks::onDestroy" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityCallbacks::onWindowFocusChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, - 28usize, - "Offset of field: GameActivityCallbacks::onNativeWindowCreated" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityCallbacks::onNativeWindowResized" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityCallbacks::onNativeWindowDestroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityCallbacks::onConfigurationChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityCallbacks::onTrimMemory" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityCallbacks::onTouchEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityCallbacks::onKeyDown" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, - 60usize, - "Offset of field: GameActivityCallbacks::onKeyUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, - 64usize, - "Offset of field: GameActivityCallbacks::onTextInputEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, - 68usize, - "Offset of field: GameActivityCallbacks::onWindowInsetsChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, - 72usize, - "Offset of field: GameActivityCallbacks::onContentRectChanged" - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).onSoftwareKeyboardVisibilityChanged) as usize - ptr as usize - }, - 76usize, - "Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onEditorAction) as usize - ptr as usize }, - 80usize, - "Offset of field: GameActivityCallbacks::onEditorAction" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityCallbacks"][::std::mem::size_of::() - 84usize]; + ["Alignment of GameActivityCallbacks"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityCallbacks::onStart"] + [::std::mem::offset_of!(GameActivityCallbacks, onStart) - 0usize]; + ["Offset of field: GameActivityCallbacks::onResume"] + [::std::mem::offset_of!(GameActivityCallbacks, onResume) - 4usize]; + ["Offset of field: GameActivityCallbacks::onSaveInstanceState"] + [::std::mem::offset_of!(GameActivityCallbacks, onSaveInstanceState) - 8usize]; + ["Offset of field: GameActivityCallbacks::onPause"] + [::std::mem::offset_of!(GameActivityCallbacks, onPause) - 12usize]; + ["Offset of field: GameActivityCallbacks::onStop"] + [::std::mem::offset_of!(GameActivityCallbacks, onStop) - 16usize]; + ["Offset of field: GameActivityCallbacks::onDestroy"] + [::std::mem::offset_of!(GameActivityCallbacks, onDestroy) - 20usize]; + ["Offset of field: GameActivityCallbacks::onWindowFocusChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowFocusChanged) - 24usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowCreated"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowCreated) - 28usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowResized"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowResized) - 32usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowRedrawNeeded) - 36usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowDestroyed"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowDestroyed) - 40usize]; + ["Offset of field: GameActivityCallbacks::onConfigurationChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onConfigurationChanged) - 44usize]; + ["Offset of field: GameActivityCallbacks::onTrimMemory"] + [::std::mem::offset_of!(GameActivityCallbacks, onTrimMemory) - 48usize]; + ["Offset of field: GameActivityCallbacks::onTouchEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTouchEvent) - 52usize]; + ["Offset of field: GameActivityCallbacks::onKeyDown"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyDown) - 56usize]; + ["Offset of field: GameActivityCallbacks::onKeyUp"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyUp) - 60usize]; + ["Offset of field: GameActivityCallbacks::onTextInputEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTextInputEvent) - 64usize]; + ["Offset of field: GameActivityCallbacks::onWindowInsetsChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowInsetsChanged) - 68usize]; + ["Offset of field: GameActivityCallbacks::onContentRectChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onContentRectChanged) - 72usize]; + ["Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged"][::std::mem::offset_of!( + GameActivityCallbacks, + onSoftwareKeyboardVisibilityChanged + ) - 76usize]; + ["Offset of field: GameActivityCallbacks::onEditorAction"] + [::std::mem::offset_of!(GameActivityCallbacks, onEditorAction) - 80usize]; +}; #[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( @@ -3164,7 +2692,7 @@ pub type GameActivity_createFunc = ::std::option::Option< savedStateSize: usize, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } @@ -3234,7 +2762,7 @@ pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; #[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, @@ -3250,22 +2778,22 @@ pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; #[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = u8; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n Note that this method can be called from *any* thread; it will send a message\n to the main thread of the process where the Java call will take place."] pub fn GameActivity_restartInput(activity: *mut GameActivity); } -extern "C" { +unsafe extern "C" { #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, @@ -3273,7 +2801,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } @@ -3285,11 +2813,11 @@ pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS GameActivityHideSoftInputFlags = 2; #[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = u16; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, @@ -3297,11 +2825,11 @@ extern "C" { insets: *mut ARect, ); } -extern "C" { +unsafe extern "C" { #[doc = " Tells whether the software keyboard is visible or not."] pub fn GameActivity_isSoftwareKeyboardVisible(activity: *mut GameActivity) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note: currently only TYPE_NULL AND TYPE_CLASS_NUMBER are supported."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, @@ -3310,70 +2838,70 @@ extern "C" { imeOptions: GameTextInputImeOptions, ); } -extern "C" { +unsafe extern "C" { #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontWeightAdjustment( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocalesCount(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getSmallestScreenWidthDp( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " The functions below return Java locale information.\n\n In simple cases there will be just one locale, but it's possible tha\n there are more than one locale objects. Users are encouraged to write code\n that handles all locales and not just the first one.\n\n The functions in the block below return string values in the provided buffer.\n Return value is zero if there were no errors, otherwise it's non-zero.\n If the return value is zero, `dst` will contain a null-terminated string:\n strlen(dst) <= dst_size - 1.\n If the return value is non-zero, the content of dst is undefined.\n\n Parameters:\n\n dst, dst_size: define a receiver buffer. Locale string can be something\n short like \"EN/EN\", but it may be longer. You should be safe with a buffer\n size of 256 bytes.\n\n If the buffer is too small, ENOBUFS is returned. Try allocating a larger\n buffer in this case.\n\n localeIdx must be between 0 and the value of GameActivity_getLocalesCount().\n If localeIdx is out of range, EINVAL is returned.\n\n Refer to Java documentation of locales for more information."] pub fn GameActivity_getLocaleLanguage( dst: *mut ::std::os::raw::c_char, @@ -3382,7 +2910,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleScript( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3390,7 +2918,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleCountry( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3398,7 +2926,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleVariant( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3500,32 +3028,14 @@ pub struct pollfd { pub events: ::std::os::raw::c_short, pub revents: ::std::os::raw::c_short, } -#[test] -fn bindgen_test_layout_pollfd() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of pollfd"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of pollfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, - 0usize, - "Offset of field: pollfd::fd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, - 4usize, - "Offset of field: pollfd::events" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, - 6usize, - "Offset of field: pollfd::revents" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pollfd"][::std::mem::size_of::() - 8usize]; + ["Alignment of pollfd"][::std::mem::align_of::() - 4usize]; + ["Offset of field: pollfd::fd"][::std::mem::offset_of!(pollfd, fd) - 0usize]; + ["Offset of field: pollfd::events"][::std::mem::offset_of!(pollfd, events) - 4usize]; + ["Offset of field: pollfd::revents"][::std::mem::offset_of!(pollfd, revents) - 6usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _fpx_sw_bytes { @@ -3535,73 +3045,34 @@ pub struct _fpx_sw_bytes { pub xstate_size: __u32, pub padding: [__u32; 7usize], } -#[test] -fn bindgen_test_layout__fpx_sw_bytes() { - const UNINIT: ::std::mem::MaybeUninit<_fpx_sw_bytes> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpx_sw_bytes>(), - 48usize, - "Size of _fpx_sw_bytes" - ); - assert_eq!( - ::std::mem::align_of::<_fpx_sw_bytes>(), - 4usize, - "Alignment of _fpx_sw_bytes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic1) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpx_sw_bytes::magic1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extended_size) as usize - ptr as usize }, - 4usize, - "Offset of field: _fpx_sw_bytes::extended_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpx_sw_bytes::xfeatures" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xstate_size) as usize - ptr as usize }, - 16usize, - "Offset of field: _fpx_sw_bytes::xstate_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 20usize, - "Offset of field: _fpx_sw_bytes::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpx_sw_bytes"][::std::mem::size_of::<_fpx_sw_bytes>() - 48usize]; + ["Alignment of _fpx_sw_bytes"][::std::mem::align_of::<_fpx_sw_bytes>() - 4usize]; + ["Offset of field: _fpx_sw_bytes::magic1"] + [::std::mem::offset_of!(_fpx_sw_bytes, magic1) - 0usize]; + ["Offset of field: _fpx_sw_bytes::extended_size"] + [::std::mem::offset_of!(_fpx_sw_bytes, extended_size) - 4usize]; + ["Offset of field: _fpx_sw_bytes::xfeatures"] + [::std::mem::offset_of!(_fpx_sw_bytes, xfeatures) - 8usize]; + ["Offset of field: _fpx_sw_bytes::xstate_size"] + [::std::mem::offset_of!(_fpx_sw_bytes, xstate_size) - 16usize]; + ["Offset of field: _fpx_sw_bytes::padding"] + [::std::mem::offset_of!(_fpx_sw_bytes, padding) - 20usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _fpreg { pub significand: [__u16; 4usize], pub exponent: __u16, } -#[test] -fn bindgen_test_layout__fpreg() { - const UNINIT: ::std::mem::MaybeUninit<_fpreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_fpreg>(), 10usize, "Size of _fpreg"); - assert_eq!( - ::std::mem::align_of::<_fpreg>(), - 2usize, - "Alignment of _fpreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpreg::significand" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpreg::exponent" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpreg"][::std::mem::size_of::<_fpreg>() - 10usize]; + ["Alignment of _fpreg"][::std::mem::align_of::<_fpreg>() - 2usize]; + ["Offset of field: _fpreg::significand"][::std::mem::offset_of!(_fpreg, significand) - 0usize]; + ["Offset of field: _fpreg::exponent"][::std::mem::offset_of!(_fpreg, exponent) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _fpxreg { @@ -3609,53 +3080,26 @@ pub struct _fpxreg { pub exponent: __u16, pub padding: [__u16; 3usize], } -#[test] -fn bindgen_test_layout__fpxreg() { - const UNINIT: ::std::mem::MaybeUninit<_fpxreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_fpxreg>(), 16usize, "Size of _fpxreg"); - assert_eq!( - ::std::mem::align_of::<_fpxreg>(), - 2usize, - "Alignment of _fpxreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpxreg::significand" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpxreg::exponent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 10usize, - "Offset of field: _fpxreg::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpxreg"][::std::mem::size_of::<_fpxreg>() - 16usize]; + ["Alignment of _fpxreg"][::std::mem::align_of::<_fpxreg>() - 2usize]; + ["Offset of field: _fpxreg::significand"] + [::std::mem::offset_of!(_fpxreg, significand) - 0usize]; + ["Offset of field: _fpxreg::exponent"][::std::mem::offset_of!(_fpxreg, exponent) - 8usize]; + ["Offset of field: _fpxreg::padding"][::std::mem::offset_of!(_fpxreg, padding) - 10usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _xmmreg { pub element: [__u32; 4usize], } -#[test] -fn bindgen_test_layout__xmmreg() { - const UNINIT: ::std::mem::MaybeUninit<_xmmreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_xmmreg>(), 16usize, "Size of _xmmreg"); - assert_eq!( - ::std::mem::align_of::<_xmmreg>(), - 4usize, - "Alignment of _xmmreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).element) as usize - ptr as usize }, - 0usize, - "Offset of field: _xmmreg::element" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _xmmreg"][::std::mem::size_of::<_xmmreg>() - 16usize]; + ["Alignment of _xmmreg"][::std::mem::align_of::<_xmmreg>() - 4usize]; + ["Offset of field: _xmmreg::element"][::std::mem::offset_of!(_xmmreg, element) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct _fpstate_32 { @@ -3683,154 +3127,60 @@ pub union _fpstate_32__bindgen_ty_1 { pub padding1: [__u32; 44usize], pub padding: [__u32; 44usize], } -#[test] -fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_32__bindgen_ty_1>(), - 176usize, - "Size of _fpstate_32__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_32__bindgen_ty_1>(), - 4usize, - "Alignment of _fpstate_32__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding1) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_1::padding1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_1::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_32__bindgen_ty_1"] + [::std::mem::size_of::<_fpstate_32__bindgen_ty_1>() - 176usize]; + ["Alignment of _fpstate_32__bindgen_ty_1"] + [::std::mem::align_of::<_fpstate_32__bindgen_ty_1>() - 4usize]; + ["Offset of field: _fpstate_32__bindgen_ty_1::padding1"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_1, padding1) - 0usize]; + ["Offset of field: _fpstate_32__bindgen_ty_1::padding"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_1, padding) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub union _fpstate_32__bindgen_ty_2 { pub padding2: [__u32; 12usize], pub sw_reserved: _fpx_sw_bytes, } -#[test] -fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_32__bindgen_ty_2>(), - 48usize, - "Size of _fpstate_32__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_32__bindgen_ty_2>(), - 4usize, - "Alignment of _fpstate_32__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding2) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_2::padding2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_2::sw_reserved" - ); -} -#[test] -fn bindgen_test_layout__fpstate_32() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_32> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_32>(), - 624usize, - "Size of _fpstate_32" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_32>(), - 4usize, - "Alignment of _fpstate_32" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cw) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32::cw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sw) as usize - ptr as usize }, - 4usize, - "Offset of field: _fpstate_32::sw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpstate_32::tag" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ipoff) as usize - ptr as usize }, - 12usize, - "Offset of field: _fpstate_32::ipoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cssel) as usize - ptr as usize }, - 16usize, - "Offset of field: _fpstate_32::cssel" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dataoff) as usize - ptr as usize }, - 20usize, - "Offset of field: _fpstate_32::dataoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).datasel) as usize - ptr as usize }, - 24usize, - "Offset of field: _fpstate_32::datasel" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, - 28usize, - "Offset of field: _fpstate_32::_st" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, - 108usize, - "Offset of field: _fpstate_32::status" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 110usize, - "Offset of field: _fpstate_32::magic" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_env) as usize - ptr as usize }, - 112usize, - "Offset of field: _fpstate_32::_fxsr_env" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 136usize, - "Offset of field: _fpstate_32::mxcsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 140usize, - "Offset of field: _fpstate_32::reserved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_st) as usize - ptr as usize }, - 144usize, - "Offset of field: _fpstate_32::_fxsr_st" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._xmm) as usize - ptr as usize }, - 272usize, - "Offset of field: _fpstate_32::_xmm" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_32__bindgen_ty_2"] + [::std::mem::size_of::<_fpstate_32__bindgen_ty_2>() - 48usize]; + ["Alignment of _fpstate_32__bindgen_ty_2"] + [::std::mem::align_of::<_fpstate_32__bindgen_ty_2>() - 4usize]; + ["Offset of field: _fpstate_32__bindgen_ty_2::padding2"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_2, padding2) - 0usize]; + ["Offset of field: _fpstate_32__bindgen_ty_2::sw_reserved"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_2, sw_reserved) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_32"][::std::mem::size_of::<_fpstate_32>() - 624usize]; + ["Alignment of _fpstate_32"][::std::mem::align_of::<_fpstate_32>() - 4usize]; + ["Offset of field: _fpstate_32::cw"][::std::mem::offset_of!(_fpstate_32, cw) - 0usize]; + ["Offset of field: _fpstate_32::sw"][::std::mem::offset_of!(_fpstate_32, sw) - 4usize]; + ["Offset of field: _fpstate_32::tag"][::std::mem::offset_of!(_fpstate_32, tag) - 8usize]; + ["Offset of field: _fpstate_32::ipoff"][::std::mem::offset_of!(_fpstate_32, ipoff) - 12usize]; + ["Offset of field: _fpstate_32::cssel"][::std::mem::offset_of!(_fpstate_32, cssel) - 16usize]; + ["Offset of field: _fpstate_32::dataoff"] + [::std::mem::offset_of!(_fpstate_32, dataoff) - 20usize]; + ["Offset of field: _fpstate_32::datasel"] + [::std::mem::offset_of!(_fpstate_32, datasel) - 24usize]; + ["Offset of field: _fpstate_32::_st"][::std::mem::offset_of!(_fpstate_32, _st) - 28usize]; + ["Offset of field: _fpstate_32::status"] + [::std::mem::offset_of!(_fpstate_32, status) - 108usize]; + ["Offset of field: _fpstate_32::magic"][::std::mem::offset_of!(_fpstate_32, magic) - 110usize]; + ["Offset of field: _fpstate_32::_fxsr_env"] + [::std::mem::offset_of!(_fpstate_32, _fxsr_env) - 112usize]; + ["Offset of field: _fpstate_32::mxcsr"][::std::mem::offset_of!(_fpstate_32, mxcsr) - 136usize]; + ["Offset of field: _fpstate_32::reserved"] + [::std::mem::offset_of!(_fpstate_32, reserved) - 140usize]; + ["Offset of field: _fpstate_32::_fxsr_st"] + [::std::mem::offset_of!(_fpstate_32, _fxsr_st) - 144usize]; + ["Offset of field: _fpstate_32::_xmm"][::std::mem::offset_of!(_fpstate_32, _xmm) - 272usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct _fpstate_64 { @@ -3853,102 +3203,37 @@ pub union _fpstate_64__bindgen_ty_1 { pub reserved3: [__u32; 12usize], pub sw_reserved: _fpx_sw_bytes, } -#[test] -fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_64__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_64__bindgen_ty_1>(), - 48usize, - "Size of _fpstate_64__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_64__bindgen_ty_1>(), - 4usize, - "Alignment of _fpstate_64__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_64__bindgen_ty_1::reserved3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_64__bindgen_ty_1::sw_reserved" - ); -} -#[test] -fn bindgen_test_layout__fpstate_64() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_64> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_64>(), - 512usize, - "Size of _fpstate_64" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_64>(), - 4usize, - "Alignment of _fpstate_64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_64::cwd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, - 2usize, - "Offset of field: _fpstate_64::swd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, - 4usize, - "Offset of field: _fpstate_64::twd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, - 6usize, - "Offset of field: _fpstate_64::fop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpstate_64::rip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, - 16usize, - "Offset of field: _fpstate_64::rdp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 24usize, - "Offset of field: _fpstate_64::mxcsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr_mask) as usize - ptr as usize }, - 28usize, - "Offset of field: _fpstate_64::mxcsr_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, - 32usize, - "Offset of field: _fpstate_64::st_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, - 160usize, - "Offset of field: _fpstate_64::xmm_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, - 416usize, - "Offset of field: _fpstate_64::reserved2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_64__bindgen_ty_1"] + [::std::mem::size_of::<_fpstate_64__bindgen_ty_1>() - 48usize]; + ["Alignment of _fpstate_64__bindgen_ty_1"] + [::std::mem::align_of::<_fpstate_64__bindgen_ty_1>() - 4usize]; + ["Offset of field: _fpstate_64__bindgen_ty_1::reserved3"] + [::std::mem::offset_of!(_fpstate_64__bindgen_ty_1, reserved3) - 0usize]; + ["Offset of field: _fpstate_64__bindgen_ty_1::sw_reserved"] + [::std::mem::offset_of!(_fpstate_64__bindgen_ty_1, sw_reserved) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_64"][::std::mem::size_of::<_fpstate_64>() - 512usize]; + ["Alignment of _fpstate_64"][::std::mem::align_of::<_fpstate_64>() - 4usize]; + ["Offset of field: _fpstate_64::cwd"][::std::mem::offset_of!(_fpstate_64, cwd) - 0usize]; + ["Offset of field: _fpstate_64::swd"][::std::mem::offset_of!(_fpstate_64, swd) - 2usize]; + ["Offset of field: _fpstate_64::twd"][::std::mem::offset_of!(_fpstate_64, twd) - 4usize]; + ["Offset of field: _fpstate_64::fop"][::std::mem::offset_of!(_fpstate_64, fop) - 6usize]; + ["Offset of field: _fpstate_64::rip"][::std::mem::offset_of!(_fpstate_64, rip) - 8usize]; + ["Offset of field: _fpstate_64::rdp"][::std::mem::offset_of!(_fpstate_64, rdp) - 16usize]; + ["Offset of field: _fpstate_64::mxcsr"][::std::mem::offset_of!(_fpstate_64, mxcsr) - 24usize]; + ["Offset of field: _fpstate_64::mxcsr_mask"] + [::std::mem::offset_of!(_fpstate_64, mxcsr_mask) - 28usize]; + ["Offset of field: _fpstate_64::st_space"] + [::std::mem::offset_of!(_fpstate_64, st_space) - 32usize]; + ["Offset of field: _fpstate_64::xmm_space"] + [::std::mem::offset_of!(_fpstate_64, xmm_space) - 160usize]; + ["Offset of field: _fpstate_64::reserved2"] + [::std::mem::offset_of!(_fpstate_64, reserved2) - 416usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _header { @@ -3956,57 +3241,26 @@ pub struct _header { pub reserved1: [__u64; 2usize], pub reserved2: [__u64; 5usize], } -#[test] -fn bindgen_test_layout__header() { - const UNINIT: ::std::mem::MaybeUninit<_header> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_header>(), 64usize, "Size of _header"); - assert_eq!( - ::std::mem::align_of::<_header>(), - 4usize, - "Alignment of _header" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, - 0usize, - "Offset of field: _header::xfeatures" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 8usize, - "Offset of field: _header::reserved1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, - 24usize, - "Offset of field: _header::reserved2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _header"][::std::mem::size_of::<_header>() - 64usize]; + ["Alignment of _header"][::std::mem::align_of::<_header>() - 4usize]; + ["Offset of field: _header::xfeatures"][::std::mem::offset_of!(_header, xfeatures) - 0usize]; + ["Offset of field: _header::reserved1"][::std::mem::offset_of!(_header, reserved1) - 8usize]; + ["Offset of field: _header::reserved2"][::std::mem::offset_of!(_header, reserved2) - 24usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _ymmh_state { pub ymmh_space: [__u32; 64usize], } -#[test] -fn bindgen_test_layout__ymmh_state() { - const UNINIT: ::std::mem::MaybeUninit<_ymmh_state> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_ymmh_state>(), - 256usize, - "Size of _ymmh_state" - ); - assert_eq!( - ::std::mem::align_of::<_ymmh_state>(), - 4usize, - "Alignment of _ymmh_state" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ymmh_space) as usize - ptr as usize }, - 0usize, - "Offset of field: _ymmh_state::ymmh_space" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _ymmh_state"][::std::mem::size_of::<_ymmh_state>() - 256usize]; + ["Alignment of _ymmh_state"][::std::mem::align_of::<_ymmh_state>() - 4usize]; + ["Offset of field: _ymmh_state::ymmh_space"] + [::std::mem::offset_of!(_ymmh_state, ymmh_space) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct _xstate { @@ -4014,36 +3268,15 @@ pub struct _xstate { pub xstate_hdr: _header, pub ymmh: _ymmh_state, } -#[test] -fn bindgen_test_layout__xstate() { - const UNINIT: ::std::mem::MaybeUninit<_xstate> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_xstate>(), - 944usize, - "Size of _xstate" - ); - assert_eq!( - ::std::mem::align_of::<_xstate>(), - 4usize, - "Alignment of _xstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 0usize, - "Offset of field: _xstate::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xstate_hdr) as usize - ptr as usize }, - 624usize, - "Offset of field: _xstate::xstate_hdr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ymmh) as usize - ptr as usize }, - 688usize, - "Offset of field: _xstate::ymmh" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _xstate"][::std::mem::size_of::<_xstate>() - 944usize]; + ["Alignment of _xstate"][::std::mem::align_of::<_xstate>() - 4usize]; + ["Offset of field: _xstate::fpstate"][::std::mem::offset_of!(_xstate, fpstate) - 0usize]; + ["Offset of field: _xstate::xstate_hdr"] + [::std::mem::offset_of!(_xstate, xstate_hdr) - 624usize]; + ["Offset of field: _xstate::ymmh"][::std::mem::offset_of!(_xstate, ymmh) - 688usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigcontext_32 { @@ -4076,161 +3309,50 @@ pub struct sigcontext_32 { pub oldmask: __u32, pub cr2: __u32, } -#[test] -fn bindgen_test_layout_sigcontext_32() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of sigcontext_32" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigcontext_32" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext_32::gs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__gsh) as usize - ptr as usize }, - 2usize, - "Offset of field: sigcontext_32::__gsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, - 4usize, - "Offset of field: sigcontext_32::fs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__fsh) as usize - ptr as usize }, - 6usize, - "Offset of field: sigcontext_32::__fsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext_32::es" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__esh) as usize - ptr as usize }, - 10usize, - "Offset of field: sigcontext_32::__esh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, - 12usize, - "Offset of field: sigcontext_32::ds" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__dsh) as usize - ptr as usize }, - 14usize, - "Offset of field: sigcontext_32::__dsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, - 16usize, - "Offset of field: sigcontext_32::di" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, - 20usize, - "Offset of field: sigcontext_32::si" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, - 24usize, - "Offset of field: sigcontext_32::bp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, - 28usize, - "Offset of field: sigcontext_32::sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, - 32usize, - "Offset of field: sigcontext_32::bx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, - 36usize, - "Offset of field: sigcontext_32::dx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, - 40usize, - "Offset of field: sigcontext_32::cx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, - 44usize, - "Offset of field: sigcontext_32::ax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, - 48usize, - "Offset of field: sigcontext_32::trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, - 52usize, - "Offset of field: sigcontext_32::err" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, - 56usize, - "Offset of field: sigcontext_32::ip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, - 60usize, - "Offset of field: sigcontext_32::cs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__csh) as usize - ptr as usize }, - 62usize, - "Offset of field: sigcontext_32::__csh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 64usize, - "Offset of field: sigcontext_32::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp_at_signal) as usize - ptr as usize }, - 68usize, - "Offset of field: sigcontext_32::sp_at_signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, - 72usize, - "Offset of field: sigcontext_32::ss" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ssh) as usize - ptr as usize }, - 74usize, - "Offset of field: sigcontext_32::__ssh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 76usize, - "Offset of field: sigcontext_32::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 80usize, - "Offset of field: sigcontext_32::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, - 84usize, - "Offset of field: sigcontext_32::cr2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext_32"][::std::mem::size_of::() - 88usize]; + ["Alignment of sigcontext_32"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigcontext_32::gs"][::std::mem::offset_of!(sigcontext_32, gs) - 0usize]; + ["Offset of field: sigcontext_32::__gsh"] + [::std::mem::offset_of!(sigcontext_32, __gsh) - 2usize]; + ["Offset of field: sigcontext_32::fs"][::std::mem::offset_of!(sigcontext_32, fs) - 4usize]; + ["Offset of field: sigcontext_32::__fsh"] + [::std::mem::offset_of!(sigcontext_32, __fsh) - 6usize]; + ["Offset of field: sigcontext_32::es"][::std::mem::offset_of!(sigcontext_32, es) - 8usize]; + ["Offset of field: sigcontext_32::__esh"] + [::std::mem::offset_of!(sigcontext_32, __esh) - 10usize]; + ["Offset of field: sigcontext_32::ds"][::std::mem::offset_of!(sigcontext_32, ds) - 12usize]; + ["Offset of field: sigcontext_32::__dsh"] + [::std::mem::offset_of!(sigcontext_32, __dsh) - 14usize]; + ["Offset of field: sigcontext_32::di"][::std::mem::offset_of!(sigcontext_32, di) - 16usize]; + ["Offset of field: sigcontext_32::si"][::std::mem::offset_of!(sigcontext_32, si) - 20usize]; + ["Offset of field: sigcontext_32::bp"][::std::mem::offset_of!(sigcontext_32, bp) - 24usize]; + ["Offset of field: sigcontext_32::sp"][::std::mem::offset_of!(sigcontext_32, sp) - 28usize]; + ["Offset of field: sigcontext_32::bx"][::std::mem::offset_of!(sigcontext_32, bx) - 32usize]; + ["Offset of field: sigcontext_32::dx"][::std::mem::offset_of!(sigcontext_32, dx) - 36usize]; + ["Offset of field: sigcontext_32::cx"][::std::mem::offset_of!(sigcontext_32, cx) - 40usize]; + ["Offset of field: sigcontext_32::ax"][::std::mem::offset_of!(sigcontext_32, ax) - 44usize]; + ["Offset of field: sigcontext_32::trapno"] + [::std::mem::offset_of!(sigcontext_32, trapno) - 48usize]; + ["Offset of field: sigcontext_32::err"][::std::mem::offset_of!(sigcontext_32, err) - 52usize]; + ["Offset of field: sigcontext_32::ip"][::std::mem::offset_of!(sigcontext_32, ip) - 56usize]; + ["Offset of field: sigcontext_32::cs"][::std::mem::offset_of!(sigcontext_32, cs) - 60usize]; + ["Offset of field: sigcontext_32::__csh"] + [::std::mem::offset_of!(sigcontext_32, __csh) - 62usize]; + ["Offset of field: sigcontext_32::flags"] + [::std::mem::offset_of!(sigcontext_32, flags) - 64usize]; + ["Offset of field: sigcontext_32::sp_at_signal"] + [::std::mem::offset_of!(sigcontext_32, sp_at_signal) - 68usize]; + ["Offset of field: sigcontext_32::ss"][::std::mem::offset_of!(sigcontext_32, ss) - 72usize]; + ["Offset of field: sigcontext_32::__ssh"] + [::std::mem::offset_of!(sigcontext_32, __ssh) - 74usize]; + ["Offset of field: sigcontext_32::fpstate"] + [::std::mem::offset_of!(sigcontext_32, fpstate) - 76usize]; + ["Offset of field: sigcontext_32::oldmask"] + [::std::mem::offset_of!(sigcontext_32, oldmask) - 80usize]; + ["Offset of field: sigcontext_32::cr2"][::std::mem::offset_of!(sigcontext_32, cr2) - 84usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigcontext_64 { @@ -4263,161 +3385,44 @@ pub struct sigcontext_64 { pub fpstate: __u64, pub reserved1: [__u64; 8usize], } -#[test] -fn bindgen_test_layout_sigcontext_64() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 256usize, - "Size of sigcontext_64" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigcontext_64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext_64::r8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext_64::r9" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, - 16usize, - "Offset of field: sigcontext_64::r10" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, - 24usize, - "Offset of field: sigcontext_64::r11" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, - 32usize, - "Offset of field: sigcontext_64::r12" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, - 40usize, - "Offset of field: sigcontext_64::r13" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, - 48usize, - "Offset of field: sigcontext_64::r14" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, - 56usize, - "Offset of field: sigcontext_64::r15" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, - 64usize, - "Offset of field: sigcontext_64::di" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, - 72usize, - "Offset of field: sigcontext_64::si" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, - 80usize, - "Offset of field: sigcontext_64::bp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, - 88usize, - "Offset of field: sigcontext_64::bx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, - 96usize, - "Offset of field: sigcontext_64::dx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, - 104usize, - "Offset of field: sigcontext_64::ax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, - 112usize, - "Offset of field: sigcontext_64::cx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, - 120usize, - "Offset of field: sigcontext_64::sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, - 128usize, - "Offset of field: sigcontext_64::ip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 136usize, - "Offset of field: sigcontext_64::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, - 144usize, - "Offset of field: sigcontext_64::cs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, - 146usize, - "Offset of field: sigcontext_64::gs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, - 148usize, - "Offset of field: sigcontext_64::fs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, - 150usize, - "Offset of field: sigcontext_64::ss" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, - 152usize, - "Offset of field: sigcontext_64::err" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, - 160usize, - "Offset of field: sigcontext_64::trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 168usize, - "Offset of field: sigcontext_64::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, - 176usize, - "Offset of field: sigcontext_64::cr2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 184usize, - "Offset of field: sigcontext_64::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 192usize, - "Offset of field: sigcontext_64::reserved1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext_64"][::std::mem::size_of::() - 256usize]; + ["Alignment of sigcontext_64"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigcontext_64::r8"][::std::mem::offset_of!(sigcontext_64, r8) - 0usize]; + ["Offset of field: sigcontext_64::r9"][::std::mem::offset_of!(sigcontext_64, r9) - 8usize]; + ["Offset of field: sigcontext_64::r10"][::std::mem::offset_of!(sigcontext_64, r10) - 16usize]; + ["Offset of field: sigcontext_64::r11"][::std::mem::offset_of!(sigcontext_64, r11) - 24usize]; + ["Offset of field: sigcontext_64::r12"][::std::mem::offset_of!(sigcontext_64, r12) - 32usize]; + ["Offset of field: sigcontext_64::r13"][::std::mem::offset_of!(sigcontext_64, r13) - 40usize]; + ["Offset of field: sigcontext_64::r14"][::std::mem::offset_of!(sigcontext_64, r14) - 48usize]; + ["Offset of field: sigcontext_64::r15"][::std::mem::offset_of!(sigcontext_64, r15) - 56usize]; + ["Offset of field: sigcontext_64::di"][::std::mem::offset_of!(sigcontext_64, di) - 64usize]; + ["Offset of field: sigcontext_64::si"][::std::mem::offset_of!(sigcontext_64, si) - 72usize]; + ["Offset of field: sigcontext_64::bp"][::std::mem::offset_of!(sigcontext_64, bp) - 80usize]; + ["Offset of field: sigcontext_64::bx"][::std::mem::offset_of!(sigcontext_64, bx) - 88usize]; + ["Offset of field: sigcontext_64::dx"][::std::mem::offset_of!(sigcontext_64, dx) - 96usize]; + ["Offset of field: sigcontext_64::ax"][::std::mem::offset_of!(sigcontext_64, ax) - 104usize]; + ["Offset of field: sigcontext_64::cx"][::std::mem::offset_of!(sigcontext_64, cx) - 112usize]; + ["Offset of field: sigcontext_64::sp"][::std::mem::offset_of!(sigcontext_64, sp) - 120usize]; + ["Offset of field: sigcontext_64::ip"][::std::mem::offset_of!(sigcontext_64, ip) - 128usize]; + ["Offset of field: sigcontext_64::flags"] + [::std::mem::offset_of!(sigcontext_64, flags) - 136usize]; + ["Offset of field: sigcontext_64::cs"][::std::mem::offset_of!(sigcontext_64, cs) - 144usize]; + ["Offset of field: sigcontext_64::gs"][::std::mem::offset_of!(sigcontext_64, gs) - 146usize]; + ["Offset of field: sigcontext_64::fs"][::std::mem::offset_of!(sigcontext_64, fs) - 148usize]; + ["Offset of field: sigcontext_64::ss"][::std::mem::offset_of!(sigcontext_64, ss) - 150usize]; + ["Offset of field: sigcontext_64::err"][::std::mem::offset_of!(sigcontext_64, err) - 152usize]; + ["Offset of field: sigcontext_64::trapno"] + [::std::mem::offset_of!(sigcontext_64, trapno) - 160usize]; + ["Offset of field: sigcontext_64::oldmask"] + [::std::mem::offset_of!(sigcontext_64, oldmask) - 168usize]; + ["Offset of field: sigcontext_64::cr2"][::std::mem::offset_of!(sigcontext_64, cr2) - 176usize]; + ["Offset of field: sigcontext_64::fpstate"] + [::std::mem::offset_of!(sigcontext_64, fpstate) - 184usize]; + ["Offset of field: sigcontext_64::reserved1"] + [::std::mem::offset_of!(sigcontext_64, reserved1) - 192usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigcontext { @@ -4450,438 +3455,172 @@ pub struct sigcontext { pub oldmask: __u32, pub cr2: __u32, } -#[test] -fn bindgen_test_layout_sigcontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of sigcontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigcontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext::gs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__gsh) as usize - ptr as usize }, - 2usize, - "Offset of field: sigcontext::__gsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, - 4usize, - "Offset of field: sigcontext::fs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__fsh) as usize - ptr as usize }, - 6usize, - "Offset of field: sigcontext::__fsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext::es" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__esh) as usize - ptr as usize }, - 10usize, - "Offset of field: sigcontext::__esh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, - 12usize, - "Offset of field: sigcontext::ds" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__dsh) as usize - ptr as usize }, - 14usize, - "Offset of field: sigcontext::__dsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edi) as usize - ptr as usize }, - 16usize, - "Offset of field: sigcontext::edi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).esi) as usize - ptr as usize }, - 20usize, - "Offset of field: sigcontext::esi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ebp) as usize - ptr as usize }, - 24usize, - "Offset of field: sigcontext::ebp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).esp) as usize - ptr as usize }, - 28usize, - "Offset of field: sigcontext::esp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ebx) as usize - ptr as usize }, - 32usize, - "Offset of field: sigcontext::ebx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edx) as usize - ptr as usize }, - 36usize, - "Offset of field: sigcontext::edx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ecx) as usize - ptr as usize }, - 40usize, - "Offset of field: sigcontext::ecx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eax) as usize - ptr as usize }, - 44usize, - "Offset of field: sigcontext::eax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, - 48usize, - "Offset of field: sigcontext::trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, - 52usize, - "Offset of field: sigcontext::err" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eip) as usize - ptr as usize }, - 56usize, - "Offset of field: sigcontext::eip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, - 60usize, - "Offset of field: sigcontext::cs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__csh) as usize - ptr as usize }, - 62usize, - "Offset of field: sigcontext::__csh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, - 64usize, - "Offset of field: sigcontext::eflags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).esp_at_signal) as usize - ptr as usize }, - 68usize, - "Offset of field: sigcontext::esp_at_signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, - 72usize, - "Offset of field: sigcontext::ss" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ssh) as usize - ptr as usize }, - 74usize, - "Offset of field: sigcontext::__ssh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 76usize, - "Offset of field: sigcontext::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 80usize, - "Offset of field: sigcontext::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, - 84usize, - "Offset of field: sigcontext::cr2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext"][::std::mem::size_of::() - 88usize]; + ["Alignment of sigcontext"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigcontext::gs"][::std::mem::offset_of!(sigcontext, gs) - 0usize]; + ["Offset of field: sigcontext::__gsh"][::std::mem::offset_of!(sigcontext, __gsh) - 2usize]; + ["Offset of field: sigcontext::fs"][::std::mem::offset_of!(sigcontext, fs) - 4usize]; + ["Offset of field: sigcontext::__fsh"][::std::mem::offset_of!(sigcontext, __fsh) - 6usize]; + ["Offset of field: sigcontext::es"][::std::mem::offset_of!(sigcontext, es) - 8usize]; + ["Offset of field: sigcontext::__esh"][::std::mem::offset_of!(sigcontext, __esh) - 10usize]; + ["Offset of field: sigcontext::ds"][::std::mem::offset_of!(sigcontext, ds) - 12usize]; + ["Offset of field: sigcontext::__dsh"][::std::mem::offset_of!(sigcontext, __dsh) - 14usize]; + ["Offset of field: sigcontext::edi"][::std::mem::offset_of!(sigcontext, edi) - 16usize]; + ["Offset of field: sigcontext::esi"][::std::mem::offset_of!(sigcontext, esi) - 20usize]; + ["Offset of field: sigcontext::ebp"][::std::mem::offset_of!(sigcontext, ebp) - 24usize]; + ["Offset of field: sigcontext::esp"][::std::mem::offset_of!(sigcontext, esp) - 28usize]; + ["Offset of field: sigcontext::ebx"][::std::mem::offset_of!(sigcontext, ebx) - 32usize]; + ["Offset of field: sigcontext::edx"][::std::mem::offset_of!(sigcontext, edx) - 36usize]; + ["Offset of field: sigcontext::ecx"][::std::mem::offset_of!(sigcontext, ecx) - 40usize]; + ["Offset of field: sigcontext::eax"][::std::mem::offset_of!(sigcontext, eax) - 44usize]; + ["Offset of field: sigcontext::trapno"][::std::mem::offset_of!(sigcontext, trapno) - 48usize]; + ["Offset of field: sigcontext::err"][::std::mem::offset_of!(sigcontext, err) - 52usize]; + ["Offset of field: sigcontext::eip"][::std::mem::offset_of!(sigcontext, eip) - 56usize]; + ["Offset of field: sigcontext::cs"][::std::mem::offset_of!(sigcontext, cs) - 60usize]; + ["Offset of field: sigcontext::__csh"][::std::mem::offset_of!(sigcontext, __csh) - 62usize]; + ["Offset of field: sigcontext::eflags"][::std::mem::offset_of!(sigcontext, eflags) - 64usize]; + ["Offset of field: sigcontext::esp_at_signal"] + [::std::mem::offset_of!(sigcontext, esp_at_signal) - 68usize]; + ["Offset of field: sigcontext::ss"][::std::mem::offset_of!(sigcontext, ss) - 72usize]; + ["Offset of field: sigcontext::__ssh"][::std::mem::offset_of!(sigcontext, __ssh) - 74usize]; + ["Offset of field: sigcontext::fpstate"][::std::mem::offset_of!(sigcontext, fpstate) - 76usize]; + ["Offset of field: sigcontext::oldmask"][::std::mem::offset_of!(sigcontext, oldmask) - 80usize]; + ["Offset of field: sigcontext::cr2"][::std::mem::offset_of!(sigcontext, cr2) - 84usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_timespec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of timespec" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 4usize, - "Offset of field: timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timespec"][::std::mem::size_of::() - 8usize]; + ["Alignment of timespec"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize]; + ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_timespec { pub tv_sec: __kernel_time64_t, pub tv_nsec: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout___kernel_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_timespec>(), - 16usize, - "Size of __kernel_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_timespec>(), - 4usize, - "Alignment of __kernel_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_timespec"][::std::mem::size_of::<__kernel_timespec>() - 16usize]; + ["Alignment of __kernel_timespec"][::std::mem::align_of::<__kernel_timespec>() - 4usize]; + ["Offset of field: __kernel_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_itimerspec { pub it_interval: __kernel_timespec, pub it_value: __kernel_timespec, } -#[test] -fn bindgen_test_layout___kernel_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_itimerspec>(), - 32usize, - "Size of __kernel_itimerspec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_itimerspec>(), - 4usize, - "Alignment of __kernel_itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: __kernel_itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_itimerspec"][::std::mem::size_of::<__kernel_itimerspec>() - 32usize]; + ["Alignment of __kernel_itimerspec"][::std::mem::align_of::<__kernel_itimerspec>() - 4usize]; + ["Offset of field: __kernel_itimerspec::it_interval"] + [::std::mem::offset_of!(__kernel_itimerspec, it_interval) - 0usize]; + ["Offset of field: __kernel_itimerspec::it_value"] + [::std::mem::offset_of!(__kernel_itimerspec, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_old_timespec { pub tv_sec: __kernel_old_time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout___kernel_old_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), - 8usize, - "Size of __kernel_old_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), - 4usize, - "Alignment of __kernel_old_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_old_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 4usize, - "Offset of field: __kernel_old_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_old_timespec"][::std::mem::size_of::<__kernel_old_timespec>() - 8usize]; + ["Alignment of __kernel_old_timespec"] + [::std::mem::align_of::<__kernel_old_timespec>() - 4usize]; + ["Offset of field: __kernel_old_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_old_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_nsec) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_sock_timeval { pub tv_sec: __s64, pub tv_usec: __s64, } -#[test] -fn bindgen_test_layout___kernel_sock_timeval() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sock_timeval>(), - 16usize, - "Size of __kernel_sock_timeval" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sock_timeval>(), - 4usize, - "Alignment of __kernel_sock_timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sock_timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sock_timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sock_timeval"][::std::mem::size_of::<__kernel_sock_timeval>() - 16usize]; + ["Alignment of __kernel_sock_timeval"] + [::std::mem::align_of::<__kernel_sock_timeval>() - 4usize]; + ["Offset of field: __kernel_sock_timeval::tv_sec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_sec) - 0usize]; + ["Offset of field: __kernel_sock_timeval::tv_usec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_usec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } -#[test] -fn bindgen_test_layout_timeval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of timeval"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 4usize, - "Offset of field: timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timeval"][::std::mem::size_of::() - 8usize]; + ["Alignment of timeval"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timeval::tv_sec"][::std::mem::offset_of!(timeval, tv_sec) - 0usize]; + ["Offset of field: timeval::tv_usec"][::std::mem::offset_of!(timeval, tv_usec) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, } -#[test] -fn bindgen_test_layout_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of itimerspec" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 8usize, - "Offset of field: itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerspec"][::std::mem::size_of::() - 16usize]; + ["Alignment of itimerspec"][::std::mem::align_of::() - 4usize]; + ["Offset of field: itimerspec::it_interval"] + [::std::mem::offset_of!(itimerspec, it_interval) - 0usize]; + ["Offset of field: itimerspec::it_value"] + [::std::mem::offset_of!(itimerspec, it_value) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerval { pub it_interval: timeval, pub it_value: timeval, } -#[test] -fn bindgen_test_layout_itimerval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of itimerval" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of itimerval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerval::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 8usize, - "Offset of field: itimerval::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerval"][::std::mem::size_of::() - 16usize]; + ["Alignment of itimerval"][::std::mem::align_of::() - 4usize]; + ["Offset of field: itimerval::it_interval"] + [::std::mem::offset_of!(itimerval, it_interval) - 0usize]; + ["Offset of field: itimerval::it_value"][::std::mem::offset_of!(itimerval, it_value) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timezone { pub tz_minuteswest: ::std::os::raw::c_int, pub tz_dsttime: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_timezone() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of timezone" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timezone" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, - 0usize, - "Offset of field: timezone::tz_minuteswest" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr as usize }, - 4usize, - "Offset of field: timezone::tz_dsttime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timezone"][::std::mem::size_of::() - 8usize]; + ["Alignment of timezone"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timezone::tz_minuteswest"] + [::std::mem::offset_of!(timezone, tz_minuteswest) - 0usize]; + ["Offset of field: timezone::tz_dsttime"] + [::std::mem::offset_of!(timezone, tz_dsttime) - 4usize]; +}; pub type sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -4907,67 +3646,30 @@ pub union __kernel_sigaction__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout___kernel_sigaction__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sigaction__bindgen_ty_1>(), - 4usize, - "Size of __kernel_sigaction__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sigaction__bindgen_ty_1>(), - 4usize, - "Alignment of __kernel_sigaction__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout___kernel_sigaction() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sigaction>(), - 16usize, - "Size of __kernel_sigaction" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sigaction>(), - 4usize, - "Alignment of __kernel_sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._u) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction::_u" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 4usize, - "Offset of field: __kernel_sigaction::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 12usize, - "Offset of field: __kernel_sigaction::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sigaction__bindgen_ty_1"] + [::std::mem::size_of::<__kernel_sigaction__bindgen_ty_1>() - 4usize]; + ["Alignment of __kernel_sigaction__bindgen_ty_1"] + [::std::mem::align_of::<__kernel_sigaction__bindgen_ty_1>() - 4usize]; + ["Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_handler"] + [::std::mem::offset_of!(__kernel_sigaction__bindgen_ty_1, _sa_handler) - 0usize]; + ["Offset of field: __kernel_sigaction__bindgen_ty_1::_sa_sigaction"] + [::std::mem::offset_of!(__kernel_sigaction__bindgen_ty_1, _sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sigaction"][::std::mem::size_of::<__kernel_sigaction>() - 16usize]; + ["Alignment of __kernel_sigaction"][::std::mem::align_of::<__kernel_sigaction>() - 4usize]; + ["Offset of field: __kernel_sigaction::_u"] + [::std::mem::offset_of!(__kernel_sigaction, _u) - 0usize]; + ["Offset of field: __kernel_sigaction::sa_mask"] + [::std::mem::offset_of!(__kernel_sigaction, sa_mask) - 4usize]; + ["Offset of field: __kernel_sigaction::sa_flags"] + [::std::mem::offset_of!(__kernel_sigaction, sa_flags) - 8usize]; + ["Offset of field: __kernel_sigaction::sa_restorer"] + [::std::mem::offset_of!(__kernel_sigaction, sa_restorer) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigaltstack { @@ -4975,36 +3677,16 @@ pub struct sigaltstack { pub ss_flags: ::std::os::raw::c_int, pub ss_size: __kernel_size_t, } -#[test] -fn bindgen_test_layout_sigaltstack() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of sigaltstack" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaltstack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaltstack::ss_sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, - 4usize, - "Offset of field: sigaltstack::ss_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaltstack::ss_size" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaltstack"][::std::mem::size_of::() - 12usize]; + ["Alignment of sigaltstack"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaltstack::ss_sp"][::std::mem::offset_of!(sigaltstack, ss_sp) - 0usize]; + ["Offset of field: sigaltstack::ss_flags"] + [::std::mem::offset_of!(sigaltstack, ss_flags) - 4usize]; + ["Offset of field: sigaltstack::ss_size"] + [::std::mem::offset_of!(sigaltstack, ss_size) - 8usize]; +}; pub type stack_t = sigaltstack; #[repr(C)] #[derive(Copy, Clone)] @@ -5012,27 +3694,13 @@ pub union sigval { pub sival_int: ::std::os::raw::c_int, pub sival_ptr: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 4usize, "Size of sigval"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_int" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_ptr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigval"][::std::mem::size_of::() - 4usize]; + ["Alignment of sigval"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigval::sival_int"][::std::mem::offset_of!(sigval, sival_int) - 0usize]; + ["Offset of field: sigval::sival_ptr"][::std::mem::offset_of!(sigval, sival_ptr) - 0usize]; +}; pub type sigval_t = sigval; #[repr(C)] #[derive(Copy, Clone)] @@ -5051,32 +3719,17 @@ pub struct __sifields__bindgen_ty_1 { pub _pid: __kernel_pid_t, pub _uid: __kernel_uid32_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_1>(), - 8usize, - "Size of __sifields__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_1::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_1::_uid" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_1>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_1::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_1::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _uid) - 4usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_2 { @@ -5085,42 +3738,21 @@ pub struct __sifields__bindgen_ty_2 { pub _sigval: sigval_t, pub _sys_private: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_2>(), - 16usize, - "Size of __sifields__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_2>(), - 4usize, - "Alignment of __sifields__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_2::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_2::_overrun" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_2::_sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_2::_sys_private" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_2>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_2>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_2::_tid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _tid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_2::_overrun"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _overrun) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sigval) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sys_private"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sys_private) - 12usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_3 { @@ -5128,37 +3760,19 @@ pub struct __sifields__bindgen_ty_3 { pub _uid: __kernel_uid32_t, pub _sigval: sigval_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_3>(), - 12usize, - "Size of __sifields__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_3>(), - 4usize, - "Alignment of __sifields__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_3::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_3::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_3::_sigval" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_3>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_3>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_3::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_3::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_3::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _sigval) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_4 { @@ -5168,47 +3782,23 @@ pub struct __sifields__bindgen_ty_4 { pub _utime: __kernel_clock_t, pub _stime: __kernel_clock_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_4>(), - 20usize, - "Size of __sifields__bindgen_ty_4" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_4>(), - 4usize, - "Alignment of __sifields__bindgen_ty_4" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_4::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_4::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_4::_status" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_4::_utime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_4::_stime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_4"] + [::std::mem::size_of::<__sifields__bindgen_ty_4>() - 20usize]; + ["Alignment of __sifields__bindgen_ty_4"] + [::std::mem::align_of::<__sifields__bindgen_ty_4>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_4::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_4::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_4::_status"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _status) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_4::_utime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _utime) - 12usize]; + ["Offset of field: __sifields__bindgen_ty_4::_stime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _stime) - 16usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_5 { @@ -5231,69 +3821,48 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { pub _lower: *mut ::std::os::raw::c_void, pub _upper: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _dummy_bnd + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _lower + ) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _upper + ) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { pub _dummy_pkey: [::std::os::raw::c_char; 4usize], pub _pkey: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 8usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _dummy_pkey + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _pkey + ) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { @@ -5301,131 +3870,68 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { pub _type: __u32, pub _flags: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._data) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._type) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5>(), - 16usize, - "Size of __sifields__bindgen_ty_5" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5::_addr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _data + ) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _type + ) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _flags + ) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _trapno) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_lsb) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_bnd) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_pkey) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _perf) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5"] + [::std::mem::size_of::<__sifields__bindgen_ty_5>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_5"] + [::std::mem::align_of::<__sifields__bindgen_ty_5>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5::_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5, _addr) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_6 { pub _band: ::std::os::raw::c_long, pub _fd: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_6() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_6>(), - 8usize, - "Size of __sifields__bindgen_ty_6" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_6>(), - 4usize, - "Alignment of __sifields__bindgen_ty_6" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_6::_band" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_6::_fd" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_6"] + [::std::mem::size_of::<__sifields__bindgen_ty_6>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_6"] + [::std::mem::align_of::<__sifields__bindgen_ty_6>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_6::_band"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _band) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_6::_fd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _fd) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_7 { @@ -5433,87 +3939,34 @@ pub struct __sifields__bindgen_ty_7 { pub _syscall: ::std::os::raw::c_int, pub _arch: ::std::os::raw::c_uint, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_7() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_7>(), - 12usize, - "Size of __sifields__bindgen_ty_7" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_7>(), - 4usize, - "Alignment of __sifields__bindgen_ty_7" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_7::_call_addr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_7::_syscall" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_7::_arch" - ); -} -#[test] -fn bindgen_test_layout___sifields() { - const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields>(), - 20usize, - "Size of __sifields" - ); - assert_eq!( - ::std::mem::align_of::<__sifields>(), - 4usize, - "Alignment of __sifields" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_kill" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_timer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_rt" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigchld" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigfault" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigpoll" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigsys" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_7"] + [::std::mem::size_of::<__sifields__bindgen_ty_7>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_7"] + [::std::mem::align_of::<__sifields__bindgen_ty_7>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_7::_call_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _call_addr) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_7::_syscall"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _syscall) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_7::_arch"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _arch) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields"][::std::mem::size_of::<__sifields>() - 20usize]; + ["Alignment of __sifields"][::std::mem::align_of::<__sifields>() - 4usize]; + ["Offset of field: __sifields::_kill"][::std::mem::offset_of!(__sifields, _kill) - 0usize]; + ["Offset of field: __sifields::_timer"][::std::mem::offset_of!(__sifields, _timer) - 0usize]; + ["Offset of field: __sifields::_rt"][::std::mem::offset_of!(__sifields, _rt) - 0usize]; + ["Offset of field: __sifields::_sigchld"] + [::std::mem::offset_of!(__sifields, _sigchld) - 0usize]; + ["Offset of field: __sifields::_sigfault"] + [::std::mem::offset_of!(__sifields, _sigfault) - 0usize]; + ["Offset of field: __sifields::_sigpoll"] + [::std::mem::offset_of!(__sifields, _sigpoll) - 0usize]; + ["Offset of field: __sifields::_sigsys"][::std::mem::offset_of!(__sifields, _sigsys) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct siginfo { @@ -5533,76 +3986,34 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { pub si_code: ::std::os::raw::c_int, pub _sifields: __sifields, } -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, - 4usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, - 8usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, - 12usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields" - ); -} -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of siginfo__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1::_si_pad" - ); -} -#[test] -fn bindgen_test_layout_siginfo() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of siginfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_signo) - 0usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_errno) - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_code) - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, _sifields) - 12usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1::_si_pad"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1, _si_pad) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo"][::std::mem::align_of::() - 4usize]; +}; pub type siginfo_t = siginfo; #[repr(C)] #[derive(Copy, Clone)] @@ -5625,98 +4036,41 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { pub _function: ::std::option::Option, pub _attribute: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, - 4usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute" - ); -} -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 52usize, - "Size of sigevent__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigevent__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_pad" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_sigev_thread" - ); -} -#[test] -fn bindgen_test_layout_sigevent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - "Size of sigevent" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigevent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent::sigev_value" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, - 4usize, - "Offset of field: sigevent::sigev_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, - 8usize, - "Offset of field: sigevent::sigev_notify" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, - 12usize, - "Offset of field: sigevent::_sigev_un" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _function) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _attribute) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1"][::std::mem::size_of::() - 52usize]; + ["Alignment of sigevent__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigevent__bindgen_ty_1::_pad"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _pad) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_tid"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _tid) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_sigev_thread"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _sigev_thread) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent"][::std::mem::size_of::() - 64usize]; + ["Alignment of sigevent"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigevent::sigev_value"] + [::std::mem::offset_of!(sigevent, sigev_value) - 0usize]; + ["Offset of field: sigevent::sigev_signo"] + [::std::mem::offset_of!(sigevent, sigev_signo) - 4usize]; + ["Offset of field: sigevent::sigev_notify"] + [::std::mem::offset_of!(sigevent, sigev_notify) - 8usize]; + ["Offset of field: sigevent::_sigev_un"][::std::mem::offset_of!(sigevent, _sigev_un) - 12usize]; +}; pub type sigevent_t = sigevent; pub type sig_atomic_t = ::std::os::raw::c_int; pub type sig_t = __sighandler_t; @@ -5726,26 +4080,12 @@ pub type sighandler_t = __sighandler_t; pub struct sigset64_t { pub __bits: [::std::os::raw::c_ulong; 2usize], } -#[test] -fn bindgen_test_layout_sigset64_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigset64_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigset64_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__bits) as usize - ptr as usize }, - 0usize, - "Offset of field: sigset64_t::__bits" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigset64_t"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigset64_t"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigset64_t::__bits"][::std::mem::offset_of!(sigset64_t, __bits) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct sigaction { @@ -5766,62 +4106,25 @@ pub union sigaction__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sigaction__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of sigaction" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 4usize, - "Offset of field: sigaction::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 12usize, - "Offset of field: sigaction::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; + ["Alignment of sigaction__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction"][::std::mem::size_of::() - 16usize]; + ["Alignment of sigaction"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction::sa_mask"][::std::mem::offset_of!(sigaction, sa_mask) - 4usize]; + ["Offset of field: sigaction::sa_flags"][::std::mem::offset_of!(sigaction, sa_flags) - 8usize]; + ["Offset of field: sigaction::sa_restorer"] + [::std::mem::offset_of!(sigaction, sa_restorer) - 12usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct sigaction64 { @@ -5842,62 +4145,28 @@ pub union sigaction64__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction64__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sigaction64__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction64__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction64() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 20usize, - "Size of sigaction64" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigaction64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 4usize, - "Offset of field: sigaction64::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaction64::sa_restorer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 12usize, - "Offset of field: sigaction64::sa_mask" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64__bindgen_ty_1"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of sigaction64__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64"][::std::mem::size_of::() - 20usize]; + ["Alignment of sigaction64"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigaction64::sa_flags"] + [::std::mem::offset_of!(sigaction64, sa_flags) - 4usize]; + ["Offset of field: sigaction64::sa_restorer"] + [::std::mem::offset_of!(sigaction64, sa_restorer) - 8usize]; + ["Offset of field: sigaction64::sa_mask"] + [::std::mem::offset_of!(sigaction64, sa_mask) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_fpregs_struct { @@ -5910,61 +4179,27 @@ pub struct user_fpregs_struct { pub fos: ::std::os::raw::c_long, pub st_space: [::std::os::raw::c_long; 20usize], } -#[test] -fn bindgen_test_layout_user_fpregs_struct() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 108usize, - "Size of user_fpregs_struct" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of user_fpregs_struct" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, - 0usize, - "Offset of field: user_fpregs_struct::cwd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, - 4usize, - "Offset of field: user_fpregs_struct::swd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, - 8usize, - "Offset of field: user_fpregs_struct::twd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fip) as usize - ptr as usize }, - 12usize, - "Offset of field: user_fpregs_struct::fip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fcs) as usize - ptr as usize }, - 16usize, - "Offset of field: user_fpregs_struct::fcs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize }, - 20usize, - "Offset of field: user_fpregs_struct::foo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fos) as usize - ptr as usize }, - 24usize, - "Offset of field: user_fpregs_struct::fos" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, - 28usize, - "Offset of field: user_fpregs_struct::st_space" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_fpregs_struct"][::std::mem::size_of::() - 108usize]; + ["Alignment of user_fpregs_struct"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user_fpregs_struct::cwd"] + [::std::mem::offset_of!(user_fpregs_struct, cwd) - 0usize]; + ["Offset of field: user_fpregs_struct::swd"] + [::std::mem::offset_of!(user_fpregs_struct, swd) - 4usize]; + ["Offset of field: user_fpregs_struct::twd"] + [::std::mem::offset_of!(user_fpregs_struct, twd) - 8usize]; + ["Offset of field: user_fpregs_struct::fip"] + [::std::mem::offset_of!(user_fpregs_struct, fip) - 12usize]; + ["Offset of field: user_fpregs_struct::fcs"] + [::std::mem::offset_of!(user_fpregs_struct, fcs) - 16usize]; + ["Offset of field: user_fpregs_struct::foo"] + [::std::mem::offset_of!(user_fpregs_struct, foo) - 20usize]; + ["Offset of field: user_fpregs_struct::fos"] + [::std::mem::offset_of!(user_fpregs_struct, fos) - 24usize]; + ["Offset of field: user_fpregs_struct::st_space"] + [::std::mem::offset_of!(user_fpregs_struct, st_space) - 28usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_fpxregs_struct { @@ -5982,86 +4217,37 @@ pub struct user_fpxregs_struct { pub xmm_space: [::std::os::raw::c_long; 32usize], pub padding: [::std::os::raw::c_long; 56usize], } -#[test] -fn bindgen_test_layout_user_fpxregs_struct() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 512usize, - "Size of user_fpxregs_struct" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of user_fpxregs_struct" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, - 0usize, - "Offset of field: user_fpxregs_struct::cwd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, - 2usize, - "Offset of field: user_fpxregs_struct::swd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, - 4usize, - "Offset of field: user_fpxregs_struct::twd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, - 6usize, - "Offset of field: user_fpxregs_struct::fop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fip) as usize - ptr as usize }, - 8usize, - "Offset of field: user_fpxregs_struct::fip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fcs) as usize - ptr as usize }, - 12usize, - "Offset of field: user_fpxregs_struct::fcs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).foo) as usize - ptr as usize }, - 16usize, - "Offset of field: user_fpxregs_struct::foo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fos) as usize - ptr as usize }, - 20usize, - "Offset of field: user_fpxregs_struct::fos" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 24usize, - "Offset of field: user_fpxregs_struct::mxcsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 28usize, - "Offset of field: user_fpxregs_struct::reserved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, - 32usize, - "Offset of field: user_fpxregs_struct::st_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, - 160usize, - "Offset of field: user_fpxregs_struct::xmm_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 288usize, - "Offset of field: user_fpxregs_struct::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_fpxregs_struct"][::std::mem::size_of::() - 512usize]; + ["Alignment of user_fpxregs_struct"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user_fpxregs_struct::cwd"] + [::std::mem::offset_of!(user_fpxregs_struct, cwd) - 0usize]; + ["Offset of field: user_fpxregs_struct::swd"] + [::std::mem::offset_of!(user_fpxregs_struct, swd) - 2usize]; + ["Offset of field: user_fpxregs_struct::twd"] + [::std::mem::offset_of!(user_fpxregs_struct, twd) - 4usize]; + ["Offset of field: user_fpxregs_struct::fop"] + [::std::mem::offset_of!(user_fpxregs_struct, fop) - 6usize]; + ["Offset of field: user_fpxregs_struct::fip"] + [::std::mem::offset_of!(user_fpxregs_struct, fip) - 8usize]; + ["Offset of field: user_fpxregs_struct::fcs"] + [::std::mem::offset_of!(user_fpxregs_struct, fcs) - 12usize]; + ["Offset of field: user_fpxregs_struct::foo"] + [::std::mem::offset_of!(user_fpxregs_struct, foo) - 16usize]; + ["Offset of field: user_fpxregs_struct::fos"] + [::std::mem::offset_of!(user_fpxregs_struct, fos) - 20usize]; + ["Offset of field: user_fpxregs_struct::mxcsr"] + [::std::mem::offset_of!(user_fpxregs_struct, mxcsr) - 24usize]; + ["Offset of field: user_fpxregs_struct::reserved"] + [::std::mem::offset_of!(user_fpxregs_struct, reserved) - 28usize]; + ["Offset of field: user_fpxregs_struct::st_space"] + [::std::mem::offset_of!(user_fpxregs_struct, st_space) - 32usize]; + ["Offset of field: user_fpxregs_struct::xmm_space"] + [::std::mem::offset_of!(user_fpxregs_struct, xmm_space) - 160usize]; + ["Offset of field: user_fpxregs_struct::padding"] + [::std::mem::offset_of!(user_fpxregs_struct, padding) - 288usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_regs_struct { @@ -6083,106 +4269,45 @@ pub struct user_regs_struct { pub esp: ::std::os::raw::c_long, pub xss: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_user_regs_struct() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 68usize, - "Size of user_regs_struct" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of user_regs_struct" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ebx) as usize - ptr as usize }, - 0usize, - "Offset of field: user_regs_struct::ebx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ecx) as usize - ptr as usize }, - 4usize, - "Offset of field: user_regs_struct::ecx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edx) as usize - ptr as usize }, - 8usize, - "Offset of field: user_regs_struct::edx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).esi) as usize - ptr as usize }, - 12usize, - "Offset of field: user_regs_struct::esi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edi) as usize - ptr as usize }, - 16usize, - "Offset of field: user_regs_struct::edi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ebp) as usize - ptr as usize }, - 20usize, - "Offset of field: user_regs_struct::ebp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eax) as usize - ptr as usize }, - 24usize, - "Offset of field: user_regs_struct::eax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xds) as usize - ptr as usize }, - 28usize, - "Offset of field: user_regs_struct::xds" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xes) as usize - ptr as usize }, - 32usize, - "Offset of field: user_regs_struct::xes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xfs) as usize - ptr as usize }, - 36usize, - "Offset of field: user_regs_struct::xfs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xgs) as usize - ptr as usize }, - 40usize, - "Offset of field: user_regs_struct::xgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig_eax) as usize - ptr as usize }, - 44usize, - "Offset of field: user_regs_struct::orig_eax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eip) as usize - ptr as usize }, - 48usize, - "Offset of field: user_regs_struct::eip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xcs) as usize - ptr as usize }, - 52usize, - "Offset of field: user_regs_struct::xcs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, - 56usize, - "Offset of field: user_regs_struct::eflags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).esp) as usize - ptr as usize }, - 60usize, - "Offset of field: user_regs_struct::esp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xss) as usize - ptr as usize }, - 64usize, - "Offset of field: user_regs_struct::xss" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_regs_struct"][::std::mem::size_of::() - 68usize]; + ["Alignment of user_regs_struct"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user_regs_struct::ebx"] + [::std::mem::offset_of!(user_regs_struct, ebx) - 0usize]; + ["Offset of field: user_regs_struct::ecx"] + [::std::mem::offset_of!(user_regs_struct, ecx) - 4usize]; + ["Offset of field: user_regs_struct::edx"] + [::std::mem::offset_of!(user_regs_struct, edx) - 8usize]; + ["Offset of field: user_regs_struct::esi"] + [::std::mem::offset_of!(user_regs_struct, esi) - 12usize]; + ["Offset of field: user_regs_struct::edi"] + [::std::mem::offset_of!(user_regs_struct, edi) - 16usize]; + ["Offset of field: user_regs_struct::ebp"] + [::std::mem::offset_of!(user_regs_struct, ebp) - 20usize]; + ["Offset of field: user_regs_struct::eax"] + [::std::mem::offset_of!(user_regs_struct, eax) - 24usize]; + ["Offset of field: user_regs_struct::xds"] + [::std::mem::offset_of!(user_regs_struct, xds) - 28usize]; + ["Offset of field: user_regs_struct::xes"] + [::std::mem::offset_of!(user_regs_struct, xes) - 32usize]; + ["Offset of field: user_regs_struct::xfs"] + [::std::mem::offset_of!(user_regs_struct, xfs) - 36usize]; + ["Offset of field: user_regs_struct::xgs"] + [::std::mem::offset_of!(user_regs_struct, xgs) - 40usize]; + ["Offset of field: user_regs_struct::orig_eax"] + [::std::mem::offset_of!(user_regs_struct, orig_eax) - 44usize]; + ["Offset of field: user_regs_struct::eip"] + [::std::mem::offset_of!(user_regs_struct, eip) - 48usize]; + ["Offset of field: user_regs_struct::xcs"] + [::std::mem::offset_of!(user_regs_struct, xcs) - 52usize]; + ["Offset of field: user_regs_struct::eflags"] + [::std::mem::offset_of!(user_regs_struct, eflags) - 56usize]; + ["Offset of field: user_regs_struct::esp"] + [::std::mem::offset_of!(user_regs_struct, esp) - 60usize]; + ["Offset of field: user_regs_struct::xss"] + [::std::mem::offset_of!(user_regs_struct, xss) - 64usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user { @@ -6202,88 +4327,26 @@ pub struct user { pub u_comm: [::std::os::raw::c_char; 32usize], pub u_debugreg: [::std::os::raw::c_int; 8usize], } -#[test] -fn bindgen_test_layout_user() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 284usize, "Size of user"); - assert_eq!(::std::mem::align_of::(), 4usize, "Alignment of user"); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, - 0usize, - "Offset of field: user::regs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_fpvalid) as usize - ptr as usize }, - 68usize, - "Offset of field: user::u_fpvalid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).i387) as usize - ptr as usize }, - 72usize, - "Offset of field: user::i387" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_tsize) as usize - ptr as usize }, - 180usize, - "Offset of field: user::u_tsize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_dsize) as usize - ptr as usize }, - 184usize, - "Offset of field: user::u_dsize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_ssize) as usize - ptr as usize }, - 188usize, - "Offset of field: user::u_ssize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_code) as usize - ptr as usize }, - 192usize, - "Offset of field: user::start_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_stack) as usize - ptr as usize }, - 196usize, - "Offset of field: user::start_stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).signal) as usize - ptr as usize }, - 200usize, - "Offset of field: user::signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 204usize, - "Offset of field: user::reserved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_ar0) as usize - ptr as usize }, - 208usize, - "Offset of field: user::u_ar0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_fpstate) as usize - ptr as usize }, - 212usize, - "Offset of field: user::u_fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 216usize, - "Offset of field: user::magic" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_comm) as usize - ptr as usize }, - 220usize, - "Offset of field: user::u_comm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_debugreg) as usize - ptr as usize }, - 252usize, - "Offset of field: user::u_debugreg" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user"][::std::mem::size_of::() - 284usize]; + ["Alignment of user"][::std::mem::align_of::() - 4usize]; + ["Offset of field: user::regs"][::std::mem::offset_of!(user, regs) - 0usize]; + ["Offset of field: user::u_fpvalid"][::std::mem::offset_of!(user, u_fpvalid) - 68usize]; + ["Offset of field: user::i387"][::std::mem::offset_of!(user, i387) - 72usize]; + ["Offset of field: user::u_tsize"][::std::mem::offset_of!(user, u_tsize) - 180usize]; + ["Offset of field: user::u_dsize"][::std::mem::offset_of!(user, u_dsize) - 184usize]; + ["Offset of field: user::u_ssize"][::std::mem::offset_of!(user, u_ssize) - 188usize]; + ["Offset of field: user::start_code"][::std::mem::offset_of!(user, start_code) - 192usize]; + ["Offset of field: user::start_stack"][::std::mem::offset_of!(user, start_stack) - 196usize]; + ["Offset of field: user::signal"][::std::mem::offset_of!(user, signal) - 200usize]; + ["Offset of field: user::reserved"][::std::mem::offset_of!(user, reserved) - 204usize]; + ["Offset of field: user::u_ar0"][::std::mem::offset_of!(user, u_ar0) - 208usize]; + ["Offset of field: user::u_fpstate"][::std::mem::offset_of!(user, u_fpstate) - 212usize]; + ["Offset of field: user::magic"][::std::mem::offset_of!(user, magic) - 216usize]; + ["Offset of field: user::u_comm"][::std::mem::offset_of!(user, u_comm) - 220usize]; + ["Offset of field: user::u_debugreg"][::std::mem::offset_of!(user, u_debugreg) - 252usize]; +}; pub const REG_GS: _bindgen_ty_22 = 0; pub const REG_FS: _bindgen_ty_22 = 1; pub const REG_ES: _bindgen_ty_22 = 2; @@ -6313,31 +4376,15 @@ pub struct _libc_fpreg { pub significand: [::std::os::raw::c_ushort; 4usize], pub exponent: ::std::os::raw::c_ushort, } -#[test] -fn bindgen_test_layout__libc_fpreg() { - const UNINIT: ::std::mem::MaybeUninit<_libc_fpreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_libc_fpreg>(), - 10usize, - "Size of _libc_fpreg" - ); - assert_eq!( - ::std::mem::align_of::<_libc_fpreg>(), - 2usize, - "Alignment of _libc_fpreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, - 0usize, - "Offset of field: _libc_fpreg::significand" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, - 8usize, - "Offset of field: _libc_fpreg::exponent" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _libc_fpreg"][::std::mem::size_of::<_libc_fpreg>() - 10usize]; + ["Alignment of _libc_fpreg"][::std::mem::align_of::<_libc_fpreg>() - 2usize]; + ["Offset of field: _libc_fpreg::significand"] + [::std::mem::offset_of!(_libc_fpreg, significand) - 0usize]; + ["Offset of field: _libc_fpreg::exponent"] + [::std::mem::offset_of!(_libc_fpreg, exponent) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _libc_fpstate { @@ -6351,66 +4398,25 @@ pub struct _libc_fpstate { pub _st: [_libc_fpreg; 8usize], pub status: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout__libc_fpstate() { - const UNINIT: ::std::mem::MaybeUninit<_libc_fpstate> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_libc_fpstate>(), - 112usize, - "Size of _libc_fpstate" - ); - assert_eq!( - ::std::mem::align_of::<_libc_fpstate>(), - 4usize, - "Alignment of _libc_fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cw) as usize - ptr as usize }, - 0usize, - "Offset of field: _libc_fpstate::cw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sw) as usize - ptr as usize }, - 4usize, - "Offset of field: _libc_fpstate::sw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, - 8usize, - "Offset of field: _libc_fpstate::tag" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ipoff) as usize - ptr as usize }, - 12usize, - "Offset of field: _libc_fpstate::ipoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cssel) as usize - ptr as usize }, - 16usize, - "Offset of field: _libc_fpstate::cssel" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dataoff) as usize - ptr as usize }, - 20usize, - "Offset of field: _libc_fpstate::dataoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).datasel) as usize - ptr as usize }, - 24usize, - "Offset of field: _libc_fpstate::datasel" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, - 28usize, - "Offset of field: _libc_fpstate::_st" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, - 108usize, - "Offset of field: _libc_fpstate::status" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _libc_fpstate"][::std::mem::size_of::<_libc_fpstate>() - 112usize]; + ["Alignment of _libc_fpstate"][::std::mem::align_of::<_libc_fpstate>() - 4usize]; + ["Offset of field: _libc_fpstate::cw"][::std::mem::offset_of!(_libc_fpstate, cw) - 0usize]; + ["Offset of field: _libc_fpstate::sw"][::std::mem::offset_of!(_libc_fpstate, sw) - 4usize]; + ["Offset of field: _libc_fpstate::tag"][::std::mem::offset_of!(_libc_fpstate, tag) - 8usize]; + ["Offset of field: _libc_fpstate::ipoff"] + [::std::mem::offset_of!(_libc_fpstate, ipoff) - 12usize]; + ["Offset of field: _libc_fpstate::cssel"] + [::std::mem::offset_of!(_libc_fpstate, cssel) - 16usize]; + ["Offset of field: _libc_fpstate::dataoff"] + [::std::mem::offset_of!(_libc_fpstate, dataoff) - 20usize]; + ["Offset of field: _libc_fpstate::datasel"] + [::std::mem::offset_of!(_libc_fpstate, datasel) - 24usize]; + ["Offset of field: _libc_fpstate::_st"][::std::mem::offset_of!(_libc_fpstate, _st) - 28usize]; + ["Offset of field: _libc_fpstate::status"] + [::std::mem::offset_of!(_libc_fpstate, status) - 108usize]; +}; pub type fpregset_t = *mut _libc_fpstate; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6420,41 +4426,15 @@ pub struct mcontext_t { pub oldmask: ::std::os::raw::c_ulong, pub cr2: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout_mcontext_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of mcontext_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of mcontext_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gregs) as usize - ptr as usize }, - 0usize, - "Offset of field: mcontext_t::gregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, - 76usize, - "Offset of field: mcontext_t::fpregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 80usize, - "Offset of field: mcontext_t::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, - 84usize, - "Offset of field: mcontext_t::cr2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mcontext_t"][::std::mem::size_of::() - 88usize]; + ["Alignment of mcontext_t"][::std::mem::align_of::() - 4usize]; + ["Offset of field: mcontext_t::gregs"][::std::mem::offset_of!(mcontext_t, gregs) - 0usize]; + ["Offset of field: mcontext_t::fpregs"][::std::mem::offset_of!(mcontext_t, fpregs) - 76usize]; + ["Offset of field: mcontext_t::oldmask"][::std::mem::offset_of!(mcontext_t, oldmask) - 80usize]; + ["Offset of field: mcontext_t::cr2"][::std::mem::offset_of!(mcontext_t, cr2) - 84usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct ucontext { @@ -6477,286 +4457,232 @@ pub struct ucontext__bindgen_ty_1__bindgen_ty_1 { pub uc_sigmask: sigset_t, pub __padding_rt_sigset: u32, } -#[test] -fn bindgen_test_layout_ucontext__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of ucontext__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of ucontext__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::uc_sigmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__padding_rt_sigset) as usize - ptr as usize }, - 4usize, - "Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::__padding_rt_sigset" - ); -} -#[test] -fn bindgen_test_layout_ucontext__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of ucontext__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of ucontext__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1::uc_sigmask64" - ); -} -#[test] -fn bindgen_test_layout_ucontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 228usize, - "Size of ucontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of ucontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext::uc_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, - 4usize, - "Offset of field: ucontext::uc_link" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, - 8usize, - "Offset of field: ucontext::uc_stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, - 20usize, - "Offset of field: ucontext::uc_mcontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__fpregs_mem) as usize - ptr as usize }, - 116usize, - "Offset of field: ucontext::__fpregs_mem" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of ucontext__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::uc_sigmask"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1__bindgen_ty_1, uc_sigmask) - 0usize]; + ["Offset of field: ucontext__bindgen_ty_1__bindgen_ty_1::__padding_rt_sigset"][::std::mem::offset_of!( + ucontext__bindgen_ty_1__bindgen_ty_1, + __padding_rt_sigset + ) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; + ["Alignment of ucontext__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ucontext__bindgen_ty_1::uc_sigmask64"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1, uc_sigmask64) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext"][::std::mem::size_of::() - 228usize]; + ["Alignment of ucontext"][::std::mem::align_of::() - 4usize]; + ["Offset of field: ucontext::uc_flags"][::std::mem::offset_of!(ucontext, uc_flags) - 0usize]; + ["Offset of field: ucontext::uc_link"][::std::mem::offset_of!(ucontext, uc_link) - 4usize]; + ["Offset of field: ucontext::uc_stack"][::std::mem::offset_of!(ucontext, uc_stack) - 8usize]; + ["Offset of field: ucontext::uc_mcontext"] + [::std::mem::offset_of!(ucontext, uc_mcontext) - 20usize]; + ["Offset of field: ucontext::__fpregs_mem"] + [::std::mem::offset_of!(ucontext, __fpregs_mem) - 116usize]; +}; pub type ucontext_t = ucontext; -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmin() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmax() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static sys_siglist: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub static sys_signame: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub fn sigaction( __signal: ::std::os::raw::c_int, __new_action: *const sigaction, __old_action: *mut sigaction, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaction64( __signal: ::std::os::raw::c_int, __new_action: *const sigaction64, __old_action: *mut sigaction64, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn siginterrupt( __signal: ::std::os::raw::c_int, __flag: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn signal(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn sigaddset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaddset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember( __set: *const sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember64( __set: *const sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask( __how: ::std::os::raw::c_int, __new_set: *const sigset_t, __old_set: *mut sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask64( __how: ::std::os::raw::c_int, __new_set: *const sigset64_t, __old_set: *mut sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend(__mask: *const sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend64(__mask: *const sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait( __set: *const sigset_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait64( __set: *const sigset64_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sighold(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigignore(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpause(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigrelse(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigset(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn raise(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn kill(__pid: pid_t, __signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn killpg( __pgrp: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn tgkill( __tgid: ::std::os::raw::c_int, __tid: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaltstack( __new_signal_stack: *const stack_t, __old_signal_stack: *mut stack_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn psiginfo(__info: *const siginfo_t, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn sigqueue( __pid: pid_t, __signal: ::std::os::raw::c_int, __value: sigval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait( __set: *const sigset_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait64( __set: *const sigset64_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo(__set: *const sigset_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo64(__set: *const sigset64_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } @@ -6766,36 +4692,26 @@ pub type fd_mask = ::std::os::raw::c_ulong; pub struct fd_set { pub fds_bits: [fd_mask; 32usize], } -#[test] -fn bindgen_test_layout_fd_set() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 128usize, "Size of fd_set"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: fd_set::fds_bits" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of fd_set"][::std::mem::size_of::() - 128usize]; + ["Alignment of fd_set"][::std::mem::align_of::() - 4usize]; + ["Offset of field: fd_set::fds_bits"][::std::mem::offset_of!(fd_set, fds_bits) - 0usize]; +}; +unsafe extern "C" { pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, arg3: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn select( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6804,7 +4720,7 @@ extern "C" { __timeout: *mut timeval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6814,7 +4730,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect64( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6824,26 +4740,26 @@ extern "C" { __mask: *const sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn gettimeofday(__tv: *mut timeval, __tz: *mut timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn settimeofday(__tv: *const timeval, __tz: *const timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn getitimer( __which: ::std::os::raw::c_int, __current_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn setitimer( __which: ::std::os::raw::c_int, __new_value: *const itimerval, __old_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn utimes( __path: *const ::std::os::raw::c_char, __times: *const timeval, @@ -6855,13 +4771,13 @@ pub struct __locale_t { _unused: [u8; 0], } pub type locale_t = *mut __locale_t; -extern "C" { +unsafe extern "C" { pub static mut tzname: [*mut ::std::os::raw::c_char; 0usize]; } -extern "C" { +unsafe extern "C" { pub static mut daylight: ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static mut timezone: ::std::os::raw::c_long; } #[repr(C)] @@ -6879,118 +4795,72 @@ pub struct tm { pub tm_gmtoff: ::std::os::raw::c_long, pub tm_zone: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_tm() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 44usize, "Size of tm"); - assert_eq!(::std::mem::align_of::(), 4usize, "Alignment of tm"); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: tm::tm_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, - 4usize, - "Offset of field: tm::tm_min" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, - 8usize, - "Offset of field: tm::tm_hour" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, - 12usize, - "Offset of field: tm::tm_mday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, - 16usize, - "Offset of field: tm::tm_mon" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, - 20usize, - "Offset of field: tm::tm_year" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, - 24usize, - "Offset of field: tm::tm_wday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, - 28usize, - "Offset of field: tm::tm_yday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, - 32usize, - "Offset of field: tm::tm_isdst" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, - 36usize, - "Offset of field: tm::tm_gmtoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, - 40usize, - "Offset of field: tm::tm_zone" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of tm"][::std::mem::size_of::() - 44usize]; + ["Alignment of tm"][::std::mem::align_of::() - 4usize]; + ["Offset of field: tm::tm_sec"][::std::mem::offset_of!(tm, tm_sec) - 0usize]; + ["Offset of field: tm::tm_min"][::std::mem::offset_of!(tm, tm_min) - 4usize]; + ["Offset of field: tm::tm_hour"][::std::mem::offset_of!(tm, tm_hour) - 8usize]; + ["Offset of field: tm::tm_mday"][::std::mem::offset_of!(tm, tm_mday) - 12usize]; + ["Offset of field: tm::tm_mon"][::std::mem::offset_of!(tm, tm_mon) - 16usize]; + ["Offset of field: tm::tm_year"][::std::mem::offset_of!(tm, tm_year) - 20usize]; + ["Offset of field: tm::tm_wday"][::std::mem::offset_of!(tm, tm_wday) - 24usize]; + ["Offset of field: tm::tm_yday"][::std::mem::offset_of!(tm, tm_yday) - 28usize]; + ["Offset of field: tm::tm_isdst"][::std::mem::offset_of!(tm, tm_isdst) - 32usize]; + ["Offset of field: tm::tm_gmtoff"][::std::mem::offset_of!(tm, tm_gmtoff) - 36usize]; + ["Offset of field: tm::tm_zone"][::std::mem::offset_of!(tm, tm_zone) - 40usize]; +}; +unsafe extern "C" { pub fn time(__t: *mut time_t) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn nanosleep( __request: *const timespec, __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn asctime(__tm: *const tm) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn asctime_r( __tm: *const tm, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn difftime(__lhs: time_t, __rhs: time_t) -> f64; } -extern "C" { +unsafe extern "C" { pub fn mktime(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn localtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn localtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timelocal(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn gmtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn gmtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timegm(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn strptime( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, __tm: *mut tm, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strptime_l( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, @@ -6998,7 +4868,7 @@ extern "C" { __l: locale_t, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -7006,7 +4876,7 @@ extern "C" { __tm: *const tm, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -7015,31 +4885,31 @@ extern "C" { __l: locale_t, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn ctime_r( __t: *const time_t, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn tzset(); } -extern "C" { +unsafe extern "C" { pub fn clock() -> clock_t; } -extern "C" { +unsafe extern "C" { pub fn clock_getcpuclockid(__pid: pid_t, __clock: *mut clockid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_getres(__clock: clockid_t, __resolution: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_gettime(__clock: clockid_t, __ts: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_nanosleep( __clock: clockid_t, __flags: ::std::os::raw::c_int, @@ -7047,20 +4917,20 @@ extern "C" { __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_settime(__clock: clockid_t, __ts: *const timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_create( __clock: clockid_t, __event: *mut sigevent, __timer_ptr: *mut timer_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_delete(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_settime( __timer: timer_t, __flags: ::std::os::raw::c_int, @@ -7068,33 +4938,33 @@ extern "C" { __old_value: *mut itimerspec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_gettime(_timer: timer_t, __ts: *mut itimerspec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_getoverrun(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_get( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_getres( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } pub type nfds_t = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn poll( __fds: *mut pollfd, __count: nfds_t, __timeout_ms: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll( __fds: *mut pollfd, __count: nfds_t, @@ -7102,7 +4972,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll64( __fds: *mut pollfd, __count: nfds_t, @@ -7126,127 +4996,65 @@ pub struct clone_args { pub set_tid_size: __u64, pub cgroup: __u64, } -#[test] -fn bindgen_test_layout_clone_args() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of clone_args" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of clone_args" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 0usize, - "Offset of field: clone_args::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, - 8usize, - "Offset of field: clone_args::pidfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, - 16usize, - "Offset of field: clone_args::child_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, - 24usize, - "Offset of field: clone_args::parent_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, - 32usize, - "Offset of field: clone_args::exit_signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, - 40usize, - "Offset of field: clone_args::stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, - 48usize, - "Offset of field: clone_args::stack_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 56usize, - "Offset of field: clone_args::tls" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, - 64usize, - "Offset of field: clone_args::set_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, - 72usize, - "Offset of field: clone_args::set_tid_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, - 80usize, - "Offset of field: clone_args::cgroup" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of clone_args"][::std::mem::size_of::() - 88usize]; + ["Alignment of clone_args"][::std::mem::align_of::() - 8usize]; + ["Offset of field: clone_args::flags"][::std::mem::offset_of!(clone_args, flags) - 0usize]; + ["Offset of field: clone_args::pidfd"][::std::mem::offset_of!(clone_args, pidfd) - 8usize]; + ["Offset of field: clone_args::child_tid"] + [::std::mem::offset_of!(clone_args, child_tid) - 16usize]; + ["Offset of field: clone_args::parent_tid"] + [::std::mem::offset_of!(clone_args, parent_tid) - 24usize]; + ["Offset of field: clone_args::exit_signal"] + [::std::mem::offset_of!(clone_args, exit_signal) - 32usize]; + ["Offset of field: clone_args::stack"][::std::mem::offset_of!(clone_args, stack) - 40usize]; + ["Offset of field: clone_args::stack_size"] + [::std::mem::offset_of!(clone_args, stack_size) - 48usize]; + ["Offset of field: clone_args::tls"][::std::mem::offset_of!(clone_args, tls) - 56usize]; + ["Offset of field: clone_args::set_tid"][::std::mem::offset_of!(clone_args, set_tid) - 64usize]; + ["Offset of field: clone_args::set_tid_size"] + [::std::mem::offset_of!(clone_args, set_tid_size) - 72usize]; + ["Offset of field: clone_args::cgroup"][::std::mem::offset_of!(clone_args, cgroup) - 80usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sched_param { pub sched_priority: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_sched_param() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sched_param" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sched_param" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, - 0usize, - "Offset of field: sched_param::sched_priority" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sched_param"][::std::mem::size_of::() - 4usize]; + ["Alignment of sched_param"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sched_param::sched_priority"] + [::std::mem::offset_of!(sched_param, sched_priority) - 0usize]; +}; +unsafe extern "C" { pub fn sched_setscheduler( __pid: pid_t, __policy: ::std::os::raw::c_int, __param: *const sched_param, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getscheduler(__pid: pid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_yield() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_max(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_min(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_setparam(__pid: pid_t, __param: *const sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getparam(__pid: pid_t, __param: *mut sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_23 = 0; @@ -7267,44 +5075,25 @@ pub struct __pthread_cleanup_t { ::std::option::Option, pub __cleanup_arg: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___pthread_cleanup_t() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cleanup_t>(), - 12usize, - "Size of __pthread_cleanup_t" - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cleanup_t>(), - 4usize, - "Alignment of __pthread_cleanup_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, - 0usize, - "Offset of field: __pthread_cleanup_t::__cleanup_prev" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, - 4usize, - "Offset of field: __pthread_cleanup_t::__cleanup_routine" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, - 8usize, - "Offset of field: __pthread_cleanup_t::__cleanup_arg" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __pthread_cleanup_t"][::std::mem::size_of::<__pthread_cleanup_t>() - 12usize]; + ["Alignment of __pthread_cleanup_t"][::std::mem::align_of::<__pthread_cleanup_t>() - 4usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_prev"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_prev) - 0usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_routine"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_routine) - 4usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_arg"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_arg) - 8usize]; +}; +unsafe extern "C" { pub fn __pthread_cleanup_push( c: *mut __pthread_cleanup_t, arg1: ::std::option::Option, arg2: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } #[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] @@ -7320,36 +5109,17 @@ pub struct android_poll_source { unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } -#[test] -fn bindgen_test_layout_android_poll_source() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 12usize, - "Size of android_poll_source" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of android_poll_source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: android_poll_source::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, - 4usize, - "Offset of field: android_poll_source::app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, - 8usize, - "Offset of field: android_poll_source::process" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_poll_source"][::std::mem::size_of::() - 12usize]; + ["Alignment of android_poll_source"][::std::mem::align_of::() - 4usize]; + ["Offset of field: android_poll_source::id"] + [::std::mem::offset_of!(android_poll_source, id) - 0usize]; + ["Offset of field: android_poll_source::app"] + [::std::mem::offset_of!(android_poll_source, app) - 4usize]; + ["Offset of field: android_poll_source::process"] + [::std::mem::offset_of!(android_poll_source, process) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { @@ -7366,51 +5136,23 @@ pub struct android_input_buffer { #[doc = " The size of the `keyEvents` buffer."] pub keyEventsBufferSize: u64, } -#[test] -fn bindgen_test_layout_android_input_buffer() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - "Size of android_input_buffer" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of android_input_buffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, - 0usize, - "Offset of field: android_input_buffer::motionEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, - 4usize, - "Offset of field: android_input_buffer::motionEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, - 12usize, - "Offset of field: android_input_buffer::motionEventsBufferSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, - 20usize, - "Offset of field: android_input_buffer::keyEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, - 24usize, - "Offset of field: android_input_buffer::keyEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, - 32usize, - "Offset of field: android_input_buffer::keyEventsBufferSize" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_input_buffer"][::std::mem::size_of::() - 40usize]; + ["Alignment of android_input_buffer"][::std::mem::align_of::() - 4usize]; + ["Offset of field: android_input_buffer::motionEvents"] + [::std::mem::offset_of!(android_input_buffer, motionEvents) - 0usize]; + ["Offset of field: android_input_buffer::motionEventsCount"] + [::std::mem::offset_of!(android_input_buffer, motionEventsCount) - 4usize]; + ["Offset of field: android_input_buffer::motionEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, motionEventsBufferSize) - 12usize]; + ["Offset of field: android_input_buffer::keyEvents"] + [::std::mem::offset_of!(android_input_buffer, keyEvents) - 20usize]; + ["Offset of field: android_input_buffer::keyEventsCount"] + [::std::mem::offset_of!(android_input_buffer, keyEventsCount) - 24usize]; + ["Offset of field: android_input_buffer::keyEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, keyEventsBufferSize) - 32usize]; +}; #[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; @@ -7469,181 +5211,70 @@ pub struct android_app { pub inputAvailableWakeUp: bool, pub inputSwapPending: bool, } -#[test] -fn bindgen_test_layout_android_app() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 232usize, - "Size of android_app" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of android_app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, - 0usize, - "Offset of field: android_app::userData" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, - 4usize, - "Offset of field: android_app::onAppCmd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, - 8usize, - "Offset of field: android_app::activity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, - 12usize, - "Offset of field: android_app::config" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, - 16usize, - "Offset of field: android_app::savedState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, - 20usize, - "Offset of field: android_app::savedStateSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, - 24usize, - "Offset of field: android_app::looper" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, - 28usize, - "Offset of field: android_app::window" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, - 32usize, - "Offset of field: android_app::contentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).softwareKeyboardVisible) as usize - ptr as usize }, - 48usize, - "Offset of field: android_app::softwareKeyboardVisible" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).editorAction) as usize - ptr as usize }, - 52usize, - "Offset of field: android_app::editorAction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, - 56usize, - "Offset of field: android_app::activityState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, - 60usize, - "Offset of field: android_app::destroyRequested" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, - 64usize, - "Offset of field: android_app::inputBuffers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, - 144usize, - "Offset of field: android_app::currentInputBuffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, - 148usize, - "Offset of field: android_app::textInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, - 152usize, - "Offset of field: android_app::mutex" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, - 156usize, - "Offset of field: android_app::cond" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, - 160usize, - "Offset of field: android_app::msgread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, - 164usize, - "Offset of field: android_app::msgwrite" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, - 168usize, - "Offset of field: android_app::thread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, - 172usize, - "Offset of field: android_app::cmdPollSource" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, - 184usize, - "Offset of field: android_app::running" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, - 188usize, - "Offset of field: android_app::stateSaved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, - 192usize, - "Offset of field: android_app::destroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, - 196usize, - "Offset of field: android_app::redrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, - 200usize, - "Offset of field: android_app::pendingWindow" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, - 204usize, - "Offset of field: android_app::pendingContentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, - 220usize, - "Offset of field: android_app::keyEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, - 224usize, - "Offset of field: android_app::motionEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, - 228usize, - "Offset of field: android_app::inputAvailableWakeUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, - 229usize, - "Offset of field: android_app::inputSwapPending" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_app"][::std::mem::size_of::() - 232usize]; + ["Alignment of android_app"][::std::mem::align_of::() - 4usize]; + ["Offset of field: android_app::userData"] + [::std::mem::offset_of!(android_app, userData) - 0usize]; + ["Offset of field: android_app::onAppCmd"] + [::std::mem::offset_of!(android_app, onAppCmd) - 4usize]; + ["Offset of field: android_app::activity"] + [::std::mem::offset_of!(android_app, activity) - 8usize]; + ["Offset of field: android_app::config"][::std::mem::offset_of!(android_app, config) - 12usize]; + ["Offset of field: android_app::savedState"] + [::std::mem::offset_of!(android_app, savedState) - 16usize]; + ["Offset of field: android_app::savedStateSize"] + [::std::mem::offset_of!(android_app, savedStateSize) - 20usize]; + ["Offset of field: android_app::looper"][::std::mem::offset_of!(android_app, looper) - 24usize]; + ["Offset of field: android_app::window"][::std::mem::offset_of!(android_app, window) - 28usize]; + ["Offset of field: android_app::contentRect"] + [::std::mem::offset_of!(android_app, contentRect) - 32usize]; + ["Offset of field: android_app::softwareKeyboardVisible"] + [::std::mem::offset_of!(android_app, softwareKeyboardVisible) - 48usize]; + ["Offset of field: android_app::editorAction"] + [::std::mem::offset_of!(android_app, editorAction) - 52usize]; + ["Offset of field: android_app::activityState"] + [::std::mem::offset_of!(android_app, activityState) - 56usize]; + ["Offset of field: android_app::destroyRequested"] + [::std::mem::offset_of!(android_app, destroyRequested) - 60usize]; + ["Offset of field: android_app::inputBuffers"] + [::std::mem::offset_of!(android_app, inputBuffers) - 64usize]; + ["Offset of field: android_app::currentInputBuffer"] + [::std::mem::offset_of!(android_app, currentInputBuffer) - 144usize]; + ["Offset of field: android_app::textInputState"] + [::std::mem::offset_of!(android_app, textInputState) - 148usize]; + ["Offset of field: android_app::mutex"][::std::mem::offset_of!(android_app, mutex) - 152usize]; + ["Offset of field: android_app::cond"][::std::mem::offset_of!(android_app, cond) - 156usize]; + ["Offset of field: android_app::msgread"] + [::std::mem::offset_of!(android_app, msgread) - 160usize]; + ["Offset of field: android_app::msgwrite"] + [::std::mem::offset_of!(android_app, msgwrite) - 164usize]; + ["Offset of field: android_app::thread"] + [::std::mem::offset_of!(android_app, thread) - 168usize]; + ["Offset of field: android_app::cmdPollSource"] + [::std::mem::offset_of!(android_app, cmdPollSource) - 172usize]; + ["Offset of field: android_app::running"] + [::std::mem::offset_of!(android_app, running) - 184usize]; + ["Offset of field: android_app::stateSaved"] + [::std::mem::offset_of!(android_app, stateSaved) - 188usize]; + ["Offset of field: android_app::destroyed"] + [::std::mem::offset_of!(android_app, destroyed) - 192usize]; + ["Offset of field: android_app::redrawNeeded"] + [::std::mem::offset_of!(android_app, redrawNeeded) - 196usize]; + ["Offset of field: android_app::pendingWindow"] + [::std::mem::offset_of!(android_app, pendingWindow) - 200usize]; + ["Offset of field: android_app::pendingContentRect"] + [::std::mem::offset_of!(android_app, pendingContentRect) - 204usize]; + ["Offset of field: android_app::keyEventFilter"] + [::std::mem::offset_of!(android_app, keyEventFilter) - 220usize]; + ["Offset of field: android_app::motionEventFilter"] + [::std::mem::offset_of!(android_app, motionEventFilter) - 224usize]; + ["Offset of field: android_app::inputAvailableWakeUp"] + [::std::mem::offset_of!(android_app, inputAvailableWakeUp) - 228usize]; + ["Offset of field: android_app::inputSwapPending"] + [::std::mem::offset_of!(android_app, inputSwapPending) - 229usize]; +}; #[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; #[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] @@ -7690,55 +5321,55 @@ pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 16; pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 17; #[doc = " Commands passed from the application's main Java thread to the game's thread.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub type NativeAppGlueAppCmd = i8; -extern "C" { +unsafe extern "C" { #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " You can send your custom events using the function below.\n\n Make sure your custom codes do not overlap with this library's ones.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Determines if a looper wake up was due to new input becoming available"] pub fn android_app_input_available_wake_up(app: *mut android_app) -> bool; } diff --git a/android-activity/src/game_activity/ffi_x86_64.rs b/android-activity/src/game_activity/ffi_x86_64.rs index f8ac1557..04b38a47 100644 --- a/android-activity/src/game_activity/ffi_x86_64.rs +++ b/android-activity/src/game_activity/ffi_x86_64.rs @@ -711,10 +711,10 @@ pub const PTHREAD_PROCESS_SHARED: u32 = 1; pub const PTHREAD_SCOPE_SYSTEM: u32 = 0; pub const PTHREAD_SCOPE_PROCESS: u32 = 1; pub const NATIVE_APP_GLUE_MAX_INPUT_BUFFERS: u32 = 2; -extern "C" { +unsafe extern "C" { pub fn android_get_application_target_sdk_version() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn android_get_device_api_level() -> ::std::os::raw::c_int; } pub type wchar_t = ::std::os::raw::c_int; @@ -726,31 +726,15 @@ pub struct max_align_t { pub __bindgen_padding_0: u64, pub __clang_max_align_nonce2: u128, } -#[test] -fn bindgen_test_layout_max_align_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of max_align_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - "Alignment of max_align_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, - 0usize, - "Offset of field: max_align_t::__clang_max_align_nonce1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, - 16usize, - "Offset of field: max_align_t::__clang_max_align_nonce2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of max_align_t"][::std::mem::size_of::() - 32usize]; + ["Alignment of max_align_t"][::std::mem::align_of::() - 16usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce1"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce2"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize]; +}; pub type __int8_t = ::std::os::raw::c_schar; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __int16_t = ::std::os::raw::c_short; @@ -792,26 +776,13 @@ pub type __u64 = ::std::os::raw::c_ulonglong; pub struct __kernel_fd_set { pub fds_bits: [::std::os::raw::c_ulong; 16usize], } -#[test] -fn bindgen_test_layout___kernel_fd_set() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fd_set>(), - 128usize, - "Size of __kernel_fd_set" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fd_set>(), - 8usize, - "Alignment of __kernel_fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fd_set::fds_bits" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fd_set"][::std::mem::size_of::<__kernel_fd_set>() - 128usize]; + ["Alignment of __kernel_fd_set"][::std::mem::align_of::<__kernel_fd_set>() - 8usize]; + ["Offset of field: __kernel_fd_set::fds_bits"] + [::std::mem::offset_of!(__kernel_fd_set, fds_bits) - 0usize]; +}; pub type __kernel_sighandler_t = ::std::option::Option; pub type __kernel_key_t = ::std::os::raw::c_int; @@ -839,26 +810,13 @@ pub type __kernel_ptrdiff_t = __kernel_long_t; pub struct __kernel_fsid_t { pub val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___kernel_fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fsid_t>(), - 8usize, - "Size of __kernel_fsid_t" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fsid_t>(), - 4usize, - "Alignment of __kernel_fsid_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_fsid_t::val" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fsid_t"][::std::mem::size_of::<__kernel_fsid_t>() - 8usize]; + ["Alignment of __kernel_fsid_t"][::std::mem::align_of::<__kernel_fsid_t>() - 4usize]; + ["Offset of field: __kernel_fsid_t::val"] + [::std::mem::offset_of!(__kernel_fsid_t, val) - 0usize]; +}; pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; pub type __kernel_old_time_t = __kernel_long_t; @@ -1262,67 +1220,32 @@ pub struct JavaVMAttachArgs { pub name: *const ::std::os::raw::c_char, pub group: jobject, } -#[test] -fn bindgen_test_layout_JavaVMAttachArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of JavaVMAttachArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of JavaVMAttachArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMAttachArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMAttachArgs::name" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).group) as usize - ptr as usize }, - 16usize, - "Offset of field: JavaVMAttachArgs::group" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMAttachArgs"][::std::mem::size_of::() - 24usize]; + ["Alignment of JavaVMAttachArgs"][::std::mem::align_of::() - 8usize]; + ["Offset of field: JavaVMAttachArgs::version"] + [::std::mem::offset_of!(JavaVMAttachArgs, version) - 0usize]; + ["Offset of field: JavaVMAttachArgs::name"] + [::std::mem::offset_of!(JavaVMAttachArgs, name) - 8usize]; + ["Offset of field: JavaVMAttachArgs::group"] + [::std::mem::offset_of!(JavaVMAttachArgs, group) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct JavaVMOption { pub optionString: *const ::std::os::raw::c_char, pub extraInfo: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_JavaVMOption() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of JavaVMOption" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of JavaVMOption" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).optionString) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMOption::optionString" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extraInfo) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMOption::extraInfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMOption"][::std::mem::size_of::() - 16usize]; + ["Alignment of JavaVMOption"][::std::mem::align_of::() - 8usize]; + ["Offset of field: JavaVMOption::optionString"] + [::std::mem::offset_of!(JavaVMOption, optionString) - 0usize]; + ["Offset of field: JavaVMOption::extraInfo"] + [::std::mem::offset_of!(JavaVMOption, extraInfo) - 8usize]; +}; #[repr(C)] pub struct JavaVMInitArgs { pub version: jint, @@ -1330,41 +1253,19 @@ pub struct JavaVMInitArgs { pub options: *mut JavaVMOption, pub ignoreUnrecognized: jboolean, } -#[test] -fn bindgen_test_layout_JavaVMInitArgs() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of JavaVMInitArgs" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of JavaVMInitArgs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - "Offset of field: JavaVMInitArgs::version" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nOptions) as usize - ptr as usize }, - 4usize, - "Offset of field: JavaVMInitArgs::nOptions" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize }, - 8usize, - "Offset of field: JavaVMInitArgs::options" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ignoreUnrecognized) as usize - ptr as usize }, - 16usize, - "Offset of field: JavaVMInitArgs::ignoreUnrecognized" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of JavaVMInitArgs"][::std::mem::size_of::() - 24usize]; + ["Alignment of JavaVMInitArgs"][::std::mem::align_of::() - 8usize]; + ["Offset of field: JavaVMInitArgs::version"] + [::std::mem::offset_of!(JavaVMInitArgs, version) - 0usize]; + ["Offset of field: JavaVMInitArgs::nOptions"] + [::std::mem::offset_of!(JavaVMInitArgs, nOptions) - 4usize]; + ["Offset of field: JavaVMInitArgs::options"] + [::std::mem::offset_of!(JavaVMInitArgs, options) - 8usize]; + ["Offset of field: JavaVMInitArgs::ignoreUnrecognized"] + [::std::mem::offset_of!(JavaVMInitArgs, ignoreUnrecognized) - 16usize]; +}; pub const AKEY_STATE_UNKNOWN: _bindgen_ty_6 = -1; pub const AKEY_STATE_UP: _bindgen_ty_6 = 0; pub const AKEY_STATE_DOWN: _bindgen_ty_6 = 1; @@ -1547,226 +1448,226 @@ pub const AINPUT_MOTION_RANGE_TOOL_MAJOR: _bindgen_ty_20 = 6; pub const AINPUT_MOTION_RANGE_TOOL_MINOR: _bindgen_ty_20 = 7; pub const AINPUT_MOTION_RANGE_ORIENTATION: _bindgen_ty_20 = 8; pub type _bindgen_ty_20 = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getType(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getDeviceId(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_getSource(event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputEvent_release(event: *const AInputEvent); } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getAction(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getFlags(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getKeyCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getScanCode(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getMetaState(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getRepeatCount(key_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getDownTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_getEventTime(key_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AKeyEvent_fromJava(env: *mut JNIEnv, keyEvent: jobject) -> *const AInputEvent; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAction(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getMetaState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getButtonState(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEdgeFlags(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getDownTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getEventTime(motion_event: *const AInputEvent) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYOffset(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getXPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getYPrecision(motion_event: *const AInputEvent) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerCount(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPointerId(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolType(motion_event: *const AInputEvent, pointer_index: usize) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getRawY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getX(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getY(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getPressure(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getSize(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMajor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getToolMinor(motion_event: *const AInputEvent, pointer_index: usize) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getOrientation( motion_event: *const AInputEvent, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getAxisValue( motion_event: *const AInputEvent, axis: i32, pointer_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistorySize(motion_event: *const AInputEvent) -> usize; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalEventTime( motion_event: *const AInputEvent, history_index: usize, ) -> i64; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalRawY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalX( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalY( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalPressure( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalSize( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalTouchMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMajor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalToolMinor( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalOrientation( motion_event: *const AInputEvent, pointer_index: usize, history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getHistoricalAxisValue( motion_event: *const AInputEvent, axis: i32, @@ -1774,13 +1675,13 @@ extern "C" { history_index: usize, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getActionButton(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_getClassification(motion_event: *const AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AMotionEvent_fromJava(env: *mut JNIEnv, motionEvent: jobject) -> *const AInputEvent; } #[repr(C)] @@ -1788,7 +1689,7 @@ extern "C" { pub struct AInputQueue { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_attachLooper( queue: *mut AInputQueue, looper: *mut ALooper, @@ -1797,26 +1698,26 @@ extern "C" { data: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_detachLooper(queue: *mut AInputQueue); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_hasEvents(queue: *mut AInputQueue) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_getEvent(queue: *mut AInputQueue, outEvent: *mut *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_preDispatchEvent(queue: *mut AInputQueue, event: *mut AInputEvent) -> i32; } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_finishEvent( queue: *mut AInputQueue, event: *mut AInputEvent, handled: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn AInputQueue_fromJava(env: *mut JNIEnv, inputQueue: jobject) -> *mut AInputQueue; } #[repr(C)] @@ -1825,59 +1726,41 @@ pub struct imaxdiv_t { pub quot: intmax_t, pub rem: intmax_t, } -#[test] -fn bindgen_test_layout_imaxdiv_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of imaxdiv_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of imaxdiv_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize }, - 0usize, - "Offset of field: imaxdiv_t::quot" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize }, - 8usize, - "Offset of field: imaxdiv_t::rem" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of imaxdiv_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of imaxdiv_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: imaxdiv_t::quot"][::std::mem::offset_of!(imaxdiv_t, quot) - 0usize]; + ["Offset of field: imaxdiv_t::rem"][::std::mem::offset_of!(imaxdiv_t, rem) - 8usize]; +}; +unsafe extern "C" { pub fn imaxabs(__i: intmax_t) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn imaxdiv(__numerator: intmax_t, __denominator: intmax_t) -> imaxdiv_t; } -extern "C" { +unsafe extern "C" { pub fn strtoimax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn strtoumax( __s: *const ::std::os::raw::c_char, __end_ptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> uintmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoimax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, __base: ::std::os::raw::c_int, ) -> intmax_t; } -extern "C" { +unsafe extern "C" { pub fn wcstoumax( __s: *const wchar_t, __end_ptr: *mut *mut wchar_t, @@ -2048,61 +1931,27 @@ pub struct AHardwareBuffer_Desc { pub rfu0: u32, pub rfu1: u64, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Desc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - "Size of AHardwareBuffer_Desc" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of AHardwareBuffer_Desc" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).width) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Desc::width" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize }, - 4usize, - "Offset of field: AHardwareBuffer_Desc::height" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).layers) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Desc::layers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).format) as usize - ptr as usize }, - 12usize, - "Offset of field: AHardwareBuffer_Desc::format" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).usage) as usize - ptr as usize }, - 16usize, - "Offset of field: AHardwareBuffer_Desc::usage" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stride) as usize - ptr as usize }, - 24usize, - "Offset of field: AHardwareBuffer_Desc::stride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu0) as usize - ptr as usize }, - 28usize, - "Offset of field: AHardwareBuffer_Desc::rfu0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rfu1) as usize - ptr as usize }, - 32usize, - "Offset of field: AHardwareBuffer_Desc::rfu1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Desc"][::std::mem::size_of::() - 40usize]; + ["Alignment of AHardwareBuffer_Desc"][::std::mem::align_of::() - 8usize]; + ["Offset of field: AHardwareBuffer_Desc::width"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, width) - 0usize]; + ["Offset of field: AHardwareBuffer_Desc::height"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, height) - 4usize]; + ["Offset of field: AHardwareBuffer_Desc::layers"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, layers) - 8usize]; + ["Offset of field: AHardwareBuffer_Desc::format"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, format) - 12usize]; + ["Offset of field: AHardwareBuffer_Desc::usage"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, usage) - 16usize]; + ["Offset of field: AHardwareBuffer_Desc::stride"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, stride) - 24usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu0"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu0) - 28usize]; + ["Offset of field: AHardwareBuffer_Desc::rfu1"] + [::std::mem::offset_of!(AHardwareBuffer_Desc, rfu1) - 32usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Plane { @@ -2110,93 +1959,58 @@ pub struct AHardwareBuffer_Plane { pub pixelStride: u32, pub rowStride: u32, } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Plane() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of AHardwareBuffer_Plane" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of AHardwareBuffer_Plane" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Plane::data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pixelStride) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Plane::pixelStride" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rowStride) as usize - ptr as usize }, - 12usize, - "Offset of field: AHardwareBuffer_Plane::rowStride" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Plane"][::std::mem::size_of::() - 16usize]; + ["Alignment of AHardwareBuffer_Plane"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: AHardwareBuffer_Plane::data"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, data) - 0usize]; + ["Offset of field: AHardwareBuffer_Plane::pixelStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, pixelStride) - 8usize]; + ["Offset of field: AHardwareBuffer_Plane::rowStride"] + [::std::mem::offset_of!(AHardwareBuffer_Plane, rowStride) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer_Planes { pub planeCount: u32, pub planes: [AHardwareBuffer_Plane; 4usize], } -#[test] -fn bindgen_test_layout_AHardwareBuffer_Planes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 72usize, - "Size of AHardwareBuffer_Planes" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of AHardwareBuffer_Planes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planeCount) as usize - ptr as usize }, - 0usize, - "Offset of field: AHardwareBuffer_Planes::planeCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).planes) as usize - ptr as usize }, - 8usize, - "Offset of field: AHardwareBuffer_Planes::planes" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AHardwareBuffer_Planes"][::std::mem::size_of::() - 72usize]; + ["Alignment of AHardwareBuffer_Planes"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: AHardwareBuffer_Planes::planeCount"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planeCount) - 0usize]; + ["Offset of field: AHardwareBuffer_Planes::planes"] + [::std::mem::offset_of!(AHardwareBuffer_Planes, planes) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct AHardwareBuffer { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_allocate( desc: *const AHardwareBuffer_Desc, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_acquire(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_release(buffer: *mut AHardwareBuffer); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_describe( buffer: *const AHardwareBuffer, outDesc: *mut AHardwareBuffer_Desc, ); } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lock( buffer: *mut AHardwareBuffer, usage: u64, @@ -2205,25 +2019,25 @@ extern "C" { outVirtualAddress: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_unlock( buffer: *mut AHardwareBuffer, fence: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_sendHandleToUnixSocket( buffer: *const AHardwareBuffer, socketFd: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_recvHandleFromUnixSocket( socketFd: ::std::os::raw::c_int, outBuffer: *mut *mut AHardwareBuffer, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockPlanes( buffer: *mut AHardwareBuffer, usage: u64, @@ -2232,10 +2046,10 @@ extern "C" { outPlanes: *mut AHardwareBuffer_Planes, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_isSupported(desc: *const AHardwareBuffer_Desc) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_lockAndGetInfo( buffer: *mut AHardwareBuffer, usage: u64, @@ -2246,7 +2060,7 @@ extern "C" { outBytesPerStride: *mut i32, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn AHardwareBuffer_getId( buffer: *const AHardwareBuffer, outId: *mut u64, @@ -2262,56 +2076,32 @@ pub struct GameActivityPointerAxes { pub rawX: f32, pub rawY: f32, } -#[test] -fn bindgen_test_layout_GameActivityPointerAxes() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 208usize, - "Size of GameActivityPointerAxes" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameActivityPointerAxes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityPointerAxes::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).toolType) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityPointerAxes::toolType" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).axisValues) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityPointerAxes::axisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawX) as usize - ptr as usize }, - 200usize, - "Offset of field: GameActivityPointerAxes::rawX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rawY) as usize - ptr as usize }, - 204usize, - "Offset of field: GameActivityPointerAxes::rawY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityPointerAxes"] + [::std::mem::size_of::() - 208usize]; + ["Alignment of GameActivityPointerAxes"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: GameActivityPointerAxes::id"] + [::std::mem::offset_of!(GameActivityPointerAxes, id) - 0usize]; + ["Offset of field: GameActivityPointerAxes::toolType"] + [::std::mem::offset_of!(GameActivityPointerAxes, toolType) - 4usize]; + ["Offset of field: GameActivityPointerAxes::axisValues"] + [::std::mem::offset_of!(GameActivityPointerAxes, axisValues) - 8usize]; + ["Offset of field: GameActivityPointerAxes::rawX"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawX) - 200usize]; + ["Offset of field: GameActivityPointerAxes::rawY"] + [::std::mem::offset_of!(GameActivityPointerAxes, rawY) - 204usize]; +}; +unsafe extern "C" { #[doc = " \\brief Enable the specified axis, so that its value is reported in the\n GameActivityPointerAxes structures stored in a motion event.\n\n You must enable any axis that you want to read, apart from\n `AMOTION_EVENT_AXIS_X` and `AMOTION_EVENT_AXIS_Y` that are enabled by\n default.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_enableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Disable the specified axis. Its value won't be reported in the\n GameActivityPointerAxes structures stored in a motion event anymore.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n If the axis index is out of range, nothing is done."] pub fn GameActivityPointerAxes_disableAxis(axis: i32); } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Get the value of the requested axis.\n\n Apart from X and Y, any axis that you want to read **must** be enabled first,\n using `GameActivityPointerAxes_enableAxis`.\n\n Find the valid enums for the axis (`AMOTION_EVENT_AXIS_X`,\n `AMOTION_EVENT_AXIS_Y`, `AMOTION_EVENT_AXIS_PRESSURE`...)\n in https://developer.android.com/ndk/reference/group/input.\n\n @param pointerInfo The structure containing information about the pointer,\n obtained from GameActivityMotionEvent.\n @param axis The axis to get the value from\n @return The value of the axis, or 0 if the axis is invalid or was not\n enabled."] pub fn GameActivityPointerAxes_getAxisValue( pointerInfo: *const GameActivityPointerAxes, @@ -2342,118 +2132,52 @@ pub struct GameActivityMotionEvent { pub precisionX: f32, pub precisionY: f32, } -#[test] -fn bindgen_test_layout_GameActivityMotionEvent() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 1760usize, - "Size of GameActivityMotionEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityMotionEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityMotionEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityMotionEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityMotionEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityMotionEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityMotionEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityMotionEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityMotionEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).actionButton) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityMotionEvent::actionButton" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buttonState) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityMotionEvent::buttonState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).classification) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityMotionEvent::classification" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edgeFlags) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityMotionEvent::edgeFlags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointerCount) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityMotionEvent::pointerCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pointers) as usize - ptr as usize }, - 60usize, - "Offset of field: GameActivityMotionEvent::pointers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historySize) as usize - ptr as usize }, - 1724usize, - "Offset of field: GameActivityMotionEvent::historySize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesMillis) as usize - ptr as usize }, - 1728usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesMillis" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalEventTimesNanos) as usize - ptr as usize }, - 1736usize, - "Offset of field: GameActivityMotionEvent::historicalEventTimesNanos" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).historicalAxisValues) as usize - ptr as usize }, - 1744usize, - "Offset of field: GameActivityMotionEvent::historicalAxisValues" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionX) as usize - ptr as usize }, - 1752usize, - "Offset of field: GameActivityMotionEvent::precisionX" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).precisionY) as usize - ptr as usize }, - 1756usize, - "Offset of field: GameActivityMotionEvent::precisionY" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityMotionEvent"] + [::std::mem::size_of::() - 1760usize]; + ["Alignment of GameActivityMotionEvent"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityMotionEvent::deviceId"] + [::std::mem::offset_of!(GameActivityMotionEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityMotionEvent::source"] + [::std::mem::offset_of!(GameActivityMotionEvent, source) - 4usize]; + ["Offset of field: GameActivityMotionEvent::action"] + [::std::mem::offset_of!(GameActivityMotionEvent, action) - 8usize]; + ["Offset of field: GameActivityMotionEvent::eventTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, eventTime) - 16usize]; + ["Offset of field: GameActivityMotionEvent::downTime"] + [::std::mem::offset_of!(GameActivityMotionEvent, downTime) - 24usize]; + ["Offset of field: GameActivityMotionEvent::flags"] + [::std::mem::offset_of!(GameActivityMotionEvent, flags) - 32usize]; + ["Offset of field: GameActivityMotionEvent::metaState"] + [::std::mem::offset_of!(GameActivityMotionEvent, metaState) - 36usize]; + ["Offset of field: GameActivityMotionEvent::actionButton"] + [::std::mem::offset_of!(GameActivityMotionEvent, actionButton) - 40usize]; + ["Offset of field: GameActivityMotionEvent::buttonState"] + [::std::mem::offset_of!(GameActivityMotionEvent, buttonState) - 44usize]; + ["Offset of field: GameActivityMotionEvent::classification"] + [::std::mem::offset_of!(GameActivityMotionEvent, classification) - 48usize]; + ["Offset of field: GameActivityMotionEvent::edgeFlags"] + [::std::mem::offset_of!(GameActivityMotionEvent, edgeFlags) - 52usize]; + ["Offset of field: GameActivityMotionEvent::pointerCount"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointerCount) - 56usize]; + ["Offset of field: GameActivityMotionEvent::pointers"] + [::std::mem::offset_of!(GameActivityMotionEvent, pointers) - 60usize]; + ["Offset of field: GameActivityMotionEvent::historySize"] + [::std::mem::offset_of!(GameActivityMotionEvent, historySize) - 1724usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesMillis"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesMillis) - 1728usize]; + ["Offset of field: GameActivityMotionEvent::historicalEventTimesNanos"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalEventTimesNanos) - 1736usize]; + ["Offset of field: GameActivityMotionEvent::historicalAxisValues"] + [::std::mem::offset_of!(GameActivityMotionEvent, historicalAxisValues) - 1744usize]; + ["Offset of field: GameActivityMotionEvent::precisionX"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionX) - 1752usize]; + ["Offset of field: GameActivityMotionEvent::precisionY"] + [::std::mem::offset_of!(GameActivityMotionEvent, precisionY) - 1756usize]; +}; +unsafe extern "C" { pub fn GameActivityMotionEvent_getHistoricalAxisValue( event: *const GameActivityMotionEvent, axis: ::std::os::raw::c_int, @@ -2461,7 +2185,7 @@ extern "C" { historyPos: ::std::os::raw::c_int, ) -> f32; } -extern "C" { +unsafe extern "C" { #[doc = " \\brief Handle the freeing of the GameActivityMotionEvent struct."] pub fn GameActivityMotionEvent_destroy(c_event: *mut GameActivityMotionEvent); } @@ -2481,76 +2205,33 @@ pub struct GameActivityKeyEvent { pub keyCode: i32, pub scanCode: i32, } -#[test] -fn bindgen_test_layout_GameActivityKeyEvent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - "Size of GameActivityKeyEvent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityKeyEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deviceId) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityKeyEvent::deviceId" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize }, - 4usize, - "Offset of field: GameActivityKeyEvent::source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).action) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityKeyEvent::action" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eventTime) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityKeyEvent::eventTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).downTime) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityKeyEvent::downTime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityKeyEvent::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).metaState) as usize - ptr as usize }, - 36usize, - "Offset of field: GameActivityKeyEvent::metaState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).modifiers) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityKeyEvent::modifiers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).repeatCount) as usize - ptr as usize }, - 44usize, - "Offset of field: GameActivityKeyEvent::repeatCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyCode) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityKeyEvent::keyCode" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).scanCode) as usize - ptr as usize }, - 52usize, - "Offset of field: GameActivityKeyEvent::scanCode" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityKeyEvent"][::std::mem::size_of::() - 56usize]; + ["Alignment of GameActivityKeyEvent"][::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityKeyEvent::deviceId"] + [::std::mem::offset_of!(GameActivityKeyEvent, deviceId) - 0usize]; + ["Offset of field: GameActivityKeyEvent::source"] + [::std::mem::offset_of!(GameActivityKeyEvent, source) - 4usize]; + ["Offset of field: GameActivityKeyEvent::action"] + [::std::mem::offset_of!(GameActivityKeyEvent, action) - 8usize]; + ["Offset of field: GameActivityKeyEvent::eventTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, eventTime) - 16usize]; + ["Offset of field: GameActivityKeyEvent::downTime"] + [::std::mem::offset_of!(GameActivityKeyEvent, downTime) - 24usize]; + ["Offset of field: GameActivityKeyEvent::flags"] + [::std::mem::offset_of!(GameActivityKeyEvent, flags) - 32usize]; + ["Offset of field: GameActivityKeyEvent::metaState"] + [::std::mem::offset_of!(GameActivityKeyEvent, metaState) - 36usize]; + ["Offset of field: GameActivityKeyEvent::modifiers"] + [::std::mem::offset_of!(GameActivityKeyEvent, modifiers) - 40usize]; + ["Offset of field: GameActivityKeyEvent::repeatCount"] + [::std::mem::offset_of!(GameActivityKeyEvent, repeatCount) - 44usize]; + ["Offset of field: GameActivityKeyEvent::keyCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, keyCode) - 48usize]; + ["Offset of field: GameActivityKeyEvent::scanCode"] + [::std::mem::offset_of!(GameActivityKeyEvent, scanCode) - 52usize]; +}; #[doc = " This struct holds a span within a region of text from start (inclusive) to\n end (exclusive). An empty span or cursor position is specified with\n start==end. An undefined span is specified with start = end = SPAN_UNDEFINED."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2560,31 +2241,15 @@ pub struct GameTextInputSpan { #[doc = " The end of the region (exclusive)."] pub end: i32, } -#[test] -fn bindgen_test_layout_GameTextInputSpan() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of GameTextInputSpan" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of GameTextInputSpan" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputSpan::start" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, - 4usize, - "Offset of field: GameTextInputSpan::end" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputSpan"][::std::mem::size_of::() - 8usize]; + ["Alignment of GameTextInputSpan"][::std::mem::align_of::() - 4usize]; + ["Offset of field: GameTextInputSpan::start"] + [::std::mem::offset_of!(GameTextInputSpan, start) - 0usize]; + ["Offset of field: GameTextInputSpan::end"] + [::std::mem::offset_of!(GameTextInputSpan, end) - 4usize]; +}; pub const GameTextInputSpanFlag_SPAN_UNDEFINED: GameTextInputSpanFlag = -1; #[doc = " Values with special meaning in a GameTextInputSpan."] pub type GameTextInputSpanFlag = i32; @@ -2601,41 +2266,19 @@ pub struct GameTextInputState { #[doc = " A composing region defined on the text."] pub composingRegion: GameTextInputSpan, } -#[test] -fn bindgen_test_layout_GameTextInputState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of GameTextInputState" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameTextInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_UTF8) as usize - ptr as usize }, - 0usize, - "Offset of field: GameTextInputState::text_UTF8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).text_length) as usize - ptr as usize }, - 8usize, - "Offset of field: GameTextInputState::text_length" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).selection) as usize - ptr as usize }, - 12usize, - "Offset of field: GameTextInputState::selection" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).composingRegion) as usize - ptr as usize }, - 20usize, - "Offset of field: GameTextInputState::composingRegion" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameTextInputState"][::std::mem::size_of::() - 32usize]; + ["Alignment of GameTextInputState"][::std::mem::align_of::() - 8usize]; + ["Offset of field: GameTextInputState::text_UTF8"] + [::std::mem::offset_of!(GameTextInputState, text_UTF8) - 0usize]; + ["Offset of field: GameTextInputState::text_length"] + [::std::mem::offset_of!(GameTextInputState, text_length) - 8usize]; + ["Offset of field: GameTextInputState::selection"] + [::std::mem::offset_of!(GameTextInputState, selection) - 12usize]; + ["Offset of field: GameTextInputState::composingRegion"] + [::std::mem::offset_of!(GameTextInputState, composingRegion) - 20usize]; +}; #[doc = " A callback called by GameTextInput_getState.\n @param context User-defined context.\n @param state State, owned by the library, that will be valid for the duration\n of the callback."] pub type GameTextInputGetStateCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, state: *const GameTextInputState), @@ -2645,19 +2288,19 @@ pub type GameTextInputGetStateCallback = ::std::option::Option< pub struct GameTextInput { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { #[doc = " Initialize the GameTextInput library.\n If called twice without GameTextInput_destroy being called, the same pointer\n will be returned and a warning will be issued.\n @param env A JNI env valid on the calling thread.\n @param max_string_size The maximum length of a string that can be edited. If\n zero, the maximum defaults to 65536 bytes. A buffer of this size is allocated\n at initialization.\n @return A handle to the library."] pub fn GameTextInput_init(env: *mut JNIEnv, max_string_size: u32) -> *mut GameTextInput; } -extern "C" { +unsafe extern "C" { #[doc = " When using GameTextInput, you need to create a gametextinput.InputConnection\n on the Java side and pass it using this function to the library, unless using\n GameActivity in which case this will be done for you. See the GameActivity\n source code or GameTextInput samples for examples of usage.\n @param input A valid GameTextInput library handle.\n @param inputConnection A gametextinput.InputConnection object."] pub fn GameTextInput_setInputConnection(input: *mut GameTextInput, inputConnection: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.stateChanged method to convert eventState and\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as event processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processEvent(input: *mut GameTextInput, eventState: jobject); } -extern "C" { +unsafe extern "C" { #[doc = " Free any resources owned by the GameTextInput library.\n Any subsequent calls to the library will fail until GameTextInput_init is\n called again.\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_destroy(input: *mut GameTextInput); } @@ -2666,7 +2309,7 @@ pub const ShowImeFlags_SHOW_IMPLICIT: ShowImeFlags = 1; pub const ShowImeFlags_SHOW_FORCED: ShowImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_showIme."] pub type ShowImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME. Calls InputMethodManager.showSoftInput().\n @param input A valid GameTextInput library handle.\n @param flags Defined in ShowImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_showIme(input: *mut GameTextInput, flags: u32); } @@ -2675,15 +2318,15 @@ pub const HideImeFlags_HIDE_IMPLICIT_ONLY: HideImeFlags = 1; pub const HideImeFlags_HIDE_NOT_ALWAYS: HideImeFlags = 2; #[doc = " Flags to be passed to GameTextInput_hideIme."] pub type HideImeFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME. Calls InputMethodManager.hideSoftInputFromWindow().\n @param input A valid GameTextInput library handle.\n @param flags Defined in HideImeFlags above. For more information see:\n https://developer.android.com/reference/android/view/inputmethod/InputMethodManager"] pub fn GameTextInput_hideIme(input: *mut GameTextInput, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n @param input A valid GameTextInput library handle."] pub fn GameTextInput_restartInput(input: *mut GameTextInput); } -extern "C" { +unsafe extern "C" { #[doc = " Call a callback with the current GameTextInput state, which may have been\n modified by changes in the IME and calls to GameTextInput_setState. We use a\n callback rather than returning the state in order to simplify ownership of\n text_UTF8 strings. These strings are only valid during the calling of the\n callback.\n @param input A valid GameTextInput library handle.\n @param callback A function that will be called with valid state.\n @param context Context used by the callback."] pub fn GameTextInput_getState( input: *mut GameTextInput, @@ -2691,7 +2334,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the current GameTextInput state. This state is reflected to any active\n IME.\n @param input A valid GameTextInput library handle.\n @param state The state to set. Ownership is maintained by the caller and must\n remain valid for the duration of the call."] pub fn GameTextInput_setState(input: *mut GameTextInput, state: *const GameTextInputState); } @@ -2702,7 +2345,7 @@ pub type GameTextInputEventCallback = ::std::option::Option< current_state: *const GameTextInputState, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME state changes.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME state changes.\n @param context Context passed as first argument to the callback.\n This function is deprecated. Don't perform any complex processing inside\n the callback other than copying the state variable. Using any synchronization\n primitives inside this callback may cause a deadlock."] pub fn GameTextInput_setEventCallback( input: *mut GameTextInput, @@ -2714,7 +2357,7 @@ extern "C" { pub type GameTextInputImeInsetsCallback = ::std::option::Option< unsafe extern "C" fn(context: *mut ::std::os::raw::c_void, current_insets: *const ARect), >; -extern "C" { +unsafe extern "C" { #[doc = " Optionally set a callback to be called whenever the IME insets change.\n Not necessary if you are using GameActivity, which handles these callbacks\n for you.\n @param input A valid GameTextInput library handle.\n @param callback Called by the library when the IME insets change.\n @param context Context passed as first argument to the callback."] pub fn GameTextInput_setImeInsetsCallback( input: *mut GameTextInput, @@ -2722,22 +2365,22 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets for the IME.\n @param input A valid GameTextInput library handle.\n @param insets Filled with the current insets by this function."] pub fn GameTextInput_getImeInsets(input: *const GameTextInput, insets: *mut ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Unless using GameActivity, it is required to call this function from your\n Java gametextinput.Listener.onImeInsetsChanged method to\n trigger any event callbacks. When using GameActivity, this does not need to\n be called as insets processing is handled by the Activity.\n @param input A valid GameTextInput library handle.\n @param eventState A Java gametextinput.State object."] pub fn GameTextInput_processImeInsets(input: *mut GameTextInput, insets: *const ARect); } -extern "C" { +unsafe extern "C" { #[doc = " Convert a GameTextInputState struct to a Java gametextinput.State object.\n Don't forget to delete the returned Java local ref when you're done.\n @param input A valid GameTextInput library handle.\n @param state Input state to convert.\n @return A Java object of class gametextinput.State. The caller is required to\n delete this local reference."] pub fn GameTextInputState_toJava( input: *const GameTextInput, state: *const GameTextInputState, ) -> jobject; } -extern "C" { +unsafe extern "C" { #[doc = " Convert from a Java gametextinput.State object into a C GameTextInputState\n struct.\n @param input A valid GameTextInput library handle.\n @param state A Java gametextinput.State object.\n @param callback A function called with the C struct, valid for the duration\n of the call.\n @param context Context passed to the callback."] pub fn GameTextInputState_fromJava( input: *const GameTextInput, @@ -2908,71 +2551,29 @@ pub struct GameActivity { #[doc = " Available starting with Honeycomb: path to the directory containing\n the application's OBB files (if any). If the app doesn't have any\n OBB files, this directory may not exist."] pub obbPath: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_GameActivity() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 80usize, - "Size of GameActivity" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).callbacks) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivity::callbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vm) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivity::vm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivity::env" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).javaGameActivity) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivity::javaGameActivity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).internalDataPath) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivity::internalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).externalDataPath) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivity::externalDataPath" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sdkVersion) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivity::sdkVersion" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).instance) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivity::instance" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).assetManager) as usize - ptr as usize }, - 64usize, - "Offset of field: GameActivity::assetManager" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obbPath) as usize - ptr as usize }, - 72usize, - "Offset of field: GameActivity::obbPath" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivity"][::std::mem::size_of::() - 80usize]; + ["Alignment of GameActivity"][::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivity::callbacks"] + [::std::mem::offset_of!(GameActivity, callbacks) - 0usize]; + ["Offset of field: GameActivity::vm"][::std::mem::offset_of!(GameActivity, vm) - 8usize]; + ["Offset of field: GameActivity::env"][::std::mem::offset_of!(GameActivity, env) - 16usize]; + ["Offset of field: GameActivity::javaGameActivity"] + [::std::mem::offset_of!(GameActivity, javaGameActivity) - 24usize]; + ["Offset of field: GameActivity::internalDataPath"] + [::std::mem::offset_of!(GameActivity, internalDataPath) - 32usize]; + ["Offset of field: GameActivity::externalDataPath"] + [::std::mem::offset_of!(GameActivity, externalDataPath) - 40usize]; + ["Offset of field: GameActivity::sdkVersion"] + [::std::mem::offset_of!(GameActivity, sdkVersion) - 48usize]; + ["Offset of field: GameActivity::instance"] + [::std::mem::offset_of!(GameActivity, instance) - 56usize]; + ["Offset of field: GameActivity::assetManager"] + [::std::mem::offset_of!(GameActivity, assetManager) - 64usize]; + ["Offset of field: GameActivity::obbPath"] + [::std::mem::offset_of!(GameActivity, obbPath) - 72usize]; +}; #[doc = " A function the user should call from their callback with the data, its length\n and the library- supplied context."] pub type SaveInstanceStateRecallback = ::std::option::Option< unsafe extern "C" fn( @@ -3074,129 +2675,56 @@ pub struct GameActivityCallbacks { unsafe extern "C" fn(activity: *mut GameActivity, action: ::std::os::raw::c_int) -> bool, >, } -#[test] -fn bindgen_test_layout_GameActivityCallbacks() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 168usize, - "Size of GameActivityCallbacks" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of GameActivityCallbacks" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStart) as usize - ptr as usize }, - 0usize, - "Offset of field: GameActivityCallbacks::onStart" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onResume) as usize - ptr as usize }, - 8usize, - "Offset of field: GameActivityCallbacks::onResume" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onSaveInstanceState) as usize - ptr as usize }, - 16usize, - "Offset of field: GameActivityCallbacks::onSaveInstanceState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onPause) as usize - ptr as usize }, - 24usize, - "Offset of field: GameActivityCallbacks::onPause" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onStop) as usize - ptr as usize }, - 32usize, - "Offset of field: GameActivityCallbacks::onStop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onDestroy) as usize - ptr as usize }, - 40usize, - "Offset of field: GameActivityCallbacks::onDestroy" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowFocusChanged) as usize - ptr as usize }, - 48usize, - "Offset of field: GameActivityCallbacks::onWindowFocusChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowCreated) as usize - ptr as usize }, - 56usize, - "Offset of field: GameActivityCallbacks::onNativeWindowCreated" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowResized) as usize - ptr as usize }, - 64usize, - "Offset of field: GameActivityCallbacks::onNativeWindowResized" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowRedrawNeeded) as usize - ptr as usize }, - 72usize, - "Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onNativeWindowDestroyed) as usize - ptr as usize }, - 80usize, - "Offset of field: GameActivityCallbacks::onNativeWindowDestroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onConfigurationChanged) as usize - ptr as usize }, - 88usize, - "Offset of field: GameActivityCallbacks::onConfigurationChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTrimMemory) as usize - ptr as usize }, - 96usize, - "Offset of field: GameActivityCallbacks::onTrimMemory" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTouchEvent) as usize - ptr as usize }, - 104usize, - "Offset of field: GameActivityCallbacks::onTouchEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyDown) as usize - ptr as usize }, - 112usize, - "Offset of field: GameActivityCallbacks::onKeyDown" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onKeyUp) as usize - ptr as usize }, - 120usize, - "Offset of field: GameActivityCallbacks::onKeyUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onTextInputEvent) as usize - ptr as usize }, - 128usize, - "Offset of field: GameActivityCallbacks::onTextInputEvent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onWindowInsetsChanged) as usize - ptr as usize }, - 136usize, - "Offset of field: GameActivityCallbacks::onWindowInsetsChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onContentRectChanged) as usize - ptr as usize }, - 144usize, - "Offset of field: GameActivityCallbacks::onContentRectChanged" - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).onSoftwareKeyboardVisibilityChanged) as usize - ptr as usize - }, - 152usize, - "Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onEditorAction) as usize - ptr as usize }, - 160usize, - "Offset of field: GameActivityCallbacks::onEditorAction" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of GameActivityCallbacks"][::std::mem::size_of::() - 168usize]; + ["Alignment of GameActivityCallbacks"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: GameActivityCallbacks::onStart"] + [::std::mem::offset_of!(GameActivityCallbacks, onStart) - 0usize]; + ["Offset of field: GameActivityCallbacks::onResume"] + [::std::mem::offset_of!(GameActivityCallbacks, onResume) - 8usize]; + ["Offset of field: GameActivityCallbacks::onSaveInstanceState"] + [::std::mem::offset_of!(GameActivityCallbacks, onSaveInstanceState) - 16usize]; + ["Offset of field: GameActivityCallbacks::onPause"] + [::std::mem::offset_of!(GameActivityCallbacks, onPause) - 24usize]; + ["Offset of field: GameActivityCallbacks::onStop"] + [::std::mem::offset_of!(GameActivityCallbacks, onStop) - 32usize]; + ["Offset of field: GameActivityCallbacks::onDestroy"] + [::std::mem::offset_of!(GameActivityCallbacks, onDestroy) - 40usize]; + ["Offset of field: GameActivityCallbacks::onWindowFocusChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowFocusChanged) - 48usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowCreated"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowCreated) - 56usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowResized"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowResized) - 64usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowRedrawNeeded"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowRedrawNeeded) - 72usize]; + ["Offset of field: GameActivityCallbacks::onNativeWindowDestroyed"] + [::std::mem::offset_of!(GameActivityCallbacks, onNativeWindowDestroyed) - 80usize]; + ["Offset of field: GameActivityCallbacks::onConfigurationChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onConfigurationChanged) - 88usize]; + ["Offset of field: GameActivityCallbacks::onTrimMemory"] + [::std::mem::offset_of!(GameActivityCallbacks, onTrimMemory) - 96usize]; + ["Offset of field: GameActivityCallbacks::onTouchEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTouchEvent) - 104usize]; + ["Offset of field: GameActivityCallbacks::onKeyDown"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyDown) - 112usize]; + ["Offset of field: GameActivityCallbacks::onKeyUp"] + [::std::mem::offset_of!(GameActivityCallbacks, onKeyUp) - 120usize]; + ["Offset of field: GameActivityCallbacks::onTextInputEvent"] + [::std::mem::offset_of!(GameActivityCallbacks, onTextInputEvent) - 128usize]; + ["Offset of field: GameActivityCallbacks::onWindowInsetsChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onWindowInsetsChanged) - 136usize]; + ["Offset of field: GameActivityCallbacks::onContentRectChanged"] + [::std::mem::offset_of!(GameActivityCallbacks, onContentRectChanged) - 144usize]; + ["Offset of field: GameActivityCallbacks::onSoftwareKeyboardVisibilityChanged"][::std::mem::offset_of!( + GameActivityCallbacks, + onSoftwareKeyboardVisibilityChanged + ) - 152usize]; + ["Offset of field: GameActivityCallbacks::onEditorAction"] + [::std::mem::offset_of!(GameActivityCallbacks, onEditorAction) - 160usize]; +}; #[doc = " This is the function that must be in the native code to instantiate the\n application's native activity. It is called with the activity instance (see\n above); if the code is being instantiated from a previously saved instance,\n the savedState will be non-NULL and point to the saved data. You must make\n any copy of this data you need -- it will be released after you return from\n this function."] pub type GameActivity_createFunc = ::std::option::Option< unsafe extern "C" fn( @@ -3205,7 +2733,7 @@ pub type GameActivity_createFunc = ::std::option::Option< savedStateSize: usize, ), >; -extern "C" { +unsafe extern "C" { #[doc = " Finish the given activity. Its finish() method will be called, causing it\n to be stopped and destroyed. Note that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_finish(activity: *mut GameActivity); } @@ -3275,7 +2803,7 @@ pub const GameActivitySetWindowFlags_GAMEACTIVITY_FLAG_DISMISS_KEYGUARD: GameActivitySetWindowFlags = 4194304; #[doc = " Flags for GameActivity_setWindowFlags,\n as per the Java API at android.view.WindowManager.LayoutParams."] pub type GameActivitySetWindowFlags = u32; -extern "C" { +unsafe extern "C" { #[doc = " Change the window flags of the given activity. Calls getWindow().setFlags()\n of the given activity.\n Note that some flags must be set before the window decoration is created,\n see\n https://developer.android.com/reference/android/view/Window#setFlags(int,%20int).\n Note also that this method can be called from\n *any* thread; it will send a message to the main thread of the process\n where the Java finish call will take place."] pub fn GameActivity_setWindowFlags( activity: *mut GameActivity, @@ -3291,22 +2819,22 @@ pub const GameActivityShowSoftInputFlags_GAMEACTIVITY_SHOW_SOFT_INPUT_FORCED: GameActivityShowSoftInputFlags = 2; #[doc = " Flags for GameActivity_showSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityShowSoftInputFlags = u8; -extern "C" { +unsafe extern "C" { #[doc = " Show the IME while in the given activity. Calls\n InputMethodManager.showSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java call will take place."] pub fn GameActivity_showSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Restarts the input method. Calls InputMethodManager.restartInput().\n Note that this method can be called from *any* thread; it will send a message\n to the main thread of the process where the Java call will take place."] pub fn GameActivity_restartInput(activity: *mut GameActivity); } -extern "C" { +unsafe extern "C" { #[doc = " Set the text entry state (see documentation of the GameTextInputState struct\n in the Game Text Input library reference).\n\n Ownership of the state is maintained by the caller."] pub fn GameActivity_setTextInputState( activity: *mut GameActivity, state: *const GameTextInputState, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get the last-received text entry state (see documentation of the\n GameTextInputState struct in the Game Text Input library reference).\n"] pub fn GameActivity_getTextInputState( activity: *mut GameActivity, @@ -3314,7 +2842,7 @@ extern "C" { context: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { #[doc = " Get a pointer to the GameTextInput library instance."] pub fn GameActivity_getTextInput(activity: *const GameActivity) -> *mut GameTextInput; } @@ -3326,11 +2854,11 @@ pub const GameActivityHideSoftInputFlags_GAMEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS GameActivityHideSoftInputFlags = 2; #[doc = " Flags for GameActivity_hideSoftInput; see the Java InputMethodManager\n API for documentation."] pub type GameActivityHideSoftInputFlags = u16; -extern "C" { +unsafe extern "C" { #[doc = " Hide the IME while in the given activity. Calls\n InputMethodManager.hideSoftInput() for the given activity. Note that this\n method can be called from *any* thread; it will send a message to the main\n thread of the process where the Java finish call will take place."] pub fn GameActivity_hideSoftInput(activity: *mut GameActivity, flags: u32); } -extern "C" { +unsafe extern "C" { #[doc = " Get the current window insets of the particular component. See\n https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type\n for more details.\n You can use these insets to influence what you show on the screen."] pub fn GameActivity_getWindowInsets( activity: *mut GameActivity, @@ -3338,11 +2866,11 @@ extern "C" { insets: *mut ARect, ); } -extern "C" { +unsafe extern "C" { #[doc = " Tells whether the software keyboard is visible or not."] pub fn GameActivity_isSoftwareKeyboardVisible(activity: *mut GameActivity) -> bool; } -extern "C" { +unsafe extern "C" { #[doc = " Set options on how the IME behaves when it is requested for text input.\n See\n https://developer.android.com/reference/android/view/inputmethod/EditorInfo\n for the meaning of inputType, actionId and imeOptions.\n\n Note: currently only TYPE_NULL AND TYPE_CLASS_NUMBER are supported."] pub fn GameActivity_setImeEditorInfo( activity: *mut GameActivity, @@ -3351,70 +2879,70 @@ extern "C" { imeOptions: GameTextInputImeOptions, ); } -extern "C" { +unsafe extern "C" { #[doc = " These are getters for Configuration class members. They may be called from\n any thread."] pub fn GameActivity_getOrientation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getColorMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getDensityDpi(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontScale(activity: *mut GameActivity) -> f32; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getFontWeightAdjustment( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getHardKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboard(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getKeyboardHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocalesCount(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMcc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getMnc(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigation(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getNavigationHidden(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenHeightDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenLayout(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getScreenWidthDp(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getSmallestScreenWidthDp( activity: *mut GameActivity, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getTouchscreen(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getUIMode(activity: *mut GameActivity) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { #[doc = " The functions below return Java locale information.\n\n In simple cases there will be just one locale, but it's possible tha\n there are more than one locale objects. Users are encouraged to write code\n that handles all locales and not just the first one.\n\n The functions in the block below return string values in the provided buffer.\n Return value is zero if there were no errors, otherwise it's non-zero.\n If the return value is zero, `dst` will contain a null-terminated string:\n strlen(dst) <= dst_size - 1.\n If the return value is non-zero, the content of dst is undefined.\n\n Parameters:\n\n dst, dst_size: define a receiver buffer. Locale string can be something\n short like \"EN/EN\", but it may be longer. You should be safe with a buffer\n size of 256 bytes.\n\n If the buffer is too small, ENOBUFS is returned. Try allocating a larger\n buffer in this case.\n\n localeIdx must be between 0 and the value of GameActivity_getLocalesCount().\n If localeIdx is out of range, EINVAL is returned.\n\n Refer to Java documentation of locales for more information."] pub fn GameActivity_getLocaleLanguage( dst: *mut ::std::os::raw::c_char, @@ -3423,7 +2951,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleScript( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3431,7 +2959,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleCountry( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3439,7 +2967,7 @@ extern "C" { localeIdx: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn GameActivity_getLocaleVariant( dst: *mut ::std::os::raw::c_char, dst_size: usize, @@ -3541,32 +3069,14 @@ pub struct pollfd { pub events: ::std::os::raw::c_short, pub revents: ::std::os::raw::c_short, } -#[test] -fn bindgen_test_layout_pollfd() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of pollfd"); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of pollfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fd) as usize - ptr as usize }, - 0usize, - "Offset of field: pollfd::fd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).events) as usize - ptr as usize }, - 4usize, - "Offset of field: pollfd::events" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).revents) as usize - ptr as usize }, - 6usize, - "Offset of field: pollfd::revents" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pollfd"][::std::mem::size_of::() - 8usize]; + ["Alignment of pollfd"][::std::mem::align_of::() - 4usize]; + ["Offset of field: pollfd::fd"][::std::mem::offset_of!(pollfd, fd) - 0usize]; + ["Offset of field: pollfd::events"][::std::mem::offset_of!(pollfd, events) - 4usize]; + ["Offset of field: pollfd::revents"][::std::mem::offset_of!(pollfd, revents) - 6usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _fpx_sw_bytes { @@ -3576,73 +3086,34 @@ pub struct _fpx_sw_bytes { pub xstate_size: __u32, pub padding: [__u32; 7usize], } -#[test] -fn bindgen_test_layout__fpx_sw_bytes() { - const UNINIT: ::std::mem::MaybeUninit<_fpx_sw_bytes> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpx_sw_bytes>(), - 48usize, - "Size of _fpx_sw_bytes" - ); - assert_eq!( - ::std::mem::align_of::<_fpx_sw_bytes>(), - 8usize, - "Alignment of _fpx_sw_bytes" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic1) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpx_sw_bytes::magic1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extended_size) as usize - ptr as usize }, - 4usize, - "Offset of field: _fpx_sw_bytes::extended_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpx_sw_bytes::xfeatures" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xstate_size) as usize - ptr as usize }, - 16usize, - "Offset of field: _fpx_sw_bytes::xstate_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 20usize, - "Offset of field: _fpx_sw_bytes::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpx_sw_bytes"][::std::mem::size_of::<_fpx_sw_bytes>() - 48usize]; + ["Alignment of _fpx_sw_bytes"][::std::mem::align_of::<_fpx_sw_bytes>() - 8usize]; + ["Offset of field: _fpx_sw_bytes::magic1"] + [::std::mem::offset_of!(_fpx_sw_bytes, magic1) - 0usize]; + ["Offset of field: _fpx_sw_bytes::extended_size"] + [::std::mem::offset_of!(_fpx_sw_bytes, extended_size) - 4usize]; + ["Offset of field: _fpx_sw_bytes::xfeatures"] + [::std::mem::offset_of!(_fpx_sw_bytes, xfeatures) - 8usize]; + ["Offset of field: _fpx_sw_bytes::xstate_size"] + [::std::mem::offset_of!(_fpx_sw_bytes, xstate_size) - 16usize]; + ["Offset of field: _fpx_sw_bytes::padding"] + [::std::mem::offset_of!(_fpx_sw_bytes, padding) - 20usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _fpreg { pub significand: [__u16; 4usize], pub exponent: __u16, } -#[test] -fn bindgen_test_layout__fpreg() { - const UNINIT: ::std::mem::MaybeUninit<_fpreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_fpreg>(), 10usize, "Size of _fpreg"); - assert_eq!( - ::std::mem::align_of::<_fpreg>(), - 2usize, - "Alignment of _fpreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpreg::significand" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpreg::exponent" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpreg"][::std::mem::size_of::<_fpreg>() - 10usize]; + ["Alignment of _fpreg"][::std::mem::align_of::<_fpreg>() - 2usize]; + ["Offset of field: _fpreg::significand"][::std::mem::offset_of!(_fpreg, significand) - 0usize]; + ["Offset of field: _fpreg::exponent"][::std::mem::offset_of!(_fpreg, exponent) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _fpxreg { @@ -3650,53 +3121,26 @@ pub struct _fpxreg { pub exponent: __u16, pub padding: [__u16; 3usize], } -#[test] -fn bindgen_test_layout__fpxreg() { - const UNINIT: ::std::mem::MaybeUninit<_fpxreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_fpxreg>(), 16usize, "Size of _fpxreg"); - assert_eq!( - ::std::mem::align_of::<_fpxreg>(), - 2usize, - "Alignment of _fpxreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpxreg::significand" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpxreg::exponent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 10usize, - "Offset of field: _fpxreg::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpxreg"][::std::mem::size_of::<_fpxreg>() - 16usize]; + ["Alignment of _fpxreg"][::std::mem::align_of::<_fpxreg>() - 2usize]; + ["Offset of field: _fpxreg::significand"] + [::std::mem::offset_of!(_fpxreg, significand) - 0usize]; + ["Offset of field: _fpxreg::exponent"][::std::mem::offset_of!(_fpxreg, exponent) - 8usize]; + ["Offset of field: _fpxreg::padding"][::std::mem::offset_of!(_fpxreg, padding) - 10usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _xmmreg { pub element: [__u32; 4usize], } -#[test] -fn bindgen_test_layout__xmmreg() { - const UNINIT: ::std::mem::MaybeUninit<_xmmreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_xmmreg>(), 16usize, "Size of _xmmreg"); - assert_eq!( - ::std::mem::align_of::<_xmmreg>(), - 4usize, - "Alignment of _xmmreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).element) as usize - ptr as usize }, - 0usize, - "Offset of field: _xmmreg::element" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _xmmreg"][::std::mem::size_of::<_xmmreg>() - 16usize]; + ["Alignment of _xmmreg"][::std::mem::align_of::<_xmmreg>() - 4usize]; + ["Offset of field: _xmmreg::element"][::std::mem::offset_of!(_xmmreg, element) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct _fpstate_32 { @@ -3724,154 +3168,60 @@ pub union _fpstate_32__bindgen_ty_1 { pub padding1: [__u32; 44usize], pub padding: [__u32; 44usize], } -#[test] -fn bindgen_test_layout__fpstate_32__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_32__bindgen_ty_1>(), - 176usize, - "Size of _fpstate_32__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_32__bindgen_ty_1>(), - 4usize, - "Alignment of _fpstate_32__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding1) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_1::padding1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_1::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_32__bindgen_ty_1"] + [::std::mem::size_of::<_fpstate_32__bindgen_ty_1>() - 176usize]; + ["Alignment of _fpstate_32__bindgen_ty_1"] + [::std::mem::align_of::<_fpstate_32__bindgen_ty_1>() - 4usize]; + ["Offset of field: _fpstate_32__bindgen_ty_1::padding1"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_1, padding1) - 0usize]; + ["Offset of field: _fpstate_32__bindgen_ty_1::padding"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_1, padding) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub union _fpstate_32__bindgen_ty_2 { pub padding2: [__u32; 12usize], pub sw_reserved: _fpx_sw_bytes, } -#[test] -fn bindgen_test_layout__fpstate_32__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_32__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_32__bindgen_ty_2>(), - 48usize, - "Size of _fpstate_32__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_32__bindgen_ty_2>(), - 8usize, - "Alignment of _fpstate_32__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding2) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_2::padding2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32__bindgen_ty_2::sw_reserved" - ); -} -#[test] -fn bindgen_test_layout__fpstate_32() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_32> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_32>(), - 624usize, - "Size of _fpstate_32" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_32>(), - 8usize, - "Alignment of _fpstate_32" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cw) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_32::cw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sw) as usize - ptr as usize }, - 4usize, - "Offset of field: _fpstate_32::sw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpstate_32::tag" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ipoff) as usize - ptr as usize }, - 12usize, - "Offset of field: _fpstate_32::ipoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cssel) as usize - ptr as usize }, - 16usize, - "Offset of field: _fpstate_32::cssel" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dataoff) as usize - ptr as usize }, - 20usize, - "Offset of field: _fpstate_32::dataoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).datasel) as usize - ptr as usize }, - 24usize, - "Offset of field: _fpstate_32::datasel" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, - 28usize, - "Offset of field: _fpstate_32::_st" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).status) as usize - ptr as usize }, - 108usize, - "Offset of field: _fpstate_32::status" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 110usize, - "Offset of field: _fpstate_32::magic" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_env) as usize - ptr as usize }, - 112usize, - "Offset of field: _fpstate_32::_fxsr_env" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 136usize, - "Offset of field: _fpstate_32::mxcsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 140usize, - "Offset of field: _fpstate_32::reserved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fxsr_st) as usize - ptr as usize }, - 144usize, - "Offset of field: _fpstate_32::_fxsr_st" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._xmm) as usize - ptr as usize }, - 272usize, - "Offset of field: _fpstate_32::_xmm" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_32__bindgen_ty_2"] + [::std::mem::size_of::<_fpstate_32__bindgen_ty_2>() - 48usize]; + ["Alignment of _fpstate_32__bindgen_ty_2"] + [::std::mem::align_of::<_fpstate_32__bindgen_ty_2>() - 8usize]; + ["Offset of field: _fpstate_32__bindgen_ty_2::padding2"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_2, padding2) - 0usize]; + ["Offset of field: _fpstate_32__bindgen_ty_2::sw_reserved"] + [::std::mem::offset_of!(_fpstate_32__bindgen_ty_2, sw_reserved) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_32"][::std::mem::size_of::<_fpstate_32>() - 624usize]; + ["Alignment of _fpstate_32"][::std::mem::align_of::<_fpstate_32>() - 8usize]; + ["Offset of field: _fpstate_32::cw"][::std::mem::offset_of!(_fpstate_32, cw) - 0usize]; + ["Offset of field: _fpstate_32::sw"][::std::mem::offset_of!(_fpstate_32, sw) - 4usize]; + ["Offset of field: _fpstate_32::tag"][::std::mem::offset_of!(_fpstate_32, tag) - 8usize]; + ["Offset of field: _fpstate_32::ipoff"][::std::mem::offset_of!(_fpstate_32, ipoff) - 12usize]; + ["Offset of field: _fpstate_32::cssel"][::std::mem::offset_of!(_fpstate_32, cssel) - 16usize]; + ["Offset of field: _fpstate_32::dataoff"] + [::std::mem::offset_of!(_fpstate_32, dataoff) - 20usize]; + ["Offset of field: _fpstate_32::datasel"] + [::std::mem::offset_of!(_fpstate_32, datasel) - 24usize]; + ["Offset of field: _fpstate_32::_st"][::std::mem::offset_of!(_fpstate_32, _st) - 28usize]; + ["Offset of field: _fpstate_32::status"] + [::std::mem::offset_of!(_fpstate_32, status) - 108usize]; + ["Offset of field: _fpstate_32::magic"][::std::mem::offset_of!(_fpstate_32, magic) - 110usize]; + ["Offset of field: _fpstate_32::_fxsr_env"] + [::std::mem::offset_of!(_fpstate_32, _fxsr_env) - 112usize]; + ["Offset of field: _fpstate_32::mxcsr"][::std::mem::offset_of!(_fpstate_32, mxcsr) - 136usize]; + ["Offset of field: _fpstate_32::reserved"] + [::std::mem::offset_of!(_fpstate_32, reserved) - 140usize]; + ["Offset of field: _fpstate_32::_fxsr_st"] + [::std::mem::offset_of!(_fpstate_32, _fxsr_st) - 144usize]; + ["Offset of field: _fpstate_32::_xmm"][::std::mem::offset_of!(_fpstate_32, _xmm) - 272usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct _fpstate_64 { @@ -3894,102 +3244,37 @@ pub union _fpstate_64__bindgen_ty_1 { pub reserved3: [__u32; 12usize], pub sw_reserved: _fpx_sw_bytes, } -#[test] -fn bindgen_test_layout__fpstate_64__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_64__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_64__bindgen_ty_1>(), - 48usize, - "Size of _fpstate_64__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_64__bindgen_ty_1>(), - 8usize, - "Alignment of _fpstate_64__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved3) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_64__bindgen_ty_1::reserved3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sw_reserved) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_64__bindgen_ty_1::sw_reserved" - ); -} -#[test] -fn bindgen_test_layout__fpstate_64() { - const UNINIT: ::std::mem::MaybeUninit<_fpstate_64> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_fpstate_64>(), - 512usize, - "Size of _fpstate_64" - ); - assert_eq!( - ::std::mem::align_of::<_fpstate_64>(), - 8usize, - "Alignment of _fpstate_64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, - 0usize, - "Offset of field: _fpstate_64::cwd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, - 2usize, - "Offset of field: _fpstate_64::swd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).twd) as usize - ptr as usize }, - 4usize, - "Offset of field: _fpstate_64::twd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, - 6usize, - "Offset of field: _fpstate_64::fop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, - 8usize, - "Offset of field: _fpstate_64::rip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, - 16usize, - "Offset of field: _fpstate_64::rdp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 24usize, - "Offset of field: _fpstate_64::mxcsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr_mask) as usize - ptr as usize }, - 28usize, - "Offset of field: _fpstate_64::mxcsr_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, - 32usize, - "Offset of field: _fpstate_64::st_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, - 160usize, - "Offset of field: _fpstate_64::xmm_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, - 416usize, - "Offset of field: _fpstate_64::reserved2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_64__bindgen_ty_1"] + [::std::mem::size_of::<_fpstate_64__bindgen_ty_1>() - 48usize]; + ["Alignment of _fpstate_64__bindgen_ty_1"] + [::std::mem::align_of::<_fpstate_64__bindgen_ty_1>() - 8usize]; + ["Offset of field: _fpstate_64__bindgen_ty_1::reserved3"] + [::std::mem::offset_of!(_fpstate_64__bindgen_ty_1, reserved3) - 0usize]; + ["Offset of field: _fpstate_64__bindgen_ty_1::sw_reserved"] + [::std::mem::offset_of!(_fpstate_64__bindgen_ty_1, sw_reserved) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _fpstate_64"][::std::mem::size_of::<_fpstate_64>() - 512usize]; + ["Alignment of _fpstate_64"][::std::mem::align_of::<_fpstate_64>() - 8usize]; + ["Offset of field: _fpstate_64::cwd"][::std::mem::offset_of!(_fpstate_64, cwd) - 0usize]; + ["Offset of field: _fpstate_64::swd"][::std::mem::offset_of!(_fpstate_64, swd) - 2usize]; + ["Offset of field: _fpstate_64::twd"][::std::mem::offset_of!(_fpstate_64, twd) - 4usize]; + ["Offset of field: _fpstate_64::fop"][::std::mem::offset_of!(_fpstate_64, fop) - 6usize]; + ["Offset of field: _fpstate_64::rip"][::std::mem::offset_of!(_fpstate_64, rip) - 8usize]; + ["Offset of field: _fpstate_64::rdp"][::std::mem::offset_of!(_fpstate_64, rdp) - 16usize]; + ["Offset of field: _fpstate_64::mxcsr"][::std::mem::offset_of!(_fpstate_64, mxcsr) - 24usize]; + ["Offset of field: _fpstate_64::mxcsr_mask"] + [::std::mem::offset_of!(_fpstate_64, mxcsr_mask) - 28usize]; + ["Offset of field: _fpstate_64::st_space"] + [::std::mem::offset_of!(_fpstate_64, st_space) - 32usize]; + ["Offset of field: _fpstate_64::xmm_space"] + [::std::mem::offset_of!(_fpstate_64, xmm_space) - 160usize]; + ["Offset of field: _fpstate_64::reserved2"] + [::std::mem::offset_of!(_fpstate_64, reserved2) - 416usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _header { @@ -3997,57 +3282,26 @@ pub struct _header { pub reserved1: [__u64; 2usize], pub reserved2: [__u64; 5usize], } -#[test] -fn bindgen_test_layout__header() { - const UNINIT: ::std::mem::MaybeUninit<_header> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::<_header>(), 64usize, "Size of _header"); - assert_eq!( - ::std::mem::align_of::<_header>(), - 8usize, - "Alignment of _header" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xfeatures) as usize - ptr as usize }, - 0usize, - "Offset of field: _header::xfeatures" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 8usize, - "Offset of field: _header::reserved1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved2) as usize - ptr as usize }, - 24usize, - "Offset of field: _header::reserved2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _header"][::std::mem::size_of::<_header>() - 64usize]; + ["Alignment of _header"][::std::mem::align_of::<_header>() - 8usize]; + ["Offset of field: _header::xfeatures"][::std::mem::offset_of!(_header, xfeatures) - 0usize]; + ["Offset of field: _header::reserved1"][::std::mem::offset_of!(_header, reserved1) - 8usize]; + ["Offset of field: _header::reserved2"][::std::mem::offset_of!(_header, reserved2) - 24usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _ymmh_state { pub ymmh_space: [__u32; 64usize], } -#[test] -fn bindgen_test_layout__ymmh_state() { - const UNINIT: ::std::mem::MaybeUninit<_ymmh_state> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_ymmh_state>(), - 256usize, - "Size of _ymmh_state" - ); - assert_eq!( - ::std::mem::align_of::<_ymmh_state>(), - 4usize, - "Alignment of _ymmh_state" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ymmh_space) as usize - ptr as usize }, - 0usize, - "Offset of field: _ymmh_state::ymmh_space" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _ymmh_state"][::std::mem::size_of::<_ymmh_state>() - 256usize]; + ["Alignment of _ymmh_state"][::std::mem::align_of::<_ymmh_state>() - 4usize]; + ["Offset of field: _ymmh_state::ymmh_space"] + [::std::mem::offset_of!(_ymmh_state, ymmh_space) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct _xstate { @@ -4055,36 +3309,15 @@ pub struct _xstate { pub xstate_hdr: _header, pub ymmh: _ymmh_state, } -#[test] -fn bindgen_test_layout__xstate() { - const UNINIT: ::std::mem::MaybeUninit<_xstate> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_xstate>(), - 832usize, - "Size of _xstate" - ); - assert_eq!( - ::std::mem::align_of::<_xstate>(), - 8usize, - "Alignment of _xstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 0usize, - "Offset of field: _xstate::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xstate_hdr) as usize - ptr as usize }, - 512usize, - "Offset of field: _xstate::xstate_hdr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ymmh) as usize - ptr as usize }, - 576usize, - "Offset of field: _xstate::ymmh" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _xstate"][::std::mem::size_of::<_xstate>() - 832usize]; + ["Alignment of _xstate"][::std::mem::align_of::<_xstate>() - 8usize]; + ["Offset of field: _xstate::fpstate"][::std::mem::offset_of!(_xstate, fpstate) - 0usize]; + ["Offset of field: _xstate::xstate_hdr"] + [::std::mem::offset_of!(_xstate, xstate_hdr) - 512usize]; + ["Offset of field: _xstate::ymmh"][::std::mem::offset_of!(_xstate, ymmh) - 576usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigcontext_32 { @@ -4117,161 +3350,50 @@ pub struct sigcontext_32 { pub oldmask: __u32, pub cr2: __u32, } -#[test] -fn bindgen_test_layout_sigcontext_32() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of sigcontext_32" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sigcontext_32" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext_32::gs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__gsh) as usize - ptr as usize }, - 2usize, - "Offset of field: sigcontext_32::__gsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, - 4usize, - "Offset of field: sigcontext_32::fs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__fsh) as usize - ptr as usize }, - 6usize, - "Offset of field: sigcontext_32::__fsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext_32::es" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__esh) as usize - ptr as usize }, - 10usize, - "Offset of field: sigcontext_32::__esh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, - 12usize, - "Offset of field: sigcontext_32::ds" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__dsh) as usize - ptr as usize }, - 14usize, - "Offset of field: sigcontext_32::__dsh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, - 16usize, - "Offset of field: sigcontext_32::di" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, - 20usize, - "Offset of field: sigcontext_32::si" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, - 24usize, - "Offset of field: sigcontext_32::bp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, - 28usize, - "Offset of field: sigcontext_32::sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, - 32usize, - "Offset of field: sigcontext_32::bx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, - 36usize, - "Offset of field: sigcontext_32::dx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, - 40usize, - "Offset of field: sigcontext_32::cx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, - 44usize, - "Offset of field: sigcontext_32::ax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, - 48usize, - "Offset of field: sigcontext_32::trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, - 52usize, - "Offset of field: sigcontext_32::err" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, - 56usize, - "Offset of field: sigcontext_32::ip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, - 60usize, - "Offset of field: sigcontext_32::cs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__csh) as usize - ptr as usize }, - 62usize, - "Offset of field: sigcontext_32::__csh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 64usize, - "Offset of field: sigcontext_32::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp_at_signal) as usize - ptr as usize }, - 68usize, - "Offset of field: sigcontext_32::sp_at_signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, - 72usize, - "Offset of field: sigcontext_32::ss" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__ssh) as usize - ptr as usize }, - 74usize, - "Offset of field: sigcontext_32::__ssh" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 76usize, - "Offset of field: sigcontext_32::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 80usize, - "Offset of field: sigcontext_32::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, - 84usize, - "Offset of field: sigcontext_32::cr2" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext_32"][::std::mem::size_of::() - 88usize]; + ["Alignment of sigcontext_32"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sigcontext_32::gs"][::std::mem::offset_of!(sigcontext_32, gs) - 0usize]; + ["Offset of field: sigcontext_32::__gsh"] + [::std::mem::offset_of!(sigcontext_32, __gsh) - 2usize]; + ["Offset of field: sigcontext_32::fs"][::std::mem::offset_of!(sigcontext_32, fs) - 4usize]; + ["Offset of field: sigcontext_32::__fsh"] + [::std::mem::offset_of!(sigcontext_32, __fsh) - 6usize]; + ["Offset of field: sigcontext_32::es"][::std::mem::offset_of!(sigcontext_32, es) - 8usize]; + ["Offset of field: sigcontext_32::__esh"] + [::std::mem::offset_of!(sigcontext_32, __esh) - 10usize]; + ["Offset of field: sigcontext_32::ds"][::std::mem::offset_of!(sigcontext_32, ds) - 12usize]; + ["Offset of field: sigcontext_32::__dsh"] + [::std::mem::offset_of!(sigcontext_32, __dsh) - 14usize]; + ["Offset of field: sigcontext_32::di"][::std::mem::offset_of!(sigcontext_32, di) - 16usize]; + ["Offset of field: sigcontext_32::si"][::std::mem::offset_of!(sigcontext_32, si) - 20usize]; + ["Offset of field: sigcontext_32::bp"][::std::mem::offset_of!(sigcontext_32, bp) - 24usize]; + ["Offset of field: sigcontext_32::sp"][::std::mem::offset_of!(sigcontext_32, sp) - 28usize]; + ["Offset of field: sigcontext_32::bx"][::std::mem::offset_of!(sigcontext_32, bx) - 32usize]; + ["Offset of field: sigcontext_32::dx"][::std::mem::offset_of!(sigcontext_32, dx) - 36usize]; + ["Offset of field: sigcontext_32::cx"][::std::mem::offset_of!(sigcontext_32, cx) - 40usize]; + ["Offset of field: sigcontext_32::ax"][::std::mem::offset_of!(sigcontext_32, ax) - 44usize]; + ["Offset of field: sigcontext_32::trapno"] + [::std::mem::offset_of!(sigcontext_32, trapno) - 48usize]; + ["Offset of field: sigcontext_32::err"][::std::mem::offset_of!(sigcontext_32, err) - 52usize]; + ["Offset of field: sigcontext_32::ip"][::std::mem::offset_of!(sigcontext_32, ip) - 56usize]; + ["Offset of field: sigcontext_32::cs"][::std::mem::offset_of!(sigcontext_32, cs) - 60usize]; + ["Offset of field: sigcontext_32::__csh"] + [::std::mem::offset_of!(sigcontext_32, __csh) - 62usize]; + ["Offset of field: sigcontext_32::flags"] + [::std::mem::offset_of!(sigcontext_32, flags) - 64usize]; + ["Offset of field: sigcontext_32::sp_at_signal"] + [::std::mem::offset_of!(sigcontext_32, sp_at_signal) - 68usize]; + ["Offset of field: sigcontext_32::ss"][::std::mem::offset_of!(sigcontext_32, ss) - 72usize]; + ["Offset of field: sigcontext_32::__ssh"] + [::std::mem::offset_of!(sigcontext_32, __ssh) - 74usize]; + ["Offset of field: sigcontext_32::fpstate"] + [::std::mem::offset_of!(sigcontext_32, fpstate) - 76usize]; + ["Offset of field: sigcontext_32::oldmask"] + [::std::mem::offset_of!(sigcontext_32, oldmask) - 80usize]; + ["Offset of field: sigcontext_32::cr2"][::std::mem::offset_of!(sigcontext_32, cr2) - 84usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigcontext_64 { @@ -4304,161 +3426,44 @@ pub struct sigcontext_64 { pub fpstate: __u64, pub reserved1: [__u64; 8usize], } -#[test] -fn bindgen_test_layout_sigcontext_64() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 256usize, - "Size of sigcontext_64" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigcontext_64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext_64::r8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext_64::r9" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, - 16usize, - "Offset of field: sigcontext_64::r10" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, - 24usize, - "Offset of field: sigcontext_64::r11" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, - 32usize, - "Offset of field: sigcontext_64::r12" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, - 40usize, - "Offset of field: sigcontext_64::r13" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, - 48usize, - "Offset of field: sigcontext_64::r14" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, - 56usize, - "Offset of field: sigcontext_64::r15" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).di) as usize - ptr as usize }, - 64usize, - "Offset of field: sigcontext_64::di" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si) as usize - ptr as usize }, - 72usize, - "Offset of field: sigcontext_64::si" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bp) as usize - ptr as usize }, - 80usize, - "Offset of field: sigcontext_64::bp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bx) as usize - ptr as usize }, - 88usize, - "Offset of field: sigcontext_64::bx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dx) as usize - ptr as usize }, - 96usize, - "Offset of field: sigcontext_64::dx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ax) as usize - ptr as usize }, - 104usize, - "Offset of field: sigcontext_64::ax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cx) as usize - ptr as usize }, - 112usize, - "Offset of field: sigcontext_64::cx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sp) as usize - ptr as usize }, - 120usize, - "Offset of field: sigcontext_64::sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ip) as usize - ptr as usize }, - 128usize, - "Offset of field: sigcontext_64::ip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 136usize, - "Offset of field: sigcontext_64::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, - 144usize, - "Offset of field: sigcontext_64::cs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, - 146usize, - "Offset of field: sigcontext_64::gs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, - 148usize, - "Offset of field: sigcontext_64::fs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, - 150usize, - "Offset of field: sigcontext_64::ss" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, - 152usize, - "Offset of field: sigcontext_64::err" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, - 160usize, - "Offset of field: sigcontext_64::trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 168usize, - "Offset of field: sigcontext_64::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, - 176usize, - "Offset of field: sigcontext_64::cr2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 184usize, - "Offset of field: sigcontext_64::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 192usize, - "Offset of field: sigcontext_64::reserved1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext_64"][::std::mem::size_of::() - 256usize]; + ["Alignment of sigcontext_64"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigcontext_64::r8"][::std::mem::offset_of!(sigcontext_64, r8) - 0usize]; + ["Offset of field: sigcontext_64::r9"][::std::mem::offset_of!(sigcontext_64, r9) - 8usize]; + ["Offset of field: sigcontext_64::r10"][::std::mem::offset_of!(sigcontext_64, r10) - 16usize]; + ["Offset of field: sigcontext_64::r11"][::std::mem::offset_of!(sigcontext_64, r11) - 24usize]; + ["Offset of field: sigcontext_64::r12"][::std::mem::offset_of!(sigcontext_64, r12) - 32usize]; + ["Offset of field: sigcontext_64::r13"][::std::mem::offset_of!(sigcontext_64, r13) - 40usize]; + ["Offset of field: sigcontext_64::r14"][::std::mem::offset_of!(sigcontext_64, r14) - 48usize]; + ["Offset of field: sigcontext_64::r15"][::std::mem::offset_of!(sigcontext_64, r15) - 56usize]; + ["Offset of field: sigcontext_64::di"][::std::mem::offset_of!(sigcontext_64, di) - 64usize]; + ["Offset of field: sigcontext_64::si"][::std::mem::offset_of!(sigcontext_64, si) - 72usize]; + ["Offset of field: sigcontext_64::bp"][::std::mem::offset_of!(sigcontext_64, bp) - 80usize]; + ["Offset of field: sigcontext_64::bx"][::std::mem::offset_of!(sigcontext_64, bx) - 88usize]; + ["Offset of field: sigcontext_64::dx"][::std::mem::offset_of!(sigcontext_64, dx) - 96usize]; + ["Offset of field: sigcontext_64::ax"][::std::mem::offset_of!(sigcontext_64, ax) - 104usize]; + ["Offset of field: sigcontext_64::cx"][::std::mem::offset_of!(sigcontext_64, cx) - 112usize]; + ["Offset of field: sigcontext_64::sp"][::std::mem::offset_of!(sigcontext_64, sp) - 120usize]; + ["Offset of field: sigcontext_64::ip"][::std::mem::offset_of!(sigcontext_64, ip) - 128usize]; + ["Offset of field: sigcontext_64::flags"] + [::std::mem::offset_of!(sigcontext_64, flags) - 136usize]; + ["Offset of field: sigcontext_64::cs"][::std::mem::offset_of!(sigcontext_64, cs) - 144usize]; + ["Offset of field: sigcontext_64::gs"][::std::mem::offset_of!(sigcontext_64, gs) - 146usize]; + ["Offset of field: sigcontext_64::fs"][::std::mem::offset_of!(sigcontext_64, fs) - 148usize]; + ["Offset of field: sigcontext_64::ss"][::std::mem::offset_of!(sigcontext_64, ss) - 150usize]; + ["Offset of field: sigcontext_64::err"][::std::mem::offset_of!(sigcontext_64, err) - 152usize]; + ["Offset of field: sigcontext_64::trapno"] + [::std::mem::offset_of!(sigcontext_64, trapno) - 160usize]; + ["Offset of field: sigcontext_64::oldmask"] + [::std::mem::offset_of!(sigcontext_64, oldmask) - 168usize]; + ["Offset of field: sigcontext_64::cr2"][::std::mem::offset_of!(sigcontext_64, cr2) - 176usize]; + ["Offset of field: sigcontext_64::fpstate"] + [::std::mem::offset_of!(sigcontext_64, fpstate) - 184usize]; + ["Offset of field: sigcontext_64::reserved1"] + [::std::mem::offset_of!(sigcontext_64, reserved1) - 192usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct sigcontext { @@ -4497,459 +3502,184 @@ pub union sigcontext__bindgen_ty_1 { pub ss: __u16, pub __pad0: __u16, } -#[test] -fn bindgen_test_layout_sigcontext__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 2usize, - "Size of sigcontext__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - "Alignment of sigcontext__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext__bindgen_ty_1::ss" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad0) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext__bindgen_ty_1::__pad0" - ); -} -#[test] -fn bindgen_test_layout_sigcontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 256usize, - "Size of sigcontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigcontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, - 0usize, - "Offset of field: sigcontext::r8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, - 8usize, - "Offset of field: sigcontext::r9" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, - 16usize, - "Offset of field: sigcontext::r10" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, - 24usize, - "Offset of field: sigcontext::r11" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, - 32usize, - "Offset of field: sigcontext::r12" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, - 40usize, - "Offset of field: sigcontext::r13" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, - 48usize, - "Offset of field: sigcontext::r14" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, - 56usize, - "Offset of field: sigcontext::r15" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdi) as usize - ptr as usize }, - 64usize, - "Offset of field: sigcontext::rdi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsi) as usize - ptr as usize }, - 72usize, - "Offset of field: sigcontext::rsi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbp) as usize - ptr as usize }, - 80usize, - "Offset of field: sigcontext::rbp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbx) as usize - ptr as usize }, - 88usize, - "Offset of field: sigcontext::rbx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdx) as usize - ptr as usize }, - 96usize, - "Offset of field: sigcontext::rdx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rax) as usize - ptr as usize }, - 104usize, - "Offset of field: sigcontext::rax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcx) as usize - ptr as usize }, - 112usize, - "Offset of field: sigcontext::rcx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsp) as usize - ptr as usize }, - 120usize, - "Offset of field: sigcontext::rsp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, - 128usize, - "Offset of field: sigcontext::rip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, - 136usize, - "Offset of field: sigcontext::eflags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, - 144usize, - "Offset of field: sigcontext::cs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, - 146usize, - "Offset of field: sigcontext::gs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, - 148usize, - "Offset of field: sigcontext::fs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).err) as usize - ptr as usize }, - 152usize, - "Offset of field: sigcontext::err" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).trapno) as usize - ptr as usize }, - 160usize, - "Offset of field: sigcontext::trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).oldmask) as usize - ptr as usize }, - 168usize, - "Offset of field: sigcontext::oldmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr2) as usize - ptr as usize }, - 176usize, - "Offset of field: sigcontext::cr2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstate) as usize - ptr as usize }, - 184usize, - "Offset of field: sigcontext::fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved1) as usize - ptr as usize }, - 192usize, - "Offset of field: sigcontext::reserved1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext__bindgen_ty_1"] + [::std::mem::size_of::() - 2usize]; + ["Alignment of sigcontext__bindgen_ty_1"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: sigcontext__bindgen_ty_1::ss"] + [::std::mem::offset_of!(sigcontext__bindgen_ty_1, ss) - 0usize]; + ["Offset of field: sigcontext__bindgen_ty_1::__pad0"] + [::std::mem::offset_of!(sigcontext__bindgen_ty_1, __pad0) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigcontext"][::std::mem::size_of::() - 256usize]; + ["Alignment of sigcontext"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigcontext::r8"][::std::mem::offset_of!(sigcontext, r8) - 0usize]; + ["Offset of field: sigcontext::r9"][::std::mem::offset_of!(sigcontext, r9) - 8usize]; + ["Offset of field: sigcontext::r10"][::std::mem::offset_of!(sigcontext, r10) - 16usize]; + ["Offset of field: sigcontext::r11"][::std::mem::offset_of!(sigcontext, r11) - 24usize]; + ["Offset of field: sigcontext::r12"][::std::mem::offset_of!(sigcontext, r12) - 32usize]; + ["Offset of field: sigcontext::r13"][::std::mem::offset_of!(sigcontext, r13) - 40usize]; + ["Offset of field: sigcontext::r14"][::std::mem::offset_of!(sigcontext, r14) - 48usize]; + ["Offset of field: sigcontext::r15"][::std::mem::offset_of!(sigcontext, r15) - 56usize]; + ["Offset of field: sigcontext::rdi"][::std::mem::offset_of!(sigcontext, rdi) - 64usize]; + ["Offset of field: sigcontext::rsi"][::std::mem::offset_of!(sigcontext, rsi) - 72usize]; + ["Offset of field: sigcontext::rbp"][::std::mem::offset_of!(sigcontext, rbp) - 80usize]; + ["Offset of field: sigcontext::rbx"][::std::mem::offset_of!(sigcontext, rbx) - 88usize]; + ["Offset of field: sigcontext::rdx"][::std::mem::offset_of!(sigcontext, rdx) - 96usize]; + ["Offset of field: sigcontext::rax"][::std::mem::offset_of!(sigcontext, rax) - 104usize]; + ["Offset of field: sigcontext::rcx"][::std::mem::offset_of!(sigcontext, rcx) - 112usize]; + ["Offset of field: sigcontext::rsp"][::std::mem::offset_of!(sigcontext, rsp) - 120usize]; + ["Offset of field: sigcontext::rip"][::std::mem::offset_of!(sigcontext, rip) - 128usize]; + ["Offset of field: sigcontext::eflags"][::std::mem::offset_of!(sigcontext, eflags) - 136usize]; + ["Offset of field: sigcontext::cs"][::std::mem::offset_of!(sigcontext, cs) - 144usize]; + ["Offset of field: sigcontext::gs"][::std::mem::offset_of!(sigcontext, gs) - 146usize]; + ["Offset of field: sigcontext::fs"][::std::mem::offset_of!(sigcontext, fs) - 148usize]; + ["Offset of field: sigcontext::err"][::std::mem::offset_of!(sigcontext, err) - 152usize]; + ["Offset of field: sigcontext::trapno"][::std::mem::offset_of!(sigcontext, trapno) - 160usize]; + ["Offset of field: sigcontext::oldmask"] + [::std::mem::offset_of!(sigcontext, oldmask) - 168usize]; + ["Offset of field: sigcontext::cr2"][::std::mem::offset_of!(sigcontext, cr2) - 176usize]; + ["Offset of field: sigcontext::fpstate"] + [::std::mem::offset_of!(sigcontext, fpstate) - 184usize]; + ["Offset of field: sigcontext::reserved1"] + [::std::mem::offset_of!(sigcontext, reserved1) - 192usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { pub tv_sec: time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout_timespec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of timespec" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timespec"][::std::mem::size_of::() - 16usize]; + ["Alignment of timespec"][::std::mem::align_of::() - 8usize]; + ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize]; + ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_timespec { pub tv_sec: __kernel_time64_t, pub tv_nsec: ::std::os::raw::c_longlong, } -#[test] -fn bindgen_test_layout___kernel_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_timespec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_timespec>(), - 16usize, - "Size of __kernel_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_timespec>(), - 8usize, - "Alignment of __kernel_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_timespec"][::std::mem::size_of::<__kernel_timespec>() - 16usize]; + ["Alignment of __kernel_timespec"][::std::mem::align_of::<__kernel_timespec>() - 8usize]; + ["Offset of field: __kernel_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_itimerspec { pub it_interval: __kernel_timespec, pub it_value: __kernel_timespec, } -#[test] -fn bindgen_test_layout___kernel_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_itimerspec> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_itimerspec>(), - 32usize, - "Size of __kernel_itimerspec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_itimerspec>(), - 8usize, - "Alignment of __kernel_itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: __kernel_itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_itimerspec"][::std::mem::size_of::<__kernel_itimerspec>() - 32usize]; + ["Alignment of __kernel_itimerspec"][::std::mem::align_of::<__kernel_itimerspec>() - 8usize]; + ["Offset of field: __kernel_itimerspec::it_interval"] + [::std::mem::offset_of!(__kernel_itimerspec, it_interval) - 0usize]; + ["Offset of field: __kernel_itimerspec::it_value"] + [::std::mem::offset_of!(__kernel_itimerspec, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_old_timespec { pub tv_sec: __kernel_old_time_t, pub tv_nsec: ::std::os::raw::c_long, } -#[test] -fn bindgen_test_layout___kernel_old_timespec() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_old_timespec> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_old_timespec>(), - 16usize, - "Size of __kernel_old_timespec" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_old_timespec>(), - 8usize, - "Alignment of __kernel_old_timespec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_old_timespec::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_old_timespec::tv_nsec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_old_timespec"][::std::mem::size_of::<__kernel_old_timespec>() - 16usize]; + ["Alignment of __kernel_old_timespec"] + [::std::mem::align_of::<__kernel_old_timespec>() - 8usize]; + ["Offset of field: __kernel_old_timespec::tv_sec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_sec) - 0usize]; + ["Offset of field: __kernel_old_timespec::tv_nsec"] + [::std::mem::offset_of!(__kernel_old_timespec, tv_nsec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __kernel_sock_timeval { pub tv_sec: __s64, pub tv_usec: __s64, } -#[test] -fn bindgen_test_layout___kernel_sock_timeval() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sock_timeval> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sock_timeval>(), - 16usize, - "Size of __kernel_sock_timeval" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sock_timeval>(), - 8usize, - "Alignment of __kernel_sock_timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sock_timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sock_timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sock_timeval"][::std::mem::size_of::<__kernel_sock_timeval>() - 16usize]; + ["Alignment of __kernel_sock_timeval"] + [::std::mem::align_of::<__kernel_sock_timeval>() - 8usize]; + ["Offset of field: __kernel_sock_timeval::tv_sec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_sec) - 0usize]; + ["Offset of field: __kernel_sock_timeval::tv_usec"] + [::std::mem::offset_of!(__kernel_sock_timeval, tv_usec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { pub tv_sec: __kernel_old_time_t, pub tv_usec: __kernel_suseconds_t, } -#[test] -fn bindgen_test_layout_timeval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 16usize, "Size of timeval"); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of timeval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: timeval::tv_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize }, - 8usize, - "Offset of field: timeval::tv_usec" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timeval"][::std::mem::size_of::() - 16usize]; + ["Alignment of timeval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: timeval::tv_sec"][::std::mem::offset_of!(timeval, tv_sec) - 0usize]; + ["Offset of field: timeval::tv_usec"][::std::mem::offset_of!(timeval, tv_usec) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerspec { pub it_interval: timespec, pub it_value: timespec, } -#[test] -fn bindgen_test_layout_itimerspec() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of itimerspec" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of itimerspec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerspec::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: itimerspec::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerspec"][::std::mem::size_of::() - 32usize]; + ["Alignment of itimerspec"][::std::mem::align_of::() - 8usize]; + ["Offset of field: itimerspec::it_interval"] + [::std::mem::offset_of!(itimerspec, it_interval) - 0usize]; + ["Offset of field: itimerspec::it_value"] + [::std::mem::offset_of!(itimerspec, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct itimerval { pub it_interval: timeval, pub it_value: timeval, } -#[test] -fn bindgen_test_layout_itimerval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of itimerval" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of itimerval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_interval) as usize - ptr as usize }, - 0usize, - "Offset of field: itimerval::it_interval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).it_value) as usize - ptr as usize }, - 16usize, - "Offset of field: itimerval::it_value" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of itimerval"][::std::mem::size_of::() - 32usize]; + ["Alignment of itimerval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: itimerval::it_interval"] + [::std::mem::offset_of!(itimerval, it_interval) - 0usize]; + ["Offset of field: itimerval::it_value"][::std::mem::offset_of!(itimerval, it_value) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timezone { pub tz_minuteswest: ::std::os::raw::c_int, pub tz_dsttime: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_timezone() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of timezone" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of timezone" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_minuteswest) as usize - ptr as usize }, - 0usize, - "Offset of field: timezone::tz_minuteswest" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tz_dsttime) as usize - ptr as usize }, - 4usize, - "Offset of field: timezone::tz_dsttime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timezone"][::std::mem::size_of::() - 8usize]; + ["Alignment of timezone"][::std::mem::align_of::() - 4usize]; + ["Offset of field: timezone::tz_minuteswest"] + [::std::mem::offset_of!(timezone, tz_minuteswest) - 0usize]; + ["Offset of field: timezone::tz_dsttime"] + [::std::mem::offset_of!(timezone, tz_dsttime) - 4usize]; +}; pub type sigset_t = ::std::os::raw::c_ulong; pub type __signalfn_t = ::std::option::Option; pub type __sighandler_t = __signalfn_t; @@ -4963,41 +3693,19 @@ pub struct __kernel_sigaction { pub sa_restorer: __sigrestore_t, pub sa_mask: sigset_t, } -#[test] -fn bindgen_test_layout___kernel_sigaction() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_sigaction> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_sigaction>(), - 32usize, - "Size of __kernel_sigaction" - ); - assert_eq!( - ::std::mem::align_of::<__kernel_sigaction>(), - 8usize, - "Alignment of __kernel_sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: __kernel_sigaction::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: __kernel_sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 16usize, - "Offset of field: __kernel_sigaction::sa_restorer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 24usize, - "Offset of field: __kernel_sigaction::sa_mask" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_sigaction"][::std::mem::size_of::<__kernel_sigaction>() - 32usize]; + ["Alignment of __kernel_sigaction"][::std::mem::align_of::<__kernel_sigaction>() - 8usize]; + ["Offset of field: __kernel_sigaction::sa_handler"] + [::std::mem::offset_of!(__kernel_sigaction, sa_handler) - 0usize]; + ["Offset of field: __kernel_sigaction::sa_flags"] + [::std::mem::offset_of!(__kernel_sigaction, sa_flags) - 8usize]; + ["Offset of field: __kernel_sigaction::sa_restorer"] + [::std::mem::offset_of!(__kernel_sigaction, sa_restorer) - 16usize]; + ["Offset of field: __kernel_sigaction::sa_mask"] + [::std::mem::offset_of!(__kernel_sigaction, sa_mask) - 24usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sigaltstack { @@ -5005,36 +3713,16 @@ pub struct sigaltstack { pub ss_flags: ::std::os::raw::c_int, pub ss_size: __kernel_size_t, } -#[test] -fn bindgen_test_layout_sigaltstack() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of sigaltstack" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaltstack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_sp) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaltstack::ss_sp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_flags) as usize - ptr as usize }, - 8usize, - "Offset of field: sigaltstack::ss_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss_size) as usize - ptr as usize }, - 16usize, - "Offset of field: sigaltstack::ss_size" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaltstack"][::std::mem::size_of::() - 24usize]; + ["Alignment of sigaltstack"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaltstack::ss_sp"][::std::mem::offset_of!(sigaltstack, ss_sp) - 0usize]; + ["Offset of field: sigaltstack::ss_flags"] + [::std::mem::offset_of!(sigaltstack, ss_flags) - 8usize]; + ["Offset of field: sigaltstack::ss_size"] + [::std::mem::offset_of!(sigaltstack, ss_size) - 16usize]; +}; pub type stack_t = sigaltstack; #[repr(C)] #[derive(Copy, Clone)] @@ -5042,27 +3730,13 @@ pub union sigval { pub sival_int: ::std::os::raw::c_int, pub sival_ptr: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 8usize, "Size of sigval"); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_int" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, - 0usize, - "Offset of field: sigval::sival_ptr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigval"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigval::sival_int"][::std::mem::offset_of!(sigval, sival_int) - 0usize]; + ["Offset of field: sigval::sival_ptr"][::std::mem::offset_of!(sigval, sival_ptr) - 0usize]; +}; pub type sigval_t = sigval; #[repr(C)] #[derive(Copy, Clone)] @@ -5081,32 +3755,17 @@ pub struct __sifields__bindgen_ty_1 { pub _pid: __kernel_pid_t, pub _uid: __kernel_uid32_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_1>(), - 8usize, - "Size of __sifields__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_1>(), - 4usize, - "Alignment of __sifields__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_1::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_1::_uid" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_1>() - 8usize]; + ["Alignment of __sifields__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_1>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_1::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_1::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_1, _uid) - 4usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_2 { @@ -5115,42 +3774,21 @@ pub struct __sifields__bindgen_ty_2 { pub _sigval: sigval_t, pub _sys_private: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_2>(), - 24usize, - "Size of __sifields__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_2>(), - 8usize, - "Alignment of __sifields__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_2::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._overrun) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_2::_overrun" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_2::_sigval" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sys_private) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_2::_sys_private" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_2>() - 24usize]; + ["Alignment of __sifields__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_2>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_2::_tid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _tid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_2::_overrun"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _overrun) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sigval) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_2::_sys_private"] + [::std::mem::offset_of!(__sifields__bindgen_ty_2, _sys_private) - 16usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_3 { @@ -5158,37 +3796,19 @@ pub struct __sifields__bindgen_ty_3 { pub _uid: __kernel_uid32_t, pub _sigval: sigval_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_3>(), - 16usize, - "Size of __sifields__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_3>(), - 8usize, - "Alignment of __sifields__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_3::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_3::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigval) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_3::_sigval" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_3>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_3>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_3::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_3::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_3::_sigval"] + [::std::mem::offset_of!(__sifields__bindgen_ty_3, _sigval) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_4 { @@ -5198,47 +3818,23 @@ pub struct __sifields__bindgen_ty_4 { pub _utime: __kernel_clock_t, pub _stime: __kernel_clock_t, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_4> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_4>(), - 32usize, - "Size of __sifields__bindgen_ty_4" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_4>(), - 8usize, - "Alignment of __sifields__bindgen_ty_4" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pid) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_4::_pid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._uid) as usize - ptr as usize }, - 4usize, - "Offset of field: __sifields__bindgen_ty_4::_uid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._status) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_4::_status" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._utime) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_4::_utime" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._stime) as usize - ptr as usize }, - 24usize, - "Offset of field: __sifields__bindgen_ty_4::_stime" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_4"] + [::std::mem::size_of::<__sifields__bindgen_ty_4>() - 32usize]; + ["Alignment of __sifields__bindgen_ty_4"] + [::std::mem::align_of::<__sifields__bindgen_ty_4>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_4::_pid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _pid) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_4::_uid"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _uid) - 4usize]; + ["Offset of field: __sifields__bindgen_ty_4::_status"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _status) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_4::_utime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _utime) - 16usize]; + ["Offset of field: __sifields__bindgen_ty_4::_stime"] + [::std::mem::offset_of!(__sifields__bindgen_ty_4, _stime) - 24usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct __sifields__bindgen_ty_5 { @@ -5261,69 +3857,48 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { pub _lower: *mut ::std::os::raw::c_void, pub _upper: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 24usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, - 16usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 24usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_dummy_bnd"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _dummy_bnd + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _lower + ) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + _upper + ) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2 { pub _dummy_pkey: [::std::os::raw::c_char; 8usize], pub _pkey: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 12usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>(), - 4usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._dummy_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 12usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2>() - 4usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_dummy_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _dummy_pkey + ) + - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2::_pkey"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_2, + _pkey + ) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { @@ -5331,131 +3906,68 @@ pub struct __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3 { pub _type: __u32, pub _flags: __u32, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 16usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._data) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._type) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 24usize, - "Size of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._trapno) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_lsb) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_pkey) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._perf) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf" - ); -} -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_5() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_5> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_5>(), - 32usize, - "Size of __sifields__bindgen_ty_5" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_5>(), - 8usize, - "Alignment of __sifields__bindgen_ty_5" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_5::_addr" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_data"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _data + ) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_type"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _type + ) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3::_flags"][::std::mem::offset_of!( + __sifields__bindgen_ty_5__bindgen_ty_1__bindgen_ty_3, + _flags + ) - 12usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::size_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 24usize]; + ["Alignment of __sifields__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::align_of::<__sifields__bindgen_ty_5__bindgen_ty_1>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_trapno"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _trapno) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_lsb"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_lsb) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_bnd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_bnd) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_addr_pkey"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _addr_pkey) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_5__bindgen_ty_1::_perf"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5__bindgen_ty_1, _perf) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_5"] + [::std::mem::size_of::<__sifields__bindgen_ty_5>() - 32usize]; + ["Alignment of __sifields__bindgen_ty_5"] + [::std::mem::align_of::<__sifields__bindgen_ty_5>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_5::_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_5, _addr) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_6 { pub _band: ::std::os::raw::c_long, pub _fd: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_6() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_6> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_6>(), - 16usize, - "Size of __sifields__bindgen_ty_6" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_6>(), - 8usize, - "Alignment of __sifields__bindgen_ty_6" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._band) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_6::_band" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fd) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_6::_fd" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_6"] + [::std::mem::size_of::<__sifields__bindgen_ty_6>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_6"] + [::std::mem::align_of::<__sifields__bindgen_ty_6>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_6::_band"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _band) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_6::_fd"] + [::std::mem::offset_of!(__sifields__bindgen_ty_6, _fd) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sifields__bindgen_ty_7 { @@ -5463,87 +3975,34 @@ pub struct __sifields__bindgen_ty_7 { pub _syscall: ::std::os::raw::c_int, pub _arch: ::std::os::raw::c_uint, } -#[test] -fn bindgen_test_layout___sifields__bindgen_ty_7() { - const UNINIT: ::std::mem::MaybeUninit<__sifields__bindgen_ty_7> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields__bindgen_ty_7>(), - 16usize, - "Size of __sifields__bindgen_ty_7" - ); - assert_eq!( - ::std::mem::align_of::<__sifields__bindgen_ty_7>(), - 8usize, - "Alignment of __sifields__bindgen_ty_7" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields__bindgen_ty_7::_call_addr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, - 8usize, - "Offset of field: __sifields__bindgen_ty_7::_syscall" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, - 12usize, - "Offset of field: __sifields__bindgen_ty_7::_arch" - ); -} -#[test] -fn bindgen_test_layout___sifields() { - const UNINIT: ::std::mem::MaybeUninit<__sifields> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sifields>(), - 32usize, - "Size of __sifields" - ); - assert_eq!( - ::std::mem::align_of::<__sifields>(), - 8usize, - "Alignment of __sifields" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_kill" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_timer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_rt" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigchld" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigfault" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigpoll" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, - 0usize, - "Offset of field: __sifields::_sigsys" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields__bindgen_ty_7"] + [::std::mem::size_of::<__sifields__bindgen_ty_7>() - 16usize]; + ["Alignment of __sifields__bindgen_ty_7"] + [::std::mem::align_of::<__sifields__bindgen_ty_7>() - 8usize]; + ["Offset of field: __sifields__bindgen_ty_7::_call_addr"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _call_addr) - 0usize]; + ["Offset of field: __sifields__bindgen_ty_7::_syscall"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _syscall) - 8usize]; + ["Offset of field: __sifields__bindgen_ty_7::_arch"] + [::std::mem::offset_of!(__sifields__bindgen_ty_7, _arch) - 12usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sifields"][::std::mem::size_of::<__sifields>() - 32usize]; + ["Alignment of __sifields"][::std::mem::align_of::<__sifields>() - 8usize]; + ["Offset of field: __sifields::_kill"][::std::mem::offset_of!(__sifields, _kill) - 0usize]; + ["Offset of field: __sifields::_timer"][::std::mem::offset_of!(__sifields, _timer) - 0usize]; + ["Offset of field: __sifields::_rt"][::std::mem::offset_of!(__sifields, _rt) - 0usize]; + ["Offset of field: __sifields::_sigchld"] + [::std::mem::offset_of!(__sifields, _sigchld) - 0usize]; + ["Offset of field: __sifields::_sigfault"] + [::std::mem::offset_of!(__sifields, _sigfault) - 0usize]; + ["Offset of field: __sifields::_sigpoll"] + [::std::mem::offset_of!(__sifields, _sigpoll) - 0usize]; + ["Offset of field: __sifields::_sigsys"][::std::mem::offset_of!(__sifields, _sigsys) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct siginfo { @@ -5563,76 +4022,34 @@ pub struct siginfo__bindgen_ty_1__bindgen_ty_1 { pub si_code: ::std::os::raw::c_int, pub _sifields: __sifields, } -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - "Size of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of siginfo__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, - 4usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, - 8usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, - 16usize, - "Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields" - ); -} -#[test] -fn bindgen_test_layout_siginfo__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of siginfo__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._si_pad) as usize - ptr as usize }, - 0usize, - "Offset of field: siginfo__bindgen_ty_1::_si_pad" - ); -} -#[test] -fn bindgen_test_layout_siginfo() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - "Size of siginfo" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of siginfo" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 48usize]; + ["Alignment of siginfo__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_signo"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_signo) - 0usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_errno"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_errno) - 4usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::si_code"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, si_code) - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1__bindgen_ty_1::_sifields"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1__bindgen_ty_1, _sifields) - 16usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo__bindgen_ty_1"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo__bindgen_ty_1::_si_pad"] + [::std::mem::offset_of!(siginfo__bindgen_ty_1, _si_pad) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo"][::std::mem::align_of::() - 8usize]; +}; pub type siginfo_t = siginfo; #[repr(C)] #[derive(Copy, Clone)] @@ -5655,98 +4072,41 @@ pub struct sigevent__bindgen_ty_1__bindgen_ty_1 { pub _function: ::std::option::Option, pub _attribute: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - "Size of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigevent__bindgen_ty_1__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._function) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._attribute) as usize - ptr as usize }, - 8usize, - "Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute" - ); -} -#[test] -fn bindgen_test_layout_sigevent__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - "Size of sigevent__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigevent__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_pad" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._tid) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_thread) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent__bindgen_ty_1::_sigev_thread" - ); -} -#[test] -fn bindgen_test_layout_sigevent() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - "Size of sigevent" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigevent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_value) as usize - ptr as usize }, - 0usize, - "Offset of field: sigevent::sigev_value" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_signo) as usize - ptr as usize }, - 8usize, - "Offset of field: sigevent::sigev_signo" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sigev_notify) as usize - ptr as usize }, - 12usize, - "Offset of field: sigevent::sigev_notify" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigev_un) as usize - ptr as usize }, - 16usize, - "Offset of field: sigevent::_sigev_un" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of sigevent__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_function"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _function) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1__bindgen_ty_1::_attribute"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1__bindgen_ty_1, _attribute) - 8usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent__bindgen_ty_1"][::std::mem::size_of::() - 48usize]; + ["Alignment of sigevent__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigevent__bindgen_ty_1::_pad"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _pad) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_tid"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _tid) - 0usize]; + ["Offset of field: sigevent__bindgen_ty_1::_sigev_thread"] + [::std::mem::offset_of!(sigevent__bindgen_ty_1, _sigev_thread) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent"][::std::mem::size_of::() - 64usize]; + ["Alignment of sigevent"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigevent::sigev_value"] + [::std::mem::offset_of!(sigevent, sigev_value) - 0usize]; + ["Offset of field: sigevent::sigev_signo"] + [::std::mem::offset_of!(sigevent, sigev_signo) - 8usize]; + ["Offset of field: sigevent::sigev_notify"] + [::std::mem::offset_of!(sigevent, sigev_notify) - 12usize]; + ["Offset of field: sigevent::_sigev_un"][::std::mem::offset_of!(sigevent, _sigev_un) - 16usize]; +}; pub type sigevent_t = sigevent; pub type sig_atomic_t = ::std::os::raw::c_int; pub type sig_t = __sighandler_t; @@ -5772,62 +4132,25 @@ pub union sigaction__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigaction__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of sigaction" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 16usize, - "Offset of field: sigaction::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 24usize, - "Offset of field: sigaction::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigaction__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction"][::std::mem::size_of::() - 32usize]; + ["Alignment of sigaction"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction::sa_flags"][::std::mem::offset_of!(sigaction, sa_flags) - 0usize]; + ["Offset of field: sigaction::sa_mask"][::std::mem::offset_of!(sigaction, sa_mask) - 16usize]; + ["Offset of field: sigaction::sa_restorer"] + [::std::mem::offset_of!(sigaction, sa_restorer) - 24usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct sigaction64 { @@ -5848,62 +4171,28 @@ pub union sigaction64__bindgen_ty_1 { ), >, } -#[test] -fn bindgen_test_layout_sigaction64__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of sigaction64__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction64__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_handler) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_handler" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_sigaction) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64__bindgen_ty_1::sa_sigaction" - ); -} -#[test] -fn bindgen_test_layout_sigaction64() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - "Size of sigaction64" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of sigaction64" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: sigaction64::sa_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_mask) as usize - ptr as usize }, - 16usize, - "Offset of field: sigaction64::sa_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sa_restorer) as usize - ptr as usize }, - 24usize, - "Offset of field: sigaction64::sa_restorer" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of sigaction64__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_handler"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_handler) - 0usize]; + ["Offset of field: sigaction64__bindgen_ty_1::sa_sigaction"] + [::std::mem::offset_of!(sigaction64__bindgen_ty_1, sa_sigaction) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction64"][::std::mem::size_of::() - 32usize]; + ["Alignment of sigaction64"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction64::sa_flags"] + [::std::mem::offset_of!(sigaction64, sa_flags) - 0usize]; + ["Offset of field: sigaction64::sa_mask"] + [::std::mem::offset_of!(sigaction64, sa_mask) - 16usize]; + ["Offset of field: sigaction64::sa_restorer"] + [::std::mem::offset_of!(sigaction64, sa_restorer) - 24usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_fpregs_struct { @@ -5919,76 +4208,33 @@ pub struct user_fpregs_struct { pub xmm_space: [::std::os::raw::c_uint; 64usize], pub padding: [::std::os::raw::c_uint; 24usize], } -#[test] -fn bindgen_test_layout_user_fpregs_struct() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 512usize, - "Size of user_fpregs_struct" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of user_fpregs_struct" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, - 0usize, - "Offset of field: user_fpregs_struct::cwd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, - 2usize, - "Offset of field: user_fpregs_struct::swd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ftw) as usize - ptr as usize }, - 4usize, - "Offset of field: user_fpregs_struct::ftw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, - 6usize, - "Offset of field: user_fpregs_struct::fop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, - 8usize, - "Offset of field: user_fpregs_struct::rip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, - 16usize, - "Offset of field: user_fpregs_struct::rdp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 24usize, - "Offset of field: user_fpregs_struct::mxcsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcr_mask) as usize - ptr as usize }, - 28usize, - "Offset of field: user_fpregs_struct::mxcr_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).st_space) as usize - ptr as usize }, - 32usize, - "Offset of field: user_fpregs_struct::st_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_space) as usize - ptr as usize }, - 160usize, - "Offset of field: user_fpregs_struct::xmm_space" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 416usize, - "Offset of field: user_fpregs_struct::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_fpregs_struct"][::std::mem::size_of::() - 512usize]; + ["Alignment of user_fpregs_struct"][::std::mem::align_of::() - 8usize]; + ["Offset of field: user_fpregs_struct::cwd"] + [::std::mem::offset_of!(user_fpregs_struct, cwd) - 0usize]; + ["Offset of field: user_fpregs_struct::swd"] + [::std::mem::offset_of!(user_fpregs_struct, swd) - 2usize]; + ["Offset of field: user_fpregs_struct::ftw"] + [::std::mem::offset_of!(user_fpregs_struct, ftw) - 4usize]; + ["Offset of field: user_fpregs_struct::fop"] + [::std::mem::offset_of!(user_fpregs_struct, fop) - 6usize]; + ["Offset of field: user_fpregs_struct::rip"] + [::std::mem::offset_of!(user_fpregs_struct, rip) - 8usize]; + ["Offset of field: user_fpregs_struct::rdp"] + [::std::mem::offset_of!(user_fpregs_struct, rdp) - 16usize]; + ["Offset of field: user_fpregs_struct::mxcsr"] + [::std::mem::offset_of!(user_fpregs_struct, mxcsr) - 24usize]; + ["Offset of field: user_fpregs_struct::mxcr_mask"] + [::std::mem::offset_of!(user_fpregs_struct, mxcr_mask) - 28usize]; + ["Offset of field: user_fpregs_struct::st_space"] + [::std::mem::offset_of!(user_fpregs_struct, st_space) - 32usize]; + ["Offset of field: user_fpregs_struct::xmm_space"] + [::std::mem::offset_of!(user_fpregs_struct, xmm_space) - 160usize]; + ["Offset of field: user_fpregs_struct::padding"] + [::std::mem::offset_of!(user_fpregs_struct, padding) - 416usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user_regs_struct { @@ -6020,156 +4266,65 @@ pub struct user_regs_struct { pub fs: ::std::os::raw::c_ulong, pub gs: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout_user_regs_struct() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 216usize, - "Size of user_regs_struct" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of user_regs_struct" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r15) as usize - ptr as usize }, - 0usize, - "Offset of field: user_regs_struct::r15" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r14) as usize - ptr as usize }, - 8usize, - "Offset of field: user_regs_struct::r14" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r13) as usize - ptr as usize }, - 16usize, - "Offset of field: user_regs_struct::r13" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r12) as usize - ptr as usize }, - 24usize, - "Offset of field: user_regs_struct::r12" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbp) as usize - ptr as usize }, - 32usize, - "Offset of field: user_regs_struct::rbp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rbx) as usize - ptr as usize }, - 40usize, - "Offset of field: user_regs_struct::rbx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r11) as usize - ptr as usize }, - 48usize, - "Offset of field: user_regs_struct::r11" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r10) as usize - ptr as usize }, - 56usize, - "Offset of field: user_regs_struct::r10" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r9) as usize - ptr as usize }, - 64usize, - "Offset of field: user_regs_struct::r9" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).r8) as usize - ptr as usize }, - 72usize, - "Offset of field: user_regs_struct::r8" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rax) as usize - ptr as usize }, - 80usize, - "Offset of field: user_regs_struct::rax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcx) as usize - ptr as usize }, - 88usize, - "Offset of field: user_regs_struct::rcx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdx) as usize - ptr as usize }, - 96usize, - "Offset of field: user_regs_struct::rdx" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsi) as usize - ptr as usize }, - 104usize, - "Offset of field: user_regs_struct::rsi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdi) as usize - ptr as usize }, - 112usize, - "Offset of field: user_regs_struct::rdi" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).orig_rax) as usize - ptr as usize }, - 120usize, - "Offset of field: user_regs_struct::orig_rax" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, - 128usize, - "Offset of field: user_regs_struct::rip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs) as usize - ptr as usize }, - 136usize, - "Offset of field: user_regs_struct::cs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, - 144usize, - "Offset of field: user_regs_struct::eflags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rsp) as usize - ptr as usize }, - 152usize, - "Offset of field: user_regs_struct::rsp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ss) as usize - ptr as usize }, - 160usize, - "Offset of field: user_regs_struct::ss" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs_base) as usize - ptr as usize }, - 168usize, - "Offset of field: user_regs_struct::fs_base" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs_base) as usize - ptr as usize }, - 176usize, - "Offset of field: user_regs_struct::gs_base" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ds) as usize - ptr as usize }, - 184usize, - "Offset of field: user_regs_struct::ds" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).es) as usize - ptr as usize }, - 192usize, - "Offset of field: user_regs_struct::es" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fs) as usize - ptr as usize }, - 200usize, - "Offset of field: user_regs_struct::fs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gs) as usize - ptr as usize }, - 208usize, - "Offset of field: user_regs_struct::gs" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user_regs_struct"][::std::mem::size_of::() - 216usize]; + ["Alignment of user_regs_struct"][::std::mem::align_of::() - 8usize]; + ["Offset of field: user_regs_struct::r15"] + [::std::mem::offset_of!(user_regs_struct, r15) - 0usize]; + ["Offset of field: user_regs_struct::r14"] + [::std::mem::offset_of!(user_regs_struct, r14) - 8usize]; + ["Offset of field: user_regs_struct::r13"] + [::std::mem::offset_of!(user_regs_struct, r13) - 16usize]; + ["Offset of field: user_regs_struct::r12"] + [::std::mem::offset_of!(user_regs_struct, r12) - 24usize]; + ["Offset of field: user_regs_struct::rbp"] + [::std::mem::offset_of!(user_regs_struct, rbp) - 32usize]; + ["Offset of field: user_regs_struct::rbx"] + [::std::mem::offset_of!(user_regs_struct, rbx) - 40usize]; + ["Offset of field: user_regs_struct::r11"] + [::std::mem::offset_of!(user_regs_struct, r11) - 48usize]; + ["Offset of field: user_regs_struct::r10"] + [::std::mem::offset_of!(user_regs_struct, r10) - 56usize]; + ["Offset of field: user_regs_struct::r9"] + [::std::mem::offset_of!(user_regs_struct, r9) - 64usize]; + ["Offset of field: user_regs_struct::r8"] + [::std::mem::offset_of!(user_regs_struct, r8) - 72usize]; + ["Offset of field: user_regs_struct::rax"] + [::std::mem::offset_of!(user_regs_struct, rax) - 80usize]; + ["Offset of field: user_regs_struct::rcx"] + [::std::mem::offset_of!(user_regs_struct, rcx) - 88usize]; + ["Offset of field: user_regs_struct::rdx"] + [::std::mem::offset_of!(user_regs_struct, rdx) - 96usize]; + ["Offset of field: user_regs_struct::rsi"] + [::std::mem::offset_of!(user_regs_struct, rsi) - 104usize]; + ["Offset of field: user_regs_struct::rdi"] + [::std::mem::offset_of!(user_regs_struct, rdi) - 112usize]; + ["Offset of field: user_regs_struct::orig_rax"] + [::std::mem::offset_of!(user_regs_struct, orig_rax) - 120usize]; + ["Offset of field: user_regs_struct::rip"] + [::std::mem::offset_of!(user_regs_struct, rip) - 128usize]; + ["Offset of field: user_regs_struct::cs"] + [::std::mem::offset_of!(user_regs_struct, cs) - 136usize]; + ["Offset of field: user_regs_struct::eflags"] + [::std::mem::offset_of!(user_regs_struct, eflags) - 144usize]; + ["Offset of field: user_regs_struct::rsp"] + [::std::mem::offset_of!(user_regs_struct, rsp) - 152usize]; + ["Offset of field: user_regs_struct::ss"] + [::std::mem::offset_of!(user_regs_struct, ss) - 160usize]; + ["Offset of field: user_regs_struct::fs_base"] + [::std::mem::offset_of!(user_regs_struct, fs_base) - 168usize]; + ["Offset of field: user_regs_struct::gs_base"] + [::std::mem::offset_of!(user_regs_struct, gs_base) - 176usize]; + ["Offset of field: user_regs_struct::ds"] + [::std::mem::offset_of!(user_regs_struct, ds) - 184usize]; + ["Offset of field: user_regs_struct::es"] + [::std::mem::offset_of!(user_regs_struct, es) - 192usize]; + ["Offset of field: user_regs_struct::fs"] + [::std::mem::offset_of!(user_regs_struct, fs) - 200usize]; + ["Offset of field: user_regs_struct::gs"] + [::std::mem::offset_of!(user_regs_struct, gs) - 208usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct user { @@ -6193,108 +4348,31 @@ pub struct user { pub error_code: ::std::os::raw::c_ulong, pub fault_address: ::std::os::raw::c_ulong, } -#[test] -fn bindgen_test_layout_user() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 928usize, "Size of user"); - assert_eq!(::std::mem::align_of::(), 8usize, "Alignment of user"); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, - 0usize, - "Offset of field: user::regs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_fpvalid) as usize - ptr as usize }, - 216usize, - "Offset of field: user::u_fpvalid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pad0) as usize - ptr as usize }, - 220usize, - "Offset of field: user::pad0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).i387) as usize - ptr as usize }, - 224usize, - "Offset of field: user::i387" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_tsize) as usize - ptr as usize }, - 736usize, - "Offset of field: user::u_tsize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_dsize) as usize - ptr as usize }, - 744usize, - "Offset of field: user::u_dsize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_ssize) as usize - ptr as usize }, - 752usize, - "Offset of field: user::u_ssize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_code) as usize - ptr as usize }, - 760usize, - "Offset of field: user::start_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_stack) as usize - ptr as usize }, - 768usize, - "Offset of field: user::start_stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).signal) as usize - ptr as usize }, - 776usize, - "Offset of field: user::signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reserved) as usize - ptr as usize }, - 784usize, - "Offset of field: user::reserved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pad1) as usize - ptr as usize }, - 788usize, - "Offset of field: user::pad1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_ar0) as usize - ptr as usize }, - 792usize, - "Offset of field: user::u_ar0" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_fpstate) as usize - ptr as usize }, - 800usize, - "Offset of field: user::u_fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).magic) as usize - ptr as usize }, - 808usize, - "Offset of field: user::magic" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_comm) as usize - ptr as usize }, - 816usize, - "Offset of field: user::u_comm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u_debugreg) as usize - ptr as usize }, - 848usize, - "Offset of field: user::u_debugreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, - 912usize, - "Offset of field: user::error_code" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fault_address) as usize - ptr as usize }, - 920usize, - "Offset of field: user::fault_address" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of user"][::std::mem::size_of::() - 928usize]; + ["Alignment of user"][::std::mem::align_of::() - 8usize]; + ["Offset of field: user::regs"][::std::mem::offset_of!(user, regs) - 0usize]; + ["Offset of field: user::u_fpvalid"][::std::mem::offset_of!(user, u_fpvalid) - 216usize]; + ["Offset of field: user::pad0"][::std::mem::offset_of!(user, pad0) - 220usize]; + ["Offset of field: user::i387"][::std::mem::offset_of!(user, i387) - 224usize]; + ["Offset of field: user::u_tsize"][::std::mem::offset_of!(user, u_tsize) - 736usize]; + ["Offset of field: user::u_dsize"][::std::mem::offset_of!(user, u_dsize) - 744usize]; + ["Offset of field: user::u_ssize"][::std::mem::offset_of!(user, u_ssize) - 752usize]; + ["Offset of field: user::start_code"][::std::mem::offset_of!(user, start_code) - 760usize]; + ["Offset of field: user::start_stack"][::std::mem::offset_of!(user, start_stack) - 768usize]; + ["Offset of field: user::signal"][::std::mem::offset_of!(user, signal) - 776usize]; + ["Offset of field: user::reserved"][::std::mem::offset_of!(user, reserved) - 784usize]; + ["Offset of field: user::pad1"][::std::mem::offset_of!(user, pad1) - 788usize]; + ["Offset of field: user::u_ar0"][::std::mem::offset_of!(user, u_ar0) - 792usize]; + ["Offset of field: user::u_fpstate"][::std::mem::offset_of!(user, u_fpstate) - 800usize]; + ["Offset of field: user::magic"][::std::mem::offset_of!(user, magic) - 808usize]; + ["Offset of field: user::u_comm"][::std::mem::offset_of!(user, u_comm) - 816usize]; + ["Offset of field: user::u_debugreg"][::std::mem::offset_of!(user, u_debugreg) - 848usize]; + ["Offset of field: user::error_code"][::std::mem::offset_of!(user, error_code) - 912usize]; + ["Offset of field: user::fault_address"] + [::std::mem::offset_of!(user, fault_address) - 920usize]; +}; pub const REG_R8: _bindgen_ty_22 = 0; pub const REG_R9: _bindgen_ty_22 = 1; pub const REG_R10: _bindgen_ty_22 = 2; @@ -6329,61 +4407,29 @@ pub struct _libc_fpxreg { pub exponent: ::std::os::raw::c_ushort, pub padding: [::std::os::raw::c_ushort; 3usize], } -#[test] -fn bindgen_test_layout__libc_fpxreg() { - const UNINIT: ::std::mem::MaybeUninit<_libc_fpxreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_libc_fpxreg>(), - 16usize, - "Size of _libc_fpxreg" - ); - assert_eq!( - ::std::mem::align_of::<_libc_fpxreg>(), - 2usize, - "Alignment of _libc_fpxreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).significand) as usize - ptr as usize }, - 0usize, - "Offset of field: _libc_fpxreg::significand" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exponent) as usize - ptr as usize }, - 8usize, - "Offset of field: _libc_fpxreg::exponent" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 10usize, - "Offset of field: _libc_fpxreg::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _libc_fpxreg"][::std::mem::size_of::<_libc_fpxreg>() - 16usize]; + ["Alignment of _libc_fpxreg"][::std::mem::align_of::<_libc_fpxreg>() - 2usize]; + ["Offset of field: _libc_fpxreg::significand"] + [::std::mem::offset_of!(_libc_fpxreg, significand) - 0usize]; + ["Offset of field: _libc_fpxreg::exponent"] + [::std::mem::offset_of!(_libc_fpxreg, exponent) - 8usize]; + ["Offset of field: _libc_fpxreg::padding"] + [::std::mem::offset_of!(_libc_fpxreg, padding) - 10usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _libc_xmmreg { pub element: [u32; 4usize], } -#[test] -fn bindgen_test_layout__libc_xmmreg() { - const UNINIT: ::std::mem::MaybeUninit<_libc_xmmreg> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_libc_xmmreg>(), - 16usize, - "Size of _libc_xmmreg" - ); - assert_eq!( - ::std::mem::align_of::<_libc_xmmreg>(), - 4usize, - "Alignment of _libc_xmmreg" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).element) as usize - ptr as usize }, - 0usize, - "Offset of field: _libc_xmmreg::element" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _libc_xmmreg"][::std::mem::size_of::<_libc_xmmreg>() - 16usize]; + ["Alignment of _libc_xmmreg"][::std::mem::align_of::<_libc_xmmreg>() - 4usize]; + ["Offset of field: _libc_xmmreg::element"] + [::std::mem::offset_of!(_libc_xmmreg, element) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct _libc_fpstate { @@ -6399,76 +4445,26 @@ pub struct _libc_fpstate { pub _xmm: [_libc_xmmreg; 16usize], pub padding: [u32; 24usize], } -#[test] -fn bindgen_test_layout__libc_fpstate() { - const UNINIT: ::std::mem::MaybeUninit<_libc_fpstate> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_libc_fpstate>(), - 512usize, - "Size of _libc_fpstate" - ); - assert_eq!( - ::std::mem::align_of::<_libc_fpstate>(), - 8usize, - "Alignment of _libc_fpstate" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cwd) as usize - ptr as usize }, - 0usize, - "Offset of field: _libc_fpstate::cwd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).swd) as usize - ptr as usize }, - 2usize, - "Offset of field: _libc_fpstate::swd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ftw) as usize - ptr as usize }, - 4usize, - "Offset of field: _libc_fpstate::ftw" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fop) as usize - ptr as usize }, - 6usize, - "Offset of field: _libc_fpstate::fop" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rip) as usize - ptr as usize }, - 8usize, - "Offset of field: _libc_fpstate::rip" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rdp) as usize - ptr as usize }, - 16usize, - "Offset of field: _libc_fpstate::rdp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 24usize, - "Offset of field: _libc_fpstate::mxcsr" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcr_mask) as usize - ptr as usize }, - 28usize, - "Offset of field: _libc_fpstate::mxcr_mask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._st) as usize - ptr as usize }, - 32usize, - "Offset of field: _libc_fpstate::_st" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._xmm) as usize - ptr as usize }, - 160usize, - "Offset of field: _libc_fpstate::_xmm" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, - 416usize, - "Offset of field: _libc_fpstate::padding" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _libc_fpstate"][::std::mem::size_of::<_libc_fpstate>() - 512usize]; + ["Alignment of _libc_fpstate"][::std::mem::align_of::<_libc_fpstate>() - 8usize]; + ["Offset of field: _libc_fpstate::cwd"][::std::mem::offset_of!(_libc_fpstate, cwd) - 0usize]; + ["Offset of field: _libc_fpstate::swd"][::std::mem::offset_of!(_libc_fpstate, swd) - 2usize]; + ["Offset of field: _libc_fpstate::ftw"][::std::mem::offset_of!(_libc_fpstate, ftw) - 4usize]; + ["Offset of field: _libc_fpstate::fop"][::std::mem::offset_of!(_libc_fpstate, fop) - 6usize]; + ["Offset of field: _libc_fpstate::rip"][::std::mem::offset_of!(_libc_fpstate, rip) - 8usize]; + ["Offset of field: _libc_fpstate::rdp"][::std::mem::offset_of!(_libc_fpstate, rdp) - 16usize]; + ["Offset of field: _libc_fpstate::mxcsr"] + [::std::mem::offset_of!(_libc_fpstate, mxcsr) - 24usize]; + ["Offset of field: _libc_fpstate::mxcr_mask"] + [::std::mem::offset_of!(_libc_fpstate, mxcr_mask) - 28usize]; + ["Offset of field: _libc_fpstate::_st"][::std::mem::offset_of!(_libc_fpstate, _st) - 32usize]; + ["Offset of field: _libc_fpstate::_xmm"] + [::std::mem::offset_of!(_libc_fpstate, _xmm) - 160usize]; + ["Offset of field: _libc_fpstate::padding"] + [::std::mem::offset_of!(_libc_fpstate, padding) - 416usize]; +}; pub type fpregset_t = *mut _libc_fpstate; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6477,36 +4473,15 @@ pub struct mcontext_t { pub fpregs: fpregset_t, pub __reserved1: [::std::os::raw::c_ulong; 8usize], } -#[test] -fn bindgen_test_layout_mcontext_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 256usize, - "Size of mcontext_t" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of mcontext_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gregs) as usize - ptr as usize }, - 0usize, - "Offset of field: mcontext_t::gregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, - 184usize, - "Offset of field: mcontext_t::fpregs" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved1) as usize - ptr as usize }, - 192usize, - "Offset of field: mcontext_t::__reserved1" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of mcontext_t"][::std::mem::size_of::() - 256usize]; + ["Alignment of mcontext_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: mcontext_t::gregs"][::std::mem::offset_of!(mcontext_t, gregs) - 0usize]; + ["Offset of field: mcontext_t::fpregs"][::std::mem::offset_of!(mcontext_t, fpregs) - 184usize]; + ["Offset of field: mcontext_t::__reserved1"] + [::std::mem::offset_of!(mcontext_t, __reserved1) - 192usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct ucontext { @@ -6523,265 +4498,221 @@ pub union ucontext__bindgen_ty_1 { pub uc_sigmask: sigset_t, pub uc_sigmask64: sigset64_t, } -#[test] -fn bindgen_test_layout_ucontext__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - "Size of ucontext__bindgen_ty_1" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of ucontext__bindgen_ty_1" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1::uc_sigmask" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_sigmask64) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext__bindgen_ty_1::uc_sigmask64" - ); -} -#[test] -fn bindgen_test_layout_ucontext() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 816usize, - "Size of ucontext" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of ucontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_flags) as usize - ptr as usize }, - 0usize, - "Offset of field: ucontext::uc_flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_link) as usize - ptr as usize }, - 8usize, - "Offset of field: ucontext::uc_link" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_stack) as usize - ptr as usize }, - 16usize, - "Offset of field: ucontext::uc_stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uc_mcontext) as usize - ptr as usize }, - 40usize, - "Offset of field: ucontext::uc_mcontext" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__fpregs_mem) as usize - ptr as usize }, - 304usize, - "Offset of field: ucontext::__fpregs_mem" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; + ["Alignment of ucontext__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: ucontext__bindgen_ty_1::uc_sigmask"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1, uc_sigmask) - 0usize]; + ["Offset of field: ucontext__bindgen_ty_1::uc_sigmask64"] + [::std::mem::offset_of!(ucontext__bindgen_ty_1, uc_sigmask64) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ucontext"][::std::mem::size_of::() - 816usize]; + ["Alignment of ucontext"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ucontext::uc_flags"][::std::mem::offset_of!(ucontext, uc_flags) - 0usize]; + ["Offset of field: ucontext::uc_link"][::std::mem::offset_of!(ucontext, uc_link) - 8usize]; + ["Offset of field: ucontext::uc_stack"][::std::mem::offset_of!(ucontext, uc_stack) - 16usize]; + ["Offset of field: ucontext::uc_mcontext"] + [::std::mem::offset_of!(ucontext, uc_mcontext) - 40usize]; + ["Offset of field: ucontext::__fpregs_mem"] + [::std::mem::offset_of!(ucontext, __fpregs_mem) - 304usize]; +}; pub type ucontext_t = ucontext; -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmin() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn __libc_current_sigrtmax() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static sys_siglist: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub static sys_signame: [*const ::std::os::raw::c_char; 65usize]; } -extern "C" { +unsafe extern "C" { pub fn sigaction( __signal: ::std::os::raw::c_int, __new_action: *const sigaction, __old_action: *mut sigaction, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaction64( __signal: ::std::os::raw::c_int, __new_action: *const sigaction64, __old_action: *mut sigaction64, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn siginterrupt( __signal: ::std::os::raw::c_int, __flag: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn signal(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn sigaddset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaddset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset( __set: *mut sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigdelset64( __set: *mut sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigemptyset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigfillset64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember( __set: *const sigset_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigismember64( __set: *const sigset64_t, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending(__set: *mut sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpending64(__set: *mut sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask( __how: ::std::os::raw::c_int, __new_set: *const sigset_t, __old_set: *mut sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigprocmask64( __how: ::std::os::raw::c_int, __new_set: *const sigset64_t, __old_set: *mut sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend(__mask: *const sigset_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigsuspend64(__mask: *const sigset64_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait( __set: *const sigset_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwait64( __set: *const sigset64_t, __signal: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sighold(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigignore(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigpause(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigrelse(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigset(__signal: ::std::os::raw::c_int, __handler: sighandler_t) -> sighandler_t; } -extern "C" { +unsafe extern "C" { pub fn raise(__signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn kill(__pid: pid_t, __signal: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn killpg( __pgrp: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn tgkill( __tgid: ::std::os::raw::c_int, __tid: ::std::os::raw::c_int, __signal: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigaltstack( __new_signal_stack: *const stack_t, __old_signal_stack: *mut stack_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn psiginfo(__info: *const siginfo_t, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn psignal(__signal: ::std::os::raw::c_int, __msg: *const ::std::os::raw::c_char); } -extern "C" { +unsafe extern "C" { pub fn sigqueue( __pid: pid_t, __signal: ::std::os::raw::c_int, __value: sigval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait( __set: *const sigset_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigtimedwait64( __set: *const sigset64_t, __info: *mut siginfo_t, __timeout: *const timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo(__set: *const sigset_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sigwaitinfo64(__set: *const sigset64_t, __info: *mut siginfo_t) -> ::std::os::raw::c_int; } @@ -6791,36 +4722,26 @@ pub type fd_mask = ::std::os::raw::c_ulong; pub struct fd_set { pub fds_bits: [fd_mask; 16usize], } -#[test] -fn bindgen_test_layout_fd_set() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 128usize, "Size of fd_set"); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of fd_set" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - "Offset of field: fd_set::fds_bits" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of fd_set"][::std::mem::size_of::() - 128usize]; + ["Alignment of fd_set"][::std::mem::align_of::() - 8usize]; + ["Offset of field: fd_set::fds_bits"][::std::mem::offset_of!(fd_set, fds_bits) - 0usize]; +}; +unsafe extern "C" { pub fn __FD_CLR_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_SET_chk(arg1: ::std::os::raw::c_int, arg2: *mut fd_set, arg3: usize); } -extern "C" { +unsafe extern "C" { pub fn __FD_ISSET_chk( arg1: ::std::os::raw::c_int, arg2: *const fd_set, arg3: usize, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn select( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6829,7 +4750,7 @@ extern "C" { __timeout: *mut timeval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6839,7 +4760,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn pselect64( __max_fd_plus_one: ::std::os::raw::c_int, __read_fds: *mut fd_set, @@ -6849,26 +4770,26 @@ extern "C" { __mask: *const sigset64_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn gettimeofday(__tv: *mut timeval, __tz: *mut timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn settimeofday(__tv: *const timeval, __tz: *const timezone) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn getitimer( __which: ::std::os::raw::c_int, __current_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn setitimer( __which: ::std::os::raw::c_int, __new_value: *const itimerval, __old_value: *mut itimerval, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn utimes( __path: *const ::std::os::raw::c_char, __times: *const timeval, @@ -6880,13 +4801,13 @@ pub struct __locale_t { _unused: [u8; 0], } pub type locale_t = *mut __locale_t; -extern "C" { +unsafe extern "C" { pub static mut tzname: [*mut ::std::os::raw::c_char; 0usize]; } -extern "C" { +unsafe extern "C" { pub static mut daylight: ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub static mut timezone: ::std::os::raw::c_long; } #[repr(C)] @@ -6904,118 +4825,72 @@ pub struct tm { pub tm_gmtoff: ::std::os::raw::c_long, pub tm_zone: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_tm() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!(::std::mem::size_of::(), 56usize, "Size of tm"); - assert_eq!(::std::mem::align_of::(), 8usize, "Alignment of tm"); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_sec) as usize - ptr as usize }, - 0usize, - "Offset of field: tm::tm_sec" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_min) as usize - ptr as usize }, - 4usize, - "Offset of field: tm::tm_min" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_hour) as usize - ptr as usize }, - 8usize, - "Offset of field: tm::tm_hour" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mday) as usize - ptr as usize }, - 12usize, - "Offset of field: tm::tm_mday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_mon) as usize - ptr as usize }, - 16usize, - "Offset of field: tm::tm_mon" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_year) as usize - ptr as usize }, - 20usize, - "Offset of field: tm::tm_year" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_wday) as usize - ptr as usize }, - 24usize, - "Offset of field: tm::tm_wday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_yday) as usize - ptr as usize }, - 28usize, - "Offset of field: tm::tm_yday" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_isdst) as usize - ptr as usize }, - 32usize, - "Offset of field: tm::tm_isdst" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_gmtoff) as usize - ptr as usize }, - 40usize, - "Offset of field: tm::tm_gmtoff" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tm_zone) as usize - ptr as usize }, - 48usize, - "Offset of field: tm::tm_zone" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of tm"][::std::mem::size_of::() - 56usize]; + ["Alignment of tm"][::std::mem::align_of::() - 8usize]; + ["Offset of field: tm::tm_sec"][::std::mem::offset_of!(tm, tm_sec) - 0usize]; + ["Offset of field: tm::tm_min"][::std::mem::offset_of!(tm, tm_min) - 4usize]; + ["Offset of field: tm::tm_hour"][::std::mem::offset_of!(tm, tm_hour) - 8usize]; + ["Offset of field: tm::tm_mday"][::std::mem::offset_of!(tm, tm_mday) - 12usize]; + ["Offset of field: tm::tm_mon"][::std::mem::offset_of!(tm, tm_mon) - 16usize]; + ["Offset of field: tm::tm_year"][::std::mem::offset_of!(tm, tm_year) - 20usize]; + ["Offset of field: tm::tm_wday"][::std::mem::offset_of!(tm, tm_wday) - 24usize]; + ["Offset of field: tm::tm_yday"][::std::mem::offset_of!(tm, tm_yday) - 28usize]; + ["Offset of field: tm::tm_isdst"][::std::mem::offset_of!(tm, tm_isdst) - 32usize]; + ["Offset of field: tm::tm_gmtoff"][::std::mem::offset_of!(tm, tm_gmtoff) - 40usize]; + ["Offset of field: tm::tm_zone"][::std::mem::offset_of!(tm, tm_zone) - 48usize]; +}; +unsafe extern "C" { pub fn time(__t: *mut time_t) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn nanosleep( __request: *const timespec, __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn asctime(__tm: *const tm) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn asctime_r( __tm: *const tm, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn difftime(__lhs: time_t, __rhs: time_t) -> f64; } -extern "C" { +unsafe extern "C" { pub fn mktime(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn localtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn localtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timelocal(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn gmtime(__t: *const time_t) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn gmtime_r(__t: *const time_t, __tm: *mut tm) -> *mut tm; } -extern "C" { +unsafe extern "C" { pub fn timegm(__tm: *mut tm) -> time_t; } -extern "C" { +unsafe extern "C" { pub fn strptime( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, __tm: *mut tm, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strptime_l( __s: *const ::std::os::raw::c_char, __fmt: *const ::std::os::raw::c_char, @@ -7023,7 +4898,7 @@ extern "C" { __l: locale_t, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn strftime( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -7031,7 +4906,7 @@ extern "C" { __tm: *const tm, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn strftime_l( __buf: *mut ::std::os::raw::c_char, __n: usize, @@ -7040,31 +4915,31 @@ extern "C" { __l: locale_t, ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn ctime(__t: *const time_t) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn ctime_r( __t: *const time_t, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } -extern "C" { +unsafe extern "C" { pub fn tzset(); } -extern "C" { +unsafe extern "C" { pub fn clock() -> clock_t; } -extern "C" { +unsafe extern "C" { pub fn clock_getcpuclockid(__pid: pid_t, __clock: *mut clockid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_getres(__clock: clockid_t, __resolution: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_gettime(__clock: clockid_t, __ts: *mut timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_nanosleep( __clock: clockid_t, __flags: ::std::os::raw::c_int, @@ -7072,20 +4947,20 @@ extern "C" { __remainder: *mut timespec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn clock_settime(__clock: clockid_t, __ts: *const timespec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_create( __clock: clockid_t, __event: *mut sigevent, __timer_ptr: *mut timer_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_delete(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_settime( __timer: timer_t, __flags: ::std::os::raw::c_int, @@ -7093,33 +4968,33 @@ extern "C" { __old_value: *mut itimerspec, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_gettime(_timer: timer_t, __ts: *mut itimerspec) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timer_getoverrun(__timer: timer_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_get( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn timespec_getres( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } pub type nfds_t = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn poll( __fds: *mut pollfd, __count: nfds_t, __timeout_ms: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll( __fds: *mut pollfd, __count: nfds_t, @@ -7127,7 +5002,7 @@ extern "C" { __mask: *const sigset_t, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn ppoll64( __fds: *mut pollfd, __count: nfds_t, @@ -7150,127 +5025,65 @@ pub struct clone_args { pub set_tid_size: __u64, pub cgroup: __u64, } -#[test] -fn bindgen_test_layout_clone_args() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - "Size of clone_args" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of clone_args" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 0usize, - "Offset of field: clone_args::flags" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pidfd) as usize - ptr as usize }, - 8usize, - "Offset of field: clone_args::pidfd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).child_tid) as usize - ptr as usize }, - 16usize, - "Offset of field: clone_args::child_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_tid) as usize - ptr as usize }, - 24usize, - "Offset of field: clone_args::parent_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exit_signal) as usize - ptr as usize }, - 32usize, - "Offset of field: clone_args::exit_signal" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack) as usize - ptr as usize }, - 40usize, - "Offset of field: clone_args::stack" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack_size) as usize - ptr as usize }, - 48usize, - "Offset of field: clone_args::stack_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tls) as usize - ptr as usize }, - 56usize, - "Offset of field: clone_args::tls" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid) as usize - ptr as usize }, - 64usize, - "Offset of field: clone_args::set_tid" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_tid_size) as usize - ptr as usize }, - 72usize, - "Offset of field: clone_args::set_tid_size" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cgroup) as usize - ptr as usize }, - 80usize, - "Offset of field: clone_args::cgroup" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of clone_args"][::std::mem::size_of::() - 88usize]; + ["Alignment of clone_args"][::std::mem::align_of::() - 8usize]; + ["Offset of field: clone_args::flags"][::std::mem::offset_of!(clone_args, flags) - 0usize]; + ["Offset of field: clone_args::pidfd"][::std::mem::offset_of!(clone_args, pidfd) - 8usize]; + ["Offset of field: clone_args::child_tid"] + [::std::mem::offset_of!(clone_args, child_tid) - 16usize]; + ["Offset of field: clone_args::parent_tid"] + [::std::mem::offset_of!(clone_args, parent_tid) - 24usize]; + ["Offset of field: clone_args::exit_signal"] + [::std::mem::offset_of!(clone_args, exit_signal) - 32usize]; + ["Offset of field: clone_args::stack"][::std::mem::offset_of!(clone_args, stack) - 40usize]; + ["Offset of field: clone_args::stack_size"] + [::std::mem::offset_of!(clone_args, stack_size) - 48usize]; + ["Offset of field: clone_args::tls"][::std::mem::offset_of!(clone_args, tls) - 56usize]; + ["Offset of field: clone_args::set_tid"][::std::mem::offset_of!(clone_args, set_tid) - 64usize]; + ["Offset of field: clone_args::set_tid_size"] + [::std::mem::offset_of!(clone_args, set_tid_size) - 72usize]; + ["Offset of field: clone_args::cgroup"][::std::mem::offset_of!(clone_args, cgroup) - 80usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct sched_param { pub sched_priority: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_sched_param() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - "Size of sched_param" - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - "Alignment of sched_param" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize }, - 0usize, - "Offset of field: sched_param::sched_priority" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sched_param"][::std::mem::size_of::() - 4usize]; + ["Alignment of sched_param"][::std::mem::align_of::() - 4usize]; + ["Offset of field: sched_param::sched_priority"] + [::std::mem::offset_of!(sched_param, sched_priority) - 0usize]; +}; +unsafe extern "C" { pub fn sched_setscheduler( __pid: pid_t, __policy: ::std::os::raw::c_int, __param: *const sched_param, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getscheduler(__pid: pid_t) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_yield() -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_max(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_get_priority_min(__policy: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_setparam(__pid: pid_t, __param: *const sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_getparam(__pid: pid_t, __param: *mut sched_param) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn sched_rr_get_interval(__pid: pid_t, __quantum: *mut timespec) -> ::std::os::raw::c_int; } pub const PTHREAD_MUTEX_NORMAL: _bindgen_ty_23 = 0; @@ -7291,44 +5104,25 @@ pub struct __pthread_cleanup_t { ::std::option::Option, pub __cleanup_arg: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___pthread_cleanup_t() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cleanup_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cleanup_t>(), - 24usize, - "Size of __pthread_cleanup_t" - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cleanup_t>(), - 8usize, - "Alignment of __pthread_cleanup_t" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_prev) as usize - ptr as usize }, - 0usize, - "Offset of field: __pthread_cleanup_t::__cleanup_prev" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_routine) as usize - ptr as usize }, - 8usize, - "Offset of field: __pthread_cleanup_t::__cleanup_routine" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_arg) as usize - ptr as usize }, - 16usize, - "Offset of field: __pthread_cleanup_t::__cleanup_arg" - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __pthread_cleanup_t"][::std::mem::size_of::<__pthread_cleanup_t>() - 24usize]; + ["Alignment of __pthread_cleanup_t"][::std::mem::align_of::<__pthread_cleanup_t>() - 8usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_prev"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_prev) - 0usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_routine"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_routine) - 8usize]; + ["Offset of field: __pthread_cleanup_t::__cleanup_arg"] + [::std::mem::offset_of!(__pthread_cleanup_t, __cleanup_arg) - 16usize]; +}; +unsafe extern "C" { pub fn __pthread_cleanup_push( c: *mut __pthread_cleanup_t, arg1: ::std::option::Option, arg2: *mut ::std::os::raw::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn __pthread_cleanup_pop(arg1: *mut __pthread_cleanup_t, arg2: ::std::os::raw::c_int); } #[doc = " Data associated with an ALooper fd that will be returned as the \"outData\"\n when that source has data ready."] @@ -7344,36 +5138,17 @@ pub struct android_poll_source { unsafe extern "C" fn(app: *mut android_app, source: *mut android_poll_source), >, } -#[test] -fn bindgen_test_layout_android_poll_source() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - "Size of android_poll_source" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_poll_source" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - "Offset of field: android_poll_source::id" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).app) as usize - ptr as usize }, - 8usize, - "Offset of field: android_poll_source::app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).process) as usize - ptr as usize }, - 16usize, - "Offset of field: android_poll_source::process" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_poll_source"][::std::mem::size_of::() - 24usize]; + ["Alignment of android_poll_source"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_poll_source::id"] + [::std::mem::offset_of!(android_poll_source, id) - 0usize]; + ["Offset of field: android_poll_source::app"] + [::std::mem::offset_of!(android_poll_source, app) - 8usize]; + ["Offset of field: android_poll_source::process"] + [::std::mem::offset_of!(android_poll_source, process) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct android_input_buffer { @@ -7390,51 +5165,23 @@ pub struct android_input_buffer { #[doc = " The size of the `keyEvents` buffer."] pub keyEventsBufferSize: u64, } -#[test] -fn bindgen_test_layout_android_input_buffer() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - "Size of android_input_buffer" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_input_buffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEvents) as usize - ptr as usize }, - 0usize, - "Offset of field: android_input_buffer::motionEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsCount) as usize - ptr as usize }, - 8usize, - "Offset of field: android_input_buffer::motionEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventsBufferSize) as usize - ptr as usize }, - 16usize, - "Offset of field: android_input_buffer::motionEventsBufferSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEvents) as usize - ptr as usize }, - 24usize, - "Offset of field: android_input_buffer::keyEvents" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsCount) as usize - ptr as usize }, - 32usize, - "Offset of field: android_input_buffer::keyEventsCount" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventsBufferSize) as usize - ptr as usize }, - 40usize, - "Offset of field: android_input_buffer::keyEventsBufferSize" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_input_buffer"][::std::mem::size_of::() - 48usize]; + ["Alignment of android_input_buffer"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_input_buffer::motionEvents"] + [::std::mem::offset_of!(android_input_buffer, motionEvents) - 0usize]; + ["Offset of field: android_input_buffer::motionEventsCount"] + [::std::mem::offset_of!(android_input_buffer, motionEventsCount) - 8usize]; + ["Offset of field: android_input_buffer::motionEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, motionEventsBufferSize) - 16usize]; + ["Offset of field: android_input_buffer::keyEvents"] + [::std::mem::offset_of!(android_input_buffer, keyEvents) - 24usize]; + ["Offset of field: android_input_buffer::keyEventsCount"] + [::std::mem::offset_of!(android_input_buffer, keyEventsCount) - 32usize]; + ["Offset of field: android_input_buffer::keyEventsBufferSize"] + [::std::mem::offset_of!(android_input_buffer, keyEventsBufferSize) - 40usize]; +}; #[doc = " Function pointer declaration for the filtering of key events.\n A function with this signature should be passed to\n android_app_set_key_event_filter and return false for any events that should\n not be handled by android_native_app_glue. These events will be handled by\n the system instead."] pub type android_key_event_filter = ::std::option::Option bool>; @@ -7493,181 +5240,70 @@ pub struct android_app { pub inputAvailableWakeUp: bool, pub inputSwapPending: bool, } -#[test] -fn bindgen_test_layout_android_app() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 392usize, - "Size of android_app" - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - "Alignment of android_app" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).userData) as usize - ptr as usize }, - 0usize, - "Offset of field: android_app::userData" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).onAppCmd) as usize - ptr as usize }, - 8usize, - "Offset of field: android_app::onAppCmd" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activity) as usize - ptr as usize }, - 16usize, - "Offset of field: android_app::activity" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, - 24usize, - "Offset of field: android_app::config" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedState) as usize - ptr as usize }, - 32usize, - "Offset of field: android_app::savedState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).savedStateSize) as usize - ptr as usize }, - 40usize, - "Offset of field: android_app::savedStateSize" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).looper) as usize - ptr as usize }, - 48usize, - "Offset of field: android_app::looper" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).window) as usize - ptr as usize }, - 56usize, - "Offset of field: android_app::window" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).contentRect) as usize - ptr as usize }, - 64usize, - "Offset of field: android_app::contentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).softwareKeyboardVisible) as usize - ptr as usize }, - 80usize, - "Offset of field: android_app::softwareKeyboardVisible" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).editorAction) as usize - ptr as usize }, - 84usize, - "Offset of field: android_app::editorAction" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).activityState) as usize - ptr as usize }, - 88usize, - "Offset of field: android_app::activityState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyRequested) as usize - ptr as usize }, - 92usize, - "Offset of field: android_app::destroyRequested" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputBuffers) as usize - ptr as usize }, - 96usize, - "Offset of field: android_app::inputBuffers" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).currentInputBuffer) as usize - ptr as usize }, - 192usize, - "Offset of field: android_app::currentInputBuffer" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).textInputState) as usize - ptr as usize }, - 196usize, - "Offset of field: android_app::textInputState" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mutex) as usize - ptr as usize }, - 200usize, - "Offset of field: android_app::mutex" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, - 240usize, - "Offset of field: android_app::cond" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgread) as usize - ptr as usize }, - 288usize, - "Offset of field: android_app::msgread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msgwrite) as usize - ptr as usize }, - 292usize, - "Offset of field: android_app::msgwrite" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, - 296usize, - "Offset of field: android_app::thread" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cmdPollSource) as usize - ptr as usize }, - 304usize, - "Offset of field: android_app::cmdPollSource" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, - 328usize, - "Offset of field: android_app::running" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stateSaved) as usize - ptr as usize }, - 332usize, - "Offset of field: android_app::stateSaved" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).destroyed) as usize - ptr as usize }, - 336usize, - "Offset of field: android_app::destroyed" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).redrawNeeded) as usize - ptr as usize }, - 340usize, - "Offset of field: android_app::redrawNeeded" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingWindow) as usize - ptr as usize }, - 344usize, - "Offset of field: android_app::pendingWindow" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pendingContentRect) as usize - ptr as usize }, - 352usize, - "Offset of field: android_app::pendingContentRect" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).keyEventFilter) as usize - ptr as usize }, - 368usize, - "Offset of field: android_app::keyEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).motionEventFilter) as usize - ptr as usize }, - 376usize, - "Offset of field: android_app::motionEventFilter" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputAvailableWakeUp) as usize - ptr as usize }, - 384usize, - "Offset of field: android_app::inputAvailableWakeUp" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inputSwapPending) as usize - ptr as usize }, - 385usize, - "Offset of field: android_app::inputSwapPending" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of android_app"][::std::mem::size_of::() - 392usize]; + ["Alignment of android_app"][::std::mem::align_of::() - 8usize]; + ["Offset of field: android_app::userData"] + [::std::mem::offset_of!(android_app, userData) - 0usize]; + ["Offset of field: android_app::onAppCmd"] + [::std::mem::offset_of!(android_app, onAppCmd) - 8usize]; + ["Offset of field: android_app::activity"] + [::std::mem::offset_of!(android_app, activity) - 16usize]; + ["Offset of field: android_app::config"][::std::mem::offset_of!(android_app, config) - 24usize]; + ["Offset of field: android_app::savedState"] + [::std::mem::offset_of!(android_app, savedState) - 32usize]; + ["Offset of field: android_app::savedStateSize"] + [::std::mem::offset_of!(android_app, savedStateSize) - 40usize]; + ["Offset of field: android_app::looper"][::std::mem::offset_of!(android_app, looper) - 48usize]; + ["Offset of field: android_app::window"][::std::mem::offset_of!(android_app, window) - 56usize]; + ["Offset of field: android_app::contentRect"] + [::std::mem::offset_of!(android_app, contentRect) - 64usize]; + ["Offset of field: android_app::softwareKeyboardVisible"] + [::std::mem::offset_of!(android_app, softwareKeyboardVisible) - 80usize]; + ["Offset of field: android_app::editorAction"] + [::std::mem::offset_of!(android_app, editorAction) - 84usize]; + ["Offset of field: android_app::activityState"] + [::std::mem::offset_of!(android_app, activityState) - 88usize]; + ["Offset of field: android_app::destroyRequested"] + [::std::mem::offset_of!(android_app, destroyRequested) - 92usize]; + ["Offset of field: android_app::inputBuffers"] + [::std::mem::offset_of!(android_app, inputBuffers) - 96usize]; + ["Offset of field: android_app::currentInputBuffer"] + [::std::mem::offset_of!(android_app, currentInputBuffer) - 192usize]; + ["Offset of field: android_app::textInputState"] + [::std::mem::offset_of!(android_app, textInputState) - 196usize]; + ["Offset of field: android_app::mutex"][::std::mem::offset_of!(android_app, mutex) - 200usize]; + ["Offset of field: android_app::cond"][::std::mem::offset_of!(android_app, cond) - 240usize]; + ["Offset of field: android_app::msgread"] + [::std::mem::offset_of!(android_app, msgread) - 288usize]; + ["Offset of field: android_app::msgwrite"] + [::std::mem::offset_of!(android_app, msgwrite) - 292usize]; + ["Offset of field: android_app::thread"] + [::std::mem::offset_of!(android_app, thread) - 296usize]; + ["Offset of field: android_app::cmdPollSource"] + [::std::mem::offset_of!(android_app, cmdPollSource) - 304usize]; + ["Offset of field: android_app::running"] + [::std::mem::offset_of!(android_app, running) - 328usize]; + ["Offset of field: android_app::stateSaved"] + [::std::mem::offset_of!(android_app, stateSaved) - 332usize]; + ["Offset of field: android_app::destroyed"] + [::std::mem::offset_of!(android_app, destroyed) - 336usize]; + ["Offset of field: android_app::redrawNeeded"] + [::std::mem::offset_of!(android_app, redrawNeeded) - 340usize]; + ["Offset of field: android_app::pendingWindow"] + [::std::mem::offset_of!(android_app, pendingWindow) - 344usize]; + ["Offset of field: android_app::pendingContentRect"] + [::std::mem::offset_of!(android_app, pendingContentRect) - 352usize]; + ["Offset of field: android_app::keyEventFilter"] + [::std::mem::offset_of!(android_app, keyEventFilter) - 368usize]; + ["Offset of field: android_app::motionEventFilter"] + [::std::mem::offset_of!(android_app, motionEventFilter) - 376usize]; + ["Offset of field: android_app::inputAvailableWakeUp"] + [::std::mem::offset_of!(android_app, inputAvailableWakeUp) - 384usize]; + ["Offset of field: android_app::inputSwapPending"] + [::std::mem::offset_of!(android_app, inputSwapPending) - 385usize]; +}; #[doc = " Looper data ID of commands coming from the app's main thread, which\n is returned as an identifier from ALooper_pollOnce(). The data for this\n identifier is a pointer to an android_poll_source structure.\n These can be retrieved and processed with android_app_read_cmd()\n and android_app_exec_cmd()."] pub const NativeAppGlueLooperId_LOOPER_ID_MAIN: NativeAppGlueLooperId = 1; #[doc = " Unused. Reserved for future use when usage of AInputQueue will be\n supported."] @@ -7714,55 +5350,55 @@ pub const NativeAppGlueAppCmd_APP_CMD_DESTROY: NativeAppGlueAppCmd = 16; pub const NativeAppGlueAppCmd_APP_CMD_WINDOW_INSETS_CHANGED: NativeAppGlueAppCmd = 17; #[doc = " Commands passed from the application's main Java thread to the game's thread.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub type NativeAppGlueAppCmd = i8; -extern "C" { +unsafe extern "C" { #[doc = " Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next\n app command message."] pub fn android_app_read_cmd(android_app: *mut android_app) -> i8; } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n initial pre-processing of the given command. You can perform your own\n actions for the command after calling this function."] pub fn android_app_pre_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call with the command returned by android_app_read_cmd() to do the\n final post-processing of the given command. You must have done your own\n actions for the command before calling this function."] pub fn android_app_post_exec_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Call this before processing input events to get the events buffer.\n The function returns NULL if there are no events to process."] pub fn android_app_swap_input_buffers( android_app: *mut android_app, ) -> *mut android_input_buffer; } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of motion events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the motion events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_motion_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " Clear the array of key events that were waiting to be handled, and release\n each of them.\n\n This method should be called after you have processed the key up events in\n your game loop. You should handle events at each iteration of your game loop."] pub fn android_app_clear_key_events(inputBuffer: *mut android_input_buffer); } -extern "C" { +unsafe extern "C" { #[doc = " This is a springboard into the Rust glue layer that wraps calling the\n main entry for the app itself."] pub fn _rust_glue_entry(app: *mut android_app); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing key events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n The default key filter will filter out volume and camera button presses."] pub fn android_app_set_key_event_filter( app: *mut android_app, filter: android_key_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " Set the filter to use when processing touch and motion events.\n Any events for which the filter returns false will be ignored by\n android_native_app_glue. If filter is set to NULL, no filtering is done.\n\n Note that the default motion event filter will only allow touchscreen events\n through, in order to mimic NativeActivity's behaviour, so for controller\n events to be passed to the app, set the filter to NULL."] pub fn android_app_set_motion_event_filter( app: *mut android_app, filter: android_motion_event_filter, ); } -extern "C" { +unsafe extern "C" { #[doc = " You can send your custom events using the function below.\n\n Make sure your custom codes do not overlap with this library's ones.\n\n Values from 0 to 127 are reserved for this library; values from -128 to -1\n can be used for custom user's events."] pub fn android_app_write_cmd(android_app: *mut android_app, cmd: i8); } -extern "C" { +unsafe extern "C" { #[doc = " Determines if a looper wake up was due to new input becoming available"] pub fn android_app_input_available_wake_up(app: *mut android_app) -> bool; } @@ -7775,38 +5411,16 @@ pub struct __va_list_tag { pub overflow_arg_area: *mut ::std::os::raw::c_void, pub reg_save_area: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___va_list_tag() { - const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - "Size of __va_list_tag" - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - "Alignment of __va_list_tag" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, - 0usize, - "Offset of field: __va_list_tag::gp_offset" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, - 4usize, - "Offset of field: __va_list_tag::fp_offset" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, - 8usize, - "Offset of field: __va_list_tag::overflow_arg_area" - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, - 16usize, - "Offset of field: __va_list_tag::reg_save_area" - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __va_list_tag"][::std::mem::size_of::<__va_list_tag>() - 24usize]; + ["Alignment of __va_list_tag"][::std::mem::align_of::<__va_list_tag>() - 8usize]; + ["Offset of field: __va_list_tag::gp_offset"] + [::std::mem::offset_of!(__va_list_tag, gp_offset) - 0usize]; + ["Offset of field: __va_list_tag::fp_offset"] + [::std::mem::offset_of!(__va_list_tag, fp_offset) - 4usize]; + ["Offset of field: __va_list_tag::overflow_arg_area"] + [::std::mem::offset_of!(__va_list_tag, overflow_arg_area) - 8usize]; + ["Offset of field: __va_list_tag::reg_save_area"] + [::std::mem::offset_of!(__va_list_tag, reg_save_area) - 16usize]; +}; From 46d2fa87c37be8602ad6aa3039538b638876653d Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 11 Aug 2025 15:54:30 +0100 Subject: [PATCH 2/3] Update to jni 0.22 and jni-sys 0.4.1 This change notably starts to use the `jni::bind_java_type!` macro for the `KeyCharacterMap` and `InputDevice` Java SDK API bindings in `src/input/sdk.rs` which is a nice simplification. --- Cargo.toml | 1 - android-activity/Cargo.toml | 4 +- android-activity/src/error.rs | 5 + android-activity/src/game_activity/ffi.rs | 2 +- android-activity/src/game_activity/mod.rs | 159 +++++---- android-activity/src/input/sdk.rs | 351 ++++++++----------- android-activity/src/jni_utils.rs | 143 ++------ android-activity/src/lib.rs | 23 +- android-activity/src/native_activity/glue.rs | 131 +++---- android-activity/src/native_activity/mod.rs | 92 +++-- android-activity/src/util.rs | 31 ++ 11 files changed, 420 insertions(+), 522 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c1f46d31..5673fe47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,3 @@ resolver = "2" members = ["android-activity"] exclude = ["examples"] - diff --git a/android-activity/Cargo.toml b/android-activity/Cargo.toml index d8050c76..dd9f12a3 100644 --- a/android-activity/Cargo.toml +++ b/android-activity/Cargo.toml @@ -33,9 +33,9 @@ api-level-33 = ["api-level-30", "ndk/api-level-33"] [dependencies] log = "0.4" -jni-sys = "0.3" cesu8 = "1" -jni = "0.21" +jni = "0.22" +jni-sys = "0.4.1" ndk-sys = "0.6.0" ndk = { version = "0.9.0", default-features = false } ndk-context = "0.1.1" diff --git a/android-activity/src/error.rs b/android-activity/src/error.rs index 7193f5a1..8ba182d8 100644 --- a/android-activity/src/error.rs +++ b/android-activity/src/error.rs @@ -27,6 +27,10 @@ pub(crate) enum InternalAppError { JniError(jni::errors::JniError), #[error("A Java Exception was thrown via a JNI method call")] JniException(String), + // For internal errors that don't lead to a Java exception but are + // still JNI related. + #[error("A bad argument was passed to a JNI method: {0}")] + JniBadArgument(String), #[error("A Java VM error")] JvmError(jni::errors::Error), #[error("Input unavailable")] @@ -51,6 +55,7 @@ impl From for AppError { match value { InternalAppError::JniError(err) => AppError::JavaError(err.to_string()), InternalAppError::JniException(msg) => AppError::JavaError(msg), + InternalAppError::JniBadArgument(msg) => AppError::JavaError(msg), InternalAppError::JvmError(err) => AppError::JavaError(err.to_string()), InternalAppError::InputUnavailable => AppError::InputUnavailable, } diff --git a/android-activity/src/game_activity/ffi.rs b/android-activity/src/game_activity/ffi.rs index 51063ff6..576d4892 100644 --- a/android-activity/src/game_activity/ffi.rs +++ b/android-activity/src/game_activity/ffi.rs @@ -12,7 +12,7 @@ #![allow(deref_nullptr)] #![allow(dead_code)] -use jni_sys::*; +use jni::sys::*; use libc::{pthread_cond_t, pthread_mutex_t, pthread_t}; use ndk_sys::{AAssetManager, AConfiguration, ALooper, ALooper_callbackFunc, ANativeWindow, ARect}; diff --git a/android-activity/src/game_activity/mod.rs b/android-activity/src/game_activity/mod.rs index 129175d8..bd144618 100644 --- a/android-activity/src/game_activity/mod.rs +++ b/android-activity/src/game_activity/mod.rs @@ -8,10 +8,12 @@ use std::sync::Weak; use std::sync::{Arc, Mutex, RwLock}; use std::time::Duration; +use jni::objects::JObject; +use jni::refs::Global; use libc::c_void; use log::{error, trace}; -use jni_sys::*; +use jni::sys::*; use ndk_sys::ALooper_wake; use ndk_sys::{ALooper, ALooper_pollAll}; @@ -21,9 +23,11 @@ use ndk::configuration::Configuration; use ndk::native_window::NativeWindow; use crate::error::InternalResult; -use crate::input::{Axis, KeyCharacterMap, KeyCharacterMapBinding}; -use crate::jni_utils::{self, CloneJavaVM}; -use crate::util::{abort_on_panic, forward_stdio_to_logcat, log_panic, try_get_path_from_ptr}; +use crate::input::{device_key_character_map, Axis, KeyCharacterMap}; +use crate::util::{ + abort_on_panic, forward_stdio_to_logcat, init_android_main_thread, log_panic, + try_get_path_from_ptr, +}; use crate::{ AndroidApp, ConfigurationRef, InputStatus, MainEvent, PollEvent, Rect, WindowManagerFlags, }; @@ -119,32 +123,31 @@ impl AndroidAppWaker { } impl AndroidApp { - pub(crate) unsafe fn from_ptr(ptr: NonNull, jvm: CloneJavaVM) -> Self { - let mut env = jvm.get_env().unwrap(); // We attach to the thread before creating the AndroidApp - - let key_map_binding = match KeyCharacterMapBinding::new(&mut env) { - Ok(b) => b, - Err(err) => { - panic!("Failed to create KeyCharacterMap JNI bindings: {err:?}"); - } - }; - - // Note: we don't use from_ptr since we don't own the android_app.config - // and need to keep in mind that the Drop handler is going to call - // AConfiguration_delete() - let config = Configuration::clone_from_ptr(NonNull::new_unchecked((*ptr.as_ptr()).config)); + pub(crate) unsafe fn from_ptr(ptr: NonNull, jvm: jni::JavaVM) -> Self { + // We attach to the thread before creating the AndroidApp + jvm.with_local_frame(10, |env| -> jni::errors::Result<_> { + if let Err(err) = crate::input::jni_init(env) { + panic!("Failed to init JNI bindings: {err:?}"); + }; - Self { - inner: Arc::new(RwLock::new(AndroidAppInner { - jvm, - native_app: NativeAppGlue { ptr }, - config: ConfigurationRef::new(config), - native_window: Default::default(), - key_map_binding: Arc::new(key_map_binding), - key_maps: Mutex::new(HashMap::new()), - input_receiver: Mutex::new(None), - })), - } + // Note: we don't use from_ptr since we don't own the android_app.config + // and need to keep in mind that the Drop handler is going to call + // AConfiguration_delete() + let config = + Configuration::clone_from_ptr(NonNull::new_unchecked((*ptr.as_ptr()).config)); + + Ok(Self { + inner: Arc::new(RwLock::new(AndroidAppInner { + jvm: jvm.clone(), + native_app: NativeAppGlue { ptr }, + config: ConfigurationRef::new(config), + native_window: Default::default(), + key_maps: Mutex::new(HashMap::new()), + input_receiver: Mutex::new(None), + })), + }) + }) + .expect("Failed to create AndroidApp instance") } } @@ -251,14 +254,11 @@ impl NativeAppGlue { #[derive(Debug)] pub struct AndroidAppInner { - pub(crate) jvm: CloneJavaVM, + pub(crate) jvm: jni::JavaVM, native_app: NativeAppGlue, config: ConfigurationRef, native_window: RwLock>, - /// Shared JNI bindings for the `KeyCharacterMap` class - key_map_binding: Arc, - /// A table of `KeyCharacterMap`s per `InputDevice` ID /// these are used to be able to map key presses to unicode /// characters @@ -533,11 +533,7 @@ impl AndroidAppInner { let key_map = match guard.entry(device_id) { std::collections::hash_map::Entry::Occupied(occupied) => occupied.get().clone(), std::collections::hash_map::Entry::Vacant(vacant) => { - let character_map = jni_utils::device_key_character_map( - self.jvm.clone(), - self.key_map_binding.clone(), - device_id, - )?; + let character_map = device_key_character_map(self.jvm.clone(), device_id)?; vacant.insert(character_map.clone()); character_map } @@ -876,7 +872,7 @@ pub unsafe extern "C" fn Java_com_google_androidgamesdk_GameActivity_initializeN jasset_mgr: jobject, saved_state: jbyteArray, java_config: jobject, -) -> jni_sys::jlong { +) -> jlong { Java_com_google_androidgamesdk_GameActivity_initializeNativeCode_C( env, java_game_activity, @@ -910,53 +906,56 @@ pub unsafe extern "C" fn _rust_glue_entry(native_app: *mut ffi::android_app) { abort_on_panic(|| { let _join_log_forwarder = forward_stdio_to_logcat(); - let jvm = unsafe { + let (jvm, jni_activity) = unsafe { let jvm = (*(*native_app).activity).vm; let activity: jobject = (*(*native_app).activity).javaGameActivity; ndk_context::initialize_android_context(jvm.cast(), activity.cast()); - - let jvm = CloneJavaVM::from_raw(jvm).unwrap(); - // Since this is a newly spawned thread then the JVM hasn't been attached - // to the thread yet. Attach before calling the applications main function - // so they can safely make JNI calls - jvm.attach_current_thread_permanently().unwrap(); - jvm + (jni::JavaVM::from_raw(jvm), activity) }; + // Note: At this point we can assume jni::JavaVM::singleton is initialized + + // Note: the GameActivity implementation will have already attached the main thread to the + // JVM before calling _rust_glue_entry so we don't to set the thread name via + // attach_current_thread_with_config since that won't actually create a new attachment. + // + // Calling .attach_current_thread will ensure that the `jni` crate knows about the + // attachment, as a convenience. + jvm.attach_current_thread(|env| -> jni::errors::Result<()> { + // SAFETY: We know jni_activity is a valid JNI global ref to an Activity instance + let jni_activity = unsafe { env.as_cast_raw::>(&jni_activity)? }; + + if let Err(err) = init_android_main_thread(&jvm, &jni_activity) { + eprintln!("Failed to name Java thread and set thread context class loader: {err}"); + } - unsafe { - // Name thread - this needs to happen here after attaching to a JVM thread, - // since that changes the thread name to something like "Thread-2". - let thread_name = std::ffi::CStr::from_bytes_with_nul(b"android_main\0").unwrap(); - libc::pthread_setname_np(libc::pthread_self(), thread_name.as_ptr()); - - let app = AndroidApp::from_ptr(NonNull::new(native_app).unwrap(), jvm.clone()); - - // We want to specifically catch any panic from the application's android_main - // so we can finish + destroy the Activity gracefully via the JVM - catch_unwind(|| { - // XXX: If we were in control of the Java Activity subclass then - // we could potentially run the android_main function via a Java native method - // springboard (e.g. call an Activity subclass method that calls a jni native - // method that then just calls android_main()) that would make sure there was - // a Java frame at the base of our call stack which would then be recognised - // when calling FindClass to lookup a suitable classLoader, instead of - // defaulting to the system loader. Without this then it's difficult for native - // code to look up non-standard Java classes. - android_main(app); - }) - .unwrap_or_else(log_panic); - - // Let JVM know that our Activity can be destroyed before detaching from the JVM - // - // "Note that this method can be called from any thread; it will send a message - // to the main thread of the process where the Java finish call will take place" - ffi::GameActivity_finish((*native_app).activity); + unsafe { + let app = AndroidApp::from_ptr(NonNull::new(native_app).unwrap(), jvm.clone()); + // We want to specifically catch any panic from the application's android_main + // so we can finish + destroy the Activity gracefully via the JVM + catch_unwind(|| { + // XXX: If we were in control of the Java Activity subclass then + // we could potentially run the android_main function via a Java native method + // springboard (e.g. call an Activity subclass method that calls a jni native + // method that then just calls android_main()) that would make sure there was + // a Java frame at the base of our call stack which would then be recognised + // when calling FindClass to lookup a suitable classLoader, instead of + // defaulting to the system loader. Without this then it's difficult for native + // code to look up non-standard Java classes. + android_main(app); + }) + .unwrap_or_else(log_panic); + + // Let JVM know that our Activity can be destroyed before detaching from the JVM + // + // "Note that this method can be called from any thread; it will send a message + // to the main thread of the process where the Java finish call will take place" + ffi::GameActivity_finish((*native_app).activity); - // This should detach automatically but lets detach explicitly to avoid depending - // on the TLS trickery in `jni-rs` - jvm.detach_current_thread(); + ndk_context::release_android_context(); + } - ndk_context::release_android_context(); - } + Ok(()) + }) + .expect("Failed to attach thread to JVM"); }) } diff --git a/android-activity/src/input/sdk.rs b/android-activity/src/input/sdk.rs index 978ad5a8..2d3b2dfe 100644 --- a/android-activity/src/input/sdk.rs +++ b/android-activity/src/input/sdk.rs @@ -1,21 +1,9 @@ -use std::sync::Arc; +use jni::sys::jint; +use jni::{objects::Global, JavaVM}; -use jni::{ - objects::{GlobalRef, JClass, JMethodID, JObject, JStaticMethodID, JValue}, - signature::{Primitive, ReturnType}, - JNIEnv, -}; -use jni_sys::jint; - -use crate::{ - input::{Keycode, MetaState}, - jni_utils::CloneJavaVM, -}; - -use crate::{ - error::{AppError, InternalAppError}, - jni_utils, -}; +use crate::error::{AppError, InternalAppError, InternalResult}; +use crate::input::{Keycode, MetaState}; +use crate::jni_utils; /// An enum representing the types of keyboards that may generate key events /// @@ -80,157 +68,86 @@ pub enum KeyMapChar { CombiningAccent(char), } -// I've also tried to think here about how to we could potentially automatically -// generate a binding struct like `KeyCharacterMapBinding` with a procmacro and -// so have intentionally limited the `Binding` being a very thin, un-opinionated -// wrapper based on basic JNI types. - -/// Lower-level JNI binding for `KeyCharacterMap` class only holds 'static state -/// and can be shared with an `Arc` ref count. -/// -/// The separation here also neatly helps us separate `InternalAppError` from -/// `AppError` for mapping JNI errors without exposing any `jni-rs` types in the -/// public API. -#[derive(Debug)] -pub(crate) struct KeyCharacterMapBinding { - //vm: JavaVM, - klass: GlobalRef, - get_method_id: JMethodID, - get_dead_char_method_id: JStaticMethodID, - get_keyboard_type_method_id: JMethodID, -} - -impl KeyCharacterMapBinding { - pub(crate) fn new(env: &mut JNIEnv) -> Result { - let binding = env.with_local_frame::<_, _, InternalAppError>(10, |env| { - let klass = env.find_class("android/view/KeyCharacterMap")?; // Creates a local ref - Ok(Self { - get_method_id: env.get_method_id(&klass, "get", "(II)I")?, - get_dead_char_method_id: env.get_static_method_id( - &klass, - "getDeadChar", - "(II)I", - )?, - get_keyboard_type_method_id: env.get_method_id(&klass, "getKeyboardType", "()I")?, - klass: env.new_global_ref(&klass)?, - }) - })?; - Ok(binding) +jni::bind_java_type! { + pub(crate) AKeyCharacterMap => "android.view.KeyCharacterMap", + methods { + priv fn _get(key_code: jint, meta_state: jint) -> jint, + priv static fn _get_dead_char(accent_char: jint, base_char: jint) -> jint, + priv fn _get_keyboard_type() -> jint, } +} - pub fn get<'local>( +impl AKeyCharacterMap<'_> { + pub(crate) fn get<'local>( &self, - env: &'local mut JNIEnv, - key_map: impl AsRef>, + env: &'local mut jni::Env, key_code: jint, meta_state: jint, ) -> Result { - let key_map = key_map.as_ref(); - - // Safety: - // - we know our global `key_map` reference is non-null and valid. - // - we know `get_method_id` remains valid - // - we know that the signature of KeyCharacterMap::get is `(int, int) -> int` - // - we know this won't leak any local references as a side effect - // - // We know it's ok to unwrap the `.i()` value since we explicitly - // specify the return type as `Int` - let unicode = unsafe { - env.call_method_unchecked( - key_map, - self.get_method_id, - ReturnType::Primitive(Primitive::Int), - &[ - JValue::Int(key_code).as_jni(), - JValue::Int(meta_state).as_jni(), - ], - ) - } - .map_err(|err| jni_utils::clear_and_map_exception_to_err(env, err))?; - Ok(unicode.i().unwrap()) + self._get(env, key_code, meta_state) + .map_err(|err| jni_utils::clear_and_map_exception_to_err(env, err)) } - pub fn get_dead_char( - &self, - env: &mut JNIEnv, + pub(crate) fn get_dead_char( + env: &mut jni::Env, accent_char: jint, base_char: jint, ) -> Result { - // Safety: - // - we know `get_dead_char_method_id` remains valid - // - we know that KeyCharacterMap::getDeadKey is a static method - // - we know that the signature of KeyCharacterMap::getDeadKey is `(int, int) -> int` - // - we know this won't leak any local references as a side effect - // - // We know it's ok to unwrap the `.i()` value since we explicitly - // specify the return type as `Int` - - // Urgh, it's pretty terrible that there's no ergonomic/safe way to get a JClass reference from a GlobalRef - // Safety: we don't do anything that would try to delete the JClass as if it were a real local reference - let klass = unsafe { JClass::from_raw(self.klass.as_obj().as_raw()) }; - let unicode = unsafe { - env.call_static_method_unchecked( - &klass, - self.get_dead_char_method_id, - ReturnType::Primitive(Primitive::Int), - &[ - JValue::Int(accent_char).as_jni(), - JValue::Int(base_char).as_jni(), - ], - ) - } - .map_err(|err| jni_utils::clear_and_map_exception_to_err(env, err))?; - Ok(unicode.i().unwrap()) + Self::_get_dead_char(env, accent_char, base_char) + .map_err(|err| jni_utils::clear_and_map_exception_to_err(env, err)) } - pub fn get_keyboard_type<'local>( + pub(crate) fn get_keyboard_type<'local>( &self, - env: &'local mut JNIEnv, - key_map: impl AsRef>, + env: &'local mut jni::Env, ) -> Result { - let key_map = key_map.as_ref(); + self._get_keyboard_type(env) + .map_err(|err| jni_utils::clear_and_map_exception_to_err(env, err)) + } +} - // Safety: - // - we know our global `key_map` reference is non-null and valid. - // - we know `get_keyboard_type_method_id` remains valid - // - we know that the signature of KeyCharacterMap::getKeyboardType is `() -> int` - // - we know this won't leak any local references as a side effect - // - // We know it's ok to unwrap the `.i()` value since we explicitly - // specify the return type as `Int` - Ok(unsafe { - env.call_method_unchecked( - key_map, - self.get_keyboard_type_method_id, - ReturnType::Primitive(Primitive::Int), - &[], - ) - } - .map_err(|err| jni_utils::clear_and_map_exception_to_err(env, err))? - .i() - .unwrap()) +jni::bind_java_type! { + rust_type = AInputDevice, + java_type = "android.view.InputDevice", + type_map { + AKeyCharacterMap => "android.view.KeyCharacterMap", + }, + methods { + static fn get_device(id: jint) -> AInputDevice, + fn get_key_character_map() -> AKeyCharacterMap, } } +// Explicitly initialize the JNI bindings so we can get and early, upfront, +// error if something is wrong. +pub fn jni_init(env: &jni::Env) -> jni::errors::Result<()> { + let _ = AKeyCharacterMapAPI::get(env, &Default::default())?; + let _ = AInputDeviceAPI::get(env, &Default::default())?; + Ok(()) +} + /// Describes the keys provided by a keyboard device and their associated labels. -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct KeyCharacterMap { - jvm: CloneJavaVM, - binding: Arc, - key_map: GlobalRef, + jvm: JavaVM, + key_map: Global>, +} +impl Clone for KeyCharacterMap { + fn clone(&self) -> Self { + let jvm = self.jvm.clone(); + jvm.attach_current_thread(|env| -> jni::errors::Result<_> { + Ok(Self { + jvm: jvm.clone(), + key_map: env.new_global_ref(&self.key_map)?, + }) + }) + .expect("Failed to attach thread to JVM and clone key map") + } } impl KeyCharacterMap { - pub(crate) fn new( - jvm: CloneJavaVM, - binding: Arc, - key_map: GlobalRef, - ) -> Self { - Self { - jvm, - binding, - key_map, - } + pub(crate) fn new(jvm: JavaVM, key_map: Global>) -> Self { + Self { jvm, key_map } } /// Gets the Unicode character generated by the specified [`Keycode`] and [`MetaState`] combination. @@ -249,37 +166,33 @@ impl KeyCharacterMap { let key_code = key_code.into(); let meta_state = meta_state.0 as i32; - // Since we expect this API to be called from the `main` thread then we expect to already be - // attached to the JVM - // - // Safety: there's no other JNIEnv in scope so this env can't be used to subvert the mutable - // borrow rules that ensure we can only add local references to the top JNI frame. - let mut env = self.jvm.get_env().map_err(|err| { - let err: InternalAppError = err.into(); - err - })?; - let unicode = self - .binding - .get(&mut env, self.key_map.as_obj(), key_code, meta_state)?; - let unicode = unicode as u32; + let vm = self.jvm.clone(); + vm.attach_current_thread(|env| -> InternalResult<_> { + let unicode = self.key_map.get(env, key_code, meta_state)?; + let unicode = unicode as u32; - const COMBINING_ACCENT: u32 = 0x80000000; - const COMBINING_ACCENT_MASK: u32 = !COMBINING_ACCENT; + const COMBINING_ACCENT: u32 = 0x80000000; + const COMBINING_ACCENT_MASK: u32 = !COMBINING_ACCENT; - if unicode == 0 { - Ok(KeyMapChar::None) - } else if unicode & COMBINING_ACCENT == COMBINING_ACCENT { - let accent = unicode & COMBINING_ACCENT_MASK; - // Safety: assumes Android key maps don't contain invalid unicode characters - Ok(KeyMapChar::CombiningAccent(unsafe { - char::from_u32_unchecked(accent) - })) - } else { - // Safety: assumes Android key maps don't contain invalid unicode characters - Ok(KeyMapChar::Unicode(unsafe { - char::from_u32_unchecked(unicode) - })) - } + if unicode == 0 { + Ok(KeyMapChar::None) + } else if unicode & COMBINING_ACCENT == COMBINING_ACCENT { + let accent = unicode & COMBINING_ACCENT_MASK; + // Safety: assumes Android key maps don't contain invalid unicode characters + Ok(KeyMapChar::CombiningAccent(unsafe { + char::from_u32_unchecked(accent) + })) + } else { + // Safety: assumes Android key maps don't contain invalid unicode characters + Ok(KeyMapChar::Unicode(unsafe { + char::from_u32_unchecked(unicode) + })) + } + }) + .map_err(|err| { + let err: InternalAppError = err.into(); + err.into() + }) } /// Get the character that is produced by combining the dead key producing accent with the key producing character c. @@ -295,28 +208,24 @@ impl KeyCharacterMap { accent_char: char, base_char: char, ) -> Result, AppError> { - let accent_char = accent_char as jni_sys::jint; - let base_char = base_char as jni_sys::jint; + let accent_char = accent_char as jni::sys::jint; + let base_char = base_char as jni::sys::jint; - // Since we expect this API to be called from the `main` thread then we expect to already be - // attached to the JVM - // - // Safety: there's no other JNIEnv in scope so this env can't be used to subvert the mutable - // borrow rules that ensure we can only add local references to the top JNI frame. - let mut env = self.jvm.get_env().map_err(|err| { - let err: InternalAppError = err.into(); - err - })?; - let unicode = self - .binding - .get_dead_char(&mut env, accent_char, base_char)?; - let unicode = unicode as u32; + let vm = self.jvm.clone(); + vm.attach_current_thread(|env| -> InternalResult<_> { + let unicode = AKeyCharacterMap::get_dead_char(env, accent_char, base_char)?; + let unicode = unicode as u32; - // Safety: assumes Android key maps don't contain invalid unicode characters - Ok(if unicode == 0 { - None - } else { - Some(unsafe { char::from_u32_unchecked(unicode) }) + // Safety: assumes Android key maps don't contain invalid unicode characters + Ok(if unicode == 0 { + None + } else { + Some(unsafe { char::from_u32_unchecked(unicode) }) + }) + }) + .map_err(|err| { + let err: InternalAppError = err.into(); + err.into() }) } @@ -330,19 +239,49 @@ impl KeyCharacterMap { /// a [`AppError::JavaError`] in case there is a spurious JNI error or an exception /// is caught. pub fn get_keyboard_type(&self) -> Result { - // Since we expect this API to be called from the `main` thread then we expect to already be - // attached to the JVM - // - // Safety: there's no other JNIEnv in scope so this env can't be used to subvert the mutable - // borrow rules that ensure we can only add local references to the top JNI frame. - let mut env = self.jvm.get_env().map_err(|err| { + let vm = self.jvm.clone(); + vm.attach_current_thread(|env| -> InternalResult<_> { + let keyboard_type = self.key_map.get_keyboard_type(env)?; + let keyboard_type = keyboard_type as u32; + Ok(keyboard_type.into()) + }) + .map_err(|err| { let err: InternalAppError = err.into(); - err - })?; - let keyboard_type = self - .binding - .get_keyboard_type(&mut env, self.key_map.as_obj())?; - let keyboard_type = keyboard_type as u32; - Ok(keyboard_type.into()) + err.into() + }) } } + +fn device_key_character_map_with_env( + env: &mut jni::Env<'_>, + device_id: i32, +) -> jni::errors::Result { + let device = AInputDevice::get_device(env, device_id)?; + if device.is_null() { + // This isn't really an error from a JNI perspective but we would only expect + // this to return null for a device ID of zero or an invalid device ID. + log::error!("No input device with id {}", device_id); + return Err(jni::errors::Error::WrongObjectType); + } + let character_map = device.get_key_character_map(env)?; + let character_map = env.new_global_ref(character_map)?; + Ok(KeyCharacterMap::new( + env.get_java_vm().clone(), + character_map, + )) +} + +pub(crate) fn device_key_character_map( + jvm: JavaVM, + device_id: i32, +) -> InternalResult { + jvm.attach_current_thread(|env| { + if device_id == 0 { + return Err(InternalAppError::JniBadArgument( + "Can't get key character map for non-physical device_id 0".into(), + )); + } + device_key_character_map_with_env(env, device_id) + .map_err(|err| jni_utils::clear_and_map_exception_to_err(env, err)) + }) +} diff --git a/android-activity/src/jni_utils.rs b/android-activity/src/jni_utils.rs index dcf60837..eee10d4b 100644 --- a/android-activity/src/jni_utils.rs +++ b/android-activity/src/jni_utils.rs @@ -5,46 +5,21 @@ //! //! These utilities help us check + clear exceptions and map them into Rust Errors. -use std::{ops::Deref, sync::Arc}; - -use jni::{ - objects::{JObject, JString}, - JavaVM, -}; - -use crate::{ - error::{InternalAppError, InternalResult}, - input::{KeyCharacterMap, KeyCharacterMapBinding}, -}; - -// TODO: JavaVM should implement Clone -#[derive(Debug)] -pub(crate) struct CloneJavaVM { - pub jvm: JavaVM, -} -impl Clone for CloneJavaVM { - fn clone(&self) -> Self { - Self { - jvm: unsafe { JavaVM::from_raw(self.jvm.get_java_vm_pointer()).unwrap() }, - } - } -} -impl CloneJavaVM { - pub unsafe fn from_raw(jvm: *mut jni_sys::JavaVM) -> InternalResult { - Ok(Self { - jvm: JavaVM::from_raw(jvm)?, - }) - } -} -unsafe impl Send for CloneJavaVM {} -unsafe impl Sync for CloneJavaVM {} - -impl Deref for CloneJavaVM { - type Target = JavaVM; - - fn deref(&self) -> &Self::Target { - &self.jvm +use crate::error::InternalAppError; + +fn try_get_stack_trace( + env: &mut jni::Env<'_>, + throwable: &jni::objects::JThrowable, +) -> jni::errors::Result { + let stack_trace = throwable.get_stack_trace(env)?; + let len = stack_trace.len(env)?; + let mut trace = String::new(); + for i in 0..len { + let element = stack_trace.get_element(env, i)?; + let element_jstr = element.try_to_string(env)?; + trace.push_str(&format!("{i}: {element_jstr}\n")); } + Ok(trace) } /// Use with `.map_err()` to map `jni::errors::Error::JavaException` into a @@ -55,41 +30,28 @@ impl Deref for CloneJavaVM { /// /// This will also clear the exception pub(crate) fn clear_and_map_exception_to_err( - env: &mut jni::JNIEnv<'_>, + env: &mut jni::Env<'_>, err: jni::errors::Error, ) -> InternalAppError { if matches!(err, jni::errors::Error::JavaException) { let result = env.with_local_frame::<_, _, InternalAppError>(5, |env| { - let e = env.exception_occurred()?; - assert!(!e.is_null()); // should only be called after receiving a JavaException Result - env.exception_clear()?; - - let class = env.get_object_class(&e)?; - //let get_stack_trace_method = env.get_method_id(&class, "getStackTrace", "()[Ljava/lang/StackTraceElement;")?; - let get_message_method = - env.get_method_id(&class, "getMessage", "()Ljava/lang/String;")?; - - let msg = unsafe { - env.call_method_unchecked( - &e, - get_message_method, - jni::signature::ReturnType::Object, - &[], - )? - .l() - .unwrap() + let Some(e) = env.exception_occurred() else { + // should only be called after receiving a JavaException Result + unreachable!("JNI Error was JavaException but no exception was set"); }; - let msg = unsafe { JString::from_raw(JObject::into_raw(msg)) }; - let msg = env.get_string(&msg)?; - let msg: String = msg.into(); - - // TODO: get Java backtrace: - /* - if let JValue::Object(elements) = env.call_method_unchecked(&e, get_stack_trace_method, jni::signature::ReturnType::Array, &[])? { - let elements = env.auto_local(elements); - + env.exception_clear(); + + let msg = e.get_message(env)?; + let mut msg: String = msg.to_string(); + match try_get_stack_trace(env, &e) { + Ok(stack_trace) => { + msg.push_str("stack trace:\n"); + msg.push_str(&stack_trace); + } + Err(err) => { + msg.push_str(&format!("\nfailed to get stack trace: {err:?}")); + } } - */ Ok(msg) }); @@ -104,48 +66,3 @@ pub(crate) fn clear_and_map_exception_to_err( err.into() } } - -pub(crate) fn device_key_character_map( - jvm: CloneJavaVM, - key_map_binding: Arc, - device_id: i32, -) -> InternalResult { - // Don't really need to 'attach' since this should be called from the app's main thread that - // should already be attached, but the redundancy should be fine - // - // Attach 'permanently' to avoid any chance of detaching the thread from the VM - let mut env = jvm.attach_current_thread_permanently()?; - - // We don't want to accidentally leak any local references while we - // aren't going to be returning from here back to the JVM, to unwind, so - // we make a local frame - let character_map = env.with_local_frame::<_, _, jni::errors::Error>(10, |env| { - let input_device_class = env.find_class("android/view/InputDevice")?; // Creates a local ref - let device = env - .call_static_method( - input_device_class, - "getDevice", - "(I)Landroid/view/InputDevice;", - &[device_id.into()], - )? - .l()?; // Creates a local ref - - let character_map = env - .call_method( - &device, - "getKeyCharacterMap", - "()Landroid/view/KeyCharacterMap;", - &[], - )? - .l()?; - let character_map = env.new_global_ref(character_map)?; - - Ok(character_map) - })?; - - Ok(KeyCharacterMap::new( - jvm.clone(), - key_map_binding, - character_map, - )) -} diff --git a/android-activity/src/lib.rs b/android-activity/src/lib.rs index 7a050789..51c63b80 100644 --- a/android-activity/src/lib.rs +++ b/android-activity/src/lib.rs @@ -566,7 +566,7 @@ impl AndroidApp { /// with the [`jni`] crate (or similar crates) to make JNI calls that bridge /// between native Rust code and Java/Kotlin code running within the JVM. /// - /// If you use the [`jni`] crate you can wrap this as a [`JavaVM`] via: + /// If you use the [`jni`] crate you can could this as a [`JavaVM`] via: /// ```no_run /// # use jni::JavaVM; /// # let app: android_activity::AndroidApp = todo!(); @@ -581,24 +581,28 @@ impl AndroidApp { /// Returns a JNI object reference for this application's JVM `Activity` as a pointer /// - /// If you use the [`jni`] crate you can wrap this as an object reference via: + /// If you use the [`jni`] crate you can cast this as a `JObject` reference via: /// ```no_run /// # use jni::objects::JObject; - /// # let app: android_activity::AndroidApp = todo!(); - /// let activity = unsafe { JObject::from_raw(app.activity_as_ptr().cast()) }; + /// # use jni::refs::Global; + /// # fn use_jni(env: &jni::Env, app: &android_activity::AndroidApp) -> jni::errors::Result<()> { + /// let raw_activity_global = app.activity_as_ptr() as jni::sys::jobject; + /// // SAFETY: The pointer is valid as long as `app` is valid. + /// let activity = unsafe { env.as_cast_raw::>(&raw_activity_global)? }; + /// # Ok(()) } /// ``` /// /// # JNI Safety /// /// Note that the object reference will be a JNI global reference, not a /// local reference and it should not be deleted. Don't wrap the reference - /// in an [`AutoLocal`] which would try to explicitly delete the reference - /// when dropped. Similarly, don't wrap the reference as a [`GlobalRef`] + /// in an [`Auto`] which would try to explicitly delete the reference + /// when dropped. Similarly, don't wrap the reference as a [`Global`] /// which would also try to explicitly delete the reference when dropped. /// /// [`jni`]: https://crates.io/crates/jni - /// [`AutoLocal`]: https://docs.rs/jni/latest/jni/objects/struct.AutoLocal.html - /// [`GlobalRef`]: https://docs.rs/jni/latest/jni/objects/struct.GlobalRef.html + /// [`Auto`]: https://docs.rs/jni/latest/jni/refs/struct.Auto.html + /// [`Global`]: https://docs.rs/jni/latest/jni/refs/struct.Global.html pub fn activity_as_ptr(&self) -> *mut c_void { self.inner.read().unwrap().activity_as_ptr() } @@ -855,6 +859,9 @@ impl AndroidApp { /// Since this API needs to use JNI internally to call into the Android JVM it may return /// a [`error::AppError::JavaError`] in case there is a spurious JNI error or an exception /// is caught. + /// + /// This API should not be called with a `device_id` of `0`, since that indicates a non-physical + /// device and will result in a [`error::AppError::JavaError`]. pub fn device_key_character_map(&self, device_id: i32) -> Result { Ok(self .inner diff --git a/android-activity/src/native_activity/glue.rs b/android-activity/src/native_activity/glue.rs index 82672a5a..67cc6a87 100644 --- a/android-activity/src/native_activity/glue.rs +++ b/android-activity/src/native_activity/glue.rs @@ -9,11 +9,11 @@ use std::{ sync::{Arc, Condvar, Mutex, Weak}, }; +use jni::{objects::JObject, refs::Global, vm::AttachConfig}; use ndk::{configuration::Configuration, input_queue::InputQueue, native_window::NativeWindow}; use crate::{ - jni_utils::CloneJavaVM, - util::{abort_on_panic, forward_stdio_to_logcat, log_panic}, + util::{abort_on_panic, forward_stdio_to_logcat, init_android_main_thread, log_panic}, ConfigurationRef, }; @@ -840,11 +840,9 @@ extern "C" fn ANativeActivity_onCreate( abort_on_panic(|| { let _join_log_forwarder = forward_stdio_to_logcat(); - log::trace!( + eprintln!( "Creating: {:p}, saved_state = {:p}, save_state_size = {}", - activity, - saved_state, - saved_state_size + activity, saved_state, saved_state_size ); // Conceptually we associate a glue reference with the JVM main thread, and another @@ -858,60 +856,7 @@ extern "C" fn ANativeActivity_onCreate( // Note: we drop the thread handle which will detach the thread std::thread::spawn(move || { let activity: *mut ndk_sys::ANativeActivity = activity_ptr as *mut _; - - let jvm = abort_on_panic(|| unsafe { - let na = activity; - let jvm: *mut jni_sys::JavaVM = (*na).vm; - let activity = (*na).clazz; // Completely bogus name; this is the _instance_ not class pointer - ndk_context::initialize_android_context(jvm.cast(), activity.cast()); - - let jvm = CloneJavaVM::from_raw(jvm).unwrap(); - // Since this is a newly spawned thread then the JVM hasn't been attached - // to the thread yet. Attach before calling the applications main function - // so they can safely make JNI calls - jvm.attach_current_thread_permanently().unwrap(); - jvm - }); - - let app = AndroidApp::new(rust_glue.clone(), jvm.clone()); - - rust_glue.notify_main_thread_running(); - - unsafe { - // Name thread - this needs to happen here after attaching to a JVM thread, - // since that changes the thread name to something like "Thread-2". - let thread_name = std::ffi::CStr::from_bytes_with_nul(b"android_main\0").unwrap(); - libc::pthread_setname_np(libc::pthread_self(), thread_name.as_ptr()); - - // We want to specifically catch any panic from the application's android_main - // so we can finish + destroy the Activity gracefully via the JVM - catch_unwind(|| { - // XXX: If we were in control of the Java Activity subclass then - // we could potentially run the android_main function via a Java native method - // springboard (e.g. call an Activity subclass method that calls a jni native - // method that then just calls android_main()) that would make sure there was - // a Java frame at the base of our call stack which would then be recognised - // when calling FindClass to lookup a suitable classLoader, instead of - // defaulting to the system loader. Without this then it's difficult for native - // code to look up non-standard Java classes. - android_main(app); - }) - .unwrap_or_else(log_panic); - - // Let JVM know that our Activity can be destroyed before detaching from the JVM - // - // "Note that this method can be called from any thread; it will send a message - // to the main thread of the process where the Java finish call will take place" - ndk_sys::ANativeActivity_finish(activity); - - // This should detach automatically but lets detach explicitly to avoid depending - // on the TLS trickery in `jni-rs` - jvm.detach_current_thread(); - - ndk_context::release_android_context(); - } - - rust_glue.notify_main_thread_stopped_running(); + rust_glue_entry(rust_glue, activity); }); // Wait for thread to start. @@ -924,3 +869,69 @@ extern "C" fn ANativeActivity_onCreate( } }) } + +fn rust_glue_entry(rust_glue: NativeActivityGlue, activity: *mut ndk_sys::ANativeActivity) { + abort_on_panic(|| { + let (jvm, jni_activity) = unsafe { + let jvm: *mut jni::sys::JavaVM = (*activity).vm.cast(); + let jni_activity: jni::sys::jobject = (*activity).clazz as _; // Completely bogus name; this is the _instance_ not class pointer + ndk_context::initialize_android_context(jvm.cast(), jni_activity.cast()); + (jni::JavaVM::from_raw(jvm), jni_activity) + }; + // Note: At this point we can assume jni::JavaVM::singleton is initialized + + // Since this is a newly spawned thread then the JVM hasn't been attached to the + // thread yet. + // + // For compatibility we attach before calling the applications main function to + // allow it to assume the thread is attached before making JNI calls. + jvm.attach_current_thread_with_config( + || AttachConfig::new().name("android_main"), + Some(16), + |env| -> jni::errors::Result<()> { + // SAFETY: We know jni_activity is a valid JNI global ref to an Activity instance + let jni_activity = unsafe { env.as_cast_raw::>(&jni_activity)? }; + + if let Err(err) = init_android_main_thread(&jvm, &jni_activity) { + eprintln!( + "Failed to name Java thread and set thread context class loader: {err}" + ); + } + + let app = AndroidApp::new(rust_glue.clone(), jvm.clone()); + + rust_glue.notify_main_thread_running(); + + unsafe { + // We want to specifically catch any panic from the application's android_main + // so we can finish + destroy the Activity gracefully via the JVM + catch_unwind(|| { + // XXX: If we were in control of the Java Activity subclass then + // we could potentially run the android_main function via a Java native method + // springboard (e.g. call an Activity subclass method that calls a jni native + // method that then just calls android_main()) that would make sure there was + // a Java frame at the base of our call stack which would then be recognised + // when calling FindClass to lookup a suitable classLoader, instead of + // defaulting to the system loader. Without this then it's difficult for native + // code to look up non-standard Java classes. + android_main(app); + }) + .unwrap_or_else(log_panic); + + // Let JVM know that our Activity can be destroyed before detaching from the JVM + // + // "Note that this method can be called from any thread; it will send a message + // to the main thread of the process where the Java finish call will take place" + ndk_sys::ANativeActivity_finish(activity); + + ndk_context::release_android_context(); + } + + rust_glue.notify_main_thread_stopped_running(); + + Ok(()) + }, + ) + .expect("Failed to attach thread to JVM"); + }) +} diff --git a/android-activity/src/native_activity/mod.rs b/android-activity/src/native_activity/mod.rs index 4fa295d8..27a25d58 100644 --- a/android-activity/src/native_activity/mod.rs +++ b/android-activity/src/native_activity/mod.rs @@ -6,15 +6,15 @@ use std::ptr::NonNull; use std::sync::{Arc, Mutex, RwLock, Weak}; use std::time::Duration; +use jni::JavaVM; use libc::c_void; use log::{error, trace}; use ndk::input_queue::InputQueue; use ndk::{asset::AssetManager, native_window::NativeWindow}; use crate::error::InternalResult; -use crate::input::{Axis, KeyCharacterMap, KeyCharacterMapBinding}; +use crate::input::{device_key_character_map, Axis, KeyCharacterMap}; use crate::input::{TextInputState, TextSpan}; -use crate::jni_utils::{self, CloneJavaVM}; use crate::{ util, AndroidApp, ConfigurationRef, InputStatus, MainEvent, PollEvent, Rect, WindowManagerFlags, }; @@ -84,50 +84,47 @@ impl AndroidAppWaker { } impl AndroidApp { - pub(crate) fn new(native_activity: NativeActivityGlue, jvm: CloneJavaVM) -> Self { - let mut env = jvm.get_env().unwrap(); // We attach to the thread before creating the AndroidApp - - let key_map_binding = match KeyCharacterMapBinding::new(&mut env) { - Ok(b) => b, - Err(err) => { - panic!("Failed to create KeyCharacterMap JNI bindings: {err:?}"); - } - }; + pub(crate) fn new(native_activity: NativeActivityGlue, jvm: JavaVM) -> Self { + jvm.with_local_frame(10, |env| -> jni::errors::Result<_> { + if let Err(err) = crate::input::jni_init(env) { + panic!("Failed to init JNI bindings: {err:?}"); + }; - let app = Self { - inner: Arc::new(RwLock::new(AndroidAppInner { - jvm, - native_activity, - looper: Looper { - ptr: ptr::null_mut(), - }, - key_map_binding: Arc::new(key_map_binding), - key_maps: Mutex::new(HashMap::new()), - input_receiver: Mutex::new(None), - })), - }; + let app = Self { + inner: Arc::new(RwLock::new(AndroidAppInner { + jvm: jvm.clone(), + native_activity, + looper: Looper { + ptr: ptr::null_mut(), + }, + key_maps: Mutex::new(HashMap::new()), + input_receiver: Mutex::new(None), + })), + }; - { - let mut guard = app.inner.write().unwrap(); - - let main_fd = guard.native_activity.cmd_read_fd(); - unsafe { - guard.looper.ptr = ndk_sys::ALooper_prepare( - ndk_sys::ALOOPER_PREPARE_ALLOW_NON_CALLBACKS as libc::c_int, - ); - ndk_sys::ALooper_addFd( - guard.looper.ptr, - main_fd, - LOOPER_ID_MAIN, - ndk_sys::ALOOPER_EVENT_INPUT as libc::c_int, - None, - //&mut guard.cmd_poll_source as *mut _ as *mut _); - ptr::null_mut(), - ); + { + let mut guard = app.inner.write().unwrap(); + + let main_fd = guard.native_activity.cmd_read_fd(); + unsafe { + guard.looper.ptr = ndk_sys::ALooper_prepare( + ndk_sys::ALOOPER_PREPARE_ALLOW_NON_CALLBACKS as libc::c_int, + ); + ndk_sys::ALooper_addFd( + guard.looper.ptr, + main_fd, + LOOPER_ID_MAIN, + ndk_sys::ALOOPER_EVENT_INPUT as libc::c_int, + None, + //&mut guard.cmd_poll_source as *mut _ as *mut _); + ptr::null_mut(), + ); + } } - } - app + Ok(app) + }) + .expect("Failed to create AndroidApp instance") } } @@ -140,14 +137,11 @@ unsafe impl Sync for Looper {} #[derive(Debug)] pub(crate) struct AndroidAppInner { - pub(crate) jvm: CloneJavaVM, + pub(crate) jvm: JavaVM, pub(crate) native_activity: NativeActivityGlue, looper: Looper, - /// Shared JNI bindings for the `KeyCharacterMap` class - key_map_binding: Arc, - /// A table of `KeyCharacterMap`s per `InputDevice` ID /// these are used to be able to map key presses to unicode /// characters @@ -396,11 +390,7 @@ impl AndroidAppInner { let key_map = match guard.entry(device_id) { std::collections::hash_map::Entry::Occupied(occupied) => occupied.get().clone(), std::collections::hash_map::Entry::Vacant(vacant) => { - let character_map = jni_utils::device_key_character_map( - self.jvm.clone(), - self.key_map_binding.clone(), - device_id, - )?; + let character_map = device_key_character_map(self.jvm.clone(), device_id)?; vacant.insert(character_map.clone()); character_map } diff --git a/android-activity/src/util.rs b/android-activity/src/util.rs index b7e774dd..0c3b5da8 100644 --- a/android-activity/src/util.rs +++ b/android-activity/src/util.rs @@ -1,3 +1,8 @@ +use jni::{ + jni_str, + objects::{JObject, JString, JThread}, + vm::JavaVM, +}; use log::{error, Level}; use std::{ ffi::{CStr, CString}, @@ -111,3 +116,29 @@ pub(crate) fn abort_on_panic(f: impl FnOnce() -> R) -> R { std::process::abort(); }) } + +/// Name the Java Thread + native thread "android_main" and set the Java Thread context class loader +/// so that jni code can more-easily find non-system Java classes. +pub(crate) fn init_android_main_thread( + vm: &JavaVM, + jni_activity: &JObject, +) -> jni::errors::Result<()> { + vm.with_local_frame(10, |env| -> jni::errors::Result<()> { + let activity_class = env.get_object_class(jni_activity)?; + let class_loader = activity_class.get_class_loader(env)?; + + let thread = JThread::current_thread(env)?; + thread.set_context_class_loader(env, &class_loader)?; + let thread_name = JString::from_jni_str(env, jni_str!("android_main"))?; + thread.set_name(env, &thread_name)?; + + // Also name native thread - this needs to happen here after attaching to a JVM thread, + // since that changes the thread name to something like "Thread-2". + unsafe { + let thread_name = std::ffi::CStr::from_bytes_with_nul(b"android_main\0").unwrap(); + let _ = libc::pthread_setname_np(libc::pthread_self(), thread_name.as_ptr()); + } + + Ok(()) + }) +} From aaf0e8b30a1cb908b3b845ab56497e5fcf119345 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 11 Jan 2026 19:48:37 +0000 Subject: [PATCH 3/3] DROP ME: git repo patch for jni 0.22 --- Cargo.toml | 3 +++ examples/agdk-mainloop/Cargo.toml | 3 +++ examples/na-mainloop/Cargo.toml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 5673fe47..6f973852 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,3 +3,6 @@ resolver = "2" members = ["android-activity"] exclude = ["examples"] + +[patch.crates-io] +jni = { git = "https://github.com/jni-rs/jni-rs.git", branch = "release-0.22" } diff --git a/examples/agdk-mainloop/Cargo.toml b/examples/agdk-mainloop/Cargo.toml index ebf11973..7daecd55 100644 --- a/examples/agdk-mainloop/Cargo.toml +++ b/examples/agdk-mainloop/Cargo.toml @@ -15,3 +15,6 @@ ndk = "0.9.0" [lib] name="main" crate_type=["cdylib"] + +[patch.crates-io] +jni = { git = "https://github.com/jni-rs/jni-rs.git", branch = "release-0.22" } \ No newline at end of file diff --git a/examples/na-mainloop/Cargo.toml b/examples/na-mainloop/Cargo.toml index f7cea943..92884794 100644 --- a/examples/na-mainloop/Cargo.toml +++ b/examples/na-mainloop/Cargo.toml @@ -182,3 +182,6 @@ label = "Application Name" #path = "/rust-windowing/android-ndk-rs/tree/master/cargo-apk" #path_prefix = "/rust-windowing/" #mime_type = "image/jpeg" + +[patch.crates-io] +jni = { git = "https://github.com/jni-rs/jni-rs.git", branch = "release-0.22" } \ No newline at end of file