Re: new gstack, gqueue



On Wed, 17 Mar 1999, Tim Janik wrote:
> On Sun, 7 Mar 1999, Jeff Garzik wrote:
> 
> > The following are two new ADTs I would like to add to Glib.  Are there
> > any comments or suggestions before the initial commit?
> > 
> > Code is in the GLIB_1_3_HACKS branch.
> > 
> > Thanks,
> > 
> > 	Jeff
> 
> jeff the gstack and gqueue stuff is so small (63 and 144 lines each), could
> you put that into one file? e.g. glist-aux.c or somesuch (since it's implemented
> piggy back on glist.c).

There are a couple issues related to this for which I am soliciting
comment:

* STL implements the stack at least as an ADT-neutral adaptor.  Should
this design be considered for stack and queue?  (IMHO, perhaps, later)

* Should pointer arrays be considered?  (IMHO stack, not queue)

* Should a full complement of functions be provided for g_stack_* and
g_queue_*?  ie. g_stack_foreach, g_stack_find, etc.  (IMHO yes)


gstack.c and gqueue.c will grow considerably if they provide a full
complement of functions as with GList.



> also the code could stand some coding style correction, e.g.
> 
> void
> g_queue_push_front (GQueue  *queue,
>                     gpointer data)
> {
>   if (queue)
>     {
> 
> instead of
> 
> void
> g_queue_push_front (GQueue *q, gpointer data)
> {
>   if (q) {

What flags need to be passed to GNU indent?  I manually reformatted
since it was so small, but a standard set of flags to tell people would
be nice.


> and last but not least, we need appropriate copyright notices in the *.c
> files.

Just checked this in.  The copyright is slightly different, does it look ok?

Thanks for taking the time to look over the new modules.

	Jeff






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