--- ray/src/hd/sm_list.c 1998/12/28 18:07:35 3.4 +++ ray/src/hd/sm_list.c 2003/02/22 02:07:25 3.8 @@ -1,9 +1,6 @@ -/* Copyright (c) 1998 Silicon Graphics, Inc. */ - #ifndef lint -static char SCCSid[] = "$SunId$ SGI"; +static const char RCSid[] = "$Id: sm_list.c,v 3.8 2003/02/22 02:07:25 greg Exp $"; #endif - /* * sm_list.c * Routines for handling linked generic linked lists, stack, and @@ -20,6 +17,7 @@ static LIST *free_lists = NULL; extern int Malloc_cnt; #endif LIST +/* NOTE: Memory is not initialized */ *new_list() { LIST *l; @@ -36,9 +34,6 @@ LIST if( !(l = (LIST *)malloc(sizeof(LIST)))) error(SYSTEM,"new_list():Unable to allocate memory"); } - /* clear the memory */ - bzero(l, sizeof(LIST)); - return(l); } @@ -74,7 +69,7 @@ LIST **end; list = new_list(); SET_LIST_DATA(list,d); - + SET_LIST_NEXT(list,NULL); if(!l) { if(end) @@ -124,22 +119,8 @@ int d; return(l); } -/* Pushes data element d at the top of the list- returns pointer - to new top of list - */ -LIST -*push_data(l,d) -LIST *l; -int d; -{ - LIST * list; - - list = new_list(); - SET_LIST_DATA(list,d); - SET_LIST_NEXT(list,l); - return(list); -} + /* frees the list */ LIST *free_list(l) @@ -153,6 +134,21 @@ LIST * l; return(NULL); } +/* Pushes data element d at the top of the list- returns pointer + to new top of list + */ +LIST +*push_data(l,d) +LIST *l; +int d; +{ + LIST *list; + + list = new_list(); + SET_LIST_DATA(list,d); + SET_LIST_NEXT(list,l); + return(list); +} /* Returns data element d at the top of the list- returns pointer to new top of list */ @@ -209,6 +205,10 @@ LIST **list; } return(FALSE); } + + + +