build: address clang-tidy errors

This commit is contained in:
Danny Robson 2021-04-20 12:10:53 +10:00
parent 59c1c9cc9e
commit 4747b649fd
5 changed files with 17 additions and 17 deletions

View File

@ -7,4 +7,3 @@
*/ */
#include "base.hpp" #include "base.hpp"

View File

@ -6,8 +6,7 @@
* Copyright 2017 Danny Robson <danny@nerdcruft.net> * Copyright 2017 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef CRUFT_UTIL_BASE64_HPP #pragma once
#define CRUFT_UTIL_BASE64_HPP
#include "../view.hpp" #include "../view.hpp"
@ -94,6 +93,8 @@ namespace cruft::encode {
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
}; };
//-------------------------------------------------------------------------
template <> template <>
const uint8_t alphabet<16>::dec[256] = { const uint8_t alphabet<16>::dec[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -241,5 +242,3 @@ namespace cruft::encode {
} }
}; };
}; };
#endif

View File

@ -52,9 +52,14 @@ namespace cruft {
using error_type = ErrorT; using error_type = ErrorT;
expected () = delete; expected () = delete;
expected (expected &&rhs) expected (expected &&rhs) noexcept (
{ std::is_nothrow_destructible_v<ValueT> &&
std::is_nothrow_destructible_v<ErrorT> &&
std::is_nothrow_move_constructible_v<ValueT> &&
std::is_nothrow_move_constructible_v<ErrorT>
) {
destroy (); destroy ();
if (rhs) { if (rhs) {
m_valid = true; m_valid = true;
::new (&m_store.value) ValueT (std::move (rhs.value ())); ::new (&m_store.value) ValueT (std::move (rhs.value ()));

View File

@ -66,13 +66,13 @@ namespace cruft::job {
{ ; } { ; }
cookie (cookie &&rhs): cookie (cookie &&rhs) noexcept:
data (nullptr) data (nullptr)
{ {
std::swap (data, rhs.data); std::swap (data, rhs.data);
} }
cookie& operator= (cookie &&rhs) cookie& operator= (cookie &&rhs) noexcept
{ {
std::swap (data, rhs.data); std::swap (data, rhs.data);
return *this; return *this;

View File

@ -6,14 +6,13 @@
* Copyright 2018 Danny Robson <danny@nerdcruft.net> * Copyright 2018 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef CRUFT_UTIL_MATHS_FAST_HPP #pragma once
#define CRUFT_UTIL_MATHS_FAST_HPP
#include "../maths.hpp" #include "../maths.hpp"
#include "../debug/assert.hpp" #include "../debug/assert.hpp"
namespace cruft::maths::fast { namespace cruft::maths::fast {
float constexpr float
estrin (float t, float a, float b, float c, float d) estrin (float t, float a, float b, float c, float d)
{ {
const auto t2 = t * t; const auto t2 = t * t;
@ -34,7 +33,7 @@ namespace cruft::maths::fast {
// //
// using minimax(sin(x)-x, [|3,5,7,9|], ...) has higher accuracy, but // using minimax(sin(x)-x, [|3,5,7,9|], ...) has higher accuracy, but
// probably not enough to offset the extra multiplications. // probably not enough to offset the extra multiplications.
float constexpr float
sin (float x) noexcept sin (float x) noexcept
{ {
CHECK_LT (x, 2 * pi<float>); CHECK_LT (x, 2 * pi<float>);
@ -84,7 +83,7 @@ namespace cruft::maths::fast {
// P; // P;
// dirtyinfnorm(P(x)-exp(x), [0;1]); // dirtyinfnorm(P(x)-exp(x), [0;1]);
// plot(P(x)-exp(x),[0; 1]); // plot(P(x)-exp(x),[0; 1]);
float constexpr float
exp (float x) exp (float x)
{ {
union { union {
@ -108,6 +107,4 @@ namespace cruft::maths::fast {
return frac * whole.f; return frac * whole.f;
} }
} }
#endif