Commit 0b7dcbbc by Alan Mishchenko

Merged in boschmitt/abc (pull request #77)

Small fixes for C++ compilers
parents 859e769f fcf82795
......@@ -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" );
......
......@@ -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
......
......@@ -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 );
}
......
......@@ -103,7 +103,7 @@ ABC_NAMESPACE_HEADER_START
*/
#if defined(__ccdoc__)
typedef platform_dependent_type ABC_PTRDIFF_T;
#elif defined(LIN64)
#elif defined(LIN64) || defined(__x86_64__)
typedef long ABC_PTRDIFF_T;
#elif defined(NT64)
typedef long long ABC_PTRDIFF_T;
......@@ -120,7 +120,7 @@ typedef int ABC_PTRDIFF_T;
*/
#if defined(__ccdoc__)
typedef platform_dependent_type ABC_PTRUINT_T;
#elif defined(LIN64)
#elif defined(LIN64) || defined(__x86_64__)
typedef unsigned long ABC_PTRUINT_T;
#elif defined(NT64)
typedef unsigned long long ABC_PTRUINT_T;
......@@ -137,7 +137,7 @@ typedef unsigned int ABC_PTRUINT_T;
*/
#if defined(__ccdoc__)
typedef platform_dependent_type ABC_PTRINT_T;
#elif defined(LIN64)
#elif defined(LIN64) || defined(__x86_64__)
typedef long ABC_PTRINT_T;
#elif defined(NT64)
typedef long long ABC_PTRINT_T;
......@@ -152,7 +152,7 @@ typedef int ABC_PTRINT_T;
*/
#if defined(__ccdoc__)
typedef platform_dependent_type ABC_INT64_T;
#elif defined(LIN64)
#elif defined(LIN64) || defined(__x86_64__)
typedef long ABC_INT64_T;
#elif defined(NT64) || defined(LIN)
typedef long long ABC_INT64_T;
......@@ -167,7 +167,7 @@ typedef signed __int64 ABC_INT64_T;
*/
#if defined(__ccdoc__)
typedef platform_dependent_type ABC_UINT64_T;
#elif defined(LIN64)
#elif defined(LIN64) || defined(__x86_64__)
typedef unsigned long ABC_UINT64_T;
#elif defined(NT64) || defined(LIN)
typedef unsigned long long ABC_UINT64_T;
......
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