[Top][All Lists]

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

[Qemu-trivial] Go along with glib's basic type typedef silliness? (was:

From: Markus Armbruster
Subject: [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)
Date: Mon, 14 Jan 2013 20:01:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

[Thread hijack, dropping cc: qemu-trivial, qemu-ppc]

Andreas Färber <address@hidden> writes:

> Am 14.01.2013 13:19, schrieb Markus Armbruster:
>> Andreas Färber <address@hidden> writes:
>>> 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;
>>>  }
>>> -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) {
>> Unrelated: do we really want to go along with glib's basic type typedef
>> silliness?
> Elsewhere I have adopted the exact GLib signature since typedefs can be
> changed at any time. In particular the GCompareFunc using gconstpointer,
> gint, etc. Not saying I find their GLib usage useful.

No, these typedefs cannot be changed.

Firstly, their exact definitions are documented[*], therefore can be
relied on.

Secondly, mountains of code rely on the exact definitions, and would
break left and right if they were changed.

They're a textbook example of a perfectly useless pseudo-abstraction.


[*] http://developer.gnome.org/glib/stable/glib-Basic-Types.html

reply via email to

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