Skip to content

Commit

Permalink
Fix -Wuninitialized compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Nov 20, 2024
1 parent 5c25f5d commit dd091aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/VecCore/Backend/Implementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ VECCORE_FORCE_INLINE
VECCORE_ATT_HOST_DEVICE
T Load(Scalar<T> const *ptr)
{
T v;
T v{};
LoadStoreImplementation<T>::Load(v, ptr);
return v;
}
Expand Down Expand Up @@ -193,7 +193,7 @@ VECCORE_FORCE_INLINE
VECCORE_ATT_HOST_DEVICE
T Gather(S const *ptr, Index<T> const &idx)
{
T v;
T v{};
GatherScatterImplementation<T>::template Gather<S>(v, ptr, idx);
return v;
}
Expand Down Expand Up @@ -291,7 +291,7 @@ VECCORE_FORCE_INLINE
VECCORE_ATT_HOST_DEVICE
T Blend(const Mask<T> &mask, const T &src1, const T &src2)
{
T v;
T v{};
MaskingImplementation<T>::Blend(v, mask, src1, src2);
return v;
}
Expand Down
6 changes: 3 additions & 3 deletions test/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TYPED_TEST_SUITE_P(VectorInterfaceTest);
TYPED_TEST_P(VectorInterfaceTest, VectorSize) {
using Vector_t = typename TestFixture::Vector_t;

Vector_t v;
Vector_t v{};
Vector_t &vref = v;

EXPECT_TRUE(vecCore::VectorSize(v) > 0);
Expand All @@ -21,15 +21,15 @@ TYPED_TEST_P(VectorInterfaceTest, VectorSize) {
TYPED_TEST_P(VectorInterfaceTest, VectorSizeVariable) {
using Vector_t = typename TestFixture::Vector_t;

Vector_t x;
Vector_t x{};

EXPECT_TRUE(vecCore::VectorSize(x) > 0);
}

TYPED_TEST_P(VectorInterfaceTest, EarlyReturnMaxLength) {
using Vector_t = typename TestFixture::Vector_t;

Vector_t x;
Vector_t x{};

// short vector, should return early if it is allowed
EXPECT_EQ(vecCore::EarlyReturnAllowed(),
Expand Down

0 comments on commit dd091aa

Please sign in to comment.