Received: from eggs.gnu.org ([208.118.235.92]:41589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tukdp-0003lr-JQ for qemu-devel@nongnu.org; Mon, 14 Jan 2013 09:04:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tukdg-0005TS-Rl for qemu-devel@nongnu.org; Mon, 14 Jan 2013 09:03:57 -0500 From: Markus Armbruster References: <1358121304-21345-1-git-send-email-afaerber@suse.de> <1358121304-21345-2-git-send-email-afaerber@suse.de> Date: Mon, 14 Jan 2013 13:19:32 +0100 In-Reply-To: <1358121304-21345-2-git-send-email-afaerber@suse.de> ("Andreas =?utf-8?Q?F=C3=A4rber=22's?= message of "Mon, 14 Jan 2013 00:54:55 +0100") Message-ID: <87k3rg2bzf.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?utf-8?Q?F=C3=A4rber?= Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Anthony Liguori , agraf@suse.de Andreas F=C3=A4rber writes: > This allows to navigate partial well-known paths from an object. Why does making the argument const allow such navigation? > Signed-off-by: Andreas F=C3=A4rber > Cc: Anthony Liguori > --- > include/qom/object.h | 2 +- > qom/object.c | 2 +- > 2 Dateien ge=C3=A4ndert, 2 Zeilen hinzugef=C3=BCgt(+), 2 Zeilen entfernt= (-) > > diff --git a/include/qom/object.h b/include/qom/object.h > index d43b289..1ef2f0e 100644 > --- a/include/qom/object.h > +++ b/include/qom/object.h > @@ -900,7 +900,7 @@ Object *object_resolve_path_type(const char *path, co= nst 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: > diff --git a/qom/object.c b/qom/object.c > index 351b88c..03e6f24 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -1017,7 +1017,7 @@ gchar *object_get_canonical_path(Object *obj) > return newpath; > } >=20=20 > -Object *object_resolve_path_component(Object *parent, gchar *part) > +Object *object_resolve_path_component(Object *parent, const gchar *part) > { > ObjectProperty *prop =3D object_property_find(parent, part, NULL); > if (prop =3D=3D NULL) { Unrelated: do we really want to go along with glib's basic type typedef silliness?