[Plib-cvs] plib/src/util ul.h,1.43,1.44 ulList.cxx,1.3,1.4
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-06-10 16:08:34
|
Update of /cvsroot/plib/plib/src/util In directory usw-pr-cvs1:/tmp/cvs-serv10696 Modified Files: ul.h ulList.cxx Log Message: Ensure that ulList 'next' member variable gets initialized (thanks to Cameron Moore and Franz Melchior) Index: ul.h =================================================================== RCS file: /cvsroot/plib/plib/src/util/ul.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- ul.h 21 Apr 2002 03:52:27 -0000 1.43 +++ ul.h 10 Jun 2002 16:08:31 -0000 1.44 @@ -663,7 +663,7 @@ void *getEntity ( unsigned int n ) { - next = n ; + next = n + 1 ; return ( n >= total ) ? (void *) NULL : entity_list [ n ] ; } @@ -685,7 +685,7 @@ replaceEntity ( searchForEntity ( old_entity ), new_entity ) ; } - void *getNextEntity (void) { return getEntity ( next+1 ) ; } + void *getNextEntity (void) { return getEntity ( next ) ; } int getNumEntities (void) const { return total ; } int searchForEntity ( void *entity ) const ; Index: ulList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/util/ulList.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ulList.cxx 3 Mar 2002 14:17:16 -0000 1.3 +++ ulList.cxx 10 Jun 2002 16:08:31 -0000 1.4 @@ -34,6 +34,7 @@ ulList::ulList ( int init ) { total = 0 ; + next = 0 ; entity_list = new void * [ limit = (init <= 0) ? 1 : init ] ; } |