summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBruno Schmitt <bruno@oschmitt.com>2017-07-04 09:35:42 +0200
committerBruno Schmitt <bruno@oschmitt.com>2017-07-04 09:35:42 +0200
commitf302e6f6ef1cfe7249f17642678c1620b5b8f988 (patch)
treed6c95a702ceeaa7ae844c639810a4ba45ecc890e /src
parentbf6a053c648576c1e5493f2d5390eb78b2e3df1c (diff)
downloadabc-f302e6f6ef1cfe7249f17642678c1620b5b8f988.tar.gz
abc-f302e6f6ef1cfe7249f17642678c1620b5b8f988.tar.bz2
abc-f302e6f6ef1cfe7249f17642678c1620b5b8f988.zip
Small fixes for C++ compilers
Diffstat (limited to 'src')
-rw-r--r--src/aig/gia/giaIf.c2
-rw-r--r--src/aig/miniaig/ndr.h16
-rw-r--r--src/base/acb/acbAbc.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c
index 0f656b03..662338f0 100644
--- a/src/aig/gia/giaIf.c
+++ b/src/aig/gia/giaIf.c
@@ -1953,7 +1953,7 @@ Gia_Man_t * Gia_ManFromIfLogic( If_Man_t * pIfMan )
{
FILE * pFile; int status;
char * pStr, Buffer[1000] = {0};
- char * pNameGen = pIfMan->pName? Extra_FileNameGeneric( pIfMan->pName ) : "nameless_";
+ const char * pNameGen = pIfMan->pName? Extra_FileNameGeneric( pIfMan->pName ) : "nameless_";
sprintf( Buffer, "%s_configs.txt", pNameGen );
ABC_FREE( pNameGen );
pFile = fopen( Buffer, "wb" );
diff --git a/src/aig/miniaig/ndr.h b/src/aig/miniaig/ndr.h
index 9e85c870..22aa33e3 100644
--- a/src/aig/miniaig/ndr.h
+++ b/src/aig/miniaig/ndr.h
@@ -33,7 +33,7 @@
#include "abcOper.h"
-//ABC_NAMESPACE_HEADER_START
+ABC_NAMESPACE_HEADER_START
#ifdef _WIN32
#define inline __inline
@@ -390,11 +390,11 @@ static inline void Ndr_ModuleWriteVerilog( char * pFileName, void * pModule, cha
// creating a new module (returns pointer to the memory buffer storing the module info)
static inline void * Ndr_ModuleCreate( int Name )
{
- Ndr_Data_t * p = malloc( sizeof(Ndr_Data_t) );
+ Ndr_Data_t * p = ABC_ALLOC( Ndr_Data_t, 1 );
p->nSize = 0;
p->nCap = 16;
- p->pHead = malloc( p->nCap );
- p->pBody = malloc( p->nCap * 4 );
+ p->pHead = ABC_ALLOC( unsigned char, p->nCap );
+ p->pBody = ABC_ALLOC( unsigned int, p->nCap * 4 );
Ndr_DataPush( p, NDR_MODULE, 0 );
Ndr_DataPush( p, NDR_NAME, Name );
Ndr_DataAddTo( p, 0, p->nSize );
@@ -453,10 +453,10 @@ static inline void * Ndr_ModuleRead( char * pFileName )
assert( nFileSize % 5 == 0 );
rewind( pFile );
// create structure
- p = malloc( sizeof(Ndr_Data_t) );
+ p = ABC_ALLOC( Ndr_Data_t, 1 );
p->nSize = p->nCap = nFileSize / 5;
- p->pHead = malloc( p->nCap );
- p->pBody = malloc( p->nCap * 4 );
+ p->pHead = ABC_ALLOC( unsigned char, p->nCap );
+ p->pBody = ABC_ALLOC( unsigned int, p->nCap * 4 );
RetValue = (int)fread( p->pBody, 4, p->nCap, pFile );
RetValue = (int)fread( p->pHead, 1, p->nCap, pFile );
assert( p->nSize == (int)p->pBody[0] );
@@ -511,7 +511,7 @@ static inline void Ndr_ModuleTest()
}
-//ABC_NAMESPACE_HEADER_END
+ABC_NAMESPACE_HEADER_END
#endif
diff --git a/src/base/acb/acbAbc.c b/src/base/acb/acbAbc.c
index 7b215a56..b3fddcac 100644
--- a/src/base/acb/acbAbc.c
+++ b/src/base/acb/acbAbc.c
@@ -192,7 +192,7 @@ Acb_Ntk_t * Acb_NtkFromNdr( char * pFileName, void * pModule, Abc_Nam_t * pNames
NameId = Ndr_ObjReadBody( p, Obj, NDR_OUTPUT );
nArray = Ndr_ObjReadArray( p, Obj, NDR_INPUT, &pArray );
Type = Ndr_ObjReadBody( p, Obj, NDR_OPERTYPE );
- ObjId = Acb_ObjAlloc( pNtk, Type, nArray, 0 );
+ ObjId = Acb_ObjAlloc( pNtk, (Acb_ObjType_t) Type, nArray, 0 );
Vec_IntWriteEntry( vMap, NameId, ObjId );
Acb_ObjSetName( pNtk, ObjId, NameId );
}