--- ray/src/hd/sm_list.c 1998/12/28 18:07:35 3.4 +++ ray/src/hd/sm_list.c 1999/06/10 15:22:23 3.7 @@ -20,6 +20,7 @@ static LIST *free_lists = NULL; extern int Malloc_cnt; #endif LIST +/* NOTE: Memory is not initialized */ *new_list() { LIST *l; @@ -36,9 +37,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 +72,7 @@ LIST **end; list = new_list(); SET_LIST_DATA(list,d); - + SET_LIST_NEXT(list,NULL); if(!l) { if(end) @@ -124,22 +122,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 +137,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 +208,10 @@ LIST **list; } return(FALSE); } + + + +