Skip to content

Commit

Permalink
Fix clang errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Oct 29, 2024
1 parent ff87332 commit fd601bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CesiumUtility/include/CesiumUtility/Hash.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#pragma once

#include <cstddef>

namespace CesiumUtility {

struct Hash {
static size_t combine(size_t first, size_t second);
static std::size_t combine(std::size_t first, std::size_t second);
};

} // namespace CesiumUtility
8 changes: 3 additions & 5 deletions CesiumUtility/src/Hash.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include <CesiumUtility/Hash.h>

#include <cstdint>

namespace CesiumUtility {

// This function is adapted from Boost v1.86.0, `hash_mix_impl<64>` function.
Expand Down Expand Up @@ -59,8 +57,8 @@ namespace CesiumUtility {
// (https://mostlymangling.blogspot.com/2019/12/stronger-better-morer-moremur-better.html)
namespace {

inline std::uint64_t mix(std::uint64_t x) {
std::uint64_t const m = 0xe9846af9b1a615d;
inline std::size_t mix(std::size_t x) {
std::size_t const m = 0xe9846af9b1a615d;

x ^= x >> 32;
x *= m;
Expand All @@ -74,7 +72,7 @@ inline std::uint64_t mix(std::uint64_t x) {
} // namespace

// This function is adapted from Boost's `hash_combine`.
size_t Hash::combine(size_t first, size_t second) {
std::size_t Hash::combine(std::size_t first, std::size_t second) {
return mix(first + 0x9e3779b9 + second);
}

Expand Down

0 comments on commit fd601bc

Please sign in to comment.