Re: [PATCH 2/6] core: changed type of date keys to GDateTime
- From: Guillaume Emont <guijemont igalia com>
- To: grilo-list gnome org
- Subject: Re: [PATCH 2/6] core: changed type of date keys to GDateTime
- Date: Thu, 30 Jun 2011 12:16:23 +0200
On 30/06/2011 11:58, Juan A. Suarez Romero wrote:
> On Thu, 2011-06-30 at 11:42 +0200, Guillaume Emont wrote:
>> As a general policy, I prefer to take a const as parameter when we
>> don't
>> modify the value, since functions with a const parameter accept
>> everything (const and non-const) whereas functions with a non-const
>> parameter only accept non-const.
>
> I perfectly understand the reason to put a 'const' on those functions.
>
> My point is that looking how other libraries do, including GLib, almost
> I never saw the use of a 'const' in other place than strings. Taking a
> look, for instance, in the GList, GObject or GTimeVal API, there is no
> trail of 'const' in any parameter than strings, even when the
> object/struct is not modified.
Yeah, and I personally hate them for that, for all the times when I had
to do:
GList *list_I_can_modify =
g_list_copy((GList *)const_list_I_cant_modify);
>
> I'm not telling if this is good or bad; just I would prefer to stick the
> usual way of using the 'const'.
I could agree if I understood their rationale for not using const.
Actually, I feel like asking around, I find that intriguing...
>
>
> _______________________________________________
> grilo-list mailing list
> grilo-list gnome org
> http://mail.gnome.org/mailman/listinfo/grilo-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]