summaryrefslogtreecommitdiffstats
path: root/src/misc/hash/hash.h
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/misc/hash/hash.h
parentf936cc0680c98ffe51b3a1716c996072d5dbf76c (diff)
downloadabc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.gz
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.tar.bz2
abc-0871bffae307e0553e0c5186336189e8b55cf6a6.zip
Version abc90215
Diffstat (limited to 'src/misc/hash/hash.h')
-rw-r--r--src/misc/hash/hash.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/misc/hash/hash.h b/src/misc/hash/hash.h
index 90e72868..dad4db18 100644
--- a/src/misc/hash/hash.h
+++ b/src/misc/hash/hash.h
@@ -21,13 +21,14 @@
#ifndef __HASH_H__
#define __HASH_H__
+#ifdef _WIN32
+#define inline __inline // compatible with MS VS 6.0
+#endif
////////////////////////////////////////////////////////////////////////
/// INCLUDES ///
////////////////////////////////////////////////////////////////////////
-#ifdef _WIN32
-#define inline __inline // compatible with MS VS 6.0
-#endif
+#include "abc_global.h"
#include "hashInt.h"
#include "hashFlt.h"
@@ -45,16 +46,12 @@
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
-#ifndef ABS
-#define ABS(a) ((a) < 0 ? -(a) : (a))
-#endif
-
////////////////////////////////////////////////////////////////////////
/// FUNCTION DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
int Hash_DefaultHashFunc(int key, int nBins) {
- return ABS( ( (key+11)*(key)*7+3 ) % nBins );
+ return ABC_ABS( ( (key+11)*(key)*7+3 ) % nBins );
}
////////////////////////////////////////////////////////////////////////