Andreas Färber <afaer...@suse.de> writes:

> Am 14.01.2013 13:19, schrieb Markus Armbruster:
>> Andreas Färber <afaer...@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.

Reply via email to