diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..44b18ce --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,31 @@ +--- +Checks: '-*, + + bugprone-*, + -bugprone-easily-swappable-parameters, + + clang-analyzer-*, + + concurrency-*, + + cppcoreguidelines-*, + -cppcoreguidelines-avoid-c-arrays, + -cppcoreguidelines-avoid-magic-numbers, + -cppcoreguidelines-pro-bounds-pointer-arithmetic, + + modernize-*, + -modernize-avoid-c-arrays, + -modernize-use-trailing-return-type, + + performance-*, + + portability-*, + + readability-*, + -readability-identifier-length, + -readability-magic-numbers, + -readability-named-parameter, + -readability-redundant-access-specifiers, + -readability-uppercase-literal-suffix, + ' +... diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1486034..5d154bd 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -10,10 +10,10 @@ jobs: matrix: config: # https://github.com/actions/virtual-environments/tree/main/images/win - - { os: "windows-2016", vs: "Visual Studio 2017", arch: "x86" } - - { os: "windows-2016", vs: "Visual Studio 2017", arch: "x64" } - { os: "windows-2019", vs: "Visual Studio 2019", arch: "x86" } - { os: "windows-2019", vs: "Visual Studio 2019", arch: "x64" } + - { os: "windows-2022", vs: "Visual Studio 2022", arch: "x86" } + - { os: "windows-2022", vs: "Visual Studio 2022", arch: "x64" } name: "${{matrix.config.vs}} ${{matrix.config.arch}}" steps: - uses: actions/checkout@v2 diff --git a/headers/vmath.hpp/vmath_qua_fun.hpp b/headers/vmath.hpp/vmath_qua_fun.hpp index fc4f0e1..b6112e2 100644 --- a/headers/vmath.hpp/vmath_qua_fun.hpp +++ b/headers/vmath.hpp/vmath_qua_fun.hpp @@ -204,12 +204,12 @@ namespace vmath_hpp const T xs_scale = sin((T{1} - a) * theta) * rsin_theta; const T ys_scale = sin(a * theta) * raw_cos_theta_sign * rsin_theta; return lerp(unit_xs, unit_ys, xs_scale, ys_scale); - } else { - // use linear interpolation for small angles - const T xs_scale = T{1} - a; - const T ys_scale = a * raw_cos_theta_sign; - return normalize(lerp(unit_xs, unit_ys, xs_scale, ys_scale)); } + + // use linear interpolation for small angles + const T xs_scale = T{1} - a; + const T ys_scale = a * raw_cos_theta_sign; + return normalize(lerp(unit_xs, unit_ys, xs_scale, ys_scale)); } } diff --git a/untests/.clang-tidy b/untests/.clang-tidy new file mode 100644 index 0000000..34f930f --- /dev/null +++ b/untests/.clang-tidy @@ -0,0 +1,19 @@ +--- +Checks: '-*, + + bugprone-*, + -bugprone-easily-swappable-parameters, + + clang-analyzer-*, + + concurrency-*, + + modernize-*, + -modernize-avoid-c-arrays, + -modernize-use-auto, + -modernize-use-nodiscard, + -modernize-use-trailing-return-type, + + portability-*, + ' +...