Re: [glib] Why is g_ptr_array_set_size take a gint instead of guint for the length parameter?



Hi

There is one entree in Bugzilla about  g_ptr_array_set_size () from 2007.

You mean this? https://bugzilla.gnome.org/show_bug.cgi?id=422939

Not really relevant.

Correct, not relevant at all .. but this all I could find .. hence my
e-mail to this
list to ask for the proper place to look.

You told me that this gint/guint is probably an oversight and that is
all we need
to know. Case close as far as I'm concern.

Well we get rid of useless friction and also it normalize the interface.
Agree that 2^31 is plenty but for my use case, g_ptr_array it is the
fastest.
Rather then returning to the user a pointer to an internal object in my
lib
I return an index to a g_ptr_array of internal pointer .. it's safer - no
risk of dangling pointer for instance.

I agree that it would make the API more pleasing, but I don't think we
can justify the API break. Sorry!

OK no problem .. maybe push this in glib 3.0 !

I'm just a random internet guy. So let me know if I need to do something else.
As I said, this thread document the gint/guint of g_ptr_array and I
think ours job is
done!


Thanks again Philip,

Sylvain.



Philip



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