From: Markus Armbruster <armbru@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-trivial <qemu-trivial@nongnu.org>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
Anthony Liguori <anthony@codemonkey.ws>,
agraf@suse.de
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const
Date: Mon, 14 Jan 2013 18:27:18 +0100 [thread overview]
Message-ID: <87hamjpte1.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <50F437C5.4020905@suse.de> ("Andreas Färber"'s message of "Mon, 14 Jan 2013 17:52:21 +0100")
Andreas Färber <afaerber@suse.de> writes:
> Am 14.01.2013 13:19, schrieb Markus Armbruster:
>> Andreas Färber <afaerber@suse.de> writes:
>>
>>> This allows to navigate partial well-known paths from an object.
>>
>> Why does making the argument const allow such navigation?
>
> Without const, object_resolve_path_component(foo, "bar") results in a
> compile error (09/10 accesses "ide[1]" etc. to avoid exposing the full
> MacIOState).
>
> Apparently this function was so far only used on dynamically generated
> (non-const) arrays:
>
> qom/container.c: child = object_resolve_path_component(obj,
> parts[i]);
> qom/object.c: child = object_resolve_path_component(parent,
> parts[index]);
Makes sense, but isn't immediately obvious from your commit message.
What about:
qom: Make object_resolve_path_component() path argument const
Navigating well-known paths from an object like
object_resolve_path_component(foo, "bar")
is perfectly legitimate, but doesn't compile, because the second
parameter lacks const. Fix that.
next prev parent reply other threads:[~2013-01-14 17:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1358121304-21345-1-git-send-email-afaerber@suse.de>
[not found] ` <1358121304-21345-2-git-send-email-afaerber@suse.de>
[not found] ` <87k3rg2bzf.fsf@blackfin.pond.sub.org>
2013-01-14 16:52 ` [Qemu-trivial] [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const Andreas Färber
2013-01-14 17:27 ` Markus Armbruster [this message]
2013-01-14 19:01 ` [Qemu-trivial] Go along with glib's basic type typedef silliness? (was: [Qemu-devel] [PATCH 01/10] qom: Make object_resolve_path_component() path argument const) Markus Armbruster
2013-01-17 20:26 ` [Qemu-trivial] [Qemu-devel] Go along with glib's basic type typedef silliness? (was: " Blue Swirl
2013-01-18 15:36 ` [Qemu-trivial] [Qemu-devel] Go along with glib's basic type typedef silliness? Markus Armbruster
2013-01-19 9:13 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hamjpte1.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.