[ox] Fix GCC errors

This commit is contained in:
2019-06-06 18:50:06 -05:00
parent 23b662c2aa
commit 096509c2be
9 changed files with 34 additions and 28 deletions

View File

@@ -9,6 +9,7 @@
#pragma once
#include "typetraits.hpp"
#include "utility.hpp"
#ifdef DEBUG
#define OxError(x) ox::_error(__FILE__, __LINE__, x)
@@ -59,7 +60,7 @@ struct ValErr {
inline constexpr ValErr() = default;
inline constexpr ValErr(T value, Error error = 0): value(value), error(error) {
inline constexpr ValErr(T value, Error error = 0): value(ox::move(value)), error(error) {
}
inline constexpr operator const T&() const {

View File

@@ -53,7 +53,7 @@ class HashMap {
/**
* K is assumed to be a null terminated string.
*/
static std::uint64_t hash(K, int len = 0xFFFF) noexcept;
static uint64_t hash(K, int len = 0xFFFF) noexcept;
/**
* K is assumed to be a null terminated string.
@@ -126,8 +126,8 @@ void HashMap<K, T>::expand() {
}
template<typename K, typename T>
std::uint64_t HashMap<K, T>::hash(K k, int len) noexcept {
std::uint64_t sum = 1;
uint64_t HashMap<K, T>::hash(K k, int len) noexcept {
uint64_t sum = 1;
for (int i = 0; i < len && k[i]; i++) {
sum += ((sum + k[i]) * 7) * sum;
}