From 7e8e03206c56e7cd9d0d9fbb447c785c400ff3ee Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 23 Jul 2006 08:01:00 -0700 Subject: Version abc60723 --- src/misc/nm/nmTable.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/misc/nm/nmTable.c') diff --git a/src/misc/nm/nmTable.c b/src/misc/nm/nmTable.c index 86c520d8..65f16e04 100644 --- a/src/misc/nm/nmTable.c +++ b/src/misc/nm/nmTable.c @@ -44,7 +44,7 @@ static unsigned Nm_HashString( char * pName, int TableSize ) }; unsigned i, Key = 0; for ( i = 0; pName[i] != '\0'; i++ ) - Key ^= s_Primes[i%10]*pName[i]; + Key ^= s_Primes[i%10]*pName[i]*pName[i]; return Key % TableSize; } @@ -142,7 +142,7 @@ Nm_Entry_t * Nm_ManTableLookupId( Nm_Man_t * p, int ObjId ) Nm_Entry_t * Nm_ManTableLookupName( Nm_Man_t * p, char * pName, Nm_Entry_t ** ppSecond ) { Nm_Entry_t * pFirst, * pSecond; - int i; + int i, Counter = 0; pFirst = pSecond = NULL; for ( i = Nm_HashString(pName, p->nBins); p->pBinsN2I[i]; i = (i+1) % p->nBins ) if ( strcmp(p->pBinsN2I[i]->Name, pName) == 0 ) @@ -154,6 +154,10 @@ Nm_Entry_t * Nm_ManTableLookupName( Nm_Man_t * p, char * pName, Nm_Entry_t ** pp else assert( 0 ); // name appears more than 2 times } + else + Counter++; + if ( Counter > 100 ) + printf( "%d ", Counter ); // save the names if ( ppSecond ) *ppSecond = pSecond; -- cgit v1.2.3