diff options
Diffstat (limited to 'src/misc/extra')
-rw-r--r-- | src/misc/extra/extra.h | 14 | ||||
-rw-r--r-- | src/misc/extra/extraBddAuto.c | 18 | ||||
-rw-r--r-- | src/misc/extra/extraBddImage.c | 2 | ||||
-rw-r--r-- | src/misc/extra/extraBddKmap.c | 20 | ||||
-rw-r--r-- | src/misc/extra/extraBddMisc.c | 2 | ||||
-rw-r--r-- | src/misc/extra/extraBddSymm.c | 14 | ||||
-rw-r--r-- | src/misc/extra/extraBddUnate.c | 4 | ||||
-rw-r--r-- | src/misc/extra/extraUtilCanon.c | 15 | ||||
-rw-r--r-- | src/misc/extra/extraUtilMemory.c | 2 | ||||
-rw-r--r-- | src/misc/extra/extraUtilMisc.c | 12 | ||||
-rw-r--r-- | src/misc/extra/extraUtilReader.c | 4 |
11 files changed, 57 insertions, 50 deletions
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h index 9870c3d0..6b840024 100644 --- a/src/misc/extra/extra.h +++ b/src/misc/extra/extra.h @@ -93,21 +93,21 @@ typedef unsigned long long uint64; // hash key macros #define hashKey1(a,TSIZE) \ -((unsigned)(a) % TSIZE) +((PORT_PTRUINT_T)(a) % TSIZE) #define hashKey2(a,b,TSIZE) \ -(((unsigned)(a) + (unsigned)(b) * DD_P1) % TSIZE) +(((PORT_PTRUINT_T)(a) + (PORT_PTRUINT_T)(b) * DD_P1) % TSIZE) #define hashKey3(a,b,c,TSIZE) \ -(((((unsigned)(a) + (unsigned)(b)) * DD_P1 + (unsigned)(c)) * DD_P2 ) % TSIZE) +(((((PORT_PTRUINT_T)(a) + (PORT_PTRUINT_T)(b)) * DD_P1 + (PORT_PTRUINT_T)(c)) * DD_P2 ) % TSIZE) #define hashKey4(a,b,c,d,TSIZE) \ -((((((unsigned)(a) + (unsigned)(b)) * DD_P1 + (unsigned)(c)) * DD_P2 + \ - (unsigned)(d)) * DD_P3) % TSIZE) +((((((PORT_PTRUINT_T)(a) + (PORT_PTRUINT_T)(b)) * DD_P1 + (PORT_PTRUINT_T)(c)) * DD_P2 + \ + (PORT_PTRUINT_T)(d)) * DD_P3) % TSIZE) #define hashKey5(a,b,c,d,e,TSIZE) \ -(((((((unsigned)(a) + (unsigned)(b)) * DD_P1 + (unsigned)(c)) * DD_P2 + \ - (unsigned)(d)) * DD_P3 + (unsigned)(e)) * DD_P1) % TSIZE) +(((((((PORT_PTRUINT_T)(a) + (PORT_PTRUINT_T)(b)) * DD_P1 + (PORT_PTRUINT_T)(c)) * DD_P2 + \ + (PORT_PTRUINT_T)(d)) * DD_P3 + (PORT_PTRUINT_T)(e)) * DD_P1) % TSIZE) #ifndef PRT #define PRT(a,t) printf("%s = ", (a)); printf("%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC)) diff --git a/src/misc/extra/extraBddAuto.c b/src/misc/extra/extraBddAuto.c index 21a969ba..11612ef4 100644 --- a/src/misc/extra/extraBddAuto.c +++ b/src/misc/extra/extraBddAuto.c @@ -575,11 +575,11 @@ DdNode * extraBddSpaceFromFunction( DdManager * dd, DdNode * bF, DdNode * bG ) // both bFunc and bCore are not constants // the operation is commutative - normalize the problem - if ( (unsigned)bF > (unsigned)bG ) + if ( (unsigned)(PORT_PTRUINT_T)bF > (unsigned)(PORT_PTRUINT_T)bG ) return extraBddSpaceFromFunction(dd, bG, bF); - if ( bRes = cuddCacheLookup2(dd, extraBddSpaceFromFunction, bF, bG) ) + if ( (bRes = cuddCacheLookup2(dd, extraBddSpaceFromFunction, bF, bG)) ) return bRes; else { @@ -741,7 +741,7 @@ DdNode * extraBddSpaceFromFunctionPos( DdManager * dd, DdNode * bF ) if ( cuddIsConstant(bFR) ) return b1; - if ( bRes = cuddCacheLookup1(dd, extraBddSpaceFromFunctionPos, bF) ) + if ( (bRes = cuddCacheLookup1(dd, extraBddSpaceFromFunctionPos, bF)) ) return bRes; else { @@ -872,7 +872,7 @@ DdNode * extraBddSpaceFromFunctionNeg( DdManager * dd, DdNode * bF ) if ( cuddIsConstant(bFR) ) return b0; - if ( bRes = cuddCacheLookup1(dd, extraBddSpaceFromFunctionNeg, bF) ) + if ( (bRes = cuddCacheLookup1(dd, extraBddSpaceFromFunctionNeg, bF)) ) return bRes; else { @@ -1003,7 +1003,7 @@ DdNode * extraBddSpaceCanonVars( DdManager * dd, DdNode * bF ) if ( cuddIsConstant(bFR) ) return bF; - if ( bRes = cuddCacheLookup1(dd, extraBddSpaceCanonVars, bF) ) + if ( (bRes = cuddCacheLookup1(dd, extraBddSpaceCanonVars, bF)) ) return bRes; else { @@ -1075,7 +1075,7 @@ DdNode * extraBddSpaceEquationsPos( DdManager * dd, DdNode * bF ) if ( bF == b1 ) return z0; - if ( zRes = cuddCacheLookup1Zdd(dd, extraBddSpaceEquationsPos, bF) ) + if ( (zRes = cuddCacheLookup1Zdd(dd, extraBddSpaceEquationsPos, bF)) ) return zRes; else { @@ -1205,7 +1205,7 @@ DdNode * extraBddSpaceEquationsNeg( DdManager * dd, DdNode * bF ) if ( bF == b1 ) return z0; - if ( zRes = cuddCacheLookup1Zdd(dd, extraBddSpaceEquationsNeg, bF) ) + if ( (zRes = cuddCacheLookup1Zdd(dd, extraBddSpaceEquationsNeg, bF)) ) return zRes; else { @@ -1337,7 +1337,7 @@ DdNode * extraBddSpaceFromMatrixPos( DdManager * dd, DdNode * zA ) if ( zA == z1 ) return b1; - if ( bRes = cuddCacheLookup1(dd, extraBddSpaceFromMatrixPos, zA) ) + if ( (bRes = cuddCacheLookup1(dd, extraBddSpaceFromMatrixPos, zA)) ) return bRes; else { @@ -1455,7 +1455,7 @@ DdNode * extraBddSpaceFromMatrixNeg( DdManager * dd, DdNode * zA ) if ( zA == z1 ) return b0; - if ( bRes = cuddCacheLookup1(dd, extraBddSpaceFromMatrixNeg, zA) ) + if ( (bRes = cuddCacheLookup1(dd, extraBddSpaceFromMatrixNeg, zA)) ) return bRes; else { diff --git a/src/misc/extra/extraBddImage.c b/src/misc/extra/extraBddImage.c index d21cfe23..23c1c682 100644 --- a/src/misc/extra/extraBddImage.c +++ b/src/misc/extra/extraBddImage.c @@ -838,7 +838,7 @@ int Extra_FindBestVariable( DdManager * dd, int iVarBest, v; double CostBest, CostCur; - CostBest = 100000000000000; + CostBest = 100000000000000.0; iVarBest = -1; for ( v = 0; v < nVars; v++ ) if ( pVars[v] ) diff --git a/src/misc/extra/extraBddKmap.c b/src/misc/extra/extraBddKmap.c index bb43db68..6b54b450 100644 --- a/src/misc/extra/extraBddKmap.c +++ b/src/misc/extra/extraBddKmap.c @@ -333,10 +333,12 @@ void Extra_PrintKMap( fprintf( Output, "%c", DOUBLE_HORIZONTAL ); fprintf( Output, "%c", DOUBLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", D_JOINS_D_HOR_BOT ); else fprintf( Output, "%c", S_JOINS_D_HOR_BOT ); + } } fprintf( Output, "%c", DOUBLE_TOP_RIGHT ); fprintf( Output, "\n" ); @@ -394,10 +396,12 @@ void Extra_PrintKMap( fprintf( Output, " " ); if ( h != nCellsHor-1 ) + { if ( h&1 ) fprintf( Output, "%c", DOUBLE_VERTICAL ); else fprintf( Output, "%c", SINGLE_VERTICAL ); + } } fprintf( Output, "%c", DOUBLE_VERTICAL ); fprintf( Output, "\n" ); @@ -417,10 +421,12 @@ void Extra_PrintKMap( fprintf( Output, "%c", DOUBLE_HORIZONTAL ); fprintf( Output, "%c", DOUBLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", DOUBLES_CROSS ); else fprintf( Output, "%c", S_VER_CROSS_D_HOR ); + } } fprintf( Output, "%c", D_JOINS_D_VER_LEFT ); } @@ -433,10 +439,12 @@ void Extra_PrintKMap( fprintf( Output, "%c", SINGLE_HORIZONTAL ); fprintf( Output, "%c", SINGLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", S_HOR_CROSS_D_VER ); else fprintf( Output, "%c", SINGLES_CROSS ); + } } fprintf( Output, "%c", S_JOINS_D_VER_LEFT ); } @@ -454,10 +462,12 @@ void Extra_PrintKMap( fprintf( Output, "%c", DOUBLE_HORIZONTAL ); fprintf( Output, "%c", DOUBLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", D_JOINS_D_HOR_TOP ); else fprintf( Output, "%c", S_JOINS_D_HOR_TOP ); + } } fprintf( Output, "%c", DOUBLE_BOT_RIGHT ); fprintf( Output, "\n" ); @@ -588,10 +598,12 @@ void Extra_PrintKMapRelation( fprintf( Output, "%c", DOUBLE_HORIZONTAL ); fprintf( Output, "%c", DOUBLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", D_JOINS_D_HOR_BOT ); else fprintf( Output, "%c", S_JOINS_D_HOR_BOT ); + } } fprintf( Output, "%c", DOUBLE_TOP_RIGHT ); fprintf( Output, "\n" ); @@ -651,10 +663,12 @@ void Extra_PrintKMapRelation( fprintf( Output, " " ); if ( h != nCellsHor-1 ) + { if ( h&1 ) fprintf( Output, "%c", DOUBLE_VERTICAL ); else fprintf( Output, "%c", SINGLE_VERTICAL ); + } } fprintf( Output, "%c", DOUBLE_VERTICAL ); fprintf( Output, "\n" ); @@ -674,10 +688,12 @@ void Extra_PrintKMapRelation( fprintf( Output, "%c", DOUBLE_HORIZONTAL ); fprintf( Output, "%c", DOUBLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", DOUBLES_CROSS ); else fprintf( Output, "%c", S_VER_CROSS_D_HOR ); + } } fprintf( Output, "%c", D_JOINS_D_VER_LEFT ); } @@ -690,10 +706,12 @@ void Extra_PrintKMapRelation( fprintf( Output, "%c", SINGLE_HORIZONTAL ); fprintf( Output, "%c", SINGLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", S_HOR_CROSS_D_VER ); else fprintf( Output, "%c", SINGLES_CROSS ); + } } fprintf( Output, "%c", S_JOINS_D_VER_LEFT ); } @@ -711,10 +729,12 @@ void Extra_PrintKMapRelation( fprintf( Output, "%c", DOUBLE_HORIZONTAL ); fprintf( Output, "%c", DOUBLE_HORIZONTAL ); if ( s != nCellsHor-1 ) + { if ( s&1 ) fprintf( Output, "%c", D_JOINS_D_HOR_TOP ); else fprintf( Output, "%c", S_JOINS_D_HOR_TOP ); + } } fprintf( Output, "%c", DOUBLE_BOT_RIGHT ); fprintf( Output, "\n" ); diff --git a/src/misc/extra/extraBddMisc.c b/src/misc/extra/extraBddMisc.c index 5ebedaba..8b8bdd81 100644 --- a/src/misc/extra/extraBddMisc.c +++ b/src/misc/extra/extraBddMisc.c @@ -1015,7 +1015,7 @@ DdNode * extraBddMove( if ( Cudd_IsConstant(bF) ) return bF; - if ( bRes = cuddCacheLookup2(dd, extraBddMove, bF, bDist) ) + if ( (bRes = cuddCacheLookup2(dd, extraBddMove, bF, bDist)) ) return bRes; else { diff --git a/src/misc/extra/extraBddSymm.c b/src/misc/extra/extraBddSymm.c index 358402b0..666814f6 100644 --- a/src/misc/extra/extraBddSymm.c +++ b/src/misc/extra/extraBddSymm.c @@ -515,7 +515,7 @@ DdNode* Extra_zddTuplesFromBdd( return NULL; /* the second argument in the recursive call stannds for <n>; - /* reate the first argument, which stands for <k> + * reate the first argument, which stands for <k> * as when we are talking about the tuple of <k> out of <n> */ for ( i = 0; i < nVars-K; i++ ) bVarsK = cuddT( bVarsK ); @@ -603,7 +603,7 @@ extraZddSymmPairsCompute( } assert( bVars != b1 ); - if ( zRes = cuddCacheLookup2Zdd(dd, extraZddSymmPairsCompute, bFunc, bVars) ) + if ( (zRes = cuddCacheLookup2Zdd(dd, extraZddSymmPairsCompute, bFunc, bVars)) ) return zRes; else { @@ -817,7 +817,7 @@ DdNode * extraZddGetSymmetricVars( } assert( bVars != b1 ); - if ( zRes = cuddCacheLookupZdd(dd, DD_GET_SYMM_VARS_TAG, bF, bG, bVars) ) + if ( (zRes = cuddCacheLookupZdd(dd, DD_GET_SYMM_VARS_TAG, bF, bG, bVars)) ) return zRes; else { @@ -1005,7 +1005,7 @@ DdNode * extraZddGetSingletons( // if ( bVars == b0 ) // bug fixed by Jin Zhang, Jan 23, 2004 return z1; - if ( zRes = cuddCacheLookup1Zdd(dd, extraZddGetSingletons, bVars) ) + if ( (zRes = cuddCacheLookup1Zdd(dd, extraZddGetSingletons, bVars)) ) return zRes; else { @@ -1067,7 +1067,7 @@ DdNode * extraBddReduceVarSet( if ( cuddIsConstant(bFR) || bVars == b1 ) return bVars; - if ( bRes = cuddCacheLookup2(dd, extraBddReduceVarSet, bVars, bF) ) + if ( (bRes = cuddCacheLookup2(dd, extraBddReduceVarSet, bVars, bF)) ) return bRes; else { @@ -1175,7 +1175,7 @@ DdNode * extraBddCheckVarsSymmetric( assert( bVars != b1 ); - if ( bRes = cuddCacheLookup2(dd, extraBddCheckVarsSymmetric, bF, bVars) ) + if ( (bRes = cuddCacheLookup2(dd, extraBddCheckVarsSymmetric, bF, bVars)) ) return bRes; else { @@ -1425,7 +1425,7 @@ DdNode * extraZddSelectOneSubset( if ( zS == z1 ) return z1; // check cache - if ( zRes = cuddCacheLookup1Zdd( dd, extraZddSelectOneSubset, zS ) ) + if ( (zRes = cuddCacheLookup1Zdd( dd, extraZddSelectOneSubset, zS )) ) return zRes; else { diff --git a/src/misc/extra/extraBddUnate.c b/src/misc/extra/extraBddUnate.c index b0297c77..92396c38 100644 --- a/src/misc/extra/extraBddUnate.c +++ b/src/misc/extra/extraBddUnate.c @@ -395,7 +395,7 @@ extraZddUnateInfoCompute( } assert( bVars != b1 ); - if ( zRes = cuddCacheLookup2Zdd(dd, extraZddUnateInfoCompute, bFunc, bVars) ) + if ( (zRes = cuddCacheLookup2Zdd(dd, extraZddUnateInfoCompute, bFunc, bVars)) ) return zRes; else { @@ -573,7 +573,7 @@ DdNode * extraZddGetSingletonsBoth( if ( bVars == b1 ) return z1; - if ( zRes = cuddCacheLookup1Zdd(dd, extraZddGetSingletonsBoth, bVars) ) + if ( (zRes = cuddCacheLookup1Zdd(dd, extraZddGetSingletonsBoth, bVars)) ) return zRes; else { diff --git a/src/misc/extra/extraUtilCanon.c b/src/misc/extra/extraUtilCanon.c index fcc7d84d..c9c199d8 100644 --- a/src/misc/extra/extraUtilCanon.c +++ b/src/misc/extra/extraUtilCanon.c @@ -344,10 +344,6 @@ void Map_Var3Test() { uTruth = i; Count = Extra_TruthCanonFastN( 5, 3, &uTruth, &ptRes, &pfRes ); - if ( *ptRes != uCanons[i] || Count != pCounters[i] ) - { - int k = 0; - } } } @@ -369,7 +365,7 @@ void Map_Var4Test() unsigned short * uCanons; char ** uPhases; char * pCounters; - int i, k; + int i; unsigned * ptRes; char * pfRes; unsigned uTruth; @@ -381,15 +377,6 @@ void Map_Var4Test() { uTruth = i; Count = Extra_TruthCanonFastN( 5, 4, &uTruth, &ptRes, &pfRes ); - if ( (*ptRes & 0xFFFF) != uCanons[i] || Count != pCounters[i] ) - { - int k = 0; - } - for ( k = 0; k < Count; k++ ) - if ( uPhases[i][k] != pfRes[k] ) - { - int v = 0; - } } } diff --git a/src/misc/extra/extraUtilMemory.c b/src/misc/extra/extraUtilMemory.c index 376ed9b0..39c34296 100644 --- a/src/misc/extra/extraUtilMemory.c +++ b/src/misc/extra/extraUtilMemory.c @@ -562,7 +562,7 @@ char * Extra_MmStepEntryFetch( Extra_MmStep_t * p, int nBytes ) if ( p->nLargeChunksAlloc == 0 ) p->nLargeChunksAlloc = 32; p->nLargeChunksAlloc *= 2; - p->pLargeChunks = REALLOC( char *, p->pLargeChunks, p->nLargeChunksAlloc ); + p->pLargeChunks = REALLOC( void *, p->pLargeChunks, p->nLargeChunksAlloc ); } p->pLargeChunks[ p->nLargeChunks++ ] = ALLOC( char, nBytes ); return p->pLargeChunks[ p->nLargeChunks - 1 ]; diff --git a/src/misc/extra/extraUtilMisc.c b/src/misc/extra/extraUtilMisc.c index dff774bc..48fca0ba 100644 --- a/src/misc/extra/extraUtilMisc.c +++ b/src/misc/extra/extraUtilMisc.c @@ -819,7 +819,7 @@ void Extra_Truth3VarN( unsigned ** puCanons, char *** puPhases, char ** ppCounte { assert( uCanons[uPhase] == uTruth32 ); if ( pCounters[uPhase] < nPhasesMax ) - uPhases[uPhase][ pCounters[uPhase]++ ] = i; + uPhases[uPhase][ (int)pCounters[uPhase]++ ] = i; } } } @@ -885,7 +885,7 @@ void Extra_Truth4VarN( unsigned short ** puCanons, char *** puPhases, char ** pp { assert( uCanons[uPhase] == uTruth ); if ( pCounters[uPhase] < nPhasesMax ) - uPhases[uPhase][ pCounters[uPhase]++ ] = i; + uPhases[uPhase][ (int)pCounters[uPhase]++ ] = i; } } } @@ -917,15 +917,15 @@ void Extra_Truth4VarN( unsigned short ** puCanons, char *** puPhases, char ** pp ***********************************************************************/ void ** Extra_ArrayAlloc( int nCols, int nRows, int Size ) { - char ** pRes; + void ** pRes; char * pBuffer; int i; assert( nCols > 0 && nRows > 0 && Size > 0 ); pBuffer = ALLOC( char, nCols * (sizeof(void *) + nRows * Size) ); - pRes = (char **)pBuffer; + pRes = (void **)pBuffer; pRes[0] = pBuffer + nCols * sizeof(void *); for ( i = 1; i < nCols; i++ ) - pRes[i] = pRes[0] + i * nRows * Size; + pRes[i] = (void *)((char *)pRes[0] + i * nRows * Size); return pRes; } @@ -1860,7 +1860,7 @@ void Extra_TruthExpand( int nVars, int nWords, unsigned * puTruth, unsigned uPha { int i; for ( i = 0; i < nWords; i++ ) - puTruthR[i] = uTruths[Cases[uPhase]][i]; + puTruthR[i] = uTruths[(int)Cases[uPhase]][i]; return; } diff --git a/src/misc/extra/extraUtilReader.c b/src/misc/extra/extraUtilReader.c index c165b989..b6a53fbc 100644 --- a/src/misc/extra/extraUtilReader.c +++ b/src/misc/extra/extraUtilReader.c @@ -232,7 +232,7 @@ int Extra_FileReaderGetLineNumber( Extra_FileReader_t * p, int iToken ) void * Extra_FileReaderGetTokens( Extra_FileReader_t * p ) { Vec_Ptr_t * vTokens; - while ( vTokens = Extra_FileReaderGetTokens_int( p ) ) + while ( (vTokens = Extra_FileReaderGetTokens_int( p )) ) if ( vTokens->nSize > 0 ) break; return vTokens; @@ -272,7 +272,7 @@ void * Extra_FileReaderGetTokens_int( Extra_FileReader_t * p ) if ( *pChar == '\n' ) p->nLineCounter++; // switch depending on the character - MapValue = p->pCharMap[*pChar]; + MapValue = p->pCharMap[(int)*pChar]; // printf( "Char value = %d. Map value = %d.\n", *pChar, MapValue ); |