summaryrefslogtreecommitdiffstats
path: root/src/misc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-09-26 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2007-09-26 08:01:00 -0700
commit7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2 (patch)
tree353d49651b06530ce1a4b1884b2f187ee3957c85 /src/misc
parentd62ee0a90d14fe762015906b6b3a5ad23421d390 (diff)
downloadabc-7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2.tar.gz
abc-7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2.tar.bz2
abc-7d7e60f2dc84393cd4c5db22d2eaf7b1fb1a79b2.zip
Version abc70926
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/st/st.c3
-rw-r--r--src/misc/st/stmm.c3
-rw-r--r--src/misc/vec/vec.h8
-rw-r--r--src/misc/vec/vecInt.h22
4 files changed, 34 insertions, 2 deletions
diff --git a/src/misc/st/st.c b/src/misc/st/st.c
index c0965a41..872fe51b 100644
--- a/src/misc/st/st.c
+++ b/src/misc/st/st.c
@@ -31,7 +31,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)
+//#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 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 99485c23..8dfacfe4 100644
--- a/src/misc/st/stmm.c
+++ b/src/misc/st/stmm.c
@@ -17,7 +17,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)
+//#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 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 40b46bc5..6a97fcaa 100644
--- a/src/misc/vec/vec.h
+++ b/src/misc/vec/vec.h
@@ -27,6 +27,10 @@ extern "C" {
#ifdef _WIN32
#define inline __inline // compatible with MS VS 6.0
+#pragma warning(disable : 4152) // warning C4152: nonstandard extension, function/data pointer conversion in expression
+#pragma warning(disable : 4244) // warning C4244: '+=' : conversion from 'int ' to 'unsigned short ', possible loss of data
+#pragma warning(disable : 4514) // warning C4514: 'Vec_StrPop' : unreferenced inline function has been removed
+#pragma warning(disable : 4710) // warning C4710: function 'Vec_PtrGrow' not inlined
#endif
////////////////////////////////////////////////////////////////////////
@@ -71,6 +75,10 @@ extern "C" {
#define PRT(a,t) printf("%s = ", (a)); printf("%6.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)
+#endif
+
#include "vecInt.h"
#include "vecFlt.h"
#include "vecStr.h"
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index d1321c62..3afa39af 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -105,6 +105,28 @@ static inline Vec_Int_t * Vec_IntStart( int nSize )
/**Function*************************************************************
+ Synopsis [Allocates a vector with the given size and cleans it.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline Vec_Int_t * Vec_IntStartNatural( int nSize )
+{
+ Vec_Int_t * p;
+ int i;
+ p = Vec_IntAlloc( nSize );
+ p->nSize = nSize;
+ for ( i = 0; i < nSize; i++ )
+ p->pArray[i] = i;
+ return p;
+}
+
+/**Function*************************************************************
+
Synopsis [Creates the vector from an integer array of the given size.]
Description []