mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
rust: remove offset_of replacement
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5df3fe062f
commit
b134a09ffa
15 changed files with 16 additions and 239 deletions
|
@ -205,8 +205,8 @@ macro_rules! vmstate_of {
|
|||
name: ::core::concat!(::core::stringify!($field_name), "\0")
|
||||
.as_bytes()
|
||||
.as_ptr() as *const ::std::os::raw::c_char,
|
||||
offset: $crate::offset_of!($struct_name, $field_name),
|
||||
$(num_offset: $crate::offset_of!($struct_name, $num),)?
|
||||
offset: ::std::mem::offset_of!($struct_name, $field_name),
|
||||
$(num_offset: ::std::mem::offset_of!($struct_name, $num),)?
|
||||
$(field_exists: $crate::vmstate_exist_fn!($struct_name, $test_fn),)?
|
||||
// The calls to `call_func_with_field!` are the magic that
|
||||
// computes most of the VMStateField from the type of the field.
|
||||
|
@ -483,10 +483,10 @@ macro_rules! vmstate_struct {
|
|||
name: ::core::concat!(::core::stringify!($field_name), "\0")
|
||||
.as_bytes()
|
||||
.as_ptr() as *const ::std::os::raw::c_char,
|
||||
$(num_offset: $crate::offset_of!($struct_name, $num),)?
|
||||
$(num_offset: ::std::mem::offset_of!($struct_name, $num),)?
|
||||
offset: {
|
||||
$crate::assert_field_type!($struct_name, $field_name, $type $(, num = $num)?);
|
||||
$crate::offset_of!($struct_name, $field_name)
|
||||
::std::mem::offset_of!($struct_name, $field_name)
|
||||
},
|
||||
size: ::core::mem::size_of::<$type>(),
|
||||
flags: $crate::bindings::VMStateFlags::VMS_STRUCT,
|
||||
|
@ -518,7 +518,7 @@ macro_rules! vmstate_clock {
|
|||
$field_name,
|
||||
$crate::qom::Owned<$crate::qdev::Clock> $(, num = $num)?
|
||||
);
|
||||
$crate::offset_of!($struct_name, $field_name)
|
||||
::std::mem::offset_of!($struct_name, $field_name)
|
||||
},
|
||||
size: ::core::mem::size_of::<*const $crate::qdev::Clock>(),
|
||||
flags: $crate::bindings::VMStateFlags(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue