Skip to contentSkip to conversation

qom: Make object_resolve_path_component() path argument const

PATCH Applied Andreas Färber 2 participants 2 messages Jan 15, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qom: Make object_resolve_path_component() path argument const

A usage with a hardcoded partial path such as

object_resolve_path_component(obj, "foo")

is totally valid but currently leads to a compilation error. Fix this.

---
 include/qom/object.h |    2 +-
 qom/object.c         |    2 +-

2 Dateien geändert, 2 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

include/qom/object.h +1 -1
index d43b289..1ef2f0e 100644
@@ -900,7 +900,7 @@ Object *object_resolve_path_type(const char *path, const char *typename,
  *
  * Returns: The resolved object or NULL on path lookup failure.
  */
-Object *object_resolve_path_component(Object *parent, gchar *part);
+Object *object_resolve_path_component(Object *parent, const gchar *part);
 
 /**
  * object_property_add_child:
qom/object.c +1 -1
index 351b88c..03e6f24 100644
@@ -1017,7 +1017,7 @@ gchar *object_get_canonical_path(Object *obj)
     return newpath;
 }
 
-Object *object_resolve_path_component(Object *parent, gchar *part)
+Object *object_resolve_path_component(Object *parent, const gchar *part)
 {
     ObjectProperty *prop = object_property_find(parent, part, NULL);
     if (prop == NULL) {
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 11 lines · Andreas Färber

A usage with a hardcoded partial path such as

object_resolve_path_component(obj, "foo")

is totally valid but currently leads to a compilation error. Fix this.

---
 include/qom/object.h |    2 +-
 qom/object.c         |    2 +-

2 Dateien geändert, 2 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches

Stefan