summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-08-23 19:56:26 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2021-08-23 19:56:26 -0700
commit85a94766a6b4e1870279110a8620cba92832367f (patch)
treecd387f17e1110d079e313043ca912e264602f2d5
parent67c47fa44aaa566d10abb154b3f89a9d427f5581 (diff)
downloadabc-85a94766a6b4e1870279110a8620cba92832367f.tar.gz
abc-85a94766a6b4e1870279110a8620cba92832367f.tar.bz2
abc-85a94766a6b4e1870279110a8620cba92832367f.zip
Compiler warnings.
-rw-r--r--src/aig/gia/giaAiger.c2
-rw-r--r--src/aig/gia/giaUtil.c2
-rw-r--r--src/aig/miniaig/ndr.h4
-rw-r--r--src/base/abci/abcLut.c2
-rw-r--r--src/base/abci/abcMiter.c4
-rw-r--r--src/base/io/ioReadBlifMv.c2
-rw-r--r--src/base/wlc/wlcNdr.c2
-rw-r--r--src/base/wln/wlnNdr.c2
-rw-r--r--src/opt/fxu/fxuReduce.c3
9 files changed, 12 insertions, 11 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c
index 817a15fe..c2c0e969 100644
--- a/src/aig/gia/giaAiger.c
+++ b/src/aig/gia/giaAiger.c
@@ -399,7 +399,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
while ( *pCur == ' ' )
pCur++;
// skip till the end of line
- for ( pName = pCur; *pCur && *pCur != '\n'; pCur++ );
+ for ( pName = (char *)pCur; *pCur && *pCur != '\n'; pCur++ );
if ( *pCur == '\n' )
*pCur = 0;
// save the name
diff --git a/src/aig/gia/giaUtil.c b/src/aig/gia/giaUtil.c
index 0a40e63e..431be5b7 100644
--- a/src/aig/gia/giaUtil.c
+++ b/src/aig/gia/giaUtil.c
@@ -2618,7 +2618,7 @@ Gia_Man_t * Gia_ManComputeCofs2( Gia_Man_t * p )
Gia_ManForEachCi( p, pObj, i )
{
pObj->Value = Gia_ManAppendCi(pNew);
- assert( pObj->Value = Abc_Var2Lit( 1 + Gia_ObjCioId(pObj), 0 ) );
+ assert( (int)pObj->Value == Abc_Var2Lit( 1 + Gia_ObjCioId(pObj), 0 ) );
}
Gia_ManHashAlloc( pNew );
Gia_ManForEachRi( p, pSink, o )
diff --git a/src/aig/miniaig/ndr.h b/src/aig/miniaig/ndr.h
index 78e5cd23..91663616 100644
--- a/src/aig/miniaig/ndr.h
+++ b/src/aig/miniaig/ndr.h
@@ -517,7 +517,7 @@ static inline void Ndr_WriteVerilog( char * pFileName, void * pDesign, char ** p
Ndr_Data_t * p = (Ndr_Data_t *)pDesign; int Mod;
FILE * pFile = pFileName ? fopen( pFileName, "wb" ) : stdout;
- if ( pFile == NULL ) { printf( "Cannot open file \"%s\" for writing.\n", pFileName ); return; }
+ if ( pFile == NULL ) { printf( "Cannot open file \"%s\" for writing.\n", pFileName ? pFileName : "stdout" ); return; }
Ndr_DesForEachMod( p, Mod )
Ndr_WriteVerilogModule( pFile, p, Mod, pNames, fSimple );
@@ -633,7 +633,7 @@ static inline void Ndr_Write( char * pFileName, void * pDesign )
{
Ndr_Data_t * p = (Ndr_Data_t *)pDesign; int RetValue;
FILE * pFile = fopen( pFileName, "wb" );
- if ( pFile == NULL ) { printf( "Cannot open file \"%s\" for writing.\n", pFileName ); return; }
+ if ( pFile == NULL ) { printf( "Cannot open file \"%s\" for writing.\n", pFileName ? pFileName : "stdout" ); return; }
RetValue = (int)fwrite( p->pBody, 4, p->pBody[0], pFile );
RetValue = (int)fwrite( p->pHead, 1, p->pBody[0], pFile );
fclose( pFile );
diff --git a/src/base/abci/abcLut.c b/src/base/abci/abcLut.c
index 8dc84ba0..49c74e6b 100644
--- a/src/base/abci/abcLut.c
+++ b/src/base/abci/abcLut.c
@@ -896,6 +896,7 @@ Abc_Ntk_t * Abc_NtkSpecialMapping( Abc_Ntk_t * pNtk, int fVerbose )
}
if ( fVerbose )
+ {
Abc_NtkForEachNode( pNtk, pObj, i )
{
printf( "Node %4d : ", i );
@@ -909,6 +910,7 @@ Abc_Ntk_t * Abc_NtkSpecialMapping( Abc_Ntk_t * pNtk, int fVerbose )
printf( " " );
Vec_IntPrint( Vec_WecEntry(vSupps, i) );
}
+ }
Abc_NtkCleanCopy( pNtk );
pNtkNew = Abc_NtkStartFrom( pNtk, ABC_NTK_LOGIC, ABC_FUNC_SOP );
diff --git a/src/base/abci/abcMiter.c b/src/base/abci/abcMiter.c
index 81b032d4..6086fc61 100644
--- a/src/base/abci/abcMiter.c
+++ b/src/base/abci/abcMiter.c
@@ -863,7 +863,7 @@ void Abc_NtkAddFrame( Abc_Ntk_t * pNtkFrames, Abc_Ntk_t * pNtk, int iFrame )
{
int fVerbose = 0;
int NodeBef = Abc_NtkNodeNum(pNtkFrames);
- char Buffer[10];
+ char Buffer[16];
Abc_Obj_t * pNode, * pLatch;
int i;
// create the prefix to be added to the node names
@@ -1008,7 +1008,7 @@ Abc_Ntk_t * Abc_NtkFrames2( Abc_Ntk_t * pNtk, int nFrames, int fInitial, AddFram
void Abc_NtkAddFrame2( Abc_Ntk_t * pNtkFrames, Abc_Ntk_t * pNtk, int iFrame, Vec_Ptr_t * vNodes, AddFrameMapping addFrameMapping, void* arg )
{
/*
- char Buffer[10];
+ char Buffer[16];
Abc_Obj_t * pNode, * pNodeNew, * pLatch;
Abc_Obj_t * pConst1, * pConst1New;
int i;
diff --git a/src/base/io/ioReadBlifMv.c b/src/base/io/ioReadBlifMv.c
index 098f94a1..e5c6fe49 100644
--- a/src/base/io/ioReadBlifMv.c
+++ b/src/base/io/ioReadBlifMv.c
@@ -1657,7 +1657,7 @@ static int Io_MvWriteValues( Abc_Obj_t * pNode, Vec_Str_t * vFunc )
***********************************************************************/
static int Io_MvParseLiteralMv( Io_MvMod_t * p, Abc_Obj_t * pNode, char * pToken, Vec_Str_t * vFunc, int iLit )
{
- char Buffer[10];
+ char Buffer[16];
Io_MvVar_t * pVar;
Abc_Obj_t * pFanin, * pNet;
char * pCur, * pNext;
diff --git a/src/base/wlc/wlcNdr.c b/src/base/wlc/wlcNdr.c
index 7325692b..b06d9357 100644
--- a/src/base/wlc/wlcNdr.c
+++ b/src/base/wlc/wlcNdr.c
@@ -487,7 +487,7 @@ Wlc_Ntk_t * Wlc_NtkFromNdr( void * pData )
pNtk->pManName = Abc_NamStart( NameIdMax+1, 10 );
for ( i = 1; i <= NameIdMax; i++ )
{
- char pName[20]; sprintf( pName, "s%0*d", nDigits, i );
+ char pName[100]; sprintf( pName, "s%0*d", nDigits, i );
NameId = Abc_NamStrFindOrAdd( pNtk->pManName, pName, &fFound );
assert( !fFound && i == NameId );
}
diff --git a/src/base/wln/wlnNdr.c b/src/base/wln/wlnNdr.c
index 37dd6eb8..9eaf71ed 100644
--- a/src/base/wln/wlnNdr.c
+++ b/src/base/wln/wlnNdr.c
@@ -256,7 +256,7 @@ Wln_Ntk_t * Wln_NtkFromNdr( void * pData, int fDump )
pNtk->pManName = Abc_NamStart( NameIdMax+1, 10 );
for ( i = 1; i <= NameIdMax; i++ )
{
- char pName[20]; sprintf( pName, "s%0*d", nDigits, i );
+ char pName[100]; sprintf( pName, "s%0*d", nDigits, i );
NameId = Abc_NamStrFindOrAdd( pNtk->pManName, pName, &fFound );
assert( !fFound && i == NameId );
}
diff --git a/src/opt/fxu/fxuReduce.c b/src/opt/fxu/fxuReduce.c
index 7542a432..84e2bf87 100644
--- a/src/opt/fxu/fxuReduce.c
+++ b/src/opt/fxu/fxuReduce.c
@@ -86,8 +86,7 @@ int Fxu_PreprocessCubePairs( Fxu_Matrix * p, Vec_Ptr_t * vCovers, int nPairsTota
assert( iPair == nPairsTotal );
// allocate storage for counters of cube pairs by difference
- pnPairCounters = ABC_FALLOC( int, 2 * nBitsMax );
- memset( pnPairCounters, 0, sizeof(int) * 2 * nBitsMax );
+ pnPairCounters = ABC_CALLOC( int, 2 * nBitsMax );
// count the number of different pairs
for ( k = 0; k < nPairsTotal; k++ )
pnPairCounters[ pnLitsDiff[k] ]++;