From d9b363330b07706ce2937d1374de8a69616e2650 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 31 Jan 2020 19:06:26 -0600 Subject: [PATCH] [ox/std] Rename bitops.hpp to bit.hpp to mirror the new bit in C++20 --- deps/ox/src/ox/mc/write.hpp | 2 +- deps/ox/src/ox/std/CMakeLists.txt | 2 +- deps/ox/src/ox/std/{bitops.hpp => bit.hpp} | 2 +- deps/ox/src/ox/std/random.cpp | 6 +++--- deps/ox/src/ox/std/std.hpp | 2 +- deps/ox/src/ox/std/typetraits.hpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) rename deps/ox/src/ox/std/{bitops.hpp => bit.hpp} (90%) diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 535768c4..f912e16b 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/deps/ox/src/ox/std/CMakeLists.txt b/deps/ox/src/ox/std/CMakeLists.txt index 6db2b3b9..a5400cf0 100644 --- a/deps/ox/src/ox/std/CMakeLists.txt +++ b/deps/ox/src/ox/std/CMakeLists.txt @@ -36,7 +36,7 @@ target_link_libraries( install( FILES assert.hpp - bitops.hpp + bit.hpp buildinfo.hpp byteswap.hpp defines.hpp diff --git a/deps/ox/src/ox/std/bitops.hpp b/deps/ox/src/ox/std/bit.hpp similarity index 90% rename from deps/ox/src/ox/std/bitops.hpp rename to deps/ox/src/ox/std/bit.hpp index 138d48b9..616249d4 100644 --- a/deps/ox/src/ox/std/bitops.hpp +++ b/deps/ox/src/ox/std/bit.hpp @@ -13,7 +13,7 @@ namespace ox { template -[[nodiscard]] inline constexpr T rotateLeft(T i, std::size_t shift) noexcept { +[[nodiscard]] constexpr T rotl(T i, int shift) noexcept { constexpr auto bits = sizeof(i) * 8; return (i << shift) | (i >> (bits - shift)); } diff --git a/deps/ox/src/ox/std/random.cpp b/deps/ox/src/ox/std/random.cpp index 2ab09551..54471cfe 100644 --- a/deps/ox/src/ox/std/random.cpp +++ b/deps/ox/src/ox/std/random.cpp @@ -6,7 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "bitops.hpp" +#include "bit.hpp" #include "random.hpp" namespace ox { @@ -28,8 +28,8 @@ uint64_t Random::gen() { auto retval = s0 + s1; s1 ^= s0; - m_seed[0] = ox::rotateLeft(s0, 55) ^ s1 ^ (s1 << 14); - m_seed[1] = ox::rotateLeft(s1, 36); + m_seed[0] = ox::rotl(s0, 55) ^ s1 ^ (s1 << 14); + m_seed[1] = ox::rotl(s1, 36); return retval; } diff --git a/deps/ox/src/ox/std/std.hpp b/deps/ox/src/ox/std/std.hpp index 9a59a4a6..c19dbc19 100644 --- a/deps/ox/src/ox/std/std.hpp +++ b/deps/ox/src/ox/std/std.hpp @@ -9,7 +9,7 @@ #pragma once #include "assert.hpp" -#include "bitops.hpp" +#include "bit.hpp" #include "byteswap.hpp" #include "error.hpp" #include "hardware.hpp" diff --git a/deps/ox/src/ox/std/typetraits.hpp b/deps/ox/src/ox/std/typetraits.hpp index a0d2ffb0..46765550 100644 --- a/deps/ox/src/ox/std/typetraits.hpp +++ b/deps/ox/src/ox/std/typetraits.hpp @@ -8,7 +8,7 @@ #pragma once -#include "bitops.hpp" +#include "bit.hpp" #if __has_include()