Skip to content

Commit

Permalink
Fixed minor warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
afritz1 committed Nov 16, 2024
1 parent 9c4b703 commit 283e7ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion OpenTESArena/src/Collision/CollisionChunkManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ namespace
static_cast<float>(boxWorldVoxelPos.x + 0.50),
static_cast<float>(scaledYBottom + scaledHalfHeight),
static_cast<float>(boxWorldVoxelPos.z + 0.50));
const JPH::Quat boxJoltQuat = JPH::Quat::sRotation(JPH::Vec3Arg::sAxisY(), boxShapeDef.yRotation);
const RadiansF boxYRotation = static_cast<RadiansF>(boxShapeDef.yRotation);
const JPH::Quat boxJoltQuat = JPH::Quat::sRotation(JPH::Vec3Arg::sAxisY(), boxYRotation);
const JPH::BodyCreationSettings boxSettings(boxShape, boxJoltPos, boxJoltQuat, JPH::EMotionType::Static, PhysicsLayers::NON_MOVING);
const JPH::Body *box = bodyInterface.CreateBody(boxSettings);
if (box == nullptr)
Expand Down
10 changes: 5 additions & 5 deletions components/utilities/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ namespace String
// Splits a string on the given character without allocating the destination array. Breaks
// early if too many splits are encountered. Returns whether the split count matches the
// destination size.
template<size_t T>
template<int T>
bool splitExpected(const std::string &str, char separator, BufferView<std::string> dst)
{
static_assert(T > 0);

if (dst.getCount() != static_cast<int>(T))
if (dst.getCount() != T)
{
return false;
}

size_t dstIndex = 0;
int dstIndex = 0;
for (const char c : str)
{
if (c == separator)
Expand All @@ -58,7 +58,7 @@ namespace String
else
{
// Put the character on the end of the current string.
dst.get(dstIndex).push_back(c);
dst[dstIndex].push_back(c);
}
}

Expand All @@ -68,7 +68,7 @@ namespace String
// Splits a string on whitespace without allocating the destination array. Breaks early if
// too many splits are encountered. Returns whether the split count matches the destination
// size.
template<size_t T>
template<int T>
bool splitExpected(const std::string &str, BufferView<std::string> dst)
{
return String::splitExpected<T>(str, String::SPACE, dst);
Expand Down
10 changes: 5 additions & 5 deletions components/utilities/StringView.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ namespace StringView
// Splits a string view on the given character without allocating the destination array.
// Breaks early if too many splits are encountered. Returns whether the split count matches
// the destination size.
template<size_t T>
template<int T>
bool splitExpected(std::string_view str, char separator, BufferView<std::string_view> dst)
{
static_assert(T > 0);

if (dst.getCount() != static_cast<int>(T))
if (dst.getCount() != T)
{
return false;
}

// Bootstrap the loop.
dst[0] = std::string_view(str.data(), 0);

size_t dstIndex = 0;
for (size_t i = 0; i < str.size(); i++)
int dstIndex = 0;
for (int i = 0; i < static_cast<int>(str.size()); i++)
{
const char c = str[i];

Expand Down Expand Up @@ -71,7 +71,7 @@ namespace StringView
// Splits a string view on whitespace without allocating the destination array. Breaks early
// if too many splits are encountered. Returns whether the split count matches the destination
// size.
template<size_t T>
template<int T>
bool splitExpected(std::string_view str, BufferView<std::string_view> dst)
{
return StringView::splitExpected<T>(str, String::SPACE, dst);
Expand Down

0 comments on commit 283e7ad

Please sign in to comment.