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"

View File

@ -6,8 +6,7 @@
* Copyright 2017 Danny Robson <danny@nerdcruft.net>
*/
#ifndef CRUFT_UTIL_BASE64_HPP
#define CRUFT_UTIL_BASE64_HPP
#pragma once
#include "../view.hpp"
@ -94,6 +93,8 @@ namespace cruft::encode {
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F',
};
//-------------------------------------------------------------------------
template <>
const uint8_t alphabet<16>::dec[256] = {
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;
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 ();
if (rhs) {
m_valid = true;
::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)
{
std::swap (data, rhs.data);
}
cookie& operator= (cookie &&rhs)
cookie& operator= (cookie &&rhs) noexcept
{
std::swap (data, rhs.data);
return *this;

View File

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