diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-02-16 21:53:16 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-02-16 21:53:16 -0800 |
commit | 791b107e7a225103ee76c921c3c4a96d0e1adae2 (patch) | |
tree | 80d8e58053fbca2087d57b7fa8cbca7c594aa764 | |
parent | 933744347b36315b42338dfdee5934f87d029398 (diff) | |
download | abc-791b107e7a225103ee76c921c3c4a96d0e1adae2.tar.gz abc-791b107e7a225103ee76c921c3c4a96d0e1adae2.tar.bz2 abc-791b107e7a225103ee76c921c3c4a96d0e1adae2.zip |
Silencing some of the gcc warnings.
37 files changed, 108 insertions, 94 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c index 53233379..abf378cb 100644 --- a/src/aig/gia/giaAiger.c +++ b/src/aig/gia/giaAiger.c @@ -354,13 +354,14 @@ Gia_Man_t * Gia_ReadAiger2( char * pFileName, int fCheck ) unsigned char * pDrivers, * pSymbols, * pCur;//, * pType; char * pContents, * pName; unsigned uLit0, uLit1, uLit; + int RetValue; // read the file into the buffer Gia_FixFileName( pFileName ); nFileSize = Gia_FileSize( pFileName ); pFile = fopen( pFileName, "rb" ); pContents = ABC_ALLOC( char, nFileSize ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); // check if the input file format is correct @@ -1079,13 +1080,14 @@ Gia_Man_t * Gia_ReadAiger( char * pFileName, int fCheck ) Gia_Man_t * pNew; char * pName, * pContents; int nFileSize; + int RetValue; // read the file into the buffer Gia_FixFileName( pFileName ); nFileSize = Gia_FileSize( pFileName ); pFile = fopen( pFileName, "rb" ); pContents = ABC_ALLOC( char, nFileSize ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); pNew = Gia_ReadAigerFromMemory( pContents, nFileSize, fCheck ); diff --git a/src/aig/gia/giaForce.c b/src/aig/gia/giaForce.c index 6927266b..e7abb555 100644 --- a/src/aig/gia/giaForce.c +++ b/src/aig/gia/giaForce.c @@ -1069,6 +1069,7 @@ void For_ManFileExperiment() int * pBuffer; int i, Size, Exp = 25; int clk = clock(); + int RetValue; Size = (1 << Exp); printf( "2^%d machine words (%d bytes).\n", Exp, sizeof(int) * Size ); @@ -1080,7 +1081,7 @@ ABC_PRT( "Fillup", clock() - clk ); clk = clock(); pFile = fopen( "test.txt", "rb" ); - fread( pBuffer, 1, sizeof(int) * Size, pFile ); + RetValue = fread( pBuffer, 1, sizeof(int) * Size, pFile ); fclose( pFile ); ABC_PRT( "Read ", clock() - clk ); diff --git a/src/aig/gia/giaSim.c b/src/aig/gia/giaSim.c index 817fc2e2..37406c8d 100644 --- a/src/aig/gia/giaSim.c +++ b/src/aig/gia/giaSim.c @@ -611,7 +611,7 @@ int Gia_ManSimSimulate( Gia_Man_t * pAig, Gia_ParSim_t * pPars ) Gia_ManSim_t * p; int i, clkTotal = clock(); int iOut, iPat, RetValue = 0; - int nTimeToStop = pPars->TimeLimit ? pPars->TimeLimit + time(NULL) : 0; +// int nTimeToStop = pPars->TimeLimit ? pPars->TimeLimit + time(NULL) : 0; if ( pAig->pReprs && pAig->pNexts ) return Gia_ManSimSimulateEquiv( pAig, pPars ); ABC_FREE( pAig->pCexSeq ); diff --git a/src/aig/gia/giaSpeedup.c b/src/aig/gia/giaSpeedup.c index d20fe1a4..1098771e 100644 --- a/src/aig/gia/giaSpeedup.c +++ b/src/aig/gia/giaSpeedup.c @@ -291,12 +291,7 @@ float Gia_ManDelayTraceLut( Gia_Man_t * p ) vObjs = Gia_ManOrderReverse( p ); Vec_IntForEachEntry( vObjs, iObj, i ) { - if ( i == 1137 ) - { - int s = 0; - } pObj = Gia_ManObj(p, iObj); -//printf( "%d ", Gia_ObjLevel(p, pObj) ); if ( Gia_ObjIsLut(p, iObj) ) { Gia_ObjPropagateRequired( p, iObj, fUseSorting ); diff --git a/src/aig/gia/giaSwitch.c b/src/aig/gia/giaSwitch.c index 848bd646..4e39a921 100644 --- a/src/aig/gia/giaSwitch.c +++ b/src/aig/gia/giaSwitch.c @@ -473,7 +473,7 @@ static inline int Gia_ManSwiSimInfoCountTrans( Gia_ManSwi_t * p, int iPlace ) static inline void Gia_ManSwiSimulateRound( Gia_ManSwi_t * p, int fCount ) { Gia_Obj_t * pObj; - int i, iCis = 0, iCos = 0; + int i;//, iCis = 0, iCos = 0; assert( p->pAig->nFront > 0 ); assert( Gia_ManConst0(p->pAig)->Value == 0 ); Gia_ManSwiSimInfoZero( p, Gia_SwiData(p, 0) ); @@ -568,8 +568,7 @@ Vec_Int_t * Gia_ManSwiSimulate( Gia_Man_t * pAig, Gia_ParSwi_t * pPars ) if ( pPars->fVerbose ) { printf( "Obj = %8d (%8d). F = %6d. ", - pAig->nObjs, Gia_ManCiNum(pAig) + Gia_ManAndNum(pAig), p->pAig->nFront, - 4.0*Abc_BitWordNum(2 * p->pAig->nFront)/(1<<20) ); + pAig->nObjs, Gia_ManCiNum(pAig) + Gia_ManAndNum(pAig), p->pAig->nFront ); printf( "AIG = %7.2f Mb. F-mem = %7.2f Mb. Other = %7.2f Mb. ", 12.0*Gia_ManObjNum(p->pAig)/(1<<20), 4.0*p->nWords*p->pAig->nFront/(1<<20), @@ -740,7 +739,7 @@ float Gia_ManComputeSwitching( Gia_Man_t * p, int nFrames, int nPref, int fProbO Gia_Man_t * pDfs; Gia_Obj_t * pObj, * pObjDfs; Vec_Int_t * vSwitching; - float * pSwitching, Switch, SwitchTotal = 0.0, SwitchTotal2 = 0.0; + float * pSwitching, Switch, SwitchTotal = 0.0;//, SwitchTotal2 = 0.0; int i; Gia_ParSwi_t Pars, * pPars = &Pars; ABC_FREE( p->pSwitching ); diff --git a/src/aig/gia/giaTsim.c b/src/aig/gia/giaTsim.c index c4fb7f26..c306e867 100644 --- a/src/aig/gia/giaTsim.c +++ b/src/aig/gia/giaTsim.c @@ -178,10 +178,6 @@ static inline void Gia_ManTerSimulateCi( Gia_ManTer_t * p, Gia_Obj_t * pObj, int static inline void Gia_ManTerSimulateCo( Gia_ManTer_t * p, int iCo, Gia_Obj_t * pObj ) { int Value = Gia_ManTerSimInfoGet( p->pDataSim, Gia_ObjDiff0(pObj) ); - if ( iCo == Gia_ManCoNum(p->pAig) -1 ) - { - int s = 0; - } Gia_ManTerSimInfoSet( p->pDataSimCos, iCo, Gia_XsimNotCond( Value, Gia_ObjFaninC0(pObj) ) ); } @@ -418,7 +414,7 @@ static inline void Gia_ManTerSimulateRound( Gia_ManTer_t * p ) ***********************************************************************/ int Gia_ManTerRetire2( Gia_ManTer_t * p, unsigned * pState ) { - int i, Entry, iMaxTerValue = -1, Counter = 0; + int i, Entry, iMaxTerValue = -1; // find non-retired register with this value for ( i = 0; i < Gia_ManRegNum(p->pAig); i++ ) if ( Gia_ManTerSimInfoGet( pState, i ) != GIA_UND && !p->pRetired[i] && iMaxTerValue < p->pCountX[i] ) diff --git a/src/aig/ioa/ioaReadAig.c b/src/aig/ioa/ioaReadAig.c index a1f09edf..eb253659 100644 --- a/src/aig/ioa/ioaReadAig.c +++ b/src/aig/ioa/ioaReadAig.c @@ -433,13 +433,13 @@ Aig_Man_t * Ioa_ReadAiger( char * pFileName, int fCheck ) FILE * pFile; Aig_Man_t * pNew; char * pName, * pContents; - int nFileSize; + int nFileSize, RetValue; // read the file into the buffer nFileSize = Ioa_FileSize( pFileName ); pFile = fopen( pFileName, "rb" ); pContents = ABC_ALLOC( char, nFileSize ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); pNew = Ioa_ReadAigerFromMemory( pContents, nFileSize, fCheck ); diff --git a/src/aig/ivy/ivyDsd.c b/src/aig/ivy/ivyDsd.c index 71c4863a..5a1deb03 100644 --- a/src/aig/ivy/ivyDsd.c +++ b/src/aig/ivy/ivyDsd.c @@ -722,6 +722,8 @@ void Ivy_TruthTestOne( unsigned uTruth ) // Vec_IntFree( vTree ); } +#if 0 + /**Function************************************************************* Synopsis [] @@ -817,6 +819,7 @@ void Ivy_TruthTest5() fclose( pFile ); } +#endif //////////////////////////////////////////////////////////////////////// diff --git a/src/aig/ivy/ivyFraig.c b/src/aig/ivy/ivyFraig.c index 2b911861..180827b8 100644 --- a/src/aig/ivy/ivyFraig.c +++ b/src/aig/ivy/ivyFraig.c @@ -2076,7 +2076,7 @@ void Ivy_FraigPrintActivity( Ivy_FraigMan_t * p ) { int i; for ( i = 0; i < p->nSatVars; i++ ) - printf( "%d %.3f ", i, p->pSat->activity[i] ); + printf( "%d %.3f ", i, (double)p->pSat->activity[i] ); printf( "\n" ); } diff --git a/src/aig/saig/saigCexMin.c b/src/aig/saig/saigCexMin.c index f1826f50..2e8e9cdc 100644 --- a/src/aig/saig/saigCexMin.c +++ b/src/aig/saig/saigCexMin.c @@ -268,7 +268,6 @@ Vec_Vec_t * Saig_ManCexMinCollectPhasePriority_( Aig_Man_t * pAig, Abc_Cex_t * p nPrioOffset = (pCex->iFrame + 1) * pCex->nPis; Aig_ManConst1(pAig)->iData = Abc_Var2Lit( nPrioOffset + pCex->nRegs, 1 ); vRoots = Vec_IntAlloc( 1000 ); -//printf( "Const1 = %d Offset = %d\n", Aig_ManConst1(pAig)->iData, nPrioOffset ); for ( f = 0; f <= pCex->iFrame; f++ ) { int nPiCount = 0; @@ -284,14 +283,8 @@ Vec_Vec_t * Saig_ManCexMinCollectPhasePriority_( Aig_Man_t * pAig, Abc_Cex_t * p else if ( f == 0 ) Vec_IntPush( vFramePPsOne, Abc_Var2Lit( nPrioOffset + Saig_ObjRegId(pAig, pObj), 0 ) ); else - { - Aig_Obj_t * pObj0 = Saig_ObjLoToLi(pAig, pObj); - int Value = Saig_ObjLoToLi(pAig, pObj)->iData; Vec_IntPush( vFramePPsOne, Saig_ObjLoToLi(pAig, pObj)->iData ); - } -//printf( "%d ", Vec_IntEntryLast(vFramePPsOne) ); } -//printf( "\n" ); // compute the PP info Saig_ManCexMinDerivePhasePriority( pAig, pCex, vFrameCis, vFramePPs, f, vRoots ); } diff --git a/src/base/abc/abcHieCec.c b/src/base/abc/abcHieCec.c index ab29c3ca..3210ad48 100644 --- a/src/base/abc/abcHieCec.c +++ b/src/base/abc/abcHieCec.c @@ -192,8 +192,8 @@ void Abc_NtkDeriveFlatGia_rec( Gia_Man_t * pGia, Abc_Ntk_t * pNtk ) if ( Abc_ObjIsNode(pObj) ) { char * pSop = (char *)pObj->pData; - int nLength = strlen(pSop); /* + int nLength = strlen(pSop); if ( nLength == 4 ) // buf/inv { assert( pSop[2] == '1' ); @@ -446,8 +446,8 @@ Gia_Man_t * Abc_NtkDeriveFlatGia2( Abc_Ntk_t * pNtk ) */ Gia_Man_t * Abc_NtkDeriveFlatGia2( Abc_Ntk_t * pNtk, Vec_Ptr_t * vModels ) { - Abc_Ntk_t * pModel; Vec_Ptr_t * vOrder; + Abc_Ntk_t * pModel = NULL; Gia_Man_t * pGia = NULL; int i; diff --git a/src/base/abc/abcHieNew.c b/src/base/abc/abcHieNew.c index fa544a93..d4598ac1 100644 --- a/src/base/abc/abcHieNew.c +++ b/src/base/abc/abcHieNew.c @@ -494,7 +494,7 @@ void Au_ManCountThings( Au_Man_t * p ) { Au_Ntk_t * pNtk, * pBoxModel; Au_Obj_t * pBox; - int i, k, clk = clock(); + int i, k;//, clk = clock(); Au_ManForEachNtkReverse( p, pNtk, i ) { pNtk->nBoxes = Au_NtkBoxNum(pNtk); @@ -961,7 +961,7 @@ Au_Ntk_t * Au_NtkParseCBlif( char * pFileName ) { FILE * pFile; Au_Man_t * pMan; - Au_Ntk_t * pRoot; + Au_Ntk_t * pRoot = NULL; Au_Obj_t * pBox, * pFan; char * pBuffer, * pCur; Vec_Int_t * vLines, * vNum2Obj, * vFanins; @@ -1147,7 +1147,6 @@ void Au_NtkDeriveFlatGia_rec( Gia_Man_t * pGia, Au_Ntk_t * p ) { int gFanins[16]; char * pSop = Abc_NamStr( p->pMan->pFuncs, pObj->Func ); - int nLength = strlen(pSop); assert( Au_ObjFaninNum(pObj) <= 16 ); assert( Au_ObjFaninNum(pObj) == Abc_SopGetVarNum(pSop) ); Au_ObjForEachFanin( pObj, pTerm, k ) @@ -1322,7 +1321,7 @@ static inline int Au_ObjGetXsimFan2( Au_Obj_t * pObj ) ***********************************************************************/ void Au_NtkTerSimulate_rec( Au_Ntk_t * p ) { - Au_Obj_t * pObj, * pTerm; + Au_Obj_t * pObj = NULL, * pTerm; int i, k; Au_NtkForEachPi( p, pTerm, i ) { @@ -1492,7 +1491,8 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) Abc_Ntk_t * pMod; Au_Man_t * pMan; Au_Ntk_t * pNtk = NULL; - int i, clk1, clk2 = 0, clk3 = 0, clk4 = 0, clk = clock(); + int i, clk1, clk2 = 0, clk3 = 0, clk = clock(); +// int clk4 = 0; clk1 = clock(); pMan = Au_ManAlloc( pRoot->pDesign ? pRoot->pDesign->pName : pRoot->pName ); diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 27f9476f..e15b7402 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -2248,7 +2248,7 @@ usage: ***********************************************************************/ int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); int c; // set defaults Extra_UtilGetoptReset(); @@ -2420,7 +2420,7 @@ int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] ); return 1; } - } + } Abc_NodeShowBdd( pNode ); return 0; @@ -5805,7 +5805,7 @@ usage: ***********************************************************************/ int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes = NULL; + Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL; int c, iOutput = -1; extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput ); @@ -5956,7 +5956,7 @@ usage: ***********************************************************************/ int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes = NULL; + Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL; int c, iOutput = -1; extern void Abc_NtkRemovePo( Abc_Ntk_t * pNtk, int iOutput ); @@ -8118,11 +8118,11 @@ usage: ***********************************************************************/ int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); int c; int nVars; // the number of variables - int nLutSize; // the size of LUTs - int nLuts; // the number of LUTs + int nLutSize = -1; // the size of LUTs + int nLuts = -1; // the number of LUTs int fAdder; int fSorter; int fMesh; @@ -11533,7 +11533,7 @@ usage: ***********************************************************************/ int Abc_CommandFraigClean( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); int c; int fDuplicate; // set defaults @@ -11972,7 +11972,7 @@ usage: ***********************************************************************/ int Abc_CommandRecStop( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); int c; // set defaults Extra_UtilGetoptReset(); @@ -12065,7 +12065,7 @@ usage: ***********************************************************************/ int Abc_CommandRecPs( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); int c, fPrintLib = 0; // set defaults Extra_UtilGetoptReset(); @@ -12162,7 +12162,7 @@ usage: ***********************************************************************/ int Abc_CommandRecFilter( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); int c, nLimit = 0; // set defaults Extra_UtilGetoptReset(); @@ -26065,7 +26065,7 @@ usage: ***********************************************************************/ int Abc_CommandAbc9AbsRefine( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Gia_Man_t * pTemp = NULL; +// Gia_Man_t * pTemp = NULL; int c; int nFfToAddMax = 0; int fTryFour = 1; @@ -27141,8 +27141,8 @@ usage: ***********************************************************************/ int Abc_CommandAbc9ReachM( Abc_Frame_t * pAbc, int argc, char ** argv ) { +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Gia_ParLlb_t Pars, * pPars = &Pars; - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); char * pLogFileName = NULL; int c; extern int Llb_ManModelCheckGia( Gia_Man_t * pGia, Gia_ParLlb_t * pPars ); @@ -27320,8 +27320,8 @@ usage: ***********************************************************************/ int Abc_CommandAbc9ReachP( Abc_Frame_t * pAbc, int argc, char ** argv ) { +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Gia_ParLlb_t Pars, * pPars = &Pars; - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Aig_Man_t * pMan; char * pLogFileName = NULL; int c; @@ -27470,8 +27470,8 @@ usage: ***********************************************************************/ int Abc_CommandAbc9ReachN( Abc_Frame_t * pAbc, int argc, char ** argv ) { +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Gia_ParLlb_t Pars, * pPars = &Pars; - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Aig_Man_t * pMan; char * pLogFileName = NULL; int c; @@ -27600,8 +27600,8 @@ usage: ***********************************************************************/ int Abc_CommandAbc9ReachY( Abc_Frame_t * pAbc, int argc, char ** argv ) { +// Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Gia_ParLlb_t Pars, * pPars = &Pars; - Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Aig_Man_t * pMan; char * pLogFileName = NULL; int c; @@ -27801,7 +27801,7 @@ usage: ***********************************************************************/ int Abc_CommandAbc9Test( Abc_Frame_t * pAbc, int argc, char ** argv ) { - Gia_Man_t * pTemp = NULL; +// Gia_Man_t * pTemp = NULL; int c, fVerbose = 0; int fSwitch = 0; // extern Gia_Man_t * Gia_VtaTest( Gia_Man_t * p ); diff --git a/src/base/abci/abcBm.c b/src/base/abci/abcBm.c index 3a8567fe..d2f80aeb 100644 --- a/src/base/abci/abcBm.c +++ b/src/base/abci/abcBm.c @@ -462,7 +462,7 @@ int * Abc_NtkSimulateOneNode( Abc_Ntk_t * pNtk, int * pModel, int input, Vec_Ptr // set the CI values Abc_AigConst1(pNtk)->pCopy = (Abc_Obj_t *)1; pNode = Abc_NtkCi(pNtk, input); - pNode->pCopy = (Abc_Obj_t *)pModel[input]; + pNode->iTemp = pModel[input]; // simulate in the topological order for(i = Vec_PtrSize(topOrder[input])-1; i >= 0; i--) @@ -472,9 +472,9 @@ int * Abc_NtkSimulateOneNode( Abc_Ntk_t * pNtk, int * pModel, int input, Vec_Ptr Value0 = ((int)(ABC_PTRUINT_T)Abc_ObjFanin0(pNode)->pCopy) ^ Abc_ObjFaninC0(pNode); Value1 = ((int)(ABC_PTRUINT_T)Abc_ObjFanin1(pNode)->pCopy) ^ Abc_ObjFaninC1(pNode); - if( pNode->pCopy != (Abc_Obj_t *)(Value0 & Value1)) + if( pNode->iTemp != (Value0 & Value1)) { - pNode->pCopy = (Abc_Obj_t *)(Value0 & Value1); + pNode->iTemp = (Value0 & Value1); Vec_PtrPush(vNodes, pNode); } @@ -846,7 +846,7 @@ void Abc_NtkVerifyReportError( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int * pMode vNodes = Abc_NtkNodeSupport( pNtk1, &pNode, 1 ); // set the PI numbers Abc_NtkForEachCi( pNtk1, pNode, i ) - pNode->pCopy = (Abc_Obj_t *)i; + pNode->iTemp = i; // print the model pNode = (Abc_Obj_t *)Vec_PtrEntry( vNodes, 0 ); if ( Abc_ObjIsCi(pNode) ) diff --git a/src/base/abci/abcCascade.c b/src/base/abci/abcCascade.c index a477077d..60f7294f 100644 --- a/src/base/abci/abcCascade.c +++ b/src/base/abci/abcCascade.c @@ -874,7 +874,7 @@ DdNode * Abc_NtkBddDecCharFunc( DdManager * dd, DdNode ** pFuncs, int nOuts, int ***********************************************************************/ DdNode * Abc_NtkBddDecTry( reo_man * pReo, DdManager * dd, DdNode ** pFuncs, int nIns, int nOuts, int Mask, int nBits ) { - int fReorder = 0; +// int fReorder = 0; DdNode * bFunc;//, * aFunc, * aFuncNew; // derive the characteristic function bFunc = Abc_NtkBddDecCharFunc( dd, pFuncs, nOuts, Mask, nBits ); Cudd_Ref( bFunc ); diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c index 6b8cd378..d54092f9 100644 --- a/src/base/abci/abcDar.c +++ b/src/base/abci/abcDar.c @@ -1174,9 +1174,9 @@ Abc_Ntk_t * Abc_NtkConstructFromCnf( Abc_Ntk_t * pNtk, Cnf_Man_t * p, Vec_Ptr_t ***********************************************************************/ Abc_Ntk_t * Abc_NtkDarToCnf( Abc_Ntk_t * pNtk, char * pFileName, int fFastAlgo, int fChangePol, int fVerbose ) { - Vec_Ptr_t * vMapped = NULL; +// Vec_Ptr_t * vMapped = NULL; Aig_Man_t * pMan; - Cnf_Man_t * pManCnf = NULL; +// Cnf_Man_t * pManCnf = NULL; Cnf_Dat_t * pCnf; Abc_Ntk_t * pNtkNew = NULL; int clk = clock(); @@ -1888,7 +1888,7 @@ int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars ) ***********************************************************************/ int Abc_NtkDarBmcInter_int( Aig_Man_t * pMan, Inter_ManParams_t * pPars, Aig_Man_t ** ppNtkRes ) { - int RetValue, iFrame, clk = clock(); + int RetValue = -1, iFrame, clk = clock(); int nTotalProvedSat = 0; assert( pMan->nRegs > 0 ); if ( ppNtkRes ) diff --git a/src/base/abci/abcIf.c b/src/base/abci/abcIf.c index ded34d3c..2d6915e4 100644 --- a/src/base/abci/abcIf.c +++ b/src/base/abci/abcIf.c @@ -358,7 +358,7 @@ Abc_Ntk_t * Abc_NtkFromIf( If_Man_t * pIfMan, Abc_Ntk_t * pNtk ) Hop_Obj_t * Abc_NodeTruthToHopInt( Hop_Man_t * pMan, Vec_Wrd_t * vAnds, int nVars ) { Vec_Ptr_t * vResults; - Hop_Obj_t * pRes0, * pRes1, * pRes; + Hop_Obj_t * pRes0, * pRes1, * pRes = NULL; If_And_t This; word Entry; int i; diff --git a/src/base/abci/abcLog.c b/src/base/abci/abcLog.c index aa926a41..d2dddaa2 100644 --- a/src/base/abci/abcLog.c +++ b/src/base/abci/abcLog.c @@ -134,7 +134,7 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames ) FILE * pFile; Abc_Cex_t * pCex; Vec_Int_t * vNums; - char Buffer[1000], * pToken; + char Buffer[1000], * pToken, * RetValue; int c, nRegs = -1, nFrames = -1, iPo = -1, Status = -1, nFrames2 = -1; pFile = fopen( pFileName, "r" ); if ( pFile == NULL ) @@ -142,7 +142,7 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames ) printf( "Cannot open log file for reading \"%s\".\n" , pFileName ); return -1; } - fgets( Buffer, 1000, pFile ); + RetValue = fgets( Buffer, 1000, pFile ); if ( !strncmp( Buffer, "snl_UNSAT", strlen("snl_UNSAT") ) ) { Status = 1; diff --git a/src/base/abci/abcLutmin.c b/src/base/abci/abcLutmin.c index d740777c..bbea264c 100644 --- a/src/base/abci/abcLutmin.c +++ b/src/base/abci/abcLutmin.c @@ -497,7 +497,7 @@ Abc_Obj_t * Abc_NtkBddFindCofactor( Abc_Ntk_t * pNtkNew, Abc_Obj_t * pNode, int Abc_Obj_t * pNodeBot, * pNodeTop; DdManager * ddOld = (DdManager *)pNode->pNtk->pManFunc; DdManager * ddNew = (DdManager *)pNtkNew->pManFunc; - DdNode * bCof0, * bCof1, * bSupp, * bTemp, * bVar; + DdNode * bCof0 = NULL, * bCof1 = NULL, * bSupp, * bTemp, * bVar; DdNode * bCof0n, * bCof1n; int i, iCof, iFreeVar, fCof1Smaller = -1; assert( Abc_ObjFaninNum(pNode) == nLutSize + 1 ); diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c index 01e0a093..a3a12b71 100644 --- a/src/base/abci/abcPrint.c +++ b/src/base/abci/abcPrint.c @@ -372,7 +372,6 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum } -/* s_TotalNodes += Abc_NtkNodeNum(pNtk); printf( "Total nodes = %6d %6.2f Mb Changes = %6d.\n", s_TotalNodes, s_TotalNodes * 20.0 / (1<<20), s_TotalChanges ); @@ -1301,7 +1300,7 @@ void Abc_NtkPrintMiter( Abc_Ntk_t * pNtk ) Time = clock() - Time; printf(" %7.2f sec\n", (float)(Time)/(float)(CLOCKS_PER_SEC)); if ( iOut >= 0 ) - printf( "The first satisfiable output is number %d (%d).\n", iOut, Abc_ObjName( Abc_NtkPo(pNtk, iOut) ) ); + printf( "The first satisfiable output is number %d (%s).\n", iOut, Abc_ObjName( Abc_NtkPo(pNtk, iOut) ) ); } @@ -1486,12 +1485,12 @@ void Abc_NtkShow6VarFunc( char * pF0, char * pF1 ) word F0, F1; if ( strlen(pF0) != 16 ) { - printf( "Wrong length (%d) of 6-var truth table (%s).\n", strlen(pF0), pF0 ); + printf( "Wrong length (%d) of 6-var truth table.\n", strlen(pF0) ); return; } if ( strlen(pF1) != 16 ) { - printf( "Wrong length (%d) of 6-var truth table (%s).\n", strlen(pF1), pF1 ); + printf( "Wrong length (%d) of 6-var truth table.\n", strlen(pF1) ); return; } Extra_ReadHexadecimal( (unsigned *)&F0, pF0, 6 ); diff --git a/src/base/abci/abcScorr.c b/src/base/abci/abcScorr.c index e7683edf..60199b33 100644 --- a/src/base/abci/abcScorr.c +++ b/src/base/abci/abcScorr.c @@ -326,7 +326,7 @@ Abc_Ntk_t * Abc_NtkTestScorr( char * pFileNameIn, char * pFileNameOut, int nStep Abc_Ntk_t * pNetlist, * pLogic, * pStrash, * pResult; Aig_Man_t * pAig, * pTempAig; Gia_Man_t * pGia, * pTempGia; - int Counter = 0; +// int Counter = 0; // check the files pFile = fopen( pFileNameIn, "rb" ); if ( pFile == NULL ) diff --git a/src/base/cmd/cmdPlugin.c b/src/base/cmd/cmdPlugin.c index 84e89cb1..f14eed55 100644 --- a/src/base/cmd/cmdPlugin.c +++ b/src/base/cmd/cmdPlugin.c @@ -332,7 +332,7 @@ static unsigned textToBin(char* text, unsigned long text_sz) char* dst = text; const char* src = text; unsigned sz, i; - sscanf(src, "%lu ", &sz); + sscanf(src, "%u ", &sz); while(*src++ != ' '); for ( i = 0; i < sz; i += 3 ) { diff --git a/src/base/cmd/cmdUtils.c b/src/base/cmd/cmdUtils.c index e6dbed4e..3849b580 100644 --- a/src/base/cmd/cmdUtils.c +++ b/src/base/cmd/cmdUtils.c @@ -49,11 +49,12 @@ static int CmdCommandPrintCompare( Abc_Command ** ppC1, Abc_Command ** ppC2 ); ***********************************************************************/ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv) { + int RetValue; if (argv[0][0] == '!') { const int size = 4096; int i; - char buffer[4096]; + char * buffer = ABC_ALLOC(char, 10000); strncpy (buffer, &argv[0][1], size); for (i = 1; i < argc; ++i) { @@ -62,7 +63,8 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv) } if (buffer[0] == 0) strncpy (buffer, "/bin/sh", size); - system (buffer); + RetValue = system (buffer); + ABC_FREE( buffer ); // NOTE: Since we reconstruct the cmdline by concatenating // the parts, we lose information. So a command like diff --git a/src/base/io/ioReadAiger.c b/src/base/io/ioReadAiger.c index 55ef16db..0644aed9 100644 --- a/src/base/io/ioReadAiger.c +++ b/src/base/io/ioReadAiger.c @@ -21,9 +21,15 @@ // The code in this file is developed in collaboration with Mark Jarvin of Toronto. +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <assert.h> +#include <time.h> + #include "src/misc/bzlib/bzlib.h" -#include "ioAbc.h" #include "src/misc/zlib/zlib.h" +#include "ioAbc.h" ABC_NAMESPACE_IMPL_START @@ -119,6 +125,7 @@ static char * Ioa_ReadLoadFileBz2Aig( char * pFileName, int * pFileSize ) int bzError; struct buflist * pNext; buflist * bufHead = NULL, * buf = NULL; + int RetValue; pFile = fopen( pFileName, "rb" ); if ( pFile == NULL ) @@ -165,7 +172,7 @@ static char * Ioa_ReadLoadFileBz2Aig( char * pFileName, int * pFileSize ) } pContents = ABC_ALLOC( char, nFileSize + 10 ); rewind( pFile ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); } else { // Some other error. printf( "Ioa_ReadLoadFileBz2(): Unable to read the compressed BLIF.\n" ); @@ -238,6 +245,7 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck ) int nFileSize = -1, iTerm, nDigits, i; char * pContents, * pDrivers = NULL, * pSymbols, * pCur, * pName, * pType; unsigned uLit0, uLit1, uLit; + int RetValue; // read the file into the buffer if ( !strncmp(pFileName+strlen(pFileName)-4,".bz2",4) ) @@ -250,7 +258,7 @@ Abc_Ntk_t * Io_ReadAiger( char * pFileName, int fCheck ) nFileSize = Extra_FileSize( pFileName ); pFile = fopen( pFileName, "rb" ); pContents = ABC_ALLOC( char, nFileSize ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); } diff --git a/src/base/io/ioReadBaf.c b/src/base/io/ioReadBaf.c index 95c63539..d3ba46be 100644 --- a/src/base/io/ioReadBaf.c +++ b/src/base/io/ioReadBaf.c @@ -52,12 +52,13 @@ Abc_Ntk_t * Io_ReadBaf( char * pFileName, int fCheck ) int nInputs, nOutputs, nLatches, nAnds, nFileSize, Num, i; char * pContents, * pName, * pCur; unsigned * pBufferNode; + int RetValue; // read the file into the buffer nFileSize = Extra_FileSize( pFileName ); pFile = fopen( pFileName, "rb" ); pContents = ABC_ALLOC( char, nFileSize ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); // skip the comments (comment lines begin with '#' and end with '\n') diff --git a/src/base/io/ioReadBlifAig.c b/src/base/io/ioReadBlifAig.c index f365cb4d..4bdb035e 100644 --- a/src/base/io/ioReadBlifAig.c +++ b/src/base/io/ioReadBlifAig.c @@ -433,6 +433,7 @@ static char * Io_BlifLoadFile( char * pFileName ) FILE * pFile; int nFileSize; char * pContents; + int RetValue; pFile = fopen( pFileName, "rb" ); if ( pFile == NULL ) { @@ -449,7 +450,7 @@ static char * Io_BlifLoadFile( char * pFileName ) } pContents = ABC_ALLOC( char, nFileSize + 10 ); rewind( pFile ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); // finish off the file with the spare .end line // some benchmarks suddenly break off without this line diff --git a/src/base/io/ioReadBlifMv.c b/src/base/io/ioReadBlifMv.c index 3e226824..127c4537 100644 --- a/src/base/io/ioReadBlifMv.c +++ b/src/base/io/ioReadBlifMv.c @@ -532,6 +532,7 @@ static char * Io_MvLoadFile( char * pFileName ) FILE * pFile; int nFileSize; char * pContents; + int RetValue; pFile = fopen( pFileName, "rb" ); if ( pFile == NULL ) { @@ -548,7 +549,7 @@ static char * Io_MvLoadFile( char * pFileName ) } pContents = ABC_ALLOC( char, nFileSize + 10 ); rewind( pFile ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); // finish off the file with the spare .end line // some benchmarks suddenly break off without this line diff --git a/src/base/ver/verStream.c b/src/base/ver/verStream.c index 75e183b3..2cfef1d5 100644 --- a/src/base/ver/verStream.c +++ b/src/base/ver/verStream.c @@ -76,6 +76,7 @@ Ver_Stream_t * Ver_StreamAlloc( char * pFileName ) Ver_Stream_t * p; FILE * pFile; int nCharsToRead; + int RetValue; // check if the file can be opened pFile = fopen( pFileName, "rb" ); if ( pFile == NULL ) @@ -99,7 +100,7 @@ Ver_Stream_t * Ver_StreamAlloc( char * pFileName ) // determine how many chars to read nCharsToRead = VER_MINIMUM(p->nFileSize, VER_BUFFER_SIZE); // load the first part into the buffer - fread( p->pBuffer, nCharsToRead, 1, p->pFile ); + RetValue = fread( p->pBuffer, nCharsToRead, 1, p->pFile ); p->nFileRead = nCharsToRead; // set the ponters to the end and the stopping point p->pBufferEnd = p->pBuffer + nCharsToRead; @@ -123,6 +124,7 @@ Ver_Stream_t * Ver_StreamAlloc( char * pFileName ) void Ver_StreamReload( Ver_Stream_t * p ) { int nCharsUsed, nCharsToRead; + int RetValue; assert( !p->fStop ); assert( p->pBufferCur > p->pBufferStop ); assert( p->pBufferCur < p->pBufferEnd ); @@ -134,7 +136,7 @@ void Ver_StreamReload( Ver_Stream_t * p ) // determine how many chars we will read nCharsToRead = VER_MINIMUM( p->nBufferSize - nCharsUsed, p->nFileSize - p->nFileRead ); // read the chars - fread( p->pBuffer + nCharsUsed, nCharsToRead, 1, p->pFile ); + RetValue = fread( p->pBuffer + nCharsUsed, nCharsToRead, 1, p->pFile ); p->nFileRead += nCharsToRead; // set the ponters to the end and the stopping point p->pBufferEnd = p->pBuffer + nCharsUsed + nCharsToRead; diff --git a/src/bool/bdc/bdcSpfd.c b/src/bool/bdc/bdcSpfd.c index 83a35c11..3144f136 100644 --- a/src/bool/bdc/bdcSpfd.c +++ b/src/bool/bdc/bdcSpfd.c @@ -725,15 +725,16 @@ Vec_Wrd_t * Bdc_SpfdReadFiles5( Vec_Int_t ** pvWeights ) Vec_Int_t * vWeights; Vec_Wrd_t * vDivs; FILE * pFile; + int RetValue; vDivs = Vec_WrdStart( 3863759 ); pFile = fopen( "func6v5n_bin.txt", "rb" ); - fread( Vec_WrdArray(vDivs), sizeof(word), Vec_WrdSize(vDivs), pFile ); + RetValue = fread( Vec_WrdArray(vDivs), sizeof(word), Vec_WrdSize(vDivs), pFile ); fclose( pFile ); vWeights = Vec_IntStart( 3863759 ); pFile = fopen( "func6v5nW_bin.txt", "rb" ); - fread( Vec_IntArray(vWeights), sizeof(int), Vec_IntSize(vWeights), pFile ); + RetValue = fread( Vec_IntArray(vWeights), sizeof(int), Vec_IntSize(vWeights), pFile ); fclose( pFile ); *pvWeights = vWeights; @@ -756,12 +757,13 @@ Vec_Wrd_t * Bdc_SpfdReadFiles6( Vec_Int_t ** pvWeights ) Vec_Int_t * vWeights; Vec_Wrd_t * vDivs = Vec_WrdStart( 12776759 ); FILE * pFile = fopen( "func6v6n_bin.txt", "rb" ); - fread( Vec_WrdArray(vDivs), sizeof(word), Vec_WrdSize(vDivs), pFile ); + int RetValue; + RetValue = fread( Vec_WrdArray(vDivs), sizeof(word), Vec_WrdSize(vDivs), pFile ); fclose( pFile ); vWeights = Vec_IntStart( 12776759 ); pFile = fopen( "func6v6nW_bin.txt", "rb" ); - fread( Vec_IntArray(vWeights), sizeof(int), Vec_IntSize(vWeights), pFile ); + RetValue = fread( Vec_IntArray(vWeights), sizeof(int), Vec_IntSize(vWeights), pFile ); fclose( pFile ); *pvWeights = vWeights; diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c index 9a213d2a..c31bc141 100644 --- a/src/map/amap/amapLiberty.c +++ b/src/map/amap/amapLiberty.c @@ -826,6 +826,7 @@ Amap_Tree_t * Amap_LibertyStart( char * pFileName ) { FILE * pFile; Amap_Tree_t * p; + int RetValue; // start the manager p = ABC_ALLOC( Amap_Tree_t, 1 ); memset( p, 0, sizeof(Amap_Tree_t) ); @@ -839,7 +840,7 @@ Amap_Tree_t * Amap_LibertyStart( char * pFileName ) } pFile = fopen( pFileName, "rb" ); p->pContents = ABC_ALLOC( char, p->nContents+1 ); - fread( p->pContents, p->nContents, 1, pFile ); + RetValue = fread( p->pContents, p->nContents, 1, pFile ); fclose( pFile ); p->pContents[p->nContents] = 0; // other diff --git a/src/map/amap/amapRead.c b/src/map/amap/amapRead.c index 5776c3ff..1031ee84 100644 --- a/src/map/amap/amapRead.c +++ b/src/map/amap/amapRead.c @@ -76,6 +76,7 @@ char * Amap_LoadFile( char * pFileName ) FILE * pFile; char * pBuffer; int nFileSize; + int RetValue; // open the BLIF file for binary reading pFile = Io_FileOpen( pFileName, "open_path", "rb", 1 ); // pFile = fopen( FileName, "rb" ); @@ -94,7 +95,7 @@ char * Amap_LoadFile( char * pFileName ) rewind( pFile ); // load the contents of the file into memory pBuffer = ABC_ALLOC( char, nFileSize + 10 ); - fread( pBuffer, nFileSize, 1, pFile ); + RetValue = fread( pBuffer, nFileSize, 1, pFile ); // terminate the string with '\0' pBuffer[ nFileSize ] = '\0'; strcat( pBuffer, "\n.end\n" ); diff --git a/src/map/mio/mioRead.c b/src/map/mio/mioRead.c index ccbc0ac6..283e2acf 100644 --- a/src/map/mio/mioRead.c +++ b/src/map/mio/mioRead.c @@ -114,6 +114,7 @@ Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st_tab { FILE * pFile; int nFileSize; + int RetValue; // open the BLIF file for binary reading pFile = Io_FileOpen( FileName, "open_path", "rb", 1 ); @@ -128,7 +129,7 @@ Mio_Library_t * Mio_LibraryReadOne( char * FileName, int fExtendedFormat, st_tab rewind( pFile ); // load the contents of the file into memory pBuffer = ABC_ALLOC( char, nFileSize + 10 ); - fread( pBuffer, nFileSize, 1, pFile ); + RetValue = fread( pBuffer, nFileSize, 1, pFile ); // terminate the string with '\0' pBuffer[ nFileSize ] = '\0'; strcat( pBuffer, "\n.end\n" ); diff --git a/src/misc/bbl/bblif.c b/src/misc/bbl/bblif.c index fc227760..47190fb7 100644 --- a/src/misc/bbl/bblif.c +++ b/src/misc/bbl/bblif.c @@ -667,10 +667,11 @@ char * Bbl_ManFileRead( char * pFileName ) FILE * pFile; char * pContents; int nFileSize; + int RetValue; nFileSize = Bbl_ManFileSize( pFileName ); pFile = fopen( pFileName, "rb" ); pContents = BBLIF_ALLOC( char, nFileSize ); - fread( pContents, nFileSize, 1, pFile ); + RetValue = fread( pContents, nFileSize, 1, pFile ); fclose( pFile ); return pContents; } diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c index b38befd6..e2c32ec3 100644 --- a/src/misc/extra/extraUtilFile.c +++ b/src/misc/extra/extraUtilFile.c @@ -235,6 +235,7 @@ char * Extra_FileRead( FILE * pFile ) { int nFileSize; char * pBuffer; + int RetValue; // get the file size, in bytes fseek( pFile, 0, SEEK_END ); nFileSize = ftell( pFile ); @@ -242,7 +243,7 @@ char * Extra_FileRead( FILE * pFile ) rewind( pFile ); // load the contents of the file into memory pBuffer = ABC_ALLOC( char, nFileSize + 3 ); - fread( pBuffer, nFileSize, 1, pFile ); + RetValue = fread( pBuffer, nFileSize, 1, pFile ); // terminate the string with '\0' pBuffer[ nFileSize + 0] = '\n'; pBuffer[ nFileSize + 1] = '\0'; diff --git a/src/misc/extra/extraUtilReader.c b/src/misc/extra/extraUtilReader.c index 41e02a27..44fc080b 100644 --- a/src/misc/extra/extraUtilReader.c +++ b/src/misc/extra/extraUtilReader.c @@ -91,6 +91,7 @@ Extra_FileReader_t * Extra_FileReaderAlloc( char * pFileName, FILE * pFile; char * pChar; int nCharsToRead; + int RetValue; // check if the file can be opened pFile = fopen( pFileName, "rb" ); if ( pFile == NULL ) @@ -122,7 +123,7 @@ Extra_FileReader_t * Extra_FileReaderAlloc( char * pFileName, // determine how many chars to read nCharsToRead = EXTRA_MINIMUM(p->nFileSize, EXTRA_BUFFER_SIZE); // load the first part into the buffer - fread( p->pBuffer, nCharsToRead, 1, p->pFile ); + RetValue = fread( p->pBuffer, nCharsToRead, 1, p->pFile ); p->nFileRead = nCharsToRead; // set the ponters to the end and the stopping point p->pBufferEnd = p->pBuffer + nCharsToRead; @@ -361,6 +362,7 @@ void * Extra_FileReaderGetTokens_int( Extra_FileReader_t * p ) void Extra_FileReaderReload( Extra_FileReader_t * p ) { int nCharsUsed, nCharsToRead; + int RetValue; assert( !p->fStop ); assert( p->pBufferCur > p->pBufferStop ); assert( p->pBufferCur < p->pBufferEnd ); @@ -372,7 +374,7 @@ void Extra_FileReaderReload( Extra_FileReader_t * p ) // determine how many chars we will read nCharsToRead = EXTRA_MINIMUM( p->nBufferSize - nCharsUsed, p->nFileSize - p->nFileRead ); // read the chars - fread( p->pBuffer + nCharsUsed, nCharsToRead, 1, p->pFile ); + RetValue = fread( p->pBuffer + nCharsUsed, nCharsToRead, 1, p->pFile ); p->nFileRead += nCharsToRead; // set the ponters to the end and the stopping point p->pBufferEnd = p->pBuffer + nCharsUsed + nCharsToRead; diff --git a/src/opt/rwr/rwrUtil.c b/src/opt/rwr/rwrUtil.c index 1b2e8760..ac723588 100644 --- a/src/opt/rwr/rwrUtil.c +++ b/src/opt/rwr/rwrUtil.c @@ -563,6 +563,7 @@ void Rwr_ManLoadFromFile( Rwr_Man_t * p, char * pFileName ) unsigned * pBuffer; int Level, Volume, nEntries, fExor; int i, clk = clock(); + int RetValue; // load the data pFile = fopen( pFileName, "rb" ); @@ -571,9 +572,9 @@ void Rwr_ManLoadFromFile( Rwr_Man_t * p, char * pFileName ) printf( "Rwr_ManLoadFromFile: Cannot open file \"%s\".\n", pFileName ); return; } - fread( &nEntries, sizeof(int), 1, pFile ); + RetValue = fread( &nEntries, sizeof(int), 1, pFile ); pBuffer = ABC_ALLOC( unsigned, nEntries * 2 ); - fread( pBuffer, sizeof(unsigned), nEntries * 2, pFile ); + RetValue = fread( pBuffer, sizeof(unsigned), nEntries * 2, pFile ); fclose( pFile ); // reconstruct the forest for ( i = 0; i < nEntries; i++ ) diff --git a/src/sat/msat/msatRead.c b/src/sat/msat/msatRead.c index b2cae898..cd7650fe 100644 --- a/src/sat/msat/msatRead.c +++ b/src/sat/msat/msatRead.c @@ -48,6 +48,7 @@ char * Msat_FileRead( FILE * pFile ) { int nFileSize; char * pBuffer; + int RetValue; // get the file size, in bytes fseek( pFile, 0, SEEK_END ); nFileSize = ftell( pFile ); @@ -55,7 +56,7 @@ char * Msat_FileRead( FILE * pFile ) rewind( pFile ); // load the contents of the file into memory pBuffer = ABC_ALLOC( char, nFileSize + 3 ); - fread( pBuffer, nFileSize, 1, pFile ); + RetValue = fread( pBuffer, nFileSize, 1, pFile ); // terminate the string with '\0' pBuffer[ nFileSize + 0] = '\n'; pBuffer[ nFileSize + 1] = '\0'; |