Skip to content

Commit

Permalink
More clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Sep 6, 2024
1 parent ae051d1 commit 07d0ceb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions runtime/src/zserio/Variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,11 @@ class BasicVariant : public AllocatorHolder<ALLOC>
}
if constexpr (std::is_same_v<R, std::nullptr_t>)
{
std::forward<F>(fun)(get<INDEX(I)>());
std::forward<F>(fun)(get<static_cast<INDEX>(I)>());
}
else
{
returnValue = std::forward<F>(fun)(get<INDEX(I)>());
returnValue = std::forward<F>(fun)(get<static_cast<INDEX>(I)>());
}
}

Expand All @@ -530,11 +530,11 @@ class BasicVariant : public AllocatorHolder<ALLOC>
}
if constexpr (std::is_same_v<R, std::nullptr_t>)
{
std::forward<F>(fun)(get<INDEX(I)>());
std::forward<F>(fun)(get<static_cast<INDEX>(I)>());
}
else
{
returnValue = std::forward<F>(fun)(get<INDEX(I)>());
returnValue = std::forward<F>(fun)(get<static_cast<INDEX>(I)>());
}
}

Expand All @@ -551,7 +551,7 @@ class BasicVariant : public AllocatorHolder<ALLOC>
{
return true;
}
return get<INDEX(I)>() == other.get<INDEX(I)>();
return get<static_cast<INDEX>(I)>() == other.get<static_cast<INDEX>(I)>();
}

template <size_t... I>
Expand All @@ -567,7 +567,7 @@ class BasicVariant : public AllocatorHolder<ALLOC>
{
return true;
}
return get<INDEX(I)>() < other.get<INDEX(I)>();
return get<static_cast<INDEX>(I)>() < other.get<static_cast<INDEX>(I)>();
}

template <typename U, typename... ARGS>
Expand Down Expand Up @@ -624,7 +624,7 @@ class BasicVariant : public AllocatorHolder<ALLOC>
{
return;
}
emplace<INDEX(I)>(other.get<INDEX(I)>());
emplace<static_cast<INDEX>(I)>(other.get<static_cast<INDEX>(I)>());
}

void move(BasicVariant&& other)
Expand Down
2 changes: 1 addition & 1 deletion runtime/test/zserio/VariantTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct BigObj
explicit BigObj(char obj) :
data() // make clang-tidy happy
{
data[0] = (char)obj;
data[0] = obj;
}
char value() const
{
Expand Down

0 comments on commit 07d0ceb

Please sign in to comment.