diff options
author | tanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a> | 2012-03-01 06:06:01 +0000 |
---|---|---|
committer | tanjent@gmail.com <tanjent@gmail.com@77a7d1d3-4c08-bdc2-d393-d5859734b01a> | 2012-03-01 06:06:01 +0000 |
commit | dd462f2c6817d4e09a6ecd99f35e3a04c342afb2 (patch) | |
tree | 9641e8b99a224b3c1b2eccf52ff530a6a7cdf29c | |
parent | f3b789787b93945c974e2cc517b7dc352b28354e (diff) | |
download | src-dd462f2c6817d4e09a6ecd99f35e3a04c342afb2.tar.gz |
Add #include "Platform.h" to fix Windows build
remove CXX_FLAGS, which make Visual Studio complain
Widen sanity test out of paranoia.
Fix typo in g_hashes reference to SpookyHash
Remove Visual Studio-specific .sln & .vcproj files
git-svn-id: http://smhasher.googlecode.com/svn/trunk@145 77a7d1d3-4c08-bdc2-d393-d5859734b01a
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | City.h | 3 | ||||
-rw-r--r-- | KeysetTest.cpp | 2 | ||||
-rw-r--r-- | SMHasher.sln | 26 | ||||
-rw-r--r-- | SMHasher.vcproj | 485 | ||||
-rw-r--r-- | Spooky.h | 3 | ||||
-rw-r--r-- | main.cpp | 2 |
7 files changed, 6 insertions, 516 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d04afdf..5b64292 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ project(SMHasher) cmake_minimum_required(VERSION 2.4) set(CMAKE_BUILD_TYPE Release) -set(CMAKE_CXX_FLAGS "-g -fno-strict-aliasing -Wall") add_library( SMHasherSupport @@ -43,8 +43,9 @@ #ifndef CITY_HASH_H_ #define CITY_HASH_H_ +#include "Platform.h" #include <stdlib.h> // for size_t. -#include <stdint.h> +//#include <stdint.h> #include <utility> typedef uint8_t uint8; diff --git a/KeysetTest.cpp b/KeysetTest.cpp index b3b8a4c..148b065 100644 --- a/KeysetTest.cpp +++ b/KeysetTest.cpp @@ -81,7 +81,7 @@ bool SanityTest ( pfHash hash, const int hashbits ) const int hashbytes = hashbits/8; const int reps = 10; - const int keymax = 128; + const int keymax = 256; const int pad = 16; const int buflen = keymax + pad*3; diff --git a/SMHasher.sln b/SMHasher.sln deleted file mode 100644 index f8c7a41..0000000 --- a/SMHasher.sln +++ /dev/null @@ -1,26 +0,0 @@ -
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SMHasher", "SMHasher.vcproj", "{AF3C61C4-642A-425B-928D-CEC37C678442}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Debug|Win32.ActiveCfg = Debug|Win32
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Debug|Win32.Build.0 = Debug|Win32
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Debug|x64.ActiveCfg = Debug|x64
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Debug|x64.Build.0 = Debug|x64
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Release|Win32.ActiveCfg = Release|Win32
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Release|Win32.Build.0 = Release|Win32
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Release|x64.ActiveCfg = Release|x64
- {AF3C61C4-642A-425B-928D-CEC37C678442}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/SMHasher.vcproj b/SMHasher.vcproj deleted file mode 100644 index e5a59da..0000000 --- a/SMHasher.vcproj +++ /dev/null @@ -1,485 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="SMHasher"
- ProjectGUID="{AF3C61C4-642A-425B-928D-CEC37C678442}"
- RootNamespace="SMHasher"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- WarnAsError="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Hashes"
- >
- <File
- RelativePath=".\City.cpp"
- >
- </File>
- <File
- RelativePath=".\City.h"
- >
- </File>
- <File
- RelativePath=".\crc.cpp"
- >
- </File>
- <File
- RelativePath=".\Hashes.cpp"
- >
- </File>
- <File
- RelativePath=".\Hashes.h"
- >
- </File>
- <File
- RelativePath=".\lookup3.cpp"
- >
- </File>
- <File
- RelativePath=".\md5.cpp"
- >
- </File>
- <File
- RelativePath=".\MurmurHash1.cpp"
- >
- </File>
- <File
- RelativePath=".\MurmurHash1.h"
- >
- </File>
- <File
- RelativePath=".\MurmurHash2.cpp"
- >
- </File>
- <File
- RelativePath=".\MurmurHash2.h"
- >
- </File>
- <File
- RelativePath=".\MurmurHash3.cpp"
- >
- </File>
- <File
- RelativePath=".\MurmurHash3.h"
- >
- </File>
- <File
- RelativePath=".\sha1.cpp"
- >
- </File>
- <File
- RelativePath=".\sha1.h"
- >
- </File>
- <File
- RelativePath=".\SuperFastHash.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Tests"
- >
- <File
- RelativePath=".\AvalancheTest.cpp"
- >
- </File>
- <File
- RelativePath=".\AvalancheTest.h"
- >
- </File>
- <File
- RelativePath=".\Bitslice.cpp"
- >
- </File>
- <File
- RelativePath=".\DifferentialTest.cpp"
- >
- </File>
- <File
- RelativePath=".\DifferentialTest.h"
- >
- </File>
- <File
- RelativePath=".\KeysetTest.cpp"
- >
- </File>
- <File
- RelativePath=".\KeysetTest.h"
- >
- </File>
- <File
- RelativePath=".\SpeedTest.cpp"
- >
- </File>
- <File
- RelativePath=".\SpeedTest.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Utils"
- >
- <File
- RelativePath=".\Bitvec.cpp"
- >
- </File>
- <File
- RelativePath=".\Bitvec.h"
- >
- </File>
- <File
- RelativePath=".\Platform.cpp"
- >
- </File>
- <File
- RelativePath=".\Platform.h"
- >
- </File>
- <File
- RelativePath=".\pstdint.h"
- >
- </File>
- <File
- RelativePath=".\Random.cpp"
- >
- </File>
- <File
- RelativePath=".\Random.h"
- >
- </File>
- <File
- RelativePath=".\Stats.cpp"
- >
- </File>
- <File
- RelativePath=".\Stats.h"
- >
- </File>
- <File
- RelativePath=".\Types.cpp"
- >
- </File>
- <File
- RelativePath=".\Types.h"
- >
- </File>
- </Filter>
- <File
- RelativePath=".\main.cpp"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
@@ -24,6 +24,7 @@ // slower than MD5. // +#include "Platform.h" #include <stddef.h> #ifdef _MSC_VER @@ -281,7 +282,7 @@ private: // * is a not-very-regular mix of 1's and 0's // * does not need any other special mathematical properties // - static const uint64 sc_const = 0xdeadbeefdeadbeefLL; + static const uint64 sc_const = 0xdeadbeefdeadbeefULL; uint64 m_data[2*sc_numVars]; // unhashed data, for partial messages uint64 m_state[sc_numVars]; // internal state of the hash @@ -61,7 +61,7 @@ HashInfo g_hashes[] = { CityHash64_test, 64, 0x25A20825, "City64", "Google CityHash64WithSeed" }, { CityHash128_test, 128, 0x6531F54E, "City128", "Google CityHash128WithSeed" }, - { SpookyHash64_test, 32, 0x3F798BBB, "Spooky32", "Bob Jenkins' SpookyHash, 32-bit result" }, + { SpookyHash32_test, 32, 0x3F798BBB, "Spooky32", "Bob Jenkins' SpookyHash, 32-bit result" }, { SpookyHash64_test, 64, 0xA7F955F1, "Spooky64", "Bob Jenkins' SpookyHash, 64-bit result" }, { SpookyHash128_test, 128, 0x8D263080, "Spooky128", "Bob Jenkins' SpookyHash, 128-bit result" }, |