summaryrefslogtreecommitdiffstats
path: root/src/base/ver
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2009-02-15 08:01:00 -0800
commit0871bffae307e0553e0c5186336189e8b55cf6a6 (patch)
tree4571d1563fe33a53a57fea1c35fb668b9d33265f /src/base/ver
parentf936cc0680c98ffe51b3a1716c996072d5dbf76c (diff)
downloadabc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip
Version abc90215
Diffstat (limited to 'src/base/ver')
-rw-r--r--src/base/ver/ver.h8
-rw-r--r--src/base/ver/verCore.c32
-rw-r--r--src/base/ver/verFormula.c8
-rw-r--r--src/base/ver/verStream.c8
4 files changed, 28 insertions, 28 deletions
diff --git a/src/base/ver/ver.h b/src/base/ver/ver.h
index 9c538ac4..01199863 100644
--- a/src/base/ver/ver.h
+++ b/src/base/ver/ver.h
@@ -21,10 +21,6 @@
#ifndef __VER_H__
#define __VER_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
@@ -36,6 +32,10 @@ extern "C" {
/// PARAMETERS ///
////////////////////////////////////////////////////////////////////////
+#ifdef __cplusplus
+extern "C" {
+#endif
+
////////////////////////////////////////////////////////////////////////
/// BASIC TYPES ///
////////////////////////////////////////////////////////////////////////
diff --git a/src/base/ver/verCore.c b/src/base/ver/verCore.c
index 93fc7b5d..f83747cf 100644
--- a/src/base/ver/verCore.c
+++ b/src/base/ver/verCore.c
@@ -101,7 +101,7 @@ struct Ver_Bundle_t_
Ver_Man_t * Ver_ParseStart( char * pFileName, Abc_Lib_t * pGateLib )
{
Ver_Man_t * p;
- p = ALLOC( Ver_Man_t, 1 );
+ p = ABC_ALLOC( Ver_Man_t, 1 );
memset( p, 0, sizeof(Ver_Man_t) );
p->pFileName = pFileName;
p->pReader = Ver_StreamAlloc( pFileName );
@@ -139,7 +139,7 @@ void Ver_ParseStop( Ver_Man_t * p )
Vec_PtrFree( p->vStackFn );
Vec_IntFree( p->vStackOp );
Vec_IntFree( p->vPerm );
- free( p );
+ ABC_FREE( p );
}
/**Function*************************************************************
@@ -274,7 +274,7 @@ void Ver_ParsePrintErrorMessage( Ver_Man_t * p )
else // print the error message with the line number
fprintf( p->Output, "%s (line %d): %s\n",
p->pFileName, Ver_StreamGetLineNumber(p->pReader), p->sError );
- // free the data
+ // ABC_FREE the data
Ver_ParseFreeData( p );
}
@@ -583,7 +583,7 @@ int Ver_ParseInsertsSuffix( Ver_Man_t * pMan, char * pWord, int nMsb, int nLsb )
assert( nMsb >= 0 && nMsb < 128 );
assert( nLsb >= 0 && nLsb < 128 );
Value = (nMsb << 8) | nLsb;
- st_insert( pMan->tName2Suffix, Extra_UtilStrsav(pWord), (char *)(PORT_PTRUINT_T)Value );
+ st_insert( pMan->tName2Suffix, Extra_UtilStrsav(pWord), (char *)(ABC_PTRUINT_T)Value );
return 1;
}
@@ -605,7 +605,7 @@ void Ver_ParseRemoveSuffixTable( Ver_Man_t * pMan )
if ( pMan->tName2Suffix == NULL )
return;
st_foreach_item( pMan->tName2Suffix, gen, (char **)&pKey, (char **)&pValue )
- free( pKey );
+ ABC_FREE( pKey );
st_free_table( pMan->tName2Suffix );
pMan->tName2Suffix = NULL;
}
@@ -764,7 +764,7 @@ int Ver_ParseConstant( Ver_Man_t * pMan, char * pWord )
if ( pWord[i] == 'x' )
Vec_PtrPush( pMan->vNames, (void *)0 );
else
- Vec_PtrPush( pMan->vNames, (void *)(PORT_PTRUINT_T)(pWord[i]-'0') );
+ Vec_PtrPush( pMan->vNames, (void *)(ABC_PTRUINT_T)(pWord[i]-'0') );
}
return 1;
}
@@ -1211,7 +1211,7 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
Ver_ParsePrintErrorMessage( pMan );
return 0;
}
- Vec_PtrPush( pMan->vNames, (void *)(PORT_PTRUINT_T)strlen(pEquation) );
+ Vec_PtrPush( pMan->vNames, (void *)(ABC_PTRUINT_T)strlen(pEquation) );
Vec_PtrPush( pMan->vNames, pEquation );
// get the buffer
pFunc = (Hop_Obj_t *)Mio_LibraryReadBuf(Abc_FrameReadLibGen());
@@ -1248,7 +1248,7 @@ int Ver_ParseAssign( Ver_Man_t * pMan, Abc_Ntk_t * pNtk )
for ( i = 0; i < Vec_PtrSize(pMan->vNames)/2; i++ )
{
// get the name of this signal
- Length = (int)(PORT_PTRUINT_T)Vec_PtrEntry( pMan->vNames, 2*i );
+ Length = (int)(ABC_PTRUINT_T)Vec_PtrEntry( pMan->vNames, 2*i );
pName = Vec_PtrEntry( pMan->vNames, 2*i + 1 );
pName[Length] = 0;
// find the corresponding net
@@ -1716,7 +1716,7 @@ int Ver_ParseBox( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkBox )
}
*/
// allocate the bundle (formal name + array of actual nets)
- pBundle = ALLOC( Ver_Bundle_t, 1 );
+ pBundle = ABC_ALLOC( Ver_Bundle_t, 1 );
pBundle->pNameFormal = NULL;
pBundle->vNetsActual = Vec_PtrAlloc( 4 );
Vec_PtrPush( vBundles, pBundle );
@@ -2002,9 +2002,9 @@ int Ver_ParseBox( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtkBox )
***********************************************************************/
void Ver_ParseFreeBundle( Ver_Bundle_t * pBundle )
{
- FREE( pBundle->pNameFormal );
+ ABC_FREE( pBundle->pNameFormal );
Vec_PtrFree( pBundle->vNetsActual );
- free( pBundle );
+ ABC_FREE( pBundle );
}
/**Function*************************************************************
@@ -2088,7 +2088,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
i--;
}
- // free the bundling
+ // ABC_FREE the bundling
Vec_PtrForEachEntry( vBundles, pBundle, k )
Ver_ParseFreeBundle( pBundle );
Vec_PtrFree( vBundles );
@@ -2205,7 +2205,7 @@ int Ver_ParseConnectBox( Ver_Man_t * pMan, Abc_Obj_t * pBox )
i--;
}
- // free the bundling
+ // ABC_FREE the bundling
Vec_PtrForEachEntry( vBundles, pBundle, k )
Ver_ParseFreeBundle( pBundle );
Vec_PtrFree( vBundles );
@@ -2515,7 +2515,7 @@ int Ver_ParseDriveFormal( Ver_Man_t * pMan, Abc_Ntk_t * pNtk, Ver_Bundle_t * pBu
Ver_ParseFreeBundle( pBundle );
Vec_PtrWriteEntry( (Vec_Ptr_t *)pBox->pCopy, j, NULL );
}
- free( pName );
+ ABC_FREE( pName );
return 1;
}
@@ -2604,7 +2604,7 @@ int Ver_ParseDriveInputs( Ver_Man_t * pMan, Vec_Ptr_t * vUndefs )
Vec_PtrWriteEntry( (Vec_Ptr_t *)pBox->pCopy, j, NULL );
}
- // free the bundles
+ // ABC_FREE the bundles
Vec_PtrFree( (Vec_Ptr_t *)pBox->pCopy );
pBox->pCopy = NULL;
}
@@ -2662,7 +2662,7 @@ void Ver_ParsePrintLog( Ver_Man_t * pMan )
// open the log file
pNameGeneric = Extra_FileNameGeneric( pMan->pFileName );
sprintf( Buffer, "%s.log", pNameGeneric );
- free( pNameGeneric );
+ ABC_FREE( pNameGeneric );
pFile = fopen( Buffer, "w" );
// count the total number of instances and how many times they occur
diff --git a/src/base/ver/verFormula.c b/src/base/ver/verFormula.c
index e9588ba9..3ed5f556 100644
--- a/src/base/ver/verFormula.c
+++ b/src/base/ver/verFormula.c
@@ -237,7 +237,7 @@ void * Ver_FormulaParser( char * pFormula, void * pMan, Vec_Ptr_t * vNames, Vec_
v = Ver_FormulaParserFindVar( pTemp, vNames );
if ( *pTemp == '\\' )
pTemp++;
- pTemp += (int)(PORT_PTRUINT_T)Vec_PtrEntry( vNames, 2*v ) - 1;
+ pTemp += (int)(ABC_PTRUINT_T)Vec_PtrEntry( vNames, 2*v ) - 1;
// assume operation AND, if vars follow one another
if ( Flag == VER_PARSE_FLAG_VAR )
@@ -404,7 +404,7 @@ int Ver_FormulaParserFindVar( char * pString, Vec_Ptr_t * vNames )
nLength = pTemp - pString;
for ( i = 0; i < Vec_PtrSize(vNames)/2; i++ )
{
- nLength2 = (int)(PORT_PTRUINT_T)Vec_PtrEntry( vNames, 2*i + 0 );
+ nLength2 = (int)(ABC_PTRUINT_T)Vec_PtrEntry( vNames, 2*i + 0 );
if ( nLength2 != nLength )
continue;
pTemp2 = Vec_PtrEntry( vNames, 2*i + 1 );
@@ -413,7 +413,7 @@ int Ver_FormulaParserFindVar( char * pString, Vec_Ptr_t * vNames )
return i;
}
// could not find - add and return the number
- Vec_PtrPush( vNames, (void *)(PORT_PTRUINT_T)nLength );
+ Vec_PtrPush( vNames, (void *)(ABC_PTRUINT_T)nLength );
Vec_PtrPush( vNames, pString );
return i;
}
@@ -453,7 +453,7 @@ void * Ver_FormulaReduction( char * pFormula, void * pMan, Vec_Ptr_t * vNames, c
while ( *pFormula != '}' )
{
v = Ver_FormulaParserFindVar( pFormula, vNames );
- pFormula += (int)(PORT_PTRUINT_T)Vec_PtrEntry( vNames, 2*v );
+ pFormula += (int)(ABC_PTRUINT_T)Vec_PtrEntry( vNames, 2*v );
while ( *pFormula == ' ' || *pFormula == ',' )
pFormula++;
}
diff --git a/src/base/ver/verStream.c b/src/base/ver/verStream.c
index 9b56bb3f..8acaf5ec 100644
--- a/src/base/ver/verStream.c
+++ b/src/base/ver/verStream.c
@@ -81,7 +81,7 @@ Ver_Stream_t * Ver_StreamAlloc( char * pFileName )
return NULL;
}
// start the file reader
- p = ALLOC( Ver_Stream_t, 1 );
+ p = ABC_ALLOC( Ver_Stream_t, 1 );
memset( p, 0, sizeof(Ver_Stream_t) );
p->pFileName = pFileName;
p->pFile = pFile;
@@ -90,7 +90,7 @@ Ver_Stream_t * Ver_StreamAlloc( char * pFileName )
p->nFileSize = ftell( pFile );
rewind( pFile );
// allocate the buffer
- p->pBuffer = ALLOC( char, VER_BUFFER_SIZE+1 );
+ p->pBuffer = ABC_ALLOC( char, VER_BUFFER_SIZE+1 );
p->nBufferSize = VER_BUFFER_SIZE;
p->pBufferCur = p->pBuffer;
// determine how many chars to read
@@ -153,8 +153,8 @@ void Ver_StreamFree( Ver_Stream_t * p )
{
if ( p->pFile )
fclose( p->pFile );
- FREE( p->pBuffer );
- free( p );
+ ABC_FREE( p->pBuffer );
+ ABC_FREE( p );
}
/**Function*************************************************************