diff options
Diffstat (limited to 'src/aig')
59 files changed, 271 insertions, 236 deletions
diff --git a/src/aig/aig/aig.h b/src/aig/aig/aig.h index 1f101584..96aa1c93 100644 --- a/src/aig/aig/aig.h +++ b/src/aig/aig/aig.h @@ -327,7 +327,7 @@ static inline Aig_Obj_t * Aig_ObjFanout0( Aig_Man_t * p, Aig_Obj_t * pObj ) { static inline Aig_Obj_t * Aig_ObjEquiv( Aig_Man_t * p, Aig_Obj_t * pObj ) { return p->pEquivs? p->pEquivs[pObj->Id] : NULL; } static inline Aig_Obj_t * Aig_ObjRepr( Aig_Man_t * p, Aig_Obj_t * pObj ) { return p->pReprs? p->pReprs[pObj->Id] : NULL; } static inline Aig_Obj_t * Aig_ObjHaig( Aig_Obj_t * pObj ) { assert( Aig_Regular(pObj)->pHaig ); return Aig_NotCond( Aig_Regular(pObj)->pHaig, Aig_IsComplement(pObj) ); } -static inline int Aig_ObjPioNum( Aig_Obj_t * pObj ) { assert( !Aig_ObjIsNode(pObj) ); return (int)(long)pObj->pNext; } +static inline int Aig_ObjPioNum( Aig_Obj_t * pObj ) { assert( !Aig_ObjIsNode(pObj) ); return (int)(PORT_PTRINT_T)pObj->pNext; } static inline int Aig_ObjWhatFanin( Aig_Obj_t * pObj, Aig_Obj_t * pFanin ) { if ( Aig_ObjFanin0(pObj) == pFanin ) return 0; diff --git a/src/aig/aig/aigInter.c b/src/aig/aig/aigInter.c index b58b758d..80198753 100644 --- a/src/aig/aig/aigInter.c +++ b/src/aig/aig/aigInter.c @@ -51,7 +51,7 @@ void Aig_ManInterFast( Aig_Man_t * pManOn, Aig_Man_t * pManOff, int fVerbose ) Cnf_Dat_t * pCnfOn, * pCnfOff; Aig_Obj_t * pObj, * pObj2; int Lits[3], status, i; - int clk = clock(); +// int clk = clock(); assert( Aig_ManPiNum(pManOn) == Aig_ManPiNum(pManOff) ); assert( Aig_ManPoNum(pManOn) == Aig_ManPoNum(pManOff) ); @@ -154,7 +154,7 @@ Aig_Man_t * Aig_ManInter( Aig_Man_t * pManOn, Aig_Man_t * pManOff, int fRelation Aig_Obj_t * pObj, * pObj2; int Lits[3], status, i; int clk; - int iLast; + int iLast = -1; // Suppress "might be used uninitialized" assert( Aig_ManPiNum(pManOn) == Aig_ManPiNum(pManOff) ); diff --git a/src/aig/aig/aigObj.c b/src/aig/aig/aigObj.c index 86117f10..3ceed094 100644 --- a/src/aig/aig/aigObj.c +++ b/src/aig/aig/aigObj.c @@ -322,7 +322,8 @@ void Aig_ObjPrint( Aig_Man_t * p, Aig_Obj_t * pObj ) if ( fShowFanouts && p->pFanData ) { Aig_Obj_t * pFanout; - int i, iFan; + int i; + int iFan = -1; // Suppress "might be used uninitialized" printf( "\nFanouts:\n" ); Aig_ObjForEachFanout( p, pObj, pFanout, iFan, i ) { diff --git a/src/aig/aig/aigOper.c b/src/aig/aig/aigOper.c index 6e9d37ba..208e2d44 100644 --- a/src/aig/aig/aigOper.c +++ b/src/aig/aig/aigOper.c @@ -236,7 +236,7 @@ Aig_Obj_t * Aig_Exor( Aig_Man_t * p, Aig_Obj_t * p0, Aig_Obj_t * p1 ) p1 = Aig_Regular(p1); pGhost = Aig_ObjCreateGhost( p, p0, p1, AIG_OBJ_EXOR ); // check the table - if ( pResult = Aig_TableLookup( p, pGhost ) ) + if ( (pResult = Aig_TableLookup( p, pGhost )) ) return Aig_NotCond( pResult, fCompl ); pResult = Aig_ObjCreate( p, pGhost ); return Aig_NotCond( pResult, fCompl ); diff --git a/src/aig/aig/aigPart.c b/src/aig/aig/aigPart.c index 392de03e..d9ec616a 100644 --- a/src/aig/aig/aigPart.c +++ b/src/aig/aig/aigPart.c @@ -1514,10 +1514,6 @@ void Aig_ManChoiceEval( Aig_Man_t * p ) { if ( !Aig_ObjIsChoice(p, pNode) ) continue; - if ( pNode->Id == 4225 ) - { - int x = 0; - } Counter = 0; for ( pTemp = pNode; pTemp; pTemp = Aig_ObjEquiv(p, pTemp) ) Counter++; diff --git a/src/aig/aig/aigPartReg.c b/src/aig/aig/aigPartReg.c index 96ad1812..79761a41 100644 --- a/src/aig/aig/aigPartReg.c +++ b/src/aig/aig/aigPartReg.c @@ -119,7 +119,9 @@ void Aig_ManRegManStop( Aig_ManPre_t * p ) int Aig_ManRegFindSeed( Aig_ManPre_t * p ) { Vec_Int_t * vRegs; - int i, k, iReg, iMax, nRegsCur, nRegsMax = -1; + int i, k, iReg; + int iMax = -1; // Suppress "might be used uninitialized" + int nRegsCur, nRegsMax = -1; for ( i = 0; i < Aig_ManRegNum(p->pAig); i++ ) { if ( p->pfUsedRegs[i] ) diff --git a/src/aig/aig/aigRepr.c b/src/aig/aig/aigRepr.c index b0605c1e..eeca69bf 100644 --- a/src/aig/aig/aigRepr.c +++ b/src/aig/aig/aigRepr.c @@ -526,15 +526,16 @@ int Aig_TransferMappedClasses( Aig_Man_t * pAig, Aig_Man_t * pPart, int * pMapBa Aig_Obj_t * pObj; int nClasses, k; nClasses = 0; - if ( pPart->pReprs ) - Aig_ManForEachObj( pPart, pObj, k ) - { - if ( pPart->pReprs[pObj->Id] == NULL ) - continue; - nClasses++; - Aig_ObjSetRepr( pAig, - Aig_ManObj(pAig, pMapBack[pObj->Id]), - Aig_ManObj(pAig, pMapBack[pPart->pReprs[pObj->Id]->Id]) ); + if ( pPart->pReprs ) { + Aig_ManForEachObj( pPart, pObj, k ) + { + if ( pPart->pReprs[pObj->Id] == NULL ) + continue; + nClasses++; + Aig_ObjSetRepr( pAig, + Aig_ManObj(pAig, pMapBack[pObj->Id]), + Aig_ManObj(pAig, pMapBack[pPart->pReprs[pObj->Id]->Id]) ); + } } return nClasses; } diff --git a/src/aig/aig/aigShow.c b/src/aig/aig/aigShow.c index 8dc67c79..1e9e10ac 100644 --- a/src/aig/aig/aigShow.c +++ b/src/aig/aig/aigShow.c @@ -329,7 +329,7 @@ void Aig_WriteDotAig( Aig_Man_t * pMan, char * pFileName, int fHaig, Vec_Ptr_t * void Aig_ManShow( Aig_Man_t * pMan, int fHaig, Vec_Ptr_t * vBold ) { extern void Abc_ShowFile( char * FileNameDot ); - static Counter = 0; + static int Counter = 0; char FileNameDot[200]; FILE * pFile; // create the file name diff --git a/src/aig/aig/aigUtil.c b/src/aig/aig/aigUtil.c index 7b64d562..211b2d9f 100644 --- a/src/aig/aig/aigUtil.c +++ b/src/aig/aig/aigUtil.c @@ -699,7 +699,7 @@ void Aig_ManDumpBlif( Aig_Man_t * p, char * pFileName, Vec_Ptr_t * vPiNames, Vec fprintf( pFile, ".inputs" ); Aig_ManForEachPiSeq( p, pObj, i ) if ( vPiNames ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, i) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, i) ); else fprintf( pFile, " n%0*d", nDigits, pObj->iData ); fprintf( pFile, "\n" ); @@ -707,7 +707,7 @@ void Aig_ManDumpBlif( Aig_Man_t * p, char * pFileName, Vec_Ptr_t * vPiNames, Vec fprintf( pFile, ".outputs" ); Aig_ManForEachPoSeq( p, pObj, i ) if ( vPoNames ) - fprintf( pFile, " %s", Vec_PtrEntry(vPoNames, i) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPoNames, i) ); else fprintf( pFile, " n%0*d", nDigits, pObj->iData ); fprintf( pFile, "\n" ); @@ -719,11 +719,11 @@ void Aig_ManDumpBlif( Aig_Man_t * p, char * pFileName, Vec_Ptr_t * vPiNames, Vec { fprintf( pFile, ".latch" ); if ( vPoNames ) - fprintf( pFile, " %s", Vec_PtrEntry(vPoNames, Aig_ManPoNum(p)-Aig_ManRegNum(p)+i) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPoNames, Aig_ManPoNum(p)-Aig_ManRegNum(p)+i) ); else fprintf( pFile, " n%0*d", nDigits, pObjLi->iData ); if ( vPiNames ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, Aig_ManPiNum(p)-Aig_ManRegNum(p)+i) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, Aig_ManPiNum(p)-Aig_ManRegNum(p)+i) ); else fprintf( pFile, " n%0*d", nDigits, pObjLo->iData ); fprintf( pFile, " 0\n" ); @@ -738,11 +738,11 @@ void Aig_ManDumpBlif( Aig_Man_t * p, char * pFileName, Vec_Ptr_t * vPiNames, Vec { fprintf( pFile, ".names" ); if ( vPiNames && Aig_ObjIsPi(Aig_ObjFanin0(pObj)) ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, Aig_ObjPioNum(Aig_ObjFanin0(pObj))) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, Aig_ObjPioNum(Aig_ObjFanin0(pObj))) ); else fprintf( pFile, " n%0*d", nDigits, Aig_ObjFanin0(pObj)->iData ); if ( vPiNames && Aig_ObjIsPi(Aig_ObjFanin1(pObj)) ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, Aig_ObjPioNum(Aig_ObjFanin1(pObj))) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, Aig_ObjPioNum(Aig_ObjFanin1(pObj))) ); else fprintf( pFile, " n%0*d", nDigits, Aig_ObjFanin1(pObj)->iData ); fprintf( pFile, " n%0*d\n", nDigits, pObj->iData ); @@ -753,11 +753,11 @@ void Aig_ManDumpBlif( Aig_Man_t * p, char * pFileName, Vec_Ptr_t * vPiNames, Vec { fprintf( pFile, ".names" ); if ( vPiNames && Aig_ObjIsPi(Aig_ObjFanin0(pObj)) ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, Aig_ObjPioNum(Aig_ObjFanin0(pObj))) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, Aig_ObjPioNum(Aig_ObjFanin0(pObj))) ); else fprintf( pFile, " n%0*d", nDigits, Aig_ObjFanin0(pObj)->iData ); if ( vPoNames ) - fprintf( pFile, " %s\n", Vec_PtrEntry(vPoNames, Aig_ObjPioNum(pObj)) ); + fprintf( pFile, " %s\n", (char*)Vec_PtrEntry(vPoNames, Aig_ObjPioNum(pObj)) ); else fprintf( pFile, " n%0*d\n", nDigits, pObj->iData ); fprintf( pFile, "%d 1\n", !Aig_ObjFaninC0(pObj) ); @@ -901,9 +901,9 @@ void Aig_ManSetPioNumbers( Aig_Man_t * p ) Aig_Obj_t * pObj; int i; Aig_ManForEachPi( p, pObj, i ) - pObj->pNext = (Aig_Obj_t *)i; + pObj->PioNum = i; Aig_ManForEachPo( p, pObj, i ) - pObj->pNext = (Aig_Obj_t *)i; + pObj->PioNum = i; } /**Function************************************************************* @@ -961,7 +961,7 @@ int Aig_ManCountChoices( Aig_Man_t * p ) void Aig_ManPrintControlFanouts( Aig_Man_t * p ) { Aig_Obj_t * pObj, * pFanin0, * pFanin1, * pCtrl; - int i, Counter = 0; + int i; pCtrl = Aig_ManPi( p, Aig_ManPiNum(p) - 1 ); @@ -1072,8 +1072,8 @@ void Aig_ManRandomTest1() } -#define NUMBER1 3716960521 -#define NUMBER2 2174103536 +#define NUMBER1 3716960521u +#define NUMBER2 2174103536u /**Function************************************************************* diff --git a/src/aig/bbr/bbrImage.c b/src/aig/bbr/bbrImage.c index 234ae3f8..f362162c 100644 --- a/src/aig/bbr/bbrImage.c +++ b/src/aig/bbr/bbrImage.c @@ -939,7 +939,7 @@ int Bbr_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/aig/bbr/bbrNtbdd.c b/src/aig/bbr/bbrNtbdd.c index 5e51a157..05c98fe1 100644 --- a/src/aig/bbr/bbrNtbdd.c +++ b/src/aig/bbr/bbrNtbdd.c @@ -48,7 +48,6 @@ static inline void Aig_ObjCleanGlobalBdd( DdManager * dd, Aig_Obj_t * pObj ) DdNode * Bbr_NodeGlobalBdds_rec( DdManager * dd, Aig_Obj_t * pNode, int nBddSizeMax, int fDropInternal, ProgressBar * pProgress, int * pCounter, int fVerbose ) { DdNode * bFunc, * bFunc0, * bFunc1; - int fDetectMuxes = 1; assert( !Aig_IsComplement(pNode) ); if ( Cudd_ReadKeys(dd)-Cudd_ReadDead(dd) > (unsigned)nBddSizeMax ) { diff --git a/src/aig/bbr/bbrReach.c b/src/aig/bbr/bbrReach.c index a78a3fb2..94d6dbfc 100644 --- a/src/aig/bbr/bbrReach.c +++ b/src/aig/bbr/bbrReach.c @@ -206,10 +206,12 @@ DdNode ** Aig_ManCreatePartitions( DdManager * dd, Aig_Man_t * p, int fReorder, int Aig_ManComputeReachable( DdManager * dd, Aig_Man_t * p, DdNode ** pbParts, DdNode * bInitial, DdNode ** pbOutputs, int nBddMax, int nIterMax, int fPartition, int fReorder, int fVerbose, int fSilent ) { int fInternalReorder = 0; - Bbr_ImageTree_t * pTree; - Bbr_ImageTree2_t * pTree2; + Bbr_ImageTree_t * pTree = NULL; // Suppress "might be used uninitialized" + Bbr_ImageTree2_t * pTree2 = NULL; // Supprses "might be used uninitialized" DdNode * bReached, * bCubeCs; - DdNode * bCurrent, * bNext, * bTemp; + DdNode * bCurrent; + DdNode * bNext = NULL; // Suppress "might be used uninitialized" + DdNode * bTemp; DdNode ** pbVarsY; Aig_Obj_t * pLatch; int i, nIters, nBddSize; diff --git a/src/aig/bdc/bdcDec.c b/src/aig/bdc/bdcDec.c index 55ce97a0..ccf6248f 100644 --- a/src/aig/bdc/bdcDec.c +++ b/src/aig/bdc/bdcDec.c @@ -41,7 +41,8 @@ ***********************************************************************/ void Bdc_SuppMinimize2( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) { - int v, clk; + int v; + int clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) clk = clock(); // compute support @@ -82,7 +83,8 @@ void Bdc_SuppMinimize2( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) ***********************************************************************/ void Bdc_SuppMinimize( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) { - int v, clk; + int v; + int clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) clk = clock(); // go through the support variables @@ -245,7 +247,9 @@ int Bdc_DecomposeFindInitialVarSet( Bdc_Man_t * p, Bdc_Isf_t * pIsf, Bdc_Isf_t * ***********************************************************************/ int Bdc_DecomposeWeakOr( Bdc_Man_t * p, Bdc_Isf_t * pIsf, Bdc_Isf_t * pIsfL, Bdc_Isf_t * pIsfR ) { - int v, VarCost, VarBest, Cost, VarCostBest = 0; + int v, VarCost; + int VarBest = -1; // Suppress "might be used uninitialized" + int Cost, VarCostBest = 0; for ( v = 0; v < p->nVars; v++ ) { @@ -542,7 +546,7 @@ int Bdc_DecomposeStepMux( Bdc_Man_t * p, Bdc_Isf_t * pIsf, Bdc_Isf_t * pIsfL, Bd { int Var, VarMin, nSuppMin, nSuppCur; unsigned uSupp0, uSupp1; - int clk; + int clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) clk = clock(); VarMin = -1; @@ -667,13 +671,14 @@ Bdc_Fun_t * Bdc_ManCreateGate( Bdc_Man_t * p, Bdc_Fun_t * pFunc0, Bdc_Fun_t * pF ***********************************************************************/ Bdc_Fun_t * Bdc_ManDecompose_rec( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) { - int static Counter = 0; - int LocalCounter = Counter++; +// int static Counter = 0; +// int LocalCounter = Counter++; Bdc_Type_t Type; Bdc_Fun_t * pFunc, * pFunc0, * pFunc1; Bdc_Isf_t IsfL, * pIsfL = &IsfL; Bdc_Isf_t IsfB, * pIsfR = &IsfB; - int iVar, clk; + int iVar; + int clk = 0; // Suppress "might be used uninitialized" /* printf( "Init function (%d):\n", LocalCounter ); Extra_PrintBinary( stdout, pIsf->puOn, 1<<4 );printf("\n"); diff --git a/src/aig/csw/cswCut.c b/src/aig/csw/cswCut.c index b3b7152b..a3d9b04e 100644 --- a/src/aig/csw/cswCut.c +++ b/src/aig/csw/cswCut.c @@ -555,7 +555,7 @@ p->timeCuts += clock() - clk; } if ( nVars == 2 && nFanins > 2 && fUseResub ) { - if ( pObjNew = Csw_ObjTwoVarCut( p, pCut ) ) + if ( (pObjNew = Csw_ObjTwoVarCut( p, pCut )) ) { p->nNodesTriv2++; return pObjNew; diff --git a/src/aig/dar/darCore.c b/src/aig/dar/darCore.c index e82cce22..ed461de5 100644 --- a/src/aig/dar/darCore.c +++ b/src/aig/dar/darCore.c @@ -264,7 +264,7 @@ Aig_MmFixed_t * Dar_ManComputeCuts( Aig_Man_t * pAig, int nCutsMax, int fVerbose printf( "Nodes = %6d. Total cuts = %6d. 4-input cuts = %6d.\n", Aig_ManObjNum(pAig), nCuts, nCutsK ); printf( "Cut size = %2d. Truth size = %2d. Total mem = %5.2f Mb ", - sizeof(Dar_Cut_t), 4, 1.0*Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20) ); + sizeof(Dar_Cut_t), (int)4, 1.0*Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20) ); PRT( "Runtime", clock() - clk ); /* Aig_ManForEachNode( pAig, pObj, i ) diff --git a/src/aig/fra/fraClau.c b/src/aig/fra/fraClau.c index fc239a40..919d0000 100644 --- a/src/aig/fra/fraClau.c +++ b/src/aig/fra/fraClau.c @@ -441,7 +441,6 @@ int Fra_ClauCheckClause( Cla_Man_t * p, Vec_Int_t * vClause, Vec_Int_t * vCex ) { int nBTLimit = 0; int RetValue, iVar, i; - int nClauseSize = Vec_IntSize( vClause ); // complement literals Vec_IntPush( vClause, toLit( p->nSatVarsTestCur++ ) ); // helper positive Vec_IntComplement( vClause ); // helper negative (the clause is C v h') diff --git a/src/aig/fra/fraClaus.c b/src/aig/fra/fraClaus.c index 6f0a2012..91b70702 100644 --- a/src/aig/fra/fraClaus.c +++ b/src/aig/fra/fraClaus.c @@ -813,7 +813,9 @@ clk = clock(); p->nClauses = Vec_IntSize( p->vClauses ); if ( Vec_IntSize( p->vClausesProven ) > 0 ) { - int RetValue, k, Beg, End, * pStart; + int RetValue, k, Beg; + int End = -1; // Suppress "might be used uninitialized" + int * pStart; // reset the solver if ( p->pSatMain ) sat_solver_delete( p->pSatMain ); p->pSatMain = Cnf_DataWriteIntoSolver( p->pCnf, 1, 0 ); diff --git a/src/aig/fra/fraInd.c b/src/aig/fra/fraInd.c index 89c4c677..ab076472 100644 --- a/src/aig/fra/fraInd.c +++ b/src/aig/fra/fraInd.c @@ -388,7 +388,8 @@ Aig_Man_t * Fra_FraigInduction( Aig_Man_t * pManAig, Fra_Ssw_t * pParams ) Cnf_Dat_t * pCnf; Aig_Man_t * pManAigNew = NULL; int nNodesBeg, nRegsBeg; - int nIter, i, clk = clock(), clk2; + int nIter = -1; // Suppress "might be used uninitialized" + int i, clk = clock(), clk2; int TimeToStop = (pParams->TimeLimit == 0.0)? 0 : clock() + (int)(pParams->TimeLimit * CLOCKS_PER_SEC); if ( Aig_ManNodeNum(pManAig) == 0 ) diff --git a/src/aig/fra/fraPart.c b/src/aig/fra/fraPart.c index f4964746..1766b978 100644 --- a/src/aig/fra/fraPart.c +++ b/src/aig/fra/fraPart.c @@ -76,7 +76,7 @@ clk = clock(); { vSup = Vec_VecEntry( vSupps, i ); Vec_IntForEachEntry( vSup, Entry, k ) - Vec_VecPush( vSuppsIn, Entry, (void *)i ); + Vec_VecPush( vSuppsIn, Entry, (void *)(PORT_PTRUINT_T)i ); } PRT( "Inverse ", clock() - clk ); @@ -212,7 +212,7 @@ clk = clock(); break; vSup = Vec_VecEntry( vSupps, i ); Vec_IntForEachEntry( vSup, Entry, k ) - Vec_VecPush( vSuppsIn, Entry, (void *)i ); + Vec_VecPush( vSuppsIn, Entry, (void *)(PORT_PTRUINT_T)i ); } PRT( "Inverse ", clock() - clk ); diff --git a/src/aig/hop/hop.h b/src/aig/hop/hop.h index 05e6471e..db4799ca 100644 --- a/src/aig/hop/hop.h +++ b/src/aig/hop/hop.h @@ -166,13 +166,13 @@ static inline int Hop_ObjIsMarkA( Hop_Obj_t * pObj ) { return pObj- static inline void Hop_ObjSetMarkA( Hop_Obj_t * pObj ) { pObj->fMarkA = 1; } static inline void Hop_ObjClearMarkA( Hop_Obj_t * pObj ) { pObj->fMarkA = 0; } -static inline void Hop_ObjSetTravId( Hop_Obj_t * pObj, int TravId ) { pObj->pData = (void *)(long)TravId; } -static inline void Hop_ObjSetTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(long)p->nTravIds; } -static inline void Hop_ObjSetTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(long)(p->nTravIds - 1); } -static inline int Hop_ObjIsTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(long)pObj->pData == p->nTravIds); } -static inline int Hop_ObjIsTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(long)pObj->pData == p->nTravIds - 1); } +static inline void Hop_ObjSetTravId( Hop_Obj_t * pObj, int TravId ) { pObj->pData = (void *)(PORT_PTRINT_T)TravId; } +static inline void Hop_ObjSetTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(PORT_PTRINT_T)p->nTravIds; } +static inline void Hop_ObjSetTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(PORT_PTRINT_T)(p->nTravIds - 1); } +static inline int Hop_ObjIsTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(PORT_PTRINT_T)pObj->pData == p->nTravIds); } +static inline int Hop_ObjIsTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(PORT_PTRINT_T)pObj->pData == p->nTravIds - 1); } -static inline int Hop_ObjTravId( Hop_Obj_t * pObj ) { return (int)pObj->pData; } +static inline int Hop_ObjTravId( Hop_Obj_t * pObj ) { return (int)(PORT_PTRINT_T)pObj->pData; } static inline int Hop_ObjPhase( Hop_Obj_t * pObj ) { return pObj->fPhase; } static inline int Hop_ObjRefs( Hop_Obj_t * pObj ) { return pObj->nRefs; } static inline void Hop_ObjRef( Hop_Obj_t * pObj ) { pObj->nRefs++; } diff --git a/src/aig/hop/hopDfs.c b/src/aig/hop/hopDfs.c index d798bc35..29963f6d 100644 --- a/src/aig/hop/hopDfs.c +++ b/src/aig/hop/hopDfs.c @@ -123,15 +123,15 @@ int Hop_ManCountLevels( Hop_Man_t * p ) vNodes = Hop_ManDfs( p ); Vec_PtrForEachEntry( vNodes, pObj, i ) { - Level0 = (int)Hop_ObjFanin0(pObj)->pData; - Level1 = (int)Hop_ObjFanin1(pObj)->pData; - pObj->pData = (void *)(1 + Hop_ObjIsExor(pObj) + AIG_MAX(Level0, Level1)); + Level0 = (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData; + Level1 = (int)(PORT_PTRUINT_T)Hop_ObjFanin1(pObj)->pData; + pObj->pData = (void *)(PORT_PTRUINT_T)(1 + Hop_ObjIsExor(pObj) + AIG_MAX(Level0, Level1)); } Vec_PtrFree( vNodes ); // get levels of the POs LevelsMax = 0; Hop_ManForEachPo( p, pObj, i ) - LevelsMax = AIG_MAX( LevelsMax, (int)Hop_ObjFanin0(pObj)->pData ); + LevelsMax = AIG_MAX( LevelsMax, (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData ); return LevelsMax; } diff --git a/src/aig/hop/hopMem.c b/src/aig/hop/hopMem.c index 0665470a..60f89d53 100644 --- a/src/aig/hop/hopMem.c +++ b/src/aig/hop/hopMem.c @@ -95,7 +95,7 @@ void Hop_ManAddMemory( Hop_Man_t * p ) pMemory = ALLOC( char, nBytes ); Vec_PtrPush( p->vChunks, pMemory ); // align memory at the 32-byte boundary - pMemory = pMemory + 64 - (((int)pMemory) & 63); + pMemory = pMemory + 64 - (((int)(PORT_PTRUINT_T)pMemory) & 63); // remember the manager in the first entry Vec_PtrPush( p->vPages, pMemory ); // break the memory down into nodes diff --git a/src/aig/hop/hopOper.c b/src/aig/hop/hopOper.c index a31ca0f2..0ecb8d61 100644 --- a/src/aig/hop/hopOper.c +++ b/src/aig/hop/hopOper.c @@ -116,7 +116,7 @@ Hop_Obj_t * Hop_And( Hop_Man_t * p, Hop_Obj_t * p0, Hop_Obj_t * p1 ) // return Hop_Exor( p, pFan0, pFan1 ); // check the table pGhost = Hop_ObjCreateGhost( p, p0, p1, AIG_AND ); - if ( pResult = Hop_TableLookup( p, pGhost ) ) + if ( (pResult = Hop_TableLookup( p, pGhost )) ) return pResult; return Hop_ObjCreate( p, pGhost ); } diff --git a/src/aig/hop/hopUtil.c b/src/aig/hop/hopUtil.c index 87fdb15e..d9dbbcaa 100644 --- a/src/aig/hop/hopUtil.c +++ b/src/aig/hop/hopUtil.c @@ -333,7 +333,7 @@ void Hop_ObjPrintEqn( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int L // PI case if ( Hop_ObjIsPi(pObj) ) { - fprintf( pFile, "%s%s", fCompl? "!" : "", pObj->pData ); + fprintf( pFile, "%s%s", fCompl? "!" : "", (char*)pObj->pData ); return; } // AND case @@ -380,7 +380,7 @@ void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, i // PI case if ( Hop_ObjIsPi(pObj) ) { - fprintf( pFile, "%s%s", fCompl? "~" : "", pObj->pData ); + fprintf( pFile, "%s%s", fCompl? "~" : "", (char*)pObj->pData ); return; } // EXOR case @@ -516,13 +516,13 @@ void Hop_ManDumpBlif( Hop_Man_t * p, char * pFileName ) // collect nodes in the DFS order vNodes = Hop_ManDfs( p ); // assign IDs to objects - Hop_ManConst1(p)->pData = (void *)Counter++; + Hop_ManConst1(p)->pData = (void *)(PORT_PTRUINT_T)Counter++; Hop_ManForEachPi( p, pObj, i ) - pObj->pData = (void *)Counter++; + pObj->pData = (void *)(PORT_PTRUINT_T)Counter++; Hop_ManForEachPo( p, pObj, i ) - pObj->pData = (void *)Counter++; + pObj->pData = (void *)(PORT_PTRUINT_T)Counter++; Vec_PtrForEachEntry( vNodes, pObj, i ) - pObj->pData = (void *)Counter++; + pObj->pData = (void *)(PORT_PTRUINT_T)Counter++; nDigits = Hop_Base10Log( Counter ); // write the file pFile = fopen( pFileName, "w" ); @@ -532,34 +532,34 @@ void Hop_ManDumpBlif( Hop_Man_t * p, char * pFileName ) // write PIs fprintf( pFile, ".inputs" ); Hop_ManForEachPi( p, pObj, i ) - fprintf( pFile, " n%0*d", nDigits, (int)pObj->pData ); + fprintf( pFile, " n%0*d", nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "\n" ); // write POs fprintf( pFile, ".outputs" ); Hop_ManForEachPo( p, pObj, i ) - fprintf( pFile, " n%0*d", nDigits, (int)pObj->pData ); + fprintf( pFile, " n%0*d", nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "\n" ); // write nodes Vec_PtrForEachEntry( vNodes, pObj, i ) { fprintf( pFile, ".names n%0*d n%0*d n%0*d\n", - nDigits, (int)Hop_ObjFanin0(pObj)->pData, - nDigits, (int)Hop_ObjFanin1(pObj)->pData, - nDigits, (int)pObj->pData ); + nDigits, (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData, + nDigits, (int)(PORT_PTRUINT_T)Hop_ObjFanin1(pObj)->pData, + nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "%d%d 1\n", !Hop_ObjFaninC0(pObj), !Hop_ObjFaninC1(pObj) ); } // write POs Hop_ManForEachPo( p, pObj, i ) { fprintf( pFile, ".names n%0*d n%0*d\n", - nDigits, (int)Hop_ObjFanin0(pObj)->pData, - nDigits, (int)pObj->pData ); + nDigits, (int)(PORT_PTRUINT_T)Hop_ObjFanin0(pObj)->pData, + nDigits, (int)(PORT_PTRUINT_T)pObj->pData ); fprintf( pFile, "%d 1\n", !Hop_ObjFaninC0(pObj) ); if ( Hop_ObjIsConst1(Hop_ObjFanin0(pObj)) ) pConst1 = Hop_ManConst1(p); } if ( pConst1 ) - fprintf( pFile, ".names n%0*d\n 1\n", nDigits, (int)pConst1->pData ); + fprintf( pFile, ".names n%0*d\n 1\n", nDigits, (int)(PORT_PTRUINT_T)pConst1->pData ); fprintf( pFile, ".end\n\n" ); fclose( pFile ); Vec_PtrFree( vNodes ); diff --git a/src/aig/ioa/ioaWriteAig.c b/src/aig/ioa/ioaWriteAig.c index aa731463..12de42ad 100644 --- a/src/aig/ioa/ioaWriteAig.c +++ b/src/aig/ioa/ioaWriteAig.c @@ -208,13 +208,13 @@ Vec_Str_t * Ioa_WriteEncodeLiterals( Vec_Int_t * vLits ) int Pos = 0, Lit, LitPrev, Diff, i; vBinary = Vec_StrAlloc( 2 * Vec_IntSize(vLits) ); LitPrev = Vec_IntEntry( vLits, 0 ); - Pos = Ioa_WriteAigerEncode( Vec_StrArray(vBinary), Pos, LitPrev ); + Pos = Ioa_WriteAigerEncode( (unsigned char *)Vec_StrArray(vBinary), Pos, LitPrev ); Vec_IntForEachEntryStart( vLits, Lit, i, 1 ) { Diff = Lit - LitPrev; Diff = (Lit < LitPrev)? -Diff : Diff; Diff = (Diff << 1) | (int)(Lit < LitPrev); - Pos = Ioa_WriteAigerEncode( Vec_StrArray(vBinary), Pos, Diff ); + Pos = Ioa_WriteAigerEncode( (unsigned char *)Vec_StrArray(vBinary), Pos, Diff ); LitPrev = Lit; if ( Pos + 10 > vBinary->nCap ) Vec_StrGrow( vBinary, vBinary->nCap+1 ); @@ -254,7 +254,7 @@ void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int // Bar_Progress_t * pProgress; FILE * pFile; Aig_Obj_t * pObj, * pDriver; - int i, nNodes, Pos, nBufferSize; + int i, nNodes, nBufferSize, Pos; unsigned char * pBuffer; unsigned uLit0, uLit1, uLit; diff --git a/src/aig/ivy/ivyBalance.c b/src/aig/ivy/ivyBalance.c index e0b2bef2..b5c77e39 100644 --- a/src/aig/ivy/ivyBalance.c +++ b/src/aig/ivy/ivyBalance.c @@ -72,7 +72,7 @@ Ivy_Man_t * Ivy_ManBalance( Ivy_Man_t * p, int fUpdateLevel ) Ivy_ObjCreatePo( pNew, Ivy_EdgeToNode(pNew, NewNodeId) ); } Vec_VecFree( vStore ); - if ( i = Ivy_ManCleanup( pNew ) ) + if ( (i = Ivy_ManCleanup( pNew )) ) { // printf( "Cleanup after balancing removed %d dangling nodes.\n", i ); } diff --git a/src/aig/ivy/ivyCanon.c b/src/aig/ivy/ivyCanon.c index 5768b87e..db5918de 100644 --- a/src/aig/ivy/ivyCanon.c +++ b/src/aig/ivy/ivyCanon.c @@ -53,7 +53,7 @@ Ivy_Obj_t * Ivy_CanonPair_rec( Ivy_Man_t * p, Ivy_Obj_t * pGhost ) // consider the case when the pair is canonical if ( !Ivy_ObjIsLatch(Ivy_ObjFanin0(pGhost)) || !Ivy_ObjIsLatch(Ivy_ObjFanin1(pGhost)) ) { - if ( pResult = Ivy_TableLookup( p, pGhost ) ) + if ( (pResult = Ivy_TableLookup( p, pGhost )) ) return pResult; return Ivy_ObjCreate( p, pGhost ); } diff --git a/src/aig/ivy/ivyCut.c b/src/aig/ivy/ivyCut.c index e257d8a6..b0dd6db7 100644 --- a/src/aig/ivy/ivyCut.c +++ b/src/aig/ivy/ivyCut.c @@ -300,7 +300,8 @@ int Ivy_ManFindBoolCutCost( Ivy_Obj_t * pObj ) ***********************************************************************/ int Ivy_ManFindBoolCut( Ivy_Man_t * p, Ivy_Obj_t * pRoot, Vec_Ptr_t * vFront, Vec_Ptr_t * vVolume, Vec_Ptr_t * vLeaves ) { - Ivy_Obj_t * pObj, * pFaninC, * pFanin0, * pFanin1, * pPivot; + Ivy_Obj_t * pObj = NULL; // Suppress "might be used uninitialized" + Ivy_Obj_t * pFaninC, * pFanin0, * pFanin1, * pPivot; int RetValue, LevelLimit, Lev, k; assert( !Ivy_IsComplement(pRoot) ); // clear the frontier and collect the nodes diff --git a/src/aig/ivy/ivyDfs.c b/src/aig/ivy/ivyDfs.c index c27cba31..9594c0d2 100644 --- a/src/aig/ivy/ivyDfs.c +++ b/src/aig/ivy/ivyDfs.c @@ -382,7 +382,7 @@ int Ivy_ManIsAcyclic( Ivy_Man_t * p ) Ivy_ManForEachCo( p, pObj, i ) { // traverse the output logic cone - if ( fAcyclic = Ivy_ManIsAcyclic_rec(p, Ivy_ObjFanin0(pObj)) ) + if ( (fAcyclic = Ivy_ManIsAcyclic_rec(p, Ivy_ObjFanin0(pObj))) ) continue; // stop as soon as the first loop is detected fprintf( stdout, " (cone of %s \"%d\")\n", Ivy_ObjIsLatch(pObj)? "latch" : "PO", Ivy_ObjId(pObj) ); diff --git a/src/aig/ivy/ivyFastMap.c b/src/aig/ivy/ivyFastMap.c index c4a043f2..6ee177a4 100644 --- a/src/aig/ivy/ivyFastMap.c +++ b/src/aig/ivy/ivyFastMap.c @@ -309,7 +309,7 @@ int Ivy_FastMapArea( Ivy_Man_t * pAig ) SeeAlso [] ***********************************************************************/ -static inline Ivy_ObjIsNodeInt1( Ivy_Obj_t * pObj ) +static inline int Ivy_ObjIsNodeInt1( Ivy_Obj_t * pObj ) { return Ivy_ObjIsNode(pObj) && Ivy_ObjRefs(pObj) == 1; } @@ -325,7 +325,7 @@ static inline Ivy_ObjIsNodeInt1( Ivy_Obj_t * pObj ) SeeAlso [] ***********************************************************************/ -static inline Ivy_ObjIsNodeInt2( Ivy_Obj_t * pObj ) +static inline int Ivy_ObjIsNodeInt2( Ivy_Obj_t * pObj ) { return Ivy_ObjIsNode(pObj) && Ivy_ObjRefs(pObj) <= 2; } @@ -612,30 +612,30 @@ void Ivy_FastMapNode( Ivy_Man_t * pAig, Ivy_Obj_t * pObj, int nLimit ) pFaninA = Ivy_ObjFanin0(pFanin0); pFaninB = Ivy_ObjFanin1(pFanin0); if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) ) - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0); else { - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA); - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB); } } else - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0); // process the second fanin if ( Ivy_ObjIsNodeInt1(pFanin1) ) { pFaninA = Ivy_ObjFanin0(pFanin1); pFaninB = Ivy_ObjFanin1(pFanin1); if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) ) - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1); else { - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA); - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB); } } else - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1); // sort the fanins Vec_IntSelectSort( pSupp->pArray, pSupp->nSize ); pSupp->nSize = Vec_IntRemoveDup( pSupp->pArray, pSupp->nSize ); @@ -681,30 +681,30 @@ void Ivy_FastMapNode( Ivy_Man_t * pAig, Ivy_Obj_t * pObj, int nLimit ) pFaninA = Ivy_ObjFanin0(pFanin0); pFaninB = Ivy_ObjFanin1(pFanin0); if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) ) - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0); else { - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA); - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB); } } else - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0); // process the second fanin if ( Ivy_ObjIsNodeInt1(pFanin1) ) { pFaninA = Ivy_ObjFanin0(pFanin1); pFaninB = Ivy_ObjFanin1(pFanin1); if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) ) - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1); else { - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA); - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB); } } else - pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1); + pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1); // sort the fanins Vec_IntSelectSort( pSupp->pArray, pSupp->nSize ); pSupp->nSize = Vec_IntRemoveDup( pSupp->pArray, pSupp->nSize ); @@ -1497,10 +1497,6 @@ void Ivy_FastMapNodeRecover( Ivy_Man_t * pAig, Ivy_Obj_t * pObj, int nLimit, Vec AreaBef = Ivy_FastMapNodeAreaRefed( pAig, pObj ); // if ( AreaBef == 1 ) // return; - if ( pObj->Id == 102 ) - { - int x = 0; - } // the cut is non-trivial Ivy_FastMapNodePrepare( pAig, pObj, nLimit, vFront, vFrontOld ); // iteratively modify the cut diff --git a/src/aig/ivy/ivyFraig.c b/src/aig/ivy/ivyFraig.c index 0d9d42a3..c306c394 100644 --- a/src/aig/ivy/ivyFraig.c +++ b/src/aig/ivy/ivyFraig.c @@ -141,7 +141,7 @@ static inline Ivy_Obj_t * Ivy_ObjNodeHashNext( Ivy_Obj_t * pObj ) static inline Ivy_Obj_t * Ivy_ObjEquivListNext( Ivy_Obj_t * pObj ) { return pObj->pPrevFan0; } static inline Ivy_Obj_t * Ivy_ObjEquivListPrev( Ivy_Obj_t * pObj ) { return pObj->pPrevFan1; } static inline Ivy_Obj_t * Ivy_ObjFraig( Ivy_Obj_t * pObj ) { return pObj->pEquiv; } -static inline int Ivy_ObjSatNum( Ivy_Obj_t * pObj ) { return (int)pObj->pNextFan0; } +static inline int Ivy_ObjSatNum( Ivy_Obj_t * pObj ) { return (int)(PORT_PTRUINT_T)pObj->pNextFan0; } static inline Vec_Ptr_t * Ivy_ObjFaninVec( Ivy_Obj_t * pObj ) { return (Vec_Ptr_t *)pObj->pNextFan1; } static inline void Ivy_ObjSetSim( Ivy_Obj_t * pObj, Ivy_FraigSim_t * pSim ) { pObj->pFanout = (Ivy_Obj_t *)pSim; } @@ -152,7 +152,7 @@ static inline void Ivy_ObjSetNodeHashNext( Ivy_Obj_t * pObj, Ivy_Obj_t * static inline void Ivy_ObjSetEquivListNext( Ivy_Obj_t * pObj, Ivy_Obj_t * pNext ) { pObj->pPrevFan0 = pNext; } static inline void Ivy_ObjSetEquivListPrev( Ivy_Obj_t * pObj, Ivy_Obj_t * pPrev ) { pObj->pPrevFan1 = pPrev; } static inline void Ivy_ObjSetFraig( Ivy_Obj_t * pObj, Ivy_Obj_t * pNode ) { pObj->pEquiv = pNode; } -static inline void Ivy_ObjSetSatNum( Ivy_Obj_t * pObj, int Num ) { pObj->pNextFan0 = (Ivy_Obj_t *)Num; } +static inline void Ivy_ObjSetSatNum( Ivy_Obj_t * pObj, int Num ) { pObj->pNextFan0 = (Ivy_Obj_t *)(PORT_PTRUINT_T)Num; } static inline void Ivy_ObjSetFaninVec( Ivy_Obj_t * pObj, Vec_Ptr_t * vFanins ) { pObj->pNextFan1 = (Ivy_Obj_t *)vFanins; } static inline unsigned Ivy_ObjRandomSim() { return (rand() << 24) ^ (rand() << 12) ^ rand(); } @@ -252,8 +252,8 @@ int Ivy_FraigProve( Ivy_Man_t ** ppManAig, void * pPars ) Prove_Params_t * pParams = pPars; Ivy_FraigParams_t Params, * pIvyParams = &Params; Ivy_Man_t * pManAig, * pManTemp; - int RetValue, nIter, clk, timeStart = clock();//, Counter; - sint64 nSatConfs, nSatInspects; + int RetValue, nIter, clk;//, Counter; + sint64 nSatConfs = 0, nSatInspects = 0; // start the network and parameters pManAig = *ppManAig; @@ -2076,7 +2076,7 @@ void Ivy_FraigPrintActivity( Ivy_FraigMan_t * p ) ***********************************************************************/ int Ivy_FraigNodesAreEquiv( Ivy_FraigMan_t * p, Ivy_Obj_t * pOld, Ivy_Obj_t * pNew ) { - int pLits[4], RetValue, RetValue1, nBTLimit, clk, clk2 = clock(); + int pLits[4], RetValue, RetValue1, nBTLimit, clk; //, clk2 = clock(); // make sure the nodes are not complemented assert( !Ivy_IsComplement(pNew) ); @@ -2225,7 +2225,8 @@ p->timeSatFail += clock() - clk; ***********************************************************************/ int Ivy_FraigNodeIsConst( Ivy_FraigMan_t * p, Ivy_Obj_t * pNew ) { - int pLits[2], RetValue1, RetValue, clk; + int pLits[2], RetValue1, clk; +// int RetValue; // make sure the nodes are not complemented assert( !Ivy_IsComplement(pNew) ); diff --git a/src/aig/ivy/ivyMem.c b/src/aig/ivy/ivyMem.c index 2a96857c..fd29e9ae 100644 --- a/src/aig/ivy/ivyMem.c +++ b/src/aig/ivy/ivyMem.c @@ -96,7 +96,7 @@ void Ivy_ManAddMemory( Ivy_Man_t * p ) pMemory = ALLOC( char, nBytes ); Vec_PtrPush( p->vChunks, pMemory ); // align memory at the 32-byte boundary - pMemory = pMemory + EntrySizeMax - (((int)pMemory) & (EntrySizeMax-1)); + pMemory = pMemory + EntrySizeMax - (((int)(PORT_PTRUINT_T)pMemory) & (EntrySizeMax-1)); // remember the manager in the first entry Vec_PtrPush( p->vPages, pMemory ); // break the memory down into nodes diff --git a/src/aig/ivy/ivyMulti.c b/src/aig/ivy/ivyMulti.c index a7970156..882c2c87 100644 --- a/src/aig/ivy/ivyMulti.c +++ b/src/aig/ivy/ivyMulti.c @@ -56,7 +56,8 @@ int Ivy_MultiPlus( Ivy_Man_t * p, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vCone, Ivy_Ty { static Ivy_Eva_t pEvals[IVY_EVAL_LIMIT]; Ivy_Eva_t * pEval, * pFan0, * pFan1; - Ivy_Obj_t * pObj, * pTemp; + Ivy_Obj_t * pObj = NULL; // Suppress "might be used uninitialized" + Ivy_Obj_t * pTemp; int nEvals, nEvalsOld, i, k, x, nLeaves; unsigned uMaskAll; @@ -218,9 +219,14 @@ static inline int Ivy_MultiWeight( unsigned uMask, int nMaskOnes, unsigned uFoun int Ivy_MultiCover( Ivy_Man_t * p, Ivy_Eva_t * pEvals, int nLeaves, int nEvals, int nLimit, Vec_Ptr_t * vSols ) { int fVerbose = 0; - Ivy_Eva_t * pEval, * pEvalBest; + Ivy_Eva_t * pEval; + Ivy_Eva_t * pEvalBest = NULL; // Suppress "might be used uninitialized" unsigned uMaskAll, uFound, uTemp; - int i, k, BestK, WeightBest, WeightCur, LevelBest, LevelCur; + int i, k, BestK; + int WeightBest = -1; // Suppress "might be used uninitialized" + int WeightCur; + int LevelBest = -1; // Suppress "might be used uninitialized" + int LevelCur; uMaskAll = (nLeaves == 32)? (~(unsigned)0) : ((1 << nLeaves) - 1); uFound = 0; // solve the covering problem diff --git a/src/aig/ivy/ivyRwr.c b/src/aig/ivy/ivyRwr.c index 3f8720ba..8bfeb03c 100644 --- a/src/aig/ivy/ivyRwr.c +++ b/src/aig/ivy/ivyRwr.c @@ -81,7 +81,7 @@ int Ivy_ManRewritePre( Ivy_Man_t * p, int fUpdateLevel, int fUseZeroCost, int fV break; // for each cut, try to resynthesize it nGain = Ivy_NodeRewrite( p, pManRwt, pNode, fUpdateLevel, fUseZeroCost ); - if ( nGain > 0 || nGain == 0 && fUseZeroCost ) + if ( nGain > 0 || (nGain == 0 && fUseZeroCost) ) { Dec_Graph_t * pGraph = Rwt_ManReadDecs(pManRwt); int fCompl = Rwt_ManReadCompl(pManRwt); @@ -122,7 +122,7 @@ Rwt_ManAddTimeTotal( pManRwt, clock() - clkStart ); else Ivy_ManResetLevels( p ); // check - if ( i = Ivy_ManCleanup(p) ) + if ( (i = Ivy_ManCleanup(p)) ) printf( "Cleanup after rewriting removed %d dangling nodes.\n", i ); if ( !Ivy_ManCheck(p) ) printf( "Ivy_ManRewritePre(): The check has failed.\n" ); @@ -154,9 +154,12 @@ int Ivy_NodeRewrite( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pNode, int fUp Ivy_Store_t * pStore; Ivy_Cut_t * pCut; Ivy_Obj_t * pFanin; - unsigned uPhase, uTruthBest, uTruth; + unsigned uPhase; + unsigned uTruthBest = 0; // Suppress "might be used uninitialized" + unsigned uTruth; char * pPerm; - int Required, nNodesSaved, nNodesSaveCur; + int Required, nNodesSaved; + int nNodesSaveCur = -1; // Suppress "might be used uninitialized" int i, c, GainCur, GainBest = -1; int clk, clk2; @@ -190,14 +193,14 @@ clk = clock(); clk2 = clock(); uTruth = 0xFFFF & Ivy_NodeGetTruth( pNode, pCut->pArray, pCut->nSize ); // truth table p->timeTruth += clock() - clk2; - pPerm = p->pPerms4[ p->pPerms[uTruth] ]; + pPerm = p->pPerms4[ (int) p->pPerms[uTruth] ]; uPhase = p->pPhases[uTruth]; // collect fanins with the corresponding permutation/phase Vec_PtrClear( p->vFaninsCur ); Vec_PtrFill( p->vFaninsCur, (int)pCut->nSize, 0 ); for ( i = 0; i < (int)pCut->nSize; i++ ) { - pFanin = Ivy_ManObj( pMan, pCut->pArray[pPerm[i]] ); + pFanin = Ivy_ManObj( pMan, pCut->pArray[(int)pPerm[i]] ); assert( Ivy_ObjIsNode(pFanin) || Ivy_ObjIsCi(pFanin) ); pFanin = Ivy_NotCond(pFanin, ((uPhase & (1<<i)) > 0) ); Vec_PtrWriteEntry( p->vFaninsCur, i, pFanin ); @@ -355,7 +358,8 @@ unsigned Ivy_NodeGetTruth( Ivy_Obj_t * pObj, int * pNums, int nNums ) Dec_Graph_t * Rwt_CutEvaluate( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pRoot, Vec_Ptr_t * vFaninsCur, int nNodesSaved, int LevelMax, int * pGainBest, unsigned uTruth ) { Vec_Ptr_t * vSubgraphs; - Dec_Graph_t * pGraphBest, * pGraphCur; + Dec_Graph_t * pGraphBest = NULL; // Suppress "might be used uninitialized" + Dec_Graph_t * pGraphCur; Rwt_Node_t * pNode, * pFanin; int nNodesAdded, GainBest, i, k; // find the matching class of subgraphs @@ -478,7 +482,7 @@ int Ivy_GraphToNetworkCount( Ivy_Man_t * p, Ivy_Obj_t * pRoot, Dec_Graph_t * pGr Ivy_Obj_t * Ivy_GraphToNetwork( Ivy_Man_t * p, Dec_Graph_t * pGraph ) { Ivy_Obj_t * pAnd0, * pAnd1; - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" int i; // check for constant function if ( Dec_GraphIsConst(pGraph) ) diff --git a/src/aig/ivy/ivySeq.c b/src/aig/ivy/ivySeq.c index 0ee29fee..f4585fa2 100644 --- a/src/aig/ivy/ivySeq.c +++ b/src/aig/ivy/ivySeq.c @@ -91,7 +91,7 @@ int Ivy_ManRewriteSeq( Ivy_Man_t * p, int fUseZeroCost, int fVerbose ) break; // for each cut, try to resynthesize it nGain = Ivy_NodeRewriteSeq( p, pManRwt, pNode, fUseZeroCost ); - if ( nGain > 0 || nGain == 0 && fUseZeroCost ) + if ( nGain > 0 || (nGain == 0 && fUseZeroCost) ) { Dec_Graph_t * pGraph = Rwt_ManReadDecs(pManRwt); int fCompl = Rwt_ManReadCompl(pManRwt); @@ -147,9 +147,12 @@ int Ivy_NodeRewriteSeq( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pNode, int Ivy_Cut_t * pCut; Ivy_Obj_t * pFanin;//, * pFanout; Vec_Ptr_t * vFanout; - unsigned uPhase, uTruthBest, uTruth;//, nNewClauses; + unsigned uPhase; + unsigned uTruthBest = 0; // Suppress "might be used uninitialized" + unsigned uTruth;//, nNewClauses; char * pPerm; - int nNodesSaved, nNodesSaveCur; + int nNodesSaved; + int nNodesSaveCur = -1; // Suppress "might be used uninitialized" int i, c, GainCur, GainBest = -1; int clk, clk2;//, clk3; @@ -182,14 +185,14 @@ clk = clock(); clk2 = clock(); uTruth = 0xFFFF & Ivy_CutGetTruth( pMan, pNode, pCut->pArray, pCut->nSize ); // truth table p->timeTruth += clock() - clk2; - pPerm = p->pPerms4[ p->pPerms[uTruth] ]; + pPerm = p->pPerms4[ (int)p->pPerms[uTruth] ]; uPhase = p->pPhases[uTruth]; // collect fanins with the corresponding permutation/phase Vec_PtrClear( p->vFaninsCur ); Vec_PtrFill( p->vFaninsCur, (int)pCut->nSize, 0 ); for ( i = 0; i < (int)pCut->nSize; i++ ) { - pFanin = Ivy_ManObj( pMan, Ivy_LeafId( pCut->pArray[pPerm[i]] ) ); + pFanin = Ivy_ManObj( pMan, Ivy_LeafId( pCut->pArray[(int)pPerm[i]] ) ); assert( Ivy_ObjIsNode(pFanin) || Ivy_ObjIsCi(pFanin) || Ivy_ObjIsConst1(pFanin) ); pFanin = Ivy_NotCond(pFanin, ((uPhase & (1<<i)) > 0) ); Vec_PtrWriteEntry( p->vFaninsCur, i, pFanin ); @@ -305,7 +308,8 @@ p->timeRes += clock() - clk; Dec_Graph_t * Rwt_CutEvaluateSeq( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pRoot, Ivy_Cut_t * pCut, char * pPerm, Vec_Ptr_t * vFaninsCur, int nNodesSaved, int * pGainBest, unsigned uTruth ) { Vec_Ptr_t * vSubgraphs; - Dec_Graph_t * pGraphBest, * pGraphCur; + Dec_Graph_t * pGraphBest = NULL; // Suppress "might be used uninitialized" + Dec_Graph_t * pGraphCur; Rwt_Node_t * pNode; int nNodesAdded, GainBest, i; // find the matching class of subgraphs @@ -364,7 +368,7 @@ void Ivy_GraphPrepare( Dec_Graph_t * pGraph, Ivy_Cut_t * pCut, Vec_Ptr_t * vFani Dec_GraphForEachLeaf( pGraph, pNode, i ) { pNode->pFunc = Vec_PtrEntry( vFanins, i ); - pNode->nLat2 = Ivy_LeafLat( pCut->pArray[pPerm[i]] ); + pNode->nLat2 = Ivy_LeafLat( pCut->pArray[(int)pPerm[i]] ); } // propagate latches through the nodes Dec_GraphForEachNode( pGraph, pNode, i ) @@ -470,7 +474,7 @@ int Ivy_GraphToNetworkSeqCountSeq( Ivy_Man_t * p, Ivy_Obj_t * pRoot, Dec_Graph_t Ivy_Obj_t * Ivy_GraphToNetworkSeq( Ivy_Man_t * p, Dec_Graph_t * pGraph ) { Ivy_Obj_t * pAnd0, * pAnd1; - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" int i, k; // check for constant function if ( Dec_GraphIsConst(pGraph) ) @@ -1021,7 +1025,6 @@ Ivy_Store_t * Ivy_CutComputeForNode( Ivy_Man_t * p, Ivy_Obj_t * pObj, int nLeave { static Ivy_Store_t CutStore, * pCutStore = &CutStore; Ivy_Cut_t CutNew, * pCutNew = &CutNew, * pCut; - Ivy_Man_t * pMan = p; Ivy_Obj_t * pLeaf; int i, k, Temp, nLats, iLeaf0, iLeaf1; diff --git a/src/aig/ivy/ivyShow.c b/src/aig/ivy/ivyShow.c index cd726e43..4fac2709 100644 --- a/src/aig/ivy/ivyShow.c +++ b/src/aig/ivy/ivyShow.c @@ -44,7 +44,7 @@ static void Ivy_WriteDotAig( Ivy_Man_t * pMan, char * pFileName, int fHaig, Vec_ void Ivy_ManShow( Ivy_Man_t * pMan, int fHaig, Vec_Ptr_t * vBold ) { extern void Abc_ShowFile( char * FileNameDot ); - static Counter = 0; + static int Counter = 0; char FileNameDot[200]; FILE * pFile; // create the file name diff --git a/src/aig/kit/cloud.h b/src/aig/kit/cloud.h index fa7f2fce..ec8e9059 100644 --- a/src/aig/kit/cloud.h +++ b/src/aig/kit/cloud.h @@ -176,8 +176,8 @@ struct cloudCacheEntry3 // the three-argument cache #define DD_P2 4256249 #define DD_P3 741457 #define DD_P4 1618033999 -#define cloudHashCudd2(f,g,s) ((((unsigned)(f) * DD_P1 + (unsigned)(g)) * DD_P2) >> (s)) -#define cloudHashCudd3(f,g,h,s) (((((unsigned)(f) * DD_P1 + (unsigned)(g)) * DD_P2 + (unsigned)(h)) * DD_P3) >> (s)) +#define cloudHashCudd2(f,g,s) ((((unsigned)(PORT_PTRUINT_T)(f) * DD_P1 + (unsigned)(PORT_PTRUINT_T)(g)) * DD_P2) >> (s)) +#define cloudHashCudd3(f,g,h,s) (((((unsigned)(PORT_PTRUINT_T)(f) * DD_P1 + (unsigned)(PORT_PTRUINT_T)(g)) * DD_P2 + (unsigned)(PORT_PTRUINT_T)(h)) * DD_P3) >> (s)) // node complementation (using node) #define Cloud_Regular(p) ((CloudNode*)(((PORT_PTRUINT_T)(p)) & ~01)) // get the regular node (w/o bubble) diff --git a/src/aig/kit/kitBdd.c b/src/aig/kit/kitBdd.c index 9c8d4f7a..75caf949 100644 --- a/src/aig/kit/kitBdd.c +++ b/src/aig/kit/kitBdd.c @@ -88,7 +88,7 @@ DdNode * Kit_SopToBdd( DdManager * dd, Kit_Sop_t * cSop, int nVars ) DdNode * Kit_GraphToBdd( DdManager * dd, Kit_Graph_t * pGraph ) { DdNode * bFunc, * bFunc0, * bFunc1; - Kit_Node_t * pNode; + Kit_Node_t * pNode = NULL; // Suppress "might be used uninitialized" int i; // sanity checks diff --git a/src/aig/kit/kitCloud.c b/src/aig/kit/kitCloud.c index 7b160fea..525f89f5 100644 --- a/src/aig/kit/kitCloud.c +++ b/src/aig/kit/kitCloud.c @@ -304,14 +304,16 @@ unsigned * Kit_TruthCompose( CloudManager * dd, unsigned * pTruth, int nVars, void Kit_TruthCofSupports( Vec_Int_t * vBddDir, Vec_Int_t * vBddInv, int nVars, Vec_Int_t * vMemory, unsigned * puSupps ) { Kit_Mux_t Mux; - unsigned * puSuppAll, * pThis, * pFan0, * pFan1; + unsigned * puSuppAll; + unsigned * pThis = NULL; // Suppress "might be used uninitialized" + unsigned * pFan0, * pFan1; int i, v, Var, Entry, nSupps; nSupps = 2 * nVars; // extend storage if ( Vec_IntSize( vMemory ) < nSupps * Vec_IntSize(vBddDir) ) Vec_IntGrow( vMemory, nSupps * Vec_IntSize(vBddDir) ); - puSuppAll = Vec_IntArray( vMemory ); + puSuppAll = (unsigned *)Vec_IntArray( vMemory ); // clear storage for the const node memset( puSuppAll, 0, sizeof(unsigned) * nSupps ); // compute supports from nodes @@ -336,7 +338,7 @@ void Kit_TruthCofSupports( Vec_Int_t * vBddDir, Vec_Int_t * vBddInv, int nVars, // extend storage if ( Vec_IntSize( vMemory ) < nSupps * Vec_IntSize(vBddInv) ) Vec_IntGrow( vMemory, nSupps * Vec_IntSize(vBddInv) ); - puSuppAll = Vec_IntArray( vMemory ); + puSuppAll = (unsigned *)Vec_IntArray( vMemory ); // clear storage for the const node memset( puSuppAll, 0, sizeof(unsigned) * nSupps ); // compute supports from nodes diff --git a/src/aig/kit/kitDsd.c b/src/aig/kit/kitDsd.c index a397d452..8d670419 100644 --- a/src/aig/kit/kitDsd.c +++ b/src/aig/kit/kitDsd.c @@ -1018,7 +1018,7 @@ unsigned Kit_DsdNonDsdSupports( Kit_DsdNtk_t * pNtk ) SeeAlso [] ***********************************************************************/ -void Kit_DsdExpandCollectAnd_rec( Kit_DsdNtk_t * p, int iLit, int * piLitsNew, int * nLitsNew ) +void Kit_DsdExpandCollectAnd_rec( Kit_DsdNtk_t * p, unsigned iLit, unsigned * piLitsNew, int * nLitsNew ) { Kit_DsdObj_t * pObj; unsigned i, iLitFanin; @@ -1045,7 +1045,7 @@ void Kit_DsdExpandCollectAnd_rec( Kit_DsdNtk_t * p, int iLit, int * piLitsNew, i SeeAlso [] ***********************************************************************/ -void Kit_DsdExpandCollectXor_rec( Kit_DsdNtk_t * p, int iLit, int * piLitsNew, int * nLitsNew ) +void Kit_DsdExpandCollectXor_rec( Kit_DsdNtk_t * p, unsigned iLit, unsigned * piLitsNew, int * nLitsNew ) { Kit_DsdObj_t * pObj; unsigned i, iLitFanin; @@ -1179,7 +1179,7 @@ Kit_DsdNtk_t * Kit_DsdExpand( Kit_DsdNtk_t * p ) SeeAlso [] ***********************************************************************/ -void Kit_DsdCompSort( int pPrios[], unsigned uSupps[], unsigned char * piLits, int nVars, int piLitsRes[] ) +void Kit_DsdCompSort( int pPrios[], unsigned uSupps[], unsigned char * piLits, int nVars, unsigned piLitsRes[] ) { int nSuppSizes[16], Priority[16], pOrder[16]; int i, k, iVarBest, SuppMax, PrioMax; @@ -1236,7 +1236,8 @@ void Kit_DsdCompSort( int pPrios[], unsigned uSupps[], unsigned char * piLits, i ***********************************************************************/ int Kit_DsdShrink_rec( Kit_DsdNtk_t * pNew, Kit_DsdNtk_t * p, int iLit, int pPrios[] ) { - Kit_DsdObj_t * pObj, * pObjNew; + Kit_DsdObj_t * pObj; + Kit_DsdObj_t * pObjNew = NULL; // Suppress "might be used uninitialized" unsigned * pTruth, * pTruthNew; unsigned i, piLitsNew[16], uSupps[16]; int iLitFanin, iLitNew; @@ -2265,7 +2266,14 @@ int Kit_DsdCofactoringGetVars( Kit_DsdNtk_t ** ppNtk, int nSize, int * pVars ) ***********************************************************************/ int Kit_DsdCofactoring( unsigned * pTruth, int nVars, int * pCofVars, int nLimit, int fVerbose ) { - Kit_DsdNtk_t * ppNtks[5][16] = {0}, * pTemp; + Kit_DsdNtk_t * ppNtks[5][16] = { + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} + }; + Kit_DsdNtk_t * pTemp; unsigned * ppCofs[5][16]; int pTryVars[16], nTryVars; int nPrimeSizeMin, nPrimeSizeMax, nPrimeSizeCur; diff --git a/src/aig/kit/kitSop.c b/src/aig/kit/kitSop.c index 20ad0651..8e175dac 100644 --- a/src/aig/kit/kitSop.c +++ b/src/aig/kit/kitSop.c @@ -174,7 +174,9 @@ void Kit_SopDivideByCube( Kit_Sop_t * cSop, Kit_Sop_t * cDiv, Kit_Sop_t * vQuo, ***********************************************************************/ void Kit_SopDivideInternal( Kit_Sop_t * cSop, Kit_Sop_t * cDiv, Kit_Sop_t * vQuo, Kit_Sop_t * vRem, Vec_Int_t * vMemory ) { - unsigned uCube, uDiv, uCube2, uDiv2, uQuo; + unsigned uCube, uDiv; + unsigned uCube2 = 0; // Suppress "might be used uninitialized" + unsigned uDiv2, uQuo; int i, i2, k, k2, nCubesRem; assert( Kit_SopCubeNum(cSop) >= Kit_SopCubeNum(cDiv) ); // consider special case diff --git a/src/aig/mfx/mfxCore.c b/src/aig/mfx/mfxCore.c index 48107e7e..a7cd3e3c 100644 --- a/src/aig/mfx/mfxCore.c +++ b/src/aig/mfx/mfxCore.c @@ -198,7 +198,6 @@ int Mfx_Perform( Nwk_Man_t * pNtk, Mfx_Par_t * pPars, If_Lib_t * pLutLib ) Bdc_Par_t Pars = {0}, * pDecPars = &Pars; Bar_Progress_t * pProgress; Mfx_Man_t * p; - Tim_Man_t * pManTimeOld = NULL; Nwk_Obj_t * pObj; Vec_Vec_t * vLevels; Vec_Ptr_t * vNodes; diff --git a/src/aig/ntl/ntlCheck.c b/src/aig/ntl/ntlCheck.c index b4125804..03e9e898 100644 --- a/src/aig/ntl/ntlCheck.c +++ b/src/aig/ntl/ntlCheck.c @@ -106,7 +106,7 @@ int Ntl_ModelCheck( Ntl_Mod_t * pModel, int fMain ) { if ( Ntl_ModelLatchNum(pModel) > 0 ) { - printf( "Root level model has %d registers.\n", pModel->pName, Ntl_ModelLatchNum(pModel) ); + printf( "Root level model %s has %d registers.\n", pModel->pName, Ntl_ModelLatchNum(pModel) ); fStatus = 0; } goto checkobjs; diff --git a/src/aig/ntl/ntlExtract.c b/src/aig/ntl/ntlExtract.c index 8049ffb8..f6f1ebb2 100644 --- a/src/aig/ntl/ntlExtract.c +++ b/src/aig/ntl/ntlExtract.c @@ -85,7 +85,7 @@ Aig_Obj_t * Ntl_ConvertSopToAigInternal( Aig_Man_t * pMan, Ntl_Obj_t * pNode, ch ***********************************************************************/ Aig_Obj_t * Ntl_GraphToNetworkAig( Aig_Man_t * pMan, Dec_Graph_t * pGraph ) { - Dec_Node_t * pNode; + Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized" Aig_Obj_t * pAnd0, * pAnd1; int i; // check for constant function @@ -526,15 +526,16 @@ Aig_Man_t * Ntl_ManCollapse( Ntl_Man_t * p, int fSeq ) } nTruePis = Aig_ManPiNum(p->pAig); // create inputs of seq boxes - if ( fSeq ) - Ntl_ModelForEachBox( pRoot, pBox, i ) - { - if ( !(Ntl_BoxIsSeq(pBox) && Ntl_BoxIsWhite(pBox)) ) - continue; - Vec_IntPush( p->vBox1Cios, Aig_ManPiNum(p->pAig) ); - Ntl_ManCollapseBoxSeq1_rec( p, pBox, fSeq ); - Ntl_ObjForEachFanout( pBox, pNet, k ) - pNet->nVisits = 2; + if ( fSeq ) { + Ntl_ModelForEachBox( pRoot, pBox, i ) + { + if ( !(Ntl_BoxIsSeq(pBox) && Ntl_BoxIsWhite(pBox)) ) + continue; + Vec_IntPush( p->vBox1Cios, Aig_ManPiNum(p->pAig) ); + Ntl_ManCollapseBoxSeq1_rec( p, pBox, fSeq ); + Ntl_ObjForEachFanout( pBox, pNet, k ) + pNet->nVisits = 2; + } } // derive the outputs Ntl_ManForEachCoNet( p, pNet, i ) @@ -548,18 +549,19 @@ Aig_Man_t * Ntl_ManCollapse( Ntl_Man_t * p, int fSeq ) } nTruePos = Aig_ManPoNum(p->pAig); // create outputs of seq boxes - if ( fSeq ) - Ntl_ModelForEachBox( pRoot, pBox, i ) - { - if ( !(Ntl_BoxIsSeq(pBox) && Ntl_BoxIsWhite(pBox)) ) - continue; - Ntl_ObjForEachFanin( pBox, pNet, k ) - if ( !Ntl_ManCollapse_rec( p, pNet, fSeq ) ) - { - printf( "Ntl_ManCollapse(): Error: Combinational loop is detected.\n" ); - return 0; - } - Ntl_ManCollapseBoxSeq2_rec( p, pBox, fSeq, Vec_IntEntry(p->vBox1Cios, iBox++) ); + if ( fSeq ) { + Ntl_ModelForEachBox( pRoot, pBox, i ) + { + if ( !(Ntl_BoxIsSeq(pBox) && Ntl_BoxIsWhite(pBox)) ) + continue; + Ntl_ObjForEachFanin( pBox, pNet, k ) + if ( !Ntl_ManCollapse_rec( p, pNet, fSeq ) ) + { + printf( "Ntl_ManCollapse(): Error: Combinational loop is detected.\n" ); + return 0; + } + Ntl_ManCollapseBoxSeq2_rec( p, pBox, fSeq, Vec_IntEntry(p->vBox1Cios, iBox++) ); + } } // make sure registers are added correctly if ( Aig_ManPiNum(p->pAig) - nTruePis != Aig_ManPoNum(p->pAig) - nTruePos ) diff --git a/src/aig/ntl/ntlObj.c b/src/aig/ntl/ntlObj.c index 10bfbbb7..55924db9 100644 --- a/src/aig/ntl/ntlObj.c +++ b/src/aig/ntl/ntlObj.c @@ -177,7 +177,7 @@ Ntl_Obj_t * Ntl_ModelCreateBox( Ntl_Mod_t * pModel, int nFanins, int nFanouts ) ***********************************************************************/ Ntl_Obj_t * Ntl_ModelDupObj( Ntl_Mod_t * pModel, Ntl_Obj_t * pOld ) { - Ntl_Obj_t * pNew; + Ntl_Obj_t * pNew = NULL; // Supprses "might be used uninitialized" if ( Ntl_ObjIsPi( pOld ) ) pNew = Ntl_ModelCreatePi( pModel ); else if ( Ntl_ObjIsPo( pOld ) ) diff --git a/src/aig/ntl/ntlReadBlif.c b/src/aig/ntl/ntlReadBlif.c index cc019732..e1b351b3 100644 --- a/src/aig/ntl/ntlReadBlif.c +++ b/src/aig/ntl/ntlReadBlif.c @@ -18,8 +18,10 @@ ***********************************************************************/ +// The code in this file is developed in collaboration with Mark Jarvin of Toronto. + #include "ntl.h" -#include <bzlib.h> +#include "bzlib.h" //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// @@ -803,7 +805,7 @@ static int Ioa_ReadParseLineModel( Ioa_ReadMod_t * p, char * pLine ) p->pNtk = Ntl_ModelAlloc( p->pMan->pDesign, Vec_PtrEntry(vTokens, 1) ); if ( p->pNtk == NULL ) { - sprintf( p->pMan->sError, "Line %d: Model %s already exists.", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens, 1) ); + sprintf( p->pMan->sError, "Line %d: Model %s already exists.", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens, 1) ); return 0; } return 1; @@ -961,7 +963,7 @@ static int Ioa_ReadParseLineLatch( Ioa_ReadMod_t * p, char * pLine ) pObj->LatchId.regInit = 2; if ( pObj->LatchId.regInit < 0 || pObj->LatchId.regInit > 2 ) { - sprintf( p->pMan->sError, "Line %d: Initial state of the latch is incorrect \"%s\".", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens,3) ); + sprintf( p->pMan->sError, "Line %d: Initial state of the latch is incorrect \"%s\".", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens,3) ); return 0; } // get the register class @@ -988,7 +990,7 @@ static int Ioa_ReadParseLineLatch( Ioa_ReadMod_t * p, char * pLine ) } if ( pObj->LatchId.regClass < 0 || pObj->LatchId.regClass > (1<<24) ) { - sprintf( p->pMan->sError, "Line %d: Class of the latch is incorrect \"%s\".", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens,3) ); + sprintf( p->pMan->sError, "Line %d: Class of the latch is incorrect \"%s\".", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens,3) ); return 0; } // get the clock @@ -1134,7 +1136,7 @@ static int Ioa_ReadParseLineDelay( Ioa_ReadMod_t * p, char * pLine ) Delay = atof( pTokenNum ); if ( Delay == 0.0 && pTokenNum[0] != '0' ) { - sprintf( p->pMan->sError, "Line %d: Delay value (%s) appears to be invalid.", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntryLast(vTokens) ); + sprintf( p->pMan->sError, "Line %d: Delay value (%s) appears to be invalid.", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntryLast(vTokens) ); return 0; } // find the PI/PO numbers @@ -1144,7 +1146,7 @@ static int Ioa_ReadParseLineDelay( Ioa_ReadMod_t * p, char * pLine ) RetValue1 = Ntl_ModelFindPioNumber( p->pNtk, 0, 0, Vec_PtrEntry(vTokens, 1), &Number1 ); if ( RetValue1 == 0 ) { - sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among PIs/POs.", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens, 1) ); + sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among PIs/POs.", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens, 1) ); return 0; } } @@ -1154,14 +1156,14 @@ static int Ioa_ReadParseLineDelay( Ioa_ReadMod_t * p, char * pLine ) RetValue2 = Ntl_ModelFindPioNumber( p->pNtk, 0, 0, Vec_PtrEntry(vTokens, 2), &Number2 ); if ( RetValue2 == 0 ) { - sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among PIs/POs.", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens, 2) ); + sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among PIs/POs.", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens, 2) ); return 0; } } if ( RetValue1 == RetValue2 && RetValue1 ) { sprintf( p->pMan->sError, "Line %d: Both signals \"%s\" and \"%s\" listed appear to be PIs or POs.", - Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens, 1), Vec_PtrEntry(vTokens, 2) ); + Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens, 1), (char*)Vec_PtrEntry(vTokens, 2) ); return 0; } if ( RetValue2 < RetValue1 ) @@ -1219,7 +1221,7 @@ static int Ioa_ReadParseLineTimes( Ioa_ReadMod_t * p, char * pLine, int fOutput Delay = atof( pTokenNum ); if ( Delay == 0.0 && pTokenNum[0] != '0' ) { - sprintf( p->pMan->sError, "Line %d: Delay value (%s) appears to be invalid.", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntryLast(vTokens) ); + sprintf( p->pMan->sError, "Line %d: Delay value (%s) appears to be invalid.", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntryLast(vTokens) ); return 0; } // find the PI/PO numbers @@ -1230,7 +1232,7 @@ static int Ioa_ReadParseLineTimes( Ioa_ReadMod_t * p, char * pLine, int fOutput RetValue = Ntl_ModelFindPioNumber( p->pNtk, 0, 1, Vec_PtrEntry(vTokens, 1), &Number ); if ( RetValue == 0 ) { - sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among POs.", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens, 1) ); + sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among POs.", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens, 1) ); return 0; } } @@ -1247,7 +1249,7 @@ static int Ioa_ReadParseLineTimes( Ioa_ReadMod_t * p, char * pLine, int fOutput RetValue = Ntl_ModelFindPioNumber( p->pNtk, 1, 0, Vec_PtrEntry(vTokens, 1), &Number ); if ( RetValue == 0 ) { - sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among PIs.", Ioa_ReadGetLine(p->pMan, pToken), Vec_PtrEntry(vTokens, 1) ); + sprintf( p->pMan->sError, "Line %d: Cannot find signal \"%s\" among PIs.", Ioa_ReadGetLine(p->pMan, pToken), (char*)Vec_PtrEntry(vTokens, 1) ); return 0; } } diff --git a/src/aig/ntl/ntlTime.c b/src/aig/ntl/ntlTime.c index ee3e489b..121fb8ea 100644 --- a/src/aig/ntl/ntlTime.c +++ b/src/aig/ntl/ntlTime.c @@ -91,20 +91,21 @@ void Ntl_ManUnpackLeafTiming( Ntl_Man_t * p, Tim_Man_t * pMan ) pNet->dTemp = 0; // store the PI timing vTimes = pRoot->vTimeInputs; - if ( vTimes ) - Vec_IntForEachEntry( vTimes, Entry, i ) - { - dTime = Aig_Int2Float( Vec_IntEntry(vTimes,++i) ); - if ( Entry == -1 ) - { - Ntl_ModelForEachPi( pRoot, pObj, v ) - Ntl_ObjFanout0(pObj)->dTemp = dTime; - } - else - { - pObj = Ntl_ModelPi( pRoot, Entry ); - Ntl_ObjFanout0(pObj)->dTemp = dTime; - } + if ( vTimes ) { + Vec_IntForEachEntry( vTimes, Entry, i ) + { + dTime = Aig_Int2Float( Vec_IntEntry(vTimes,++i) ); + if ( Entry == -1 ) + { + Ntl_ModelForEachPi( pRoot, pObj, v ) + Ntl_ObjFanout0(pObj)->dTemp = dTime; + } + else + { + pObj = Ntl_ModelPi( pRoot, Entry ); + Ntl_ObjFanout0(pObj)->dTemp = dTime; + } + } } // store box timing Ntl_ModelForEachMapLeaf( pRoot, pObj, k ) diff --git a/src/aig/ntl/ntlWriteBlif.c b/src/aig/ntl/ntlWriteBlif.c index 8c97d3d0..0ba330fb 100644 --- a/src/aig/ntl/ntlWriteBlif.c +++ b/src/aig/ntl/ntlWriteBlif.c @@ -18,10 +18,12 @@ ***********************************************************************/ +// The code in this file is developed in collaboration with Mark Jarvin of Toronto. + #include "ntl.h" #include "ioa.h" -#include <bzlib.h> +#include "bzlib.h" #include <stdarg.h> #ifdef _WIN32 diff --git a/src/aig/nwk/nwkFanio.c b/src/aig/nwk/nwkFanio.c index 89bf60ee..4068a1a5 100644 --- a/src/aig/nwk/nwkFanio.c +++ b/src/aig/nwk/nwkFanio.c @@ -232,7 +232,7 @@ void Nwk_ObjPatchFanin( Nwk_Obj_t * pObj, Nwk_Obj_t * pFaninOld, Nwk_Obj_t * pFa if ( iFanin == -1 ) { printf( "Nwk_ObjPatchFanin(); Error! Node %d is not among", pFaninOld->Id ); - printf( " the fanins of node %s...\n", pObj->Id ); + printf( " the fanins of node %d...\n", pObj->Id ); return; } pObj->pFanio[iFanin] = pFaninNew; diff --git a/src/aig/nwk/nwkFlow.c b/src/aig/nwk/nwkFlow.c index 48496158..b6155056 100644 --- a/src/aig/nwk/nwkFlow.c +++ b/src/aig/nwk/nwkFlow.c @@ -78,7 +78,7 @@ static inline void Nwk_ObjSetVisitedTop( Nwk_Obj_t * pObj ) else assert( 0 ); } -static inline Nwk_ManIncrementTravIdFlow( Nwk_Man_t * pMan ) +static inline void Nwk_ManIncrementTravIdFlow( Nwk_Man_t * pMan ) { Nwk_ManIncrementTravId( pMan ); Nwk_ManIncrementTravId( pMan ); diff --git a/src/aig/nwk/nwkMan.c b/src/aig/nwk/nwkMan.c index da402f21..d9a41849 100644 --- a/src/aig/nwk/nwkMan.c +++ b/src/aig/nwk/nwkMan.c @@ -140,11 +140,11 @@ int Nwk_ManCompareAndSaveBest( Nwk_Man_t * pNtk, void * pNtl ) ParsNew.nPis = Nwk_ManPiNum( pNtk ); ParsNew.nPos = Nwk_ManPoNum( pNtk ); // reset the parameters if the network has the same name - if ( ParsBest.pName == NULL || - strcmp(ParsBest.pName, pNtk->pName) || - ParsBest.Depth > ParsNew.Depth || - ParsBest.Depth == ParsNew.Depth && ParsBest.Flops > ParsNew.Flops || - ParsBest.Depth == ParsNew.Depth && ParsBest.Flops == ParsNew.Flops && ParsBest.Nodes > ParsNew.Nodes ) + if ( ParsBest.pName == NULL || + strcmp(ParsBest.pName, pNtk->pName) || + ParsBest.Depth > ParsNew.Depth || + (ParsBest.Depth == ParsNew.Depth && ParsBest.Flops > ParsNew.Flops) || + (ParsBest.Depth == ParsNew.Depth && ParsBest.Flops == ParsNew.Flops && ParsBest.Nodes > ParsNew.Nodes) ) { FREE( ParsBest.pName ); ParsBest.pName = Aig_UtilStrsav( pNtk->pName ); diff --git a/src/aig/nwk/nwkSpeedup.c b/src/aig/nwk/nwkSpeedup.c index b7802f72..469e9b71 100644 --- a/src/aig/nwk/nwkSpeedup.c +++ b/src/aig/nwk/nwkSpeedup.c @@ -221,8 +221,8 @@ Aig_Man_t * Nwk_ManSpeedup( Nwk_Man_t * pNtk, int fUseLutLib, int Percentage, in printf( "\n" ); } // mark the timing critical nodes and edges - puTCEdges = ALLOC( int, Nwk_ManObjNumMax(pNtk) ); - memset( puTCEdges, 0, sizeof(int) * Nwk_ManObjNumMax(pNtk) ); + puTCEdges = ALLOC( unsigned, Nwk_ManObjNumMax(pNtk) ); + memset( puTCEdges, 0, sizeof(unsigned) * Nwk_ManObjNumMax(pNtk) ); Nwk_ManForEachNode( pNtk, pNode, i ) { if ( Nwk_ObjSlack(pNode) >= tDelta ) diff --git a/src/aig/nwk/nwkTiming.c b/src/aig/nwk/nwkTiming.c index e8123dae..64508474 100644 --- a/src/aig/nwk/nwkTiming.c +++ b/src/aig/nwk/nwkTiming.c @@ -264,7 +264,8 @@ float Nwk_NodePropagateRequired( Nwk_Obj_t * pObj, int fUseSorting ) int pPinPerm[32]; float pPinDelays[32]; Nwk_Obj_t * pFanin; - float tRequired, * pDelays; + float tRequired = 0.0; // Suppress "might be used uninitialized" + float * pDelays; int k; assert( Nwk_ObjIsNode(pObj) ); if ( pLutLib == NULL ) @@ -557,10 +558,10 @@ void Nwk_NodeUpdateAddToQueue( Vec_Ptr_t * vQueue, Nwk_Obj_t * pObj, int iCurren ***********************************************************************/ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj ) { - If_Lib_t * pLutLib = pObj->pMan->pLutLib; Tim_Man_t * pManTime = pObj->pMan->pManTime; Vec_Ptr_t * vQueue = pObj->pMan->vTemp; - Nwk_Obj_t * pTemp, * pNext; + Nwk_Obj_t * pTemp; + Nwk_Obj_t * pNext = NULL; // Suppress "might be used uninitialized" float tArrival; int iCur, k, iBox, iTerm1, nTerms; assert( Nwk_ObjIsNode(pObj) ); @@ -636,10 +637,10 @@ void Nwk_NodeUpdateArrival( Nwk_Obj_t * pObj ) ***********************************************************************/ void Nwk_NodeUpdateRequired( Nwk_Obj_t * pObj ) { - If_Lib_t * pLutLib = pObj->pMan->pLutLib; Tim_Man_t * pManTime = pObj->pMan->pManTime; Vec_Ptr_t * vQueue = pObj->pMan->vTemp; - Nwk_Obj_t * pTemp, * pNext; + Nwk_Obj_t * pTemp; + Nwk_Obj_t * pNext = NULL; // Suppress "might be used uninitialized" float tRequired; int iCur, k, iBox, iTerm1, nTerms; assert( Nwk_ObjIsNode(pObj) ); @@ -763,7 +764,8 @@ void Nwk_ManUpdateLevel( Nwk_Obj_t * pObj ) { Tim_Man_t * pManTime = pObj->pMan->pManTime; Vec_Ptr_t * vQueue = pObj->pMan->vTemp; - Nwk_Obj_t * pTemp, * pNext; + Nwk_Obj_t * pTemp; + Nwk_Obj_t * pNext = NULL; // Suppress "might be used uninitialized" int LevelNew, iCur, k, iBox, iTerm1, nTerms; assert( Nwk_ObjIsNode(pObj) ); // initialize the queue with the node diff --git a/src/aig/nwk/nwkUtil.c b/src/aig/nwk/nwkUtil.c index 14f7632f..d6daca4e 100644 --- a/src/aig/nwk/nwkUtil.c +++ b/src/aig/nwk/nwkUtil.c @@ -261,7 +261,7 @@ void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileName, Vec_Ptr_t * vPiNames, Aig_MmFlex_t * pMem; char * pSop = NULL; unsigned * pTruth; - int i, k, nDigits, Counter = 0; + int i, k, nDigits; if ( Nwk_ManPoNum(pNtk) == 0 ) { printf( "Nwk_ManDumpBlif(): Network does not have POs.\n" ); @@ -278,7 +278,7 @@ void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileName, Vec_Ptr_t * vPiNames, fprintf( pFile, ".inputs" ); Nwk_ManForEachCi( pNtk, pObj, i ) if ( vPiNames ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, i) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, i) ); else fprintf( pFile, " n%0*d", nDigits, pObj->Id ); fprintf( pFile, "\n" ); @@ -286,7 +286,7 @@ void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileName, Vec_Ptr_t * vPiNames, fprintf( pFile, ".outputs" ); Nwk_ManForEachCo( pNtk, pObj, i ) if ( vPoNames ) - fprintf( pFile, " %s", Vec_PtrEntry(vPoNames, i) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPoNames, i) ); else fprintf( pFile, " n%0*d", nDigits, pObj->Id ); fprintf( pFile, "\n" ); @@ -310,7 +310,7 @@ void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileName, Vec_Ptr_t * vPiNames, { Nwk_ObjForEachFanin( pObj, pFanin, k ) if ( vPiNames && Nwk_ObjIsPi(pFanin) ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, Nwk_ObjPioNum(pFanin)) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, Nwk_ObjPioNum(pFanin)) ); else fprintf( pFile, " n%0*d", nDigits, pFanin->Id ); } @@ -327,11 +327,11 @@ void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileName, Vec_Ptr_t * vPiNames, { fprintf( pFile, ".names" ); if ( vPiNames && Nwk_ObjIsPi(Nwk_ObjFanin0(pObj)) ) - fprintf( pFile, " %s", Vec_PtrEntry(vPiNames, Nwk_ObjPioNum(Nwk_ObjFanin0(pObj))) ); + fprintf( pFile, " %s", (char*)Vec_PtrEntry(vPiNames, Nwk_ObjPioNum(Nwk_ObjFanin0(pObj))) ); else fprintf( pFile, " n%0*d", nDigits, Nwk_ObjFanin0(pObj)->Id ); if ( vPoNames ) - fprintf( pFile, " %s\n", Vec_PtrEntry(vPoNames, Nwk_ObjPioNum(pObj)) ); + fprintf( pFile, " %s\n", (char*)Vec_PtrEntry(vPoNames, Nwk_ObjPioNum(pObj)) ); else fprintf( pFile, " n%0*d\n", nDigits, pObj->Id ); fprintf( pFile, "%d 1\n", !pObj->fInvert ); diff --git a/src/aig/rwt/rwtDec.c b/src/aig/rwt/rwtDec.c index 98019629..df6209cd 100644 --- a/src/aig/rwt/rwtDec.c +++ b/src/aig/rwt/rwtDec.c @@ -60,7 +60,7 @@ void Rwt_ManPreprocess( Rwt_Man_t * p ) for ( pNode = p->pTable[i]; pNode; pNode = pNode->pNext ) { assert( pNode->uTruth == p->pTable[i]->uTruth ); - assert( p->pMap[pNode->uTruth] >= 0 && p->pMap[pNode->uTruth] < 222 ); + assert( p->pMap[pNode->uTruth] < 222 ); // Always >= 0 b/c unsigned. Vec_VecPush( p->vClasses, p->pMap[pNode->uTruth], pNode ); p->pMapInv[ p->pMap[pNode->uTruth] ] = p->puCanons[pNode->uTruth]; } diff --git a/src/aig/saig/saigInter.c b/src/aig/saig/saigInter.c index 889e6298..afc4a34a 100644 --- a/src/aig/saig/saigInter.c +++ b/src/aig/saig/saigInter.c @@ -151,7 +151,8 @@ Aig_Man_t * Saig_ManDuplicated( Aig_Man_t * p ) Aig_Man_t * Saig_ManTransformed( Aig_Man_t * p ) { Aig_Man_t * pNew; - Aig_Obj_t * pObj, * pObjLi, * pObjLo, * pCtrl; + Aig_Obj_t * pObj, * pObjLi, * pObjLo; + Aig_Obj_t * pCtrl = NULL; // Suppress "might be used uninitialized" int i; assert( Aig_ManRegNum(p) > 0 ); // create the new manager @@ -583,12 +584,6 @@ p->timeCnf += clock() - clk; printf( " I = %2d. Bmc =%3d. IntAnd =%6d. IntLev =%5d. Conf =%6d. ", i+1, i + 1 + p->nFrames, Aig_ManNodeNum(p->pInter), Aig_ManLevelNum(p->pInter), p->nConfCur ); PRT( "Time", clock() - clk ); - if ( Aig_ManNodeNum(p->pInter) == 0 ) - { - Aig_Obj_t * pObj = Aig_ManPo(p->pInter, 0); - Aig_Obj_t * pObjR = Aig_Regular(pObj); - int x = 0; - } } if ( RetValue == 0 ) // found a (spurious?) counter-example { diff --git a/src/aig/saig/saigRetMin.c b/src/aig/saig/saigRetMin.c index 0ad6c314..1820ae9a 100644 --- a/src/aig/saig/saigRetMin.c +++ b/src/aig/saig/saigRetMin.c @@ -150,13 +150,14 @@ int Saig_ManRetimeUnsatCore( Aig_Man_t * p, int fVerbose ) printf( "\n" ); } // collect the nodes - if ( fVeryVerbose ) - Aig_ManForEachObj( p, pObj, i ) - if ( pCnf->pVarNums[pObj->Id] >= 0 && pVars[ pCnf->pVarNums[pObj->Id] ] == 1 ) - { - Aig_ObjPrint( p, pObj ); - printf( "\n" ); - } + if ( fVeryVerbose ) { + Aig_ManForEachObj( p, pObj, i ) + if ( pCnf->pVarNums[pObj->Id] >= 0 && pVars[ pCnf->pVarNums[pObj->Id] ] == 1 ) + { + Aig_ObjPrint( p, pObj ); + printf( "\n" ); + } + } // pick the first PO in the list nPos = 0; iBadPo = -1; diff --git a/src/aig/saig/saigScl.c b/src/aig/saig/saigScl.c index 67e3e95b..6d55943a 100644 --- a/src/aig/saig/saigScl.c +++ b/src/aig/saig/saigScl.c @@ -82,7 +82,7 @@ void Saig_ManReportUselessRegisters( Aig_Man_t * pAig ) int Saig_ManReportComplements( Aig_Man_t * p ) { Aig_Obj_t * pObj, * pFanin; - int i, Counter = 0, Diffs = 0; + int i, Counter = 0; assert( Aig_ManRegNum(p) > 0 ); Aig_ManForEachObj( p, pObj, i ) assert( !pObj->fMarkA ); diff --git a/src/aig/saig/saigTrans.c b/src/aig/saig/saigTrans.c index b0039276..c1c2d8e9 100644 --- a/src/aig/saig/saigTrans.c +++ b/src/aig/saig/saigTrans.c @@ -375,7 +375,7 @@ Aig_Man_t * Saig_ManTimeframeSimplify( Aig_Man_t * pAig, int nFrames, int nFrame { extern Aig_Man_t * Fra_FraigEquivence( Aig_Man_t * pManAig, int nConfMax, int fProve ); Aig_Man_t * pFrames, * pFraig, * pRes1, * pRes2; - int clk, clkTotal = clock(); + int clk; // create uninitialized timeframes with map1 pFrames = Saig_ManFramesNonInitial( pAig, nFrames ); // perform fraiging for the unrolled timeframes |