Skip to content

Commit

Permalink
Remove unnecessary static_casts
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Sep 29, 2024
1 parent b626f65 commit 4ea8dd6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/CSFML/Graphics/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ void sfShader_setIntColorUniform(sfShader* shader, const char* name, sfColor col
sfShader_setIvec4Uniform(shader,
name,
{
static_cast<int>(color.r),
static_cast<int>(color.g),
static_cast<int>(color.b),
static_cast<int>(color.a),
color.r,
color.g,
color.b,
color.a,
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/CSFML/Network/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bool sfPacket_endOfPacket(const sfPacket* packet)
bool sfPacket_canRead(const sfPacket* packet)
{
assert(packet);
return static_cast<bool>(*packet);
return bool{*packet};
}


Expand Down
4 changes: 2 additions & 2 deletions test/Window/Joystick.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ TEST_CASE("[Window] sfJoystick")
// no joysticks will be detected. This is how we can ensure these
// tests are portable and reliable.

const auto joystick = GENERATE(range(0u, static_cast<unsigned int>(sfJoystickCount - 1)));
const auto joystick = GENERATE(range(0u, unsigned{sfJoystickCount - 1}));

SECTION("sfJoystick_isConnected()")
{
Expand All @@ -56,7 +56,7 @@ TEST_CASE("[Window] sfJoystick")

SECTION("sfJoystick_isButtonPressed()")
{
const auto button = GENERATE(range(0u, static_cast<unsigned int>(sfJoystickButtonCount - 1)));
const auto button = GENERATE(range(0u, unsigned{sfJoystickButtonCount - 1}));
CHECK(!sfJoystick_isButtonPressed(joystick, button));
}

Expand Down

0 comments on commit 4ea8dd6

Please sign in to comment.