Skip to content

Commit 6ce8f95

Browse files
committed
Remove unnecessary static_casts
1 parent b626f65 commit 6ce8f95

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/CSFML/Graphics/Shader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ void sfShader_setIntColorUniform(sfShader* shader, const char* name, sfColor col
253253
sfShader_setIvec4Uniform(shader,
254254
name,
255255
{
256-
static_cast<int>(color.r),
257-
static_cast<int>(color.g),
258-
static_cast<int>(color.b),
259-
static_cast<int>(color.a),
256+
color.r,
257+
color.g,
258+
color.b,
259+
color.a,
260260
});
261261
}
262262

src/CSFML/Network/Packet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ bool sfPacket_endOfPacket(const sfPacket* packet)
105105
bool sfPacket_canRead(const sfPacket* packet)
106106
{
107107
assert(packet);
108-
return static_cast<bool>(*packet);
108+
return bool{*packet};
109109
}
110110

111111

test/Window/Joystick.test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ TEST_CASE("[Window] sfJoystick")
3030
// no joysticks will be detected. This is how we can ensure these
3131
// tests are portable and reliable.
3232

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

3535
SECTION("sfJoystick_isConnected()")
3636
{
@@ -56,7 +56,7 @@ TEST_CASE("[Window] sfJoystick")
5656

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

0 commit comments

Comments
 (0)