diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-10-30 10:29:44 -0400 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-10-30 10:29:44 -0400 |
commit | 80f46fa2ae6240c9439a8c01d806f922b625df48 (patch) | |
tree | ce471955664e699ecf6b6086686e5429297b07da | |
parent | f4a250839dc1ff0ee4e4f027924a46baa4da2d78 (diff) | |
download | abc-80f46fa2ae6240c9439a8c01d806f922b625df48.tar.gz abc-80f46fa2ae6240c9439a8c01d806f922b625df48.tar.bz2 abc-80f46fa2ae6240c9439a8c01d806f922b625df48.zip |
Compiler warnings.
-rw-r--r-- | src/aig/hop/hop.h | 4 | ||||
-rw-r--r-- | src/base/cmd/cmd.c | 2 | ||||
-rw-r--r-- | src/bool/lucky/luckyFast6.c | 14 | ||||
-rw-r--r-- | src/misc/util/abc_global.h | 6 | ||||
-rw-r--r-- | src/misc/vec/vecWrd.h | 7 |
5 files changed, 16 insertions, 17 deletions
diff --git a/src/aig/hop/hop.h b/src/aig/hop/hop.h index e63ea3e0..bf9f0c7b 100644 --- a/src/aig/hop/hop.h +++ b/src/aig/hop/hop.h @@ -120,8 +120,8 @@ static inline int Hop_TruthWordNum( int nVars ) { return nVars static inline int Hop_InfoHasBit( unsigned * p, int i ) { return (p[(i)>>5] & (1<<((i) & 31))) > 0; } static inline void Hop_InfoSetBit( unsigned * p, int i ) { p[(i)>>5] |= (1<<((i) & 31)); } static inline void Hop_InfoXorBit( unsigned * p, int i ) { p[(i)>>5] ^= (1<<((i) & 31)); } -static inline int Hop_Base2Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n >>= 1, r++ ); return r; } -static inline int Hop_Base10Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 10, r++ ); return r; } +static inline int Hop_Base2Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n >>= 1, r++ ) {}; return r; } +static inline int Hop_Base10Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 10, r++ ) {}; return r; } static inline Hop_Obj_t * Hop_Regular( Hop_Obj_t * p ) { return (Hop_Obj_t *)((ABC_PTRUINT_T)(p) & ~01); } static inline Hop_Obj_t * Hop_Not( Hop_Obj_t * p ) { return (Hop_Obj_t *)((ABC_PTRUINT_T)(p) ^ 01); } diff --git a/src/base/cmd/cmd.c b/src/base/cmd/cmd.c index 93e658d5..e69bbc0e 100644 --- a/src/base/cmd/cmd.c +++ b/src/base/cmd/cmd.c @@ -1912,7 +1912,7 @@ void Gia_ManGnuplotShow( char * pPlotFileName ) void * pAbc; char * pProgNameGnuplotWin = "wgnuplot.exe"; char * pProgNameGnuplotUnix = "gnuplot"; - char * pProgNameGnuplot; + char * pProgNameGnuplot = NULL; // read in the Capo plotting output if ( (pFile = fopen( pPlotFileName, "r" )) == NULL ) diff --git a/src/bool/lucky/luckyFast6.c b/src/bool/lucky/luckyFast6.c index f2e032fa..75135537 100644 --- a/src/bool/lucky/luckyFast6.c +++ b/src/bool/lucky/luckyFast6.c @@ -70,7 +70,7 @@ unsigned adjustInfoAfterSwap(char* pCanonPerm, unsigned uCanonPhase, int iVar, u } -inline word Extra_Truth6SwapAdjacent( word t, int iVar ) +word Extra_Truth6SwapAdjacent( word t, int iVar ) { // variable swapping code static word PMasks[5][3] = { @@ -83,7 +83,7 @@ inline word Extra_Truth6SwapAdjacent( word t, int iVar ) assert( iVar < 5 ); return (t & PMasks[iVar][0]) | ((t & PMasks[iVar][1]) << (1 << iVar)) | ((t & PMasks[iVar][2]) >> (1 << iVar)); } -inline word Extra_Truth6ChangePhase( word t, int iVar) +word Extra_Truth6ChangePhase( word t, int iVar) { // elementary truth tables static word Truth6[6] = { @@ -98,7 +98,7 @@ inline word Extra_Truth6ChangePhase( word t, int iVar) return ((t & ~Truth6[iVar]) << (1 << iVar)) | ((t & Truth6[iVar]) >> (1 << iVar)); } -inline word Extra_Truth6MinimumRoundOne( word t, int iVar, char* pCanonPerm, unsigned* pCanonPhase ) +word Extra_Truth6MinimumRoundOne( word t, int iVar, char* pCanonPerm, unsigned* pCanonPhase ) { word tCur, tMin = t; // ab unsigned info =0; @@ -155,7 +155,7 @@ inline word Extra_Truth6MinimumRoundOne( word t, int iVar, char* pCanonPerm, uns } } -inline word Extra_Truth6MinimumRoundOne_noEBFC( word t, int iVar, char* pCanonPerm, unsigned* pCanonPhase) +word Extra_Truth6MinimumRoundOne_noEBFC( word t, int iVar, char* pCanonPerm, unsigned* pCanonPhase) { word tMin; assert( iVar >= 0 && iVar < 5 ); @@ -173,7 +173,7 @@ inline word Extra_Truth6MinimumRoundOne_noEBFC( word t, int iVar, char* pCanonP // this function finds minimal for all TIED(and tied only) iVars //it finds tied vars based on rearranged Store info - group of tied vars has the same bit count in Store -inline word Extra_Truth6MinimumRoundMany( word t, int* pStore, char* pCanonPerm, unsigned* pCanonPhase ) +word Extra_Truth6MinimumRoundMany( word t, int* pStore, char* pCanonPerm, unsigned* pCanonPhase ) { int i, bitInfoTemp; word tMin0, tMin=t; @@ -192,7 +192,7 @@ inline word Extra_Truth6MinimumRoundMany( word t, int* pStore, char* pCanonPerm, return tMin; } -inline word Extra_Truth6MinimumRoundMany_noEBFC( word t, int* pStore, char* pCanonPerm, unsigned* pCanonPhase ) +word Extra_Truth6MinimumRoundMany_noEBFC( word t, int* pStore, char* pCanonPerm, unsigned* pCanonPhase ) { int i, bitInfoTemp; word tMin0, tMin=t; @@ -210,7 +210,7 @@ inline word Extra_Truth6MinimumRoundMany_noEBFC( word t, int* pStore, char* pCan }while ( tMin0 != tMin ); return tMin; } -inline word Extra_Truth6MinimumRoundMany1( word t, int* pStore, char* pCanonPerm, unsigned* pCanonPhase ) +word Extra_Truth6MinimumRoundMany1( word t, int* pStore, char* pCanonPerm, unsigned* pCanonPhase ) { word tMin0, tMin=t; char pCanonPerm1[16]; diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index efd790f6..950a8889 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -246,9 +246,9 @@ static inline double Abc_MinDouble( double a, double b ) { return a < b ? static inline int Abc_Float2Int( float Val ) { union { int x; float y; } v; v.y = Val; return v.x; } static inline float Abc_Int2Float( int Num ) { union { int x; float y; } v; v.x = Num; return v.y; } -static inline int Abc_Base2Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n >>= 1, r++ ); return r; } -static inline int Abc_Base10Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 10, r++ ); return r; } -static inline int Abc_Base16Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 16, r++ ); return r; } +static inline int Abc_Base2Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n >>= 1, r++ ) {}; return r; } +static inline int Abc_Base10Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 10, r++ ) {}; return r; } +static inline int Abc_Base16Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 16, r++ ) {}; return r; } static inline char * Abc_UtilStrsav( char * s ) { return s ? strcpy(ABC_ALLOC(char, strlen(s)+1), s) : NULL; } static inline int Abc_BitWordNum( int nBits ) { return (nBits>>5) + ((nBits&31) > 0); } static inline int Abc_TruthWordNum( int nVars ) { return nVars <= 5 ? 1 : (1 << (nVars - 5)); } diff --git a/src/misc/vec/vecWrd.h b/src/misc/vec/vecWrd.h index a5beeb37..9c33a5ba 100644 --- a/src/misc/vec/vecWrd.h +++ b/src/misc/vec/vecWrd.h @@ -971,8 +971,7 @@ static inline int Vec_WrdEqual( Vec_Wrd_t * p1, Vec_Wrd_t * p2 ) Synopsis [Counts the number of common entries.] - Description [Assumes that the entries are non-negative integers that - are not very large, so inversion of the array can be performed.] + Description [] SideEffects [] @@ -988,9 +987,9 @@ static inline int Vec_WrdCountCommon( Vec_Wrd_t * p1, Vec_Wrd_t * p2 ) vTemp = p1, p1 = p2, p2 = vTemp; assert( Vec_WrdSize(p1) >= Vec_WrdSize(p2) ); vTemp = Vec_WrdInvert( p2, -1 ); - Vec_WrdFillExtra( vTemp, Vec_WrdFindMax(p1) + 1, -1 ); + Vec_WrdFillExtra( vTemp, Vec_WrdFindMax(p1) + 1, ~((word)0) ); Vec_WrdForEachEntry( p1, Entry, i ) - if ( Vec_WrdEntry(vTemp, Entry) >= 0 ) + if ( Vec_WrdEntry(vTemp, Entry) != ~((word)0) ) Counter++; Vec_WrdFree( vTemp ); return Counter; |