summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraappleby@google.com <aappleby@google.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a>2011-04-08 21:07:48 +0000
committeraappleby@google.com <aappleby@google.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a>2011-04-08 21:07:48 +0000
commitc8e8bf81bc6041d6d836365a501a0a96830d2d81 (patch)
tree7dd0455cd91b01165e5e9ff07e78a43a658ed411
parentcc592168c77f4f357d593456e7d094d786866f38 (diff)
downloadsrc-c8e8bf81bc6041d6d836365a501a0a96830d2d81.tar.gz
Remove dead files, make Murmur1/2/3 all have explicit public domain licensing & no external dependencies
git-svn-id: http://smhasher.googlecode.com/svn/trunk@129 77a7d1d3-4c08-bdc2-d393-d5859734b01a
-rw-r--r--CMakeLists.txt5
-rw-r--r--MurmurHash1.cpp9
-rw-r--r--MurmurHash1.h28
-rw-r--r--MurmurHash2.cpp26
-rw-r--r--MurmurHash2.h28
-rw-r--r--MurmurHash2_test.cpp0
-rw-r--r--MurmurHash3.h5
-rw-r--r--MurmurHash64.cpp0
-rw-r--r--MurmurHashAligned.cpp2
-rw-r--r--MurmurHashAligned2.cpp4
-rw-r--r--MurmurHashNeutral2.cpp2
11 files changed, 83 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9717f48..fc75ddc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,12 +17,7 @@ add_library(
md5.cpp
MurmurHash1.cpp
MurmurHash2.cpp
- MurmurHash2_test.cpp
MurmurHash3.cpp
- MurmurHash64.cpp
- MurmurHashAligned2.cpp
- MurmurHashAligned.cpp
- MurmurHashNeutral2.cpp
Platform.cpp
Random.cpp
sha1.cpp
diff --git a/MurmurHash1.cpp b/MurmurHash1.cpp
index ed23e6f..b21e9f7 100644
--- a/MurmurHash1.cpp
+++ b/MurmurHash1.cpp
@@ -1,7 +1,6 @@
-#include "MurmurHash1.h"
-
//-----------------------------------------------------------------------------
-// MurmurHash1, by Austin Appleby
+// MurmurHash was written by Austin Appleby, and is placed in the public
+// domain. The author hereby disclaims copyright to this source code.
// Note - This code makes a few assumptions about how your machine behaves -
@@ -14,6 +13,10 @@
// 2. It will not produce the same results on little-endian and big-endian
// machines.
+#include "MurmurHash1.h"
+
+//-----------------------------------------------------------------------------
+
uint32_t MurmurHash1 ( const void * key, int len, uint32_t seed )
{
const unsigned int m = 0xc6a4a793;
diff --git a/MurmurHash1.h b/MurmurHash1.h
index eff8d11..edbfa21 100644
--- a/MurmurHash1.h
+++ b/MurmurHash1.h
@@ -1,4 +1,28 @@
-#include "Platform.h"
+//-----------------------------------------------------------------------------
+// MurmurHash was written by Austin Appleby, and is placed in the public
+// domain. The author hereby disclaims copyright to this source code.
+
+#ifndef _MURMURHASH1_H_
+#define _MURMURHASH1_H_
+
+//-----------------------------------------------------------------------------
+// Platform-specific functions and macros
+
+// Microsoft Visual Studio
+
+#if defined(_MSC_VER)
+
+typedef unsigned char uint8_t;
+typedef unsigned long uint32_t;
+typedef unsigned __int64 uint64_t;
+
+// Other compilers
+
+#else // defined(_MSC_VER)
+
+#include <stdint.h>
+
+#endif // !defined(_MSC_VER)
//-----------------------------------------------------------------------------
@@ -6,3 +30,5 @@ uint32_t MurmurHash1 ( const void * key, int len, uint32_t seed );
uint32_t MurmurHash1Aligned ( const void * key, int len, uint32_t seed );
//-----------------------------------------------------------------------------
+
+#endif // _MURMURHASH1_H_
diff --git a/MurmurHash2.cpp b/MurmurHash2.cpp
index cc94f79..cf15edf 100644
--- a/MurmurHash2.cpp
+++ b/MurmurHash2.cpp
@@ -1,7 +1,6 @@
-#include "MurmurHash2.h"
-
//-----------------------------------------------------------------------------
-// MurmurHash2, by Austin Appleby
+// MurmurHash3 was written by Austin Appleby, and is placed in the public
+// domain. The author hereby disclaims copyright to this source code.
// Note - This code makes a few assumptions about how your machine behaves -
@@ -14,6 +13,27 @@
// 2. It will not produce the same results on little-endian and big-endian
// machines.
+#include "MurmurHash2.h"
+
+//-----------------------------------------------------------------------------
+// Platform-specific functions and macros
+
+// Microsoft Visual Studio
+
+#if defined(_MSC_VER)
+
+#define BIG_CONSTANT(x) (x)
+
+// Other compilers
+
+#else // defined(_MSC_VER)
+
+#define BIG_CONSTANT(x) (x##LLU)
+
+#endif // !defined(_MSC_VER)
+
+//-----------------------------------------------------------------------------
+
uint32_t MurmurHash2 ( const void * key, int len, uint32_t seed )
{
// 'm' and 'r' are mixing constants generated offline.
diff --git a/MurmurHash2.h b/MurmurHash2.h
index f119653..38dbbeb 100644
--- a/MurmurHash2.h
+++ b/MurmurHash2.h
@@ -1,4 +1,28 @@
-#include "Platform.h"
+//-----------------------------------------------------------------------------
+// MurmurHash2 was written by Austin Appleby, and is placed in the public
+// domain. The author hereby disclaims copyright to this source code.
+
+#ifndef _MURMURHASH2_H_
+#define _MURMURHASH2_H_
+
+//-----------------------------------------------------------------------------
+// Platform-specific functions and macros
+
+// Microsoft Visual Studio
+
+#if defined(_MSC_VER)
+
+typedef unsigned char uint8_t;
+typedef unsigned long uint32_t;
+typedef unsigned __int64 uint64_t;
+
+// Other compilers
+
+#else // defined(_MSC_VER)
+
+#include <stdint.h>
+
+#endif // !defined(_MSC_VER)
//-----------------------------------------------------------------------------
@@ -11,3 +35,5 @@ uint32_t MurmurHashAligned2 ( const void * key, int len, uint32_t seed );
//-----------------------------------------------------------------------------
+#endif // _MURMURHASH2_H_
+
diff --git a/MurmurHash2_test.cpp b/MurmurHash2_test.cpp
deleted file mode 100644
index e69de29..0000000
--- a/MurmurHash2_test.cpp
+++ /dev/null
diff --git a/MurmurHash3.h b/MurmurHash3.h
index 9c8425c..58e9820 100644
--- a/MurmurHash3.h
+++ b/MurmurHash3.h
@@ -2,11 +2,6 @@
// MurmurHash3 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
-// Note - The x86 and x64 versions do _not_ produce the same results, as the
-// algorithms are optimized for their respective platforms. You can still
-// compile and run any of them on any platform, but your performance with the
-// non-native version will be less than optimal.
-
#ifndef _MURMURHASH3_H_
#define _MURMURHASH3_H_
diff --git a/MurmurHash64.cpp b/MurmurHash64.cpp
deleted file mode 100644
index e69de29..0000000
--- a/MurmurHash64.cpp
+++ /dev/null
diff --git a/MurmurHashAligned.cpp b/MurmurHashAligned.cpp
deleted file mode 100644
index 63dfe61..0000000
--- a/MurmurHashAligned.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-//#include "stdafx.h"
-
diff --git a/MurmurHashAligned2.cpp b/MurmurHashAligned2.cpp
deleted file mode 100644
index 83e9723..0000000
--- a/MurmurHashAligned2.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-//#include "stdafx.h"
-
-#pragma warning(disable:4311)
-
diff --git a/MurmurHashNeutral2.cpp b/MurmurHashNeutral2.cpp
deleted file mode 100644
index 63dfe61..0000000
--- a/MurmurHashNeutral2.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-//#include "stdafx.h"
-