Commit 360bce61 by Alan Mishchenko

Compiler warnings.

parent 4c557544
...@@ -38,6 +38,7 @@ ABC_NAMESPACE_IMPL_START ...@@ -38,6 +38,7 @@ ABC_NAMESPACE_IMPL_START
#define NF_LEAF_MAX 6 #define NF_LEAF_MAX 6
#define NF_CUT_MAX 32 #define NF_CUT_MAX 32
#define NF_NO_LEAF 31 #define NF_NO_LEAF 31
#define NF_NO_FUNC 0x3FFFFFF
#define NF_INFINITY FLT_MAX #define NF_INFINITY FLT_MAX
typedef struct Nf_Cut_t_ Nf_Cut_t; typedef struct Nf_Cut_t_ Nf_Cut_t;
...@@ -46,7 +47,7 @@ struct Nf_Cut_t_ ...@@ -46,7 +47,7 @@ struct Nf_Cut_t_
word Sign; // signature word Sign; // signature
int Delay; // delay int Delay; // delay
float Flow; // flow float Flow; // flow
unsigned iFunc : 26; // function unsigned iFunc : 26; // function (NF_NO_FUNC)
unsigned Useless : 1; // function unsigned Useless : 1; // function
unsigned nLeaves : 5; // leaf number (NF_NO_LEAF) unsigned nLeaves : 5; // leaf number (NF_NO_LEAF)
int pLeaves[NF_LEAF_MAX+1]; // leaves int pLeaves[NF_LEAF_MAX+1]; // leaves
...@@ -645,7 +646,7 @@ static inline int Nf_CutMergeOrder( Nf_Cut_t * pCut0, Nf_Cut_t * pCut1, Nf_Cut_t ...@@ -645,7 +646,7 @@ static inline int Nf_CutMergeOrder( Nf_Cut_t * pCut0, Nf_Cut_t * pCut1, Nf_Cut_t
pC[i] = pC0[i]; pC[i] = pC0[i];
} }
pCut->nLeaves = nLutSize; pCut->nLeaves = nLutSize;
pCut->iFunc = -1; pCut->iFunc = NF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign;
return 1; return 1;
} }
...@@ -679,7 +680,7 @@ FlushCut0: ...@@ -679,7 +680,7 @@ FlushCut0:
while ( i < nSize0 ) while ( i < nSize0 )
pC[c++] = pC0[i++]; pC[c++] = pC0[i++];
pCut->nLeaves = c; pCut->nLeaves = c;
pCut->iFunc = -1; pCut->iFunc = NF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign;
return 1; return 1;
...@@ -688,7 +689,7 @@ FlushCut1: ...@@ -688,7 +689,7 @@ FlushCut1:
while ( k < nSize1 ) while ( k < nSize1 )
pC[c++] = pC1[k++]; pC[c++] = pC1[k++];
pCut->nLeaves = c; pCut->nLeaves = c;
pCut->iFunc = -1; pCut->iFunc = NF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign;
return 1; return 1;
} }
...@@ -712,7 +713,7 @@ static inline int Nf_CutMergeOrderMux( Nf_Cut_t * pCut0, Nf_Cut_t * pCut1, Nf_Cu ...@@ -712,7 +713,7 @@ static inline int Nf_CutMergeOrderMux( Nf_Cut_t * pCut0, Nf_Cut_t * pCut1, Nf_Cu
if (x2 == xMin) i2++; if (x2 == xMin) i2++;
} }
pCut->nLeaves = c; pCut->nLeaves = c;
pCut->iFunc = -1; pCut->iFunc = NF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign | pCut2->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign | pCut2->Sign;
return 1; return 1;
} }
......
...@@ -38,6 +38,7 @@ ABC_NAMESPACE_IMPL_START ...@@ -38,6 +38,7 @@ ABC_NAMESPACE_IMPL_START
#define PF_LEAF_MAX 6 #define PF_LEAF_MAX 6
#define PF_CUT_MAX 32 #define PF_CUT_MAX 32
#define PF_NO_LEAF 31 #define PF_NO_LEAF 31
#define PF_NO_FUNC 0x3FFFFFF
#define PF_INFINITY FLT_MAX #define PF_INFINITY FLT_MAX
typedef struct Pf_Cut_t_ Pf_Cut_t; typedef struct Pf_Cut_t_ Pf_Cut_t;
...@@ -46,7 +47,7 @@ struct Pf_Cut_t_ ...@@ -46,7 +47,7 @@ struct Pf_Cut_t_
word Sign; // signature word Sign; // signature
int Delay; // delay int Delay; // delay
float Flow; // flow float Flow; // flow
unsigned iFunc : 26; // function unsigned iFunc : 26; // function (PF_NO_FUNC)
unsigned Useless : 1; // function unsigned Useless : 1; // function
unsigned nLeaves : 5; // leaf number (PF_NO_LEAF) unsigned nLeaves : 5; // leaf number (PF_NO_LEAF)
int pLeaves[PF_LEAF_MAX+1]; // leaves int pLeaves[PF_LEAF_MAX+1]; // leaves
...@@ -600,7 +601,7 @@ static inline int Pf_CutMergeOrder( Pf_Cut_t * pCut0, Pf_Cut_t * pCut1, Pf_Cut_t ...@@ -600,7 +601,7 @@ static inline int Pf_CutMergeOrder( Pf_Cut_t * pCut0, Pf_Cut_t * pCut1, Pf_Cut_t
pC[i] = pC0[i]; pC[i] = pC0[i];
} }
pCut->nLeaves = nLutSize; pCut->nLeaves = nLutSize;
pCut->iFunc = -1; pCut->iFunc = PF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign;
return 1; return 1;
} }
...@@ -634,7 +635,7 @@ FlushCut0: ...@@ -634,7 +635,7 @@ FlushCut0:
while ( i < nSize0 ) while ( i < nSize0 )
pC[c++] = pC0[i++]; pC[c++] = pC0[i++];
pCut->nLeaves = c; pCut->nLeaves = c;
pCut->iFunc = -1; pCut->iFunc = PF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign;
return 1; return 1;
...@@ -643,7 +644,7 @@ FlushCut1: ...@@ -643,7 +644,7 @@ FlushCut1:
while ( k < nSize1 ) while ( k < nSize1 )
pC[c++] = pC1[k++]; pC[c++] = pC1[k++];
pCut->nLeaves = c; pCut->nLeaves = c;
pCut->iFunc = -1; pCut->iFunc = PF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign;
return 1; return 1;
} }
...@@ -667,7 +668,7 @@ static inline int Pf_CutMergeOrderMux( Pf_Cut_t * pCut0, Pf_Cut_t * pCut1, Pf_Cu ...@@ -667,7 +668,7 @@ static inline int Pf_CutMergeOrderMux( Pf_Cut_t * pCut0, Pf_Cut_t * pCut1, Pf_Cu
if (x2 == xMin) i2++; if (x2 == xMin) i2++;
} }
pCut->nLeaves = c; pCut->nLeaves = c;
pCut->iFunc = -1; pCut->iFunc = PF_NO_FUNC;
pCut->Sign = pCut0->Sign | pCut1->Sign | pCut2->Sign; pCut->Sign = pCut0->Sign | pCut1->Sign | pCut2->Sign;
return 1; return 1;
} }
......
...@@ -88,12 +88,14 @@ Vec_Ptr_t * Abc_NtkDfs( Abc_Ntk_t * pNtk, int fCollectAll ) ...@@ -88,12 +88,14 @@ Vec_Ptr_t * Abc_NtkDfs( Abc_Ntk_t * pNtk, int fCollectAll )
// start the array of nodes // start the array of nodes
vNodes = Vec_PtrAlloc( 100 ); vNodes = Vec_PtrAlloc( 100 );
if ( pNtk->nBarBufs2 > 0 ) if ( pNtk->nBarBufs2 > 0 )
{
Abc_NtkForEachBarBuf( pNtk, pObj, i ) Abc_NtkForEachBarBuf( pNtk, pObj, i )
{ {
Abc_NodeSetTravIdCurrent( pObj ); Abc_NodeSetTravIdCurrent( pObj );
Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes ); Abc_NtkDfs_rec( Abc_ObjFanin0Ntk(Abc_ObjFanin0(pObj)), vNodes );
Vec_PtrPush( vNodes, pObj ); Vec_PtrPush( vNodes, pObj );
} }
}
Abc_NtkForEachCo( pNtk, pObj, i ) Abc_NtkForEachCo( pNtk, pObj, i )
{ {
Abc_NodeSetTravIdCurrent( pObj ); Abc_NodeSetTravIdCurrent( pObj );
......
...@@ -294,8 +294,8 @@ static inline void Cba_ObjSetName( Cba_Ntk_t * p, int i, int x ) { a ...@@ -294,8 +294,8 @@ static inline void Cba_ObjSetName( Cba_Ntk_t * p, int i, int x ) { a
static inline void Cba_ObjSetCopy( Cba_Ntk_t * p, int i, int x ) { assert(Cba_ObjCopy(p, i) == -1); Vec_IntSetEntry( &p->vCopy, i, x ); } static inline void Cba_ObjSetCopy( Cba_Ntk_t * p, int i, int x ) { assert(Cba_ObjCopy(p, i) == -1); Vec_IntSetEntry( &p->vCopy, i, x ); }
static inline int Cba_ObjGetConst( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsCi(p, i)); return Cba_ObjIsBo(p, i) && Cba_ObjIsConst(p, i-1) ? Cba_ObjType(p, i-1) : 0; } static inline int Cba_ObjGetConst( Cba_Ntk_t * p, int i ) { assert(Cba_ObjIsCi(p, i)); return Cba_ObjIsBo(p, i) && Cba_ObjIsConst(p, i-1) ? Cba_ObjType(p, i-1) : 0; }
static inline int Cba_BoxBiNum( Cba_Ntk_t * p, int i ) { int s = i-1; assert(Cba_ObjIsBox(p, i)); while (--i >= 0 && Cba_ObjIsBi(p, i)); return s - i; } static inline int Cba_BoxBiNum( Cba_Ntk_t * p, int i ) { int s = i-1; assert(Cba_ObjIsBox(p, i)); while (--i >= 0 && Cba_ObjIsBi(p, i)) {} return s - i; }
static inline int Cba_BoxBoNum( Cba_Ntk_t * p, int i ) { int s = i+1; assert(Cba_ObjIsBox(p, i)); while (++i < Cba_NtkObjNum(p) && Cba_ObjIsBo(p, i)); return i - s; } static inline int Cba_BoxBoNum( Cba_Ntk_t * p, int i ) { int s = i+1; assert(Cba_ObjIsBox(p, i)); while (++i < Cba_NtkObjNum(p) && Cba_ObjIsBo(p, i)) {} return i - s; }
static inline int Cba_BoxSize( Cba_Ntk_t * p, int i ) { return 1 + Cba_BoxBiNum(p, i) + Cba_BoxBoNum(p, i); } static inline int Cba_BoxSize( Cba_Ntk_t * p, int i ) { return 1 + Cba_BoxBiNum(p, i) + Cba_BoxBoNum(p, i); }
static inline int Cba_BoxBi( Cba_Ntk_t * p, int b, int i ) { assert(Cba_ObjIsBox(p, b)); return b - 1 - i; } static inline int Cba_BoxBi( Cba_Ntk_t * p, int b, int i ) { assert(Cba_ObjIsBox(p, b)); return b - 1 - i; }
static inline int Cba_BoxBo( Cba_Ntk_t * p, int b, int i ) { assert(Cba_ObjIsBox(p, b)); return b + 1 + i; } static inline int Cba_BoxBo( Cba_Ntk_t * p, int b, int i ) { assert(Cba_ObjIsBox(p, b)); return b + 1 + i; }
......
...@@ -2316,6 +2316,7 @@ int CmdCommandCapo( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -2316,6 +2316,7 @@ int CmdCommandCapo( Abc_Frame_t * pAbc, int argc, char **argv )
pProgNameGnuplotUnix = Cmd_FlagReadByName(pAbc, "gnuplotunix"); pProgNameGnuplotUnix = Cmd_FlagReadByName(pAbc, "gnuplotunix");
// check if Gnuplot is available // check if Gnuplot is available
pProgNameGnuplot = NULL;
if ( (pFile = fopen( pProgNameGnuplotWin, "r" )) ) if ( (pFile = fopen( pProgNameGnuplotWin, "r" )) )
pProgNameGnuplot = pProgNameGnuplotWin; pProgNameGnuplot = pProgNameGnuplotWin;
else if ( (pFile = fopen( pProgNameGnuplotUnix, "r" )) ) else if ( (pFile = fopen( pProgNameGnuplotUnix, "r" )) )
......
...@@ -67,7 +67,7 @@ static inline int irand(double* seed, int size) { ...@@ -67,7 +67,7 @@ static inline int irand(double* seed, int size) {
//================================================================================================= //=================================================================================================
// Variable datatype + minor functions: // Variable datatype + minor functions:
static const int var0 = 1; //static const int var0 = 1;
static const int var1 = 0; static const int var1 = 0;
static const int varX = 3; static const int varX = 3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment