qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] qom: Make object_property_add_uint*_ptr() get non-const poin


From: Eduardo Habkost
Subject: [PATCH 2/3] qom: Make object_property_add_uint*_ptr() get non-const pointers
Date: Fri, 9 Oct 2020 15:15:19 -0400

Currently, the getter/setter functions are awkward because the
visit_type_uint*() functions provided by QAPI will always write a
value to the provided pointer.  Getting a non-const pointer will
allow us to simplify a lot of the getters/setters logic.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 include/qom/object.h | 8 ++++----
 qom/object.c         | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index a124cf897d..1441807be6 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1744,7 +1744,7 @@ typedef enum {
  * Returns: The newly added property on success, or %NULL on failure.
  */
 ObjectProperty *object_property_add_uint8_ptr(Object *obj, const char *name,
-                                              const uint8_t *v,
+                                              uint8_t *v,
                                               ObjectPropertyFlags flags);
 
 ObjectProperty *object_class_property_add_uint8_ptr(ObjectClass *klass,
@@ -1765,7 +1765,7 @@ ObjectProperty 
*object_class_property_add_uint8_ptr(ObjectClass *klass,
  * Returns: The newly added property on success, or %NULL on failure.
  */
 ObjectProperty *object_property_add_uint16_ptr(Object *obj, const char *name,
-                                    const uint16_t *v,
+                                    uint16_t *v,
                                     ObjectPropertyFlags flags);
 
 ObjectProperty *object_class_property_add_uint16_ptr(ObjectClass *klass,
@@ -1786,7 +1786,7 @@ ObjectProperty 
*object_class_property_add_uint16_ptr(ObjectClass *klass,
  * Returns: The newly added property on success, or %NULL on failure.
  */
 ObjectProperty *object_property_add_uint32_ptr(Object *obj, const char *name,
-                                    const uint32_t *v,
+                                    uint32_t *v,
                                     ObjectPropertyFlags flags);
 
 ObjectProperty *object_class_property_add_uint32_ptr(ObjectClass *klass,
@@ -1807,7 +1807,7 @@ ObjectProperty 
*object_class_property_add_uint32_ptr(ObjectClass *klass,
  * Returns: The newly added property on success, or %NULL on failure.
  */
 ObjectProperty *object_property_add_uint64_ptr(Object *obj, const char *name,
-                                    const uint64_t *v,
+                                    uint64_t *v,
                                     ObjectPropertyFlags flags);
 
 ObjectProperty *object_class_property_add_uint64_ptr(ObjectClass *klass,
diff --git a/qom/object.c b/qom/object.c
index 73f27b8b7e..6b4dfc279a 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -2623,7 +2623,7 @@ object_class_property_add_uint_ptr(ObjectClass *oc, const 
char *name,
 
 ObjectProperty *
 object_property_add_uint8_ptr(Object *obj, const char *name,
-                              const uint8_t *v,
+                              uint8_t *v,
                               ObjectPropertyFlags flags)
 {
     return object_property_add_uint_ptr(obj, name, "uint8",
@@ -2646,7 +2646,7 @@ object_class_property_add_uint8_ptr(ObjectClass *klass, 
const char *name,
 
 ObjectProperty *
 object_property_add_uint16_ptr(Object *obj, const char *name,
-                               const uint16_t *v,
+                               uint16_t *v,
                                ObjectPropertyFlags flags)
 {
     return object_property_add_uint_ptr(obj, name, "uint16",
@@ -2669,7 +2669,7 @@ object_class_property_add_uint16_ptr(ObjectClass *klass, 
const char *name,
 
 ObjectProperty *
 object_property_add_uint32_ptr(Object *obj, const char *name,
-                               const uint32_t *v,
+                               uint32_t *v,
                                ObjectPropertyFlags flags)
 {
     return object_property_add_uint_ptr(obj, name, "uint32",
@@ -2692,7 +2692,7 @@ object_class_property_add_uint32_ptr(ObjectClass *klass, 
const char *name,
 
 ObjectProperty *
 object_property_add_uint64_ptr(Object *obj, const char *name,
-                               const uint64_t *v,
+                               uint64_t *v,
                                ObjectPropertyFlags flags)
 {
     return object_property_add_uint_ptr(obj, name, "uint64",
-- 
2.26.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]