Skip to content
This repository was archived by the owner on Aug 2, 2024. It is now read-only.

Commit bab36b2

Browse files
authored
Fix MSVC Warnings C4100/C4101 (#3)
* Fix MSVC Warnings C4100/C4101 Due to 'if constexpr' MSVC complains about: C4100: unreferenced formal parameter C4101: unreferenced local variable Uses [[maybe_unused]] (C++17) * Format files
1 parent 2a70ff1 commit bab36b2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

public/klein/detail/matrix.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace kln
2222
// Convert a motor to a column-major 4x4
2323
template <bool Translate = true>
2424
KLN_INLINE void KLN_VEC_CALL mat4x4_12(__m128 const& b,
25-
__m128 const* c,
25+
[[maybe_unused]] __m128 const* c,
2626
__m128* out) noexcept
2727
{
2828
// The derivation of this conversion follows directly from the general

public/klein/detail/sandwich.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ inline namespace detail
247247
template <bool Variadic = false, bool Translate = true>
248248
KLN_INLINE void KLN_VEC_CALL swMM(__m128 const* in,
249249
__m128 const& b,
250-
__m128 const* c,
250+
[[maybe_unused]] __m128 const* c,
251251
__m128* out,
252252
size_t count = 0) noexcept
253253
{
@@ -330,9 +330,10 @@ inline namespace detail
330330
tmp6 = _mm_mul_ps(tmp6, scale);
331331

332332
// Translation
333-
__m128 tmp7; // scaled by a and added to p2
334-
__m128 tmp8; // scaled by (a0, a3, a1, a2) and added to p2
335-
__m128 tmp9; // scaled by (a0, a2, a3, a1) and added to p2
333+
[[maybe_unused]] __m128 tmp7; // scaled by a and added to p2
334+
[[maybe_unused]] __m128 tmp8; // scaled by (a0, a3, a1, a2), added to p2
335+
[[maybe_unused]] __m128 tmp9; // scaled by (a0, a2, a3, a1), added to p2
336+
336337
if constexpr (Translate)
337338
{
338339
__m128 czero = KLN_SWIZZLE(*c, 0, 0, 0, 0);
@@ -408,7 +409,7 @@ inline namespace detail
408409
template <bool Variadic = false, bool Translate = true>
409410
KLN_INLINE void KLN_VEC_CALL sw012(__m128 const* a,
410411
__m128 const& b,
411-
__m128 const* c,
412+
[[maybe_unused]] __m128 const* c,
412413
__m128* out,
413414
size_t count = 0)
414415
{
@@ -477,7 +478,7 @@ inline namespace detail
477478
// 2a3(b0 c3 + b1 c2 + b3 c0 - b2 c1)
478479
// by decomposing into four vectors, factoring out the a components
479480

480-
__m128 tmp4;
481+
[[maybe_unused]] __m128 tmp4;
481482
if constexpr (Translate)
482483
{
483484
tmp4 = _mm_mul_ps(KLN_SWIZZLE(b, 0, 0, 0, 0), *c);
@@ -535,7 +536,7 @@ inline namespace detail
535536
template <bool Variadic = false, bool Translate = true>
536537
KLN_INLINE void KLN_VEC_CALL sw312(__m128 const* a,
537538
__m128 const& b,
538-
__m128 const* c,
539+
[[maybe_unused]] __m128 const* c,
539540
__m128* out,
540541
size_t count = 0) noexcept
541542
{

0 commit comments

Comments
 (0)