mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
rust: qom: add default definitions for ObjectImpl
Remove a bunch of duplicate const definitions. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
ab870fa106
commit
b2a4854508
3 changed files with 4 additions and 14 deletions
|
@ -109,10 +109,7 @@ impl ObjectImpl for PL011State {
|
|||
const TYPE_INFO: qemu_api::bindings::TypeInfo = qemu_api::type_info! { Self };
|
||||
const TYPE_NAME: &'static CStr = crate::TYPE_PL011;
|
||||
const PARENT_TYPE_NAME: Option<&'static CStr> = Some(TYPE_SYS_BUS_DEVICE);
|
||||
const ABSTRACT: bool = false;
|
||||
const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = Some(pl011_init);
|
||||
const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
|
@ -666,8 +663,5 @@ impl ObjectImpl for PL011Luminary {
|
|||
const TYPE_INFO: qemu_api::bindings::TypeInfo = qemu_api::type_info! { Self };
|
||||
const TYPE_NAME: &'static CStr = crate::TYPE_PL011_LUMINARY;
|
||||
const PARENT_TYPE_NAME: Option<&'static CStr> = Some(crate::TYPE_PL011);
|
||||
const ABSTRACT: bool = false;
|
||||
const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = Some(pl011_luminary_init);
|
||||
const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
}
|
||||
|
|
|
@ -14,10 +14,10 @@ pub trait ObjectImpl {
|
|||
const TYPE_INFO: TypeInfo;
|
||||
const TYPE_NAME: &'static CStr;
|
||||
const PARENT_TYPE_NAME: Option<&'static CStr>;
|
||||
const ABSTRACT: bool;
|
||||
const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)>;
|
||||
const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)>;
|
||||
const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)>;
|
||||
const ABSTRACT: bool = false;
|
||||
const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
}
|
||||
|
||||
pub trait Class {
|
||||
|
|
|
@ -58,10 +58,6 @@ fn test_device_decl_macros() {
|
|||
const TYPE_INFO: qemu_api::bindings::TypeInfo = qemu_api::type_info! { Self };
|
||||
const TYPE_NAME: &'static CStr = c_str!("dummy");
|
||||
const PARENT_TYPE_NAME: Option<&'static CStr> = Some(device_class::TYPE_DEVICE);
|
||||
const ABSTRACT: bool = false;
|
||||
const INSTANCE_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
const INSTANCE_POST_INIT: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
const INSTANCE_FINALIZE: Option<unsafe extern "C" fn(obj: *mut Object)> = None;
|
||||
}
|
||||
|
||||
impl Class for DummyClass {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue