diff options
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abc/abcHieCec.c | 4 | ||||
-rw-r--r-- | src/base/abc/abcHieNew.c | 10 | ||||
-rw-r--r-- | src/base/abci/abc.c | 34 | ||||
-rw-r--r-- | src/base/abci/abcBm.c | 8 | ||||
-rw-r--r-- | src/base/abci/abcCascade.c | 2 | ||||
-rw-r--r-- | src/base/abci/abcDar.c | 6 | ||||
-rw-r--r-- | src/base/abci/abcIf.c | 2 | ||||
-rw-r--r-- | src/base/abci/abcLog.c | 4 | ||||
-rw-r--r-- | src/base/abci/abcLutmin.c | 2 | ||||
-rw-r--r-- | src/base/abci/abcPrint.c | 7 | ||||
-rw-r--r-- | src/base/abci/abcScorr.c | 2 | ||||
-rw-r--r-- | src/base/cmd/cmdPlugin.c | 2 | ||||
-rw-r--r-- | src/base/cmd/cmdUtils.c | 6 | ||||
-rw-r--r-- | src/base/io/ioReadAiger.c | 14 | ||||
-rw-r--r-- | src/base/io/ioReadBaf.c | 3 | ||||
-rw-r--r-- | src/base/io/ioReadBlifAig.c | 3 | ||||
-rw-r--r-- | src/base/io/ioReadBlifMv.c | 3 | ||||
-rw-r--r-- | src/base/ver/verStream.c | 6 |
18 files changed, 66 insertions, 52 deletions
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; |