g_slist and const



I'm tightning my code and i wonder why some of the g_slist functions don't use 
"const".

gint     g_slist_position  (GSList           *list,  GSList           *llink);
gint     g_slist_index      (GSList           *list, gconstpointer     data);
guint    g_slist_length    (GSList           *list);

Should be like this:
gint     g_slist_position    (const GSList  *list, const GSList *llink);
gint     g_slist_index        (const GSList   *list, gconstpointer     data);
guint   g_slist_length      (const GSList   *list);

I have changed the code and glib compile without any problems.
The change will be harmless, and the code will more readable.
The documentation have to be changed then !

Same for g_list,,,    and maybe many other place in glib. 
Havn't got time to investigate the rest of the code.

Rgds
Asbjorn 



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