diff --git a/common/build/Utilities/utilities.vcxproj b/common/build/Utilities/utilities.vcxproj index 4b978d2a95..c687c9086a 100644 --- a/common/build/Utilities/utilities.vcxproj +++ b/common/build/Utilities/utilities.vcxproj @@ -67,7 +67,6 @@ - @@ -121,7 +120,6 @@ - diff --git a/common/build/Utilities/utilities.vcxproj.filters b/common/build/Utilities/utilities.vcxproj.filters index 76cb800c03..e645959405 100644 --- a/common/build/Utilities/utilities.vcxproj.filters +++ b/common/build/Utilities/utilities.vcxproj.filters @@ -32,9 +32,6 @@ Source Files - - Source Files - Source Files @@ -156,9 +153,6 @@ Header Files - - Header Files - Header Files diff --git a/common/include/Utilities/HashMap.h b/common/include/Utilities/HashMap.h deleted file mode 100644 index 528fa0357f..0000000000 --- a/common/include/Utilities/HashMap.h +++ /dev/null @@ -1,31 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs -* Copyright (C) 2002-2010 PCSX2 Dev Team -* -* PCSX2 is free software: you can redistribute it and/or modify it under the terms -* of the GNU Lesser General Public License as published by the Free Software Found- -* ation, either version 3 of the License, or (at your option) any later version. -* -* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; -* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -* PURPOSE. See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License along with PCSX2. -* If not, see . -*/ - -#pragma once - -namespace HashTools -{ - -/// -/// Type that represents a hashcode; returned by all hash functions. -/// -/// -/// In theory this could be changed to a 64 bit value in the future, although many of the hash algorithms -/// would have to be changed to take advantage of the larger data type. -/// -typedef u32 hash_key_t; - -hash_key_t Hash(const char *data, int len); -} diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt index a4c015643b..380089bddf 100644 --- a/common/src/Utilities/CMakeLists.txt +++ b/common/src/Utilities/CMakeLists.txt @@ -25,7 +25,6 @@ set(UtilitiesSources EventSource.cpp Exceptions.cpp FastFormatString.cpp - HashTools.cpp IniInterface.cpp Linux/LnxHostSys.cpp Mutex.cpp @@ -57,7 +56,6 @@ set(UtilitiesHeaders ../../include/Utilities/Exceptions.h ../../include/Utilities/FixedPointTypes.h ../../include/Utilities/General.h - ../../include/Utilities/HashMap.h ../../include/Utilities/MakeUnique.h ../../include/Utilities/MemcpyFast.h ../../include/Utilities/MemsetFast.inl diff --git a/common/src/Utilities/HashTools.cpp b/common/src/Utilities/HashTools.cpp deleted file mode 100644 index aa30e287bc..0000000000 --- a/common/src/Utilities/HashTools.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* PCSX2 - PS2 Emulator for PCs -* Copyright (C) 2002-2010 PCSX2 Dev Team -* -* PCSX2 is free software: you can redistribute it and/or modify it under the terms -* of the GNU Lesser General Public License as published by the Free Software Found- -* ation, either version 3 of the License, or (at your option) any later version. -* -* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; -* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -* PURPOSE. See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License along with PCSX2. -* If not, see . -*/ - -#include "PrecompiledHeader.h" -#include "HashMap.h" - -namespace HashTools -{ - -#define get16bits(d) (*((const u16 *)(d))) - -/// -/// Calculates a hash value for an arbitrary set of binary data. -/// -/// -/// This method produces a 32 bit hash result from an array of source data, and -/// is suitable for generating string hashes. It can also be used to generate -/// hashes for struct-style data (example below). This is the method used by the -/// std::string / std::wstring overloads of the -/// class. -/// -/// Note: -/// This method is an ideal use for any set of data that has five or more -/// components to it. For smaller data types, such as Point or Rectangle -/// structs for example, you can use the int32 / uint32 hashs for faster -/// results. -/// -/// -/// This is an example of taking the hash of a structure. Keep in mind that -/// this method only works reliably for structures that do not contain objects -/// or pointers. -/// -/// struct SomeData -/// { -/// int val; -/// double floats[3]; -/// char id[4]; -/// }; -/// -/// SomeData data; -/// uint32 hashval = Hash( (const char*)&data, sizeof( data ) ); -/// -/// -u32 Hash(const s8 *data, int len) -{ - u32 hash = len; - int rem; - - if (len <= 0 || data == NULL) - return 0; - - rem = len & 3; - len >>= 2; - - /* Main loop */ - for (; len > 0; --len) { - hash += get16bits(data); - u32 tmp = (get16bits(data + 2) << 11) ^ hash; - hash = (hash << 16) ^ tmp; - data += 2 * sizeof(u16); - hash += hash >> 11; - } - - /* Handle end cases */ - switch (rem) { - case 3: - hash += get16bits(data); - hash ^= hash << 16; - hash ^= data[sizeof(u16)] << 18; - hash += hash >> 11; - break; - case 2: - hash += get16bits(data); - hash ^= hash << 11; - hash += hash >> 17; - break; - case 1: - hash += *data; - hash ^= hash << 10; - hash += hash >> 1; - } - - /* Force "avalanching" of final 127 bits */ - hash ^= hash << 3; - hash += hash >> 5; - hash ^= hash << 4; - hash += hash >> 17; - hash ^= hash << 25; - hash += hash >> 6; - - return hash; -} -} diff --git a/pcsx2/gui/AppUserMode.cpp b/pcsx2/gui/AppUserMode.cpp index 842bed99dd..614bc17bc6 100644 --- a/pcsx2/gui/AppUserMode.cpp +++ b/pcsx2/gui/AppUserMode.cpp @@ -16,7 +16,6 @@ #include "PrecompiledHeader.h" #include "MainFrame.h" #include "Utilities/IniInterface.h" -#include "Utilities/HashMap.h" #include "Dialogs/ModalPopups.h" #include diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index 6d4169b4a3..70f8708d58 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -22,8 +22,6 @@ #include "AppAccelerators.h" #include "AppSaveStates.h" -#include "Utilities/HashMap.h" - // Various includes needed for dumping... #include "GS.h" #include "Dump.h"