mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-28 21:56:12 +01:00
Use SFML 2.6's set of compiler warnings
Some minor tweaks were made to remove Android-specific workarounds that CSFML doesn't need and removing a few warnings that are not feasible to fix at the moment.
This commit is contained in:
1 parent
e8776bc80d
commit
d536b3d2cc
13 files changed
+132
-20
No files matched your search
@@ -66,10 +66,10 @@ sfColor sfColor_fromRGBA(sfUint8 red, sfUint8 green, sfUint8 blue, sfUint8 alpha
|
||||
////////////////////////////////////////////////////////////
|
||||
sfColor sfColor_fromInteger(sfUint32 color)
|
||||
{
|
||||
sfUint8 red = (color & 0xff000000) >> 24;
|
||||
sfUint8 green = (color & 0x00ff0000) >> 16;
|
||||
sfUint8 blue = (color & 0x0000ff00) >> 8;
|
||||
sfUint8 alpha = (color & 0x000000ff) >> 0;
|
||||
sfUint8 red = static_cast<sfUint8>((color & 0xff000000) >> 24);
|
||||
sfUint8 green = static_cast<sfUint8>((color & 0x00ff0000) >> 16);
|
||||
sfUint8 blue = static_cast<sfUint8>((color & 0x0000ff00) >> 8);
|
||||
sfUint8 alpha = static_cast<sfUint8>((color & 0x000000ff) >> 0);
|
||||
|
||||
return sfColor_fromRGBA(red, green, blue, alpha);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ sfColor sfColor_fromInteger(sfUint32 color)
|
||||
////////////////////////////////////////////////////////////
|
||||
sfUint32 sfColor_toInteger(sfColor color)
|
||||
{
|
||||
return (color.r << 24) | (color.g << 16) | (color.b << 8) | color.a;
|
||||
return static_cast<sfUint32>((color.r << 24) | (color.g << 16) | (color.b << 8) | color.a);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ void sfFont_setSmooth(sfFont* font, sfBool smooth)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
const sfBool sfFont_isSmooth(const sfFont *font)
|
||||
sfBool sfFont_isSmooth(const sfFont *font)
|
||||
{
|
||||
if (font->This.isSmooth())
|
||||
{
|
||||
|
||||
@@ -347,7 +347,7 @@ sfWindowHandle sfRenderWindow_getSystemHandle(const sfRenderWindow* renderWindow
|
||||
{
|
||||
CSFML_CHECK_RETURN(renderWindow, 0);
|
||||
|
||||
return (sfWindowHandle)renderWindow->This.getSystemHandle();
|
||||
return static_cast<sfWindowHandle>(renderWindow->This.getSystemHandle());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -269,10 +269,10 @@ void sfShader_setIvec4Uniform(sfShader* shader, const char* name, sfGlslIvec4 ve
|
||||
void sfShader_setIntColorUniform(sfShader* shader, const char* name, sfColor color)
|
||||
{
|
||||
sfGlslIvec4 ivec4;
|
||||
ivec4.x = (int)color.r;
|
||||
ivec4.y = (int)color.g;
|
||||
ivec4.z = (int)color.b;
|
||||
ivec4.w = (int)color.a;
|
||||
ivec4.x = static_cast<int>(color.r);
|
||||
ivec4.y = static_cast<int>(color.g);
|
||||
ivec4.z = static_cast<int>(color.b);
|
||||
ivec4.w = static_cast<int>(color.a);
|
||||
|
||||
sfShader_setIvec4Uniform(shader, name, ivec4);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ sfBool sfTransform_equal(sfTransform* left, sfTransform* right)
|
||||
CSFML_CHECK_RETURN(right, false);
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
if (left->matrix[i] != left->matrix[i]) return sfFalse;
|
||||
if (left->matrix[i] != right->matrix[i]) return sfFalse;
|
||||
}
|
||||
return sfTrue;
|
||||
}
|
||||
@@ -69,7 +69,8 @@ void sfVertexBuffer_destroy(sfVertexBuffer* vertexBuffer)
|
||||
////////////////////////////////////////////////////////////
|
||||
unsigned int sfVertexBuffer_getVertexCount(const sfVertexBuffer* vertexBuffer)
|
||||
{
|
||||
CSFML_CALL_RETURN(vertexBuffer, getVertexCount(), 0);
|
||||
CSFML_CHECK_RETURN(vertexBuffer, 0);
|
||||
return static_cast<unsigned int>(vertexBuffer->This.getVertexCount());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,14 +35,14 @@ sfTime sfTime_Zero = {0};
|
||||
////////////////////////////////////////////////////////////
|
||||
float sfTime_asSeconds(sfTime time)
|
||||
{
|
||||
return time.microseconds / 1000000.f;
|
||||
return static_cast<float>(time.microseconds) / 1000000.f;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
sfInt32 sfTime_asMilliseconds(sfTime time)
|
||||
{
|
||||
return static_cast<sfUint32>(time.microseconds / 1000);
|
||||
return static_cast<sfInt32>(time.microseconds / 1000);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ sfInt64 sfTime_asMicroseconds(sfTime time)
|
||||
sfTime sfSeconds(float amount)
|
||||
{
|
||||
sfTime time;
|
||||
time.microseconds = static_cast<sfUint64>(amount * 1000000);
|
||||
time.microseconds = static_cast<sfInt64>(amount * 1000000);
|
||||
return time;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ sfTime sfSeconds(float amount)
|
||||
sfTime sfMilliseconds(sfInt32 amount)
|
||||
{
|
||||
sfTime time;
|
||||
time.microseconds = static_cast<sfUint64>(amount) * 1000;
|
||||
time.microseconds = static_cast<sfInt64>(amount) * 1000;
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
@@ -320,5 +320,5 @@ sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window)
|
||||
{
|
||||
CSFML_CHECK_RETURN(window, 0);
|
||||
|
||||
return (sfWindowHandle)window->This.getSystemHandle();
|
||||
return static_cast<sfWindowHandle>(window->This.getSystemHandle());
|
||||
}
|
||||
Reference in new issue
Block a user