Skip to content

Commit

Permalink
fix(mask): avoid signed/unsigned warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrechette committed Sep 22, 2023
1 parent a8a17bc commit 07d19a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/rtm/impl/mask_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace rtm
const uint32_t z_mask = z ? 0xFFFFFFFFU : 0;
const uint32_t w_mask = w ? 0xFFFFFFFFU : 0;

return mask4d{ _mm_castsi128_pd(_mm_set_epi32(y_mask, y_mask, x_mask, x_mask)), _mm_castsi128_pd(_mm_set_epi32(w_mask, w_mask, z_mask, z_mask)) };
return mask4d{ _mm_castsi128_pd(_mm_set_epi32(static_cast<int32_t>(y_mask), static_cast<int32_t>(y_mask), static_cast<int32_t>(x_mask), static_cast<int32_t>(x_mask))), _mm_castsi128_pd(_mm_set_epi32(static_cast<int32_t>(w_mask), static_cast<int32_t>(w_mask), static_cast<int32_t>(z_mask), static_cast<int32_t>(z_mask))) };
#else
return mask4d{ _mm_castsi128_pd(_mm_set_epi64x(static_cast<int64_t>(y), static_cast<int64_t>(x))), _mm_castsi128_pd(_mm_set_epi64x(static_cast<int64_t>(w), static_cast<int64_t>(z))) };
#endif
Expand All @@ -235,7 +235,7 @@ namespace rtm
const uint32_t z_mask = z ? 0xFFFFFFFFU : 0;
const uint32_t w_mask = w ? 0xFFFFFFFFU : 0;

return mask4q{ _mm_set_epi32(y_mask, y_mask, x_mask, x_mask), _mm_set_epi32(w_mask, w_mask, z_mask, z_mask) };
return mask4q{ _mm_set_epi32(static_cast<int32_t>(y_mask), static_cast<int32_t>(y_mask), static_cast<int32_t>(x_mask), static_cast<int32_t>(x_mask)), _mm_set_epi32(static_cast<int32_t>(w_mask), static_cast<int32_t>(w_mask), static_cast<int32_t>(z_mask), static_cast<int32_t>(z_mask)) };
#else
return mask4q{ _mm_set_epi64x(static_cast<int64_t>(y), static_cast<int64_t>(x)), _mm_set_epi64x(static_cast<int64_t>(w), static_cast<int64_t>(z)) };
#endif
Expand Down

0 comments on commit 07d19a3

Please sign in to comment.