From f1fa787b92c52d1034de164d2a26771ff969454e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sun, 9 Feb 2025 22:15:54 +0100 Subject: qom: Have class_base_init() take a const data argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250424194905.82506-3-philmd@linaro.org> --- rust/qemu-api/src/qom.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/qemu-api') diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index 34d7bc0..03fe624 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -492,7 +492,7 @@ pub trait ObjectImpl: ObjectType + IsA { /// the effects of copying the contents of the parent's class struct /// to the descendants. const CLASS_BASE_INIT: Option< - unsafe extern "C" fn(klass: *mut ObjectClass, data: *mut c_void), + unsafe extern "C" fn(klass: *mut ObjectClass, data: *const c_void), > = None; const TYPE_INFO: TypeInfo = TypeInfo { -- cgit v1.1 From 12d1a768bdfea6e27a3a829228840d72507613a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sun, 9 Feb 2025 23:47:35 +0100 Subject: qom: Have class_init() take a const data argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mechanical change using gsed, then style manually adapted to pass checkpatch.pl script. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250424194905.82506-4-philmd@linaro.org> --- rust/qemu-api/src/qom.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/qemu-api') diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index 03fe624..f385cb7 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -227,7 +227,7 @@ unsafe extern "C" fn rust_instance_post_init(obj: *mut bindings:: unsafe extern "C" fn rust_class_init( klass: *mut ObjectClass, - _data: *mut c_void, + _data: *const c_void, ) { let mut klass = NonNull::new(klass) .unwrap() -- cgit v1.1 From b282b859cf3442d922644e2cd2bee68272baafd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 10 Feb 2025 09:56:56 +0100 Subject: qom: Constify TypeInfo::class_data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All callers now correctly expect a const class data. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250424194905.82506-5-philmd@linaro.org> --- rust/qemu-api/src/qom.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/qemu-api') diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index f385cb7..f0a79f9 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -513,7 +513,7 @@ pub trait ObjectImpl: ObjectType + IsA { class_size: core::mem::size_of::(), class_init: Some(rust_class_init::), class_base_init: Self::CLASS_BASE_INIT, - class_data: core::ptr::null_mut(), + class_data: core::ptr::null(), interfaces: core::ptr::null_mut(), }; -- cgit v1.1 From 231bf6dda1ef7b4894ba374efb248c65b1841e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 23 Apr 2025 18:44:12 +0200 Subject: qom: Constify TypeInfo::interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20250424194905.82506-6-philmd@linaro.org> --- rust/qemu-api/src/qom.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/qemu-api') diff --git a/rust/qemu-api/src/qom.rs b/rust/qemu-api/src/qom.rs index f0a79f9..f1b4022 100644 --- a/rust/qemu-api/src/qom.rs +++ b/rust/qemu-api/src/qom.rs @@ -514,7 +514,7 @@ pub trait ObjectImpl: ObjectType + IsA { class_init: Some(rust_class_init::), class_base_init: Self::CLASS_BASE_INIT, class_data: core::ptr::null(), - interfaces: core::ptr::null_mut(), + interfaces: core::ptr::null(), }; // methods on ObjectClass -- cgit v1.1