summaryrefslogtreecommitdiffstats
path: root/src/misc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
commit320c429bc46728c1faddfc561c166810aa134a04 (patch)
treec773cc96431cd38ae35484dae7d7d17a79671ac2 /src/misc
parentf65983c2c0810cfb933f696952325a81d2378987 (diff)
downloadabc-320c429bc46728c1faddfc561c166810aa134a04.tar.gz
abc-320c429bc46728c1faddfc561c166810aa134a04.tar.bz2
abc-320c429bc46728c1faddfc561c166810aa134a04.zip
Version abc80301
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/extra/extra.h2
-rw-r--r--src/misc/extra/extraUtilFile.c23
-rw-r--r--src/misc/st/st.c5
-rw-r--r--src/misc/st/stmm.c5
-rw-r--r--src/misc/vec/vec.h5
-rw-r--r--src/misc/vec/vecVec.h42
6 files changed, 76 insertions, 6 deletions
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h
index 314257a2..dc2aac28 100644
--- a/src/misc/extra/extra.h
+++ b/src/misc/extra/extra.h
@@ -52,6 +52,7 @@ extern "C" {
#include <time.h>
#include "st.h"
#include "cuddInt.h"
+#include "port_type.h"
/*---------------------------------------------------------------------------*/
/* Constant declarations */
@@ -314,6 +315,7 @@ extern char * Extra_FileGetSimilarName( char * pFileNameWrong, char * pS1,
extern char * Extra_FileNameExtension( char * FileName );
extern char * Extra_FileNameAppend( char * pBase, char * pSuffix );
extern char * Extra_FileNameGeneric( char * FileName );
+extern char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix );
extern int Extra_FileSize( char * pFileName );
extern char * Extra_FileRead( FILE * pFile );
extern char * Extra_TimeStamp();
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c
index 4c51b8b5..243f3457 100644
--- a/src/misc/extra/extraUtilFile.c
+++ b/src/misc/extra/extraUtilFile.c
@@ -179,6 +179,29 @@ char * Extra_FileNameGeneric( char * FileName )
/**Function*************************************************************
+ Synopsis [Returns the composite name of the file.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+char * Extra_FileNameGenericAppend( char * pBase, char * pSuffix )
+{
+ static char Buffer[1000];
+ char * pDot;
+ strcpy( Buffer, pBase );
+ pDot = strstr( Buffer, "." );
+ if ( pDot )
+ *pDot = 0;
+ strcat( Buffer, pSuffix );
+ return Buffer;
+}
+
+/**Function*************************************************************
+
Synopsis [Returns the file size.]
Description [The file should be closed.]
diff --git a/src/misc/st/st.c b/src/misc/st/st.c
index 872fe51b..2798ae99 100644
--- a/src/misc/st/st.c
+++ b/src/misc/st/st.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "st.h"
+#include "port_type.h"
#ifndef ABS
# define ABS(a) ((a) < 0 ? -(a) : (a))
@@ -31,8 +32,8 @@
#define ST_NUMCMP(x,y) ((x) != (y))
#define ST_NUMHASH(x,size) (ABS((long)x)%(size))
-//#define ST_PTRHASH(x,size) ((int)((unsigned long)(x)>>2)%size) // 64-bit bug fix 9/17/2007
-#define ST_PTRHASH(x,size) ((int)(((unsigned long)(x)>>2)%size))
+//#define ST_PTRHASH(x,size) ((int)((PORT_PTRUINT_T)(x)>>2)%size) // 64-bit bug fix 9/17/2007
+#define ST_PTRHASH(x,size) ((int)(((PORT_PTRUINT_T)(x)>>2)%size))
#define EQUAL(func, x, y) \
((((func) == st_numcmp) || ((func) == st_ptrcmp)) ?\
(ST_NUMCMP((x),(y)) == 0) : ((*func)((x), (y)) == 0))
diff --git a/src/misc/st/stmm.c b/src/misc/st/stmm.c
index 8dfacfe4..7a52c1cd 100644
--- a/src/misc/st/stmm.c
+++ b/src/misc/st/stmm.c
@@ -10,6 +10,7 @@
#include <stdio.h>
#include "extra.h"
#include "stmm.h"
+#include "port_type.h"
#ifndef ABS
# define ABS(a) ((a) < 0 ? -(a) : (a))
@@ -17,8 +18,8 @@
#define STMM_NUMCMP(x,y) ((x) != (y))
#define STMM_NUMHASH(x,size) (ABS((long)x)%(size))
-//#define STMM_PTRHASH(x,size) ((int)((unsigned long)(x)>>2)%size) // 64-bit bug fix 9/17/2007
-#define STMM_PTRHASH(x,size) ((int)(((unsigned long)(x)>>2)%size))
+//#define STMM_PTRHASH(x,size) ((int)((PORT_PTRUINT_T)(x)>>2)%size) // 64-bit bug fix 9/17/2007
+#define STMM_PTRHASH(x,size) ((int)(((PORT_PTRUINT_T)(x)>>2)%size))
#define EQUAL(func, x, y) \
((((func) == stmm_numcmp) || ((func) == stmm_ptrcmp)) ?\
(STMM_NUMCMP((x),(y)) == 0) : ((*func)((x), (y)) == 0))
diff --git a/src/misc/vec/vec.h b/src/misc/vec/vec.h
index a4bd4771..4091ac7f 100644
--- a/src/misc/vec/vec.h
+++ b/src/misc/vec/vec.h
@@ -83,11 +83,11 @@ typedef long long sint64;
#endif
#ifndef PRT
-#define PRT(a,t) printf("%s = ", (a)); printf("%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))
+#define PRT(a,t) printf("%s = ", (a)); printf("%7.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))
#endif
#ifndef PRTP
-#define PRTP(a,t,T) printf("%s = ", (a)); printf("%6.2f sec (%6.2f %%)\n", (float)(t)/(float)(CLOCKS_PER_SEC), (T)? 100.0*(t)/(T) : 0.0)
+#define PRTP(a,t,T) printf("%s = ", (a)); printf("%7.2f sec (%6.2f %%)\n", (float)(t)/(float)(CLOCKS_PER_SEC), (T)? 100.0*(t)/(T) : 0.0)
#endif
#include "vecInt.h"
@@ -96,6 +96,7 @@ typedef long long sint64;
#include "vecPtr.h"
#include "vecVec.h"
#include "vecAtt.h"
+#include "port_type.h"
////////////////////////////////////////////////////////////////////////
/// PARAMETERS ///
diff --git a/src/misc/vec/vecVec.h b/src/misc/vec/vecVec.h
index 55ffdf4f..13880c21 100644
--- a/src/misc/vec/vecVec.h
+++ b/src/misc/vec/vecVec.h
@@ -207,6 +207,48 @@ static inline void Vec_VecFree( Vec_Vec_t * p )
/**Function*************************************************************
+ Synopsis [Frees the vector.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline Vec_Vec_t * Vec_VecDupPtr( Vec_Vec_t * p )
+{
+ Vec_Ptr_t * vNew, * vVec;
+ int i;
+ vNew = Vec_PtrAlloc( Vec_VecSize(p) );
+ Vec_VecForEachLevel( p, vVec, i )
+ Vec_PtrPush( vNew, Vec_PtrDup(vVec) );
+ return (Vec_Vec_t *)vNew;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Frees the vector.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline Vec_Vec_t * Vec_VecDupInt( Vec_Vec_t * p )
+{
+ Vec_Ptr_t * vNew, * vVec;
+ int i;
+ vNew = Vec_PtrAlloc( Vec_VecSize(p) );
+ Vec_VecForEachLevel( p, vVec, i )
+ Vec_PtrPush( vNew, Vec_IntDup((Vec_Int_t *)vVec) );
+ return (Vec_Vec_t *)vNew;
+}
+
+/**Function*************************************************************
+
Synopsis [Frees the vector of vectors.]
Description []