Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
|
|
@ -4,7 +4,6 @@
|
|||
#include <cstring>
|
||||
|
||||
namespace myGPack {
|
||||
|
||||
// OFFSET: 0x00AECE00
|
||||
// FUNCTION: fn_18145
|
||||
PakName::PakName() {
|
||||
|
|
@ -19,14 +18,15 @@ namespace myGPack {
|
|||
}
|
||||
|
||||
void AssignNameKey(std::uint32_t& result, char* destination, const char* source) {
|
||||
// Source helper: copies through NUL without bounds checking.
|
||||
std::strcpy(destination, source);
|
||||
_strlwr(destination);
|
||||
const std::size_t length = std::strlen(destination);
|
||||
std::uint32_t hash = 5381;
|
||||
|
||||
for (std::size_t i = 0; i < length; ++i) {
|
||||
hash = 33 * hash + static_cast<std::int8_t>(destination[i]);
|
||||
}
|
||||
|
||||
result = hash;
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ namespace myGPack {
|
|||
if (this->m_hash == other.m_hash) {
|
||||
return std::strcmp(this->m_name, other.m_name) < 0;
|
||||
}
|
||||
|
||||
return this->m_hash < other.m_hash;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue