From 320c429bc46728c1faddfc561c166810aa134a04 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 1 Mar 2008 08:01:00 -0800 Subject: Version abc80301 --- src/misc/extra/extra.h | 2 ++ src/misc/extra/extraUtilFile.c | 23 +++++++++++++++++++++++ src/misc/st/st.c | 5 +++-- src/misc/st/stmm.c | 5 +++-- src/misc/vec/vec.h | 5 +++-- src/misc/vec/vecVec.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 76 insertions(+), 6 deletions(-) (limited to 'src/misc') 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 #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 @@ -177,6 +177,29 @@ char * Extra_FileNameGeneric( char * FileName ) return pRes; } +/**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.] 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 #include #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 #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 @@ -205,6 +205,48 @@ static inline void Vec_VecFree( Vec_Vec_t * p ) Vec_PtrFree( (Vec_Ptr_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.] -- cgit v1.2.3