[ox/std] Rename bitops.hpp to bit.hpp to mirror the new bit in C++20

This commit is contained in:
Gary Talent 2020-01-31 19:06:26 -06:00
parent c9f91c16c2
commit d9b363330b
6 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@
#include <ox/model/optype.hpp> #include <ox/model/optype.hpp>
#include <ox/model/types.hpp> #include <ox/model/types.hpp>
#include <ox/std/bitops.hpp> #include <ox/std/bit.hpp>
#include <ox/std/byteswap.hpp> #include <ox/std/byteswap.hpp>
#include <ox/std/string.hpp> #include <ox/std/string.hpp>
#include <ox/std/types.hpp> #include <ox/std/types.hpp>

View File

@ -36,7 +36,7 @@ target_link_libraries(
install( install(
FILES FILES
assert.hpp assert.hpp
bitops.hpp bit.hpp
buildinfo.hpp buildinfo.hpp
byteswap.hpp byteswap.hpp
defines.hpp defines.hpp

View File

@ -13,7 +13,7 @@
namespace ox { namespace ox {
template<typename T> template<typename T>
[[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; constexpr auto bits = sizeof(i) * 8;
return (i << shift) | (i >> (bits - shift)); return (i << shift) | (i >> (bits - shift));
} }

View File

@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#include "bitops.hpp" #include "bit.hpp"
#include "random.hpp" #include "random.hpp"
namespace ox { namespace ox {
@ -28,8 +28,8 @@ uint64_t Random::gen() {
auto retval = s0 + s1; auto retval = s0 + s1;
s1 ^= s0; s1 ^= s0;
m_seed[0] = ox::rotateLeft(s0, 55) ^ s1 ^ (s1 << 14); m_seed[0] = ox::rotl(s0, 55) ^ s1 ^ (s1 << 14);
m_seed[1] = ox::rotateLeft(s1, 36); m_seed[1] = ox::rotl(s1, 36);
return retval; return retval;
} }

View File

@ -9,7 +9,7 @@
#pragma once #pragma once
#include "assert.hpp" #include "assert.hpp"
#include "bitops.hpp" #include "bit.hpp"
#include "byteswap.hpp" #include "byteswap.hpp"
#include "error.hpp" #include "error.hpp"
#include "hardware.hpp" #include "hardware.hpp"

View File

@ -8,7 +8,7 @@
#pragma once #pragma once
#include "bitops.hpp" #include "bit.hpp"
#if __has_include(<type_traits>) #if __has_include(<type_traits>)