Re: [PATCH 2/6] core: changed type of date keys to GDateTime



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.

I'm not telling if this is good or bad; just I would prefer to stick the
usual way of using the 'const'.




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