mirror of https://github.com/YosysHQ/abc.git
Silencing some of the gcc warnings.
This commit is contained in:
parent
933744347b
commit
791b107e7a
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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] )
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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) )
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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++ )
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Reference in New Issue