Commit 67127b83 by Alan Mishchenko

New DSD detection code.

parent c50c1fc6
...@@ -2287,6 +2287,10 @@ SOURCE=.\src\map\if\ifDec16.c ...@@ -2287,6 +2287,10 @@ SOURCE=.\src\map\if\ifDec16.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\src\map\if\ifDsd.c
# End Source File
# Begin Source File
SOURCE=.\src\map\if\ifLibBox.c SOURCE=.\src\map\if\ifLibBox.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -137,10 +137,18 @@ static inline int Hsh_IntManHash( unsigned * pData, int nSize, int nTableSize ) ...@@ -137,10 +137,18 @@ static inline int Hsh_IntManHash( unsigned * pData, int nSize, int nTableSize )
Key += pDataC[c] * s_Primes[c % 7]; Key += pDataC[c] * s_Primes[c % 7];
return (int)(Key % nTableSize); return (int)(Key % nTableSize);
} }
static inline int Hsh_IntManAdd( Hsh_IntMan_t * p, int iData ) static inline int * Hsh_IntManLookup( Hsh_IntMan_t * p, unsigned * pData )
{ {
Hsh_IntObj_t * pObj; Hsh_IntObj_t * pObj;
unsigned * pData = Hsh_IntData( p, iData ); int * pPlace = Vec_IntEntryP( p->vTable, Hsh_IntManHash(pData, p->nSize, Vec_IntSize(p->vTable)) );
for ( ; (pObj = Hsh_IntObj(p, *pPlace)); pPlace = &pObj->iNext )
if ( !memcmp( pData, Hsh_IntData(p, pObj->iData), sizeof(int) * p->nSize ) )
return pPlace;
assert( *pPlace == -1 );
return pPlace;
}
static inline int Hsh_IntManAdd( Hsh_IntMan_t * p, int iData )
{
int i, * pPlace; int i, * pPlace;
if ( Vec_WrdSize(p->vObjs) > Vec_IntSize(p->vTable) ) if ( Vec_WrdSize(p->vObjs) > Vec_IntSize(p->vTable) )
{ {
...@@ -151,13 +159,14 @@ static inline int Hsh_IntManAdd( Hsh_IntMan_t * p, int iData ) ...@@ -151,13 +159,14 @@ static inline int Hsh_IntManAdd( Hsh_IntMan_t * p, int iData )
Hsh_IntObj(p, i)->iNext = *pPlace; *pPlace = i; Hsh_IntObj(p, i)->iNext = *pPlace; *pPlace = i;
} }
} }
pPlace = Vec_IntEntryP( p->vTable, Hsh_IntManHash(pData, p->nSize, Vec_IntSize(p->vTable)) ); pPlace = Hsh_IntManLookup( p, Hsh_IntData(p, iData) );
for ( ; (pObj = Hsh_IntObj(p, *pPlace)); pPlace = &pObj->iNext ) if ( *pPlace == -1 )
if ( !memcmp( pData, Hsh_IntData(p, pObj->iData), sizeof(int) * p->nSize ) ) {
return (word *)pObj - Vec_WrdArray(p->vObjs); *pPlace = Vec_WrdSize(p->vObjs);
*pPlace = Vec_WrdSize(p->vObjs); Vec_WrdPush( p->vObjs, Hsh_IntWord(iData, -1) );
Vec_WrdPush( p->vObjs, Hsh_IntWord(iData, -1) ); return Vec_WrdSize(p->vObjs) - 1;
return Vec_WrdSize(p->vObjs)-1; }
return (word *)Hsh_IntObj(p, *pPlace) - Vec_WrdArray(p->vObjs);
} }
/**Function************************************************************* /**Function*************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment