Fixed compiler warnings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index d5030fe..942a719 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -2095,35 +2095,37 @@ int SDL_GL_UnbindTexture(SDL_Texture *texture)
static SDL_BlendMode
SDL_GetShortBlendMode(SDL_BlendMode blendMode)
{
- switch (blendMode) {
- case SDL_BLENDMODE_NONE_FULL:
+ if (blendMode == SDL_BLENDMODE_NONE_FULL) {
return SDL_BLENDMODE_NONE;
- case SDL_BLENDMODE_BLEND_FULL:
+ }
+ if (blendMode == SDL_BLENDMODE_BLEND_FULL) {
return SDL_BLENDMODE_BLEND;
- case SDL_BLENDMODE_ADD_FULL:
+ }
+ if (blendMode == SDL_BLENDMODE_ADD_FULL) {
return SDL_BLENDMODE_ADD;
- case SDL_BLENDMODE_MOD_FULL:
+ }
+ if (blendMode == SDL_BLENDMODE_MOD_FULL) {
return SDL_BLENDMODE_MOD;
- default:
- return blendMode;
}
+ return blendMode;
}
static SDL_BlendMode
SDL_GetLongBlendMode(SDL_BlendMode blendMode)
{
- switch (blendMode) {
- case SDL_BLENDMODE_NONE:
+ if (blendMode == SDL_BLENDMODE_NONE) {
return SDL_BLENDMODE_NONE_FULL;
- case SDL_BLENDMODE_BLEND:
+ }
+ if (blendMode == SDL_BLENDMODE_BLEND) {
return SDL_BLENDMODE_BLEND_FULL;
- case SDL_BLENDMODE_ADD:
+ }
+ if (blendMode == SDL_BLENDMODE_ADD) {
return SDL_BLENDMODE_ADD_FULL;
- case SDL_BLENDMODE_MOD:
+ }
+ if (blendMode == SDL_BLENDMODE_MOD) {
return SDL_BLENDMODE_MOD_FULL;
- default:
- return blendMode;
}
+ return blendMode;
}
SDL_BlendMode
diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c
index 456f3ce..5c1dd82 100644
--- a/src/render/opengl/SDL_render_gl.c
+++ b/src/render/opengl/SDL_render_gl.c
@@ -642,7 +642,6 @@ static GLenum GetBlendEquation(SDL_BlendOperation operation)
static SDL_bool
GL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
{
- GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode);
SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode);
SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode);
diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c
index ebd1e92..07bef55 100644
--- a/src/render/opengles2/SDL_render_gles2.c
+++ b/src/render/opengles2/SDL_render_gles2.c
@@ -416,7 +416,6 @@ static GLenum GetBlendEquation(SDL_BlendOperation operation)
static SDL_bool
GLES2_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
{
- GLES2_DriverContext *data = (GLES2_DriverContext *) renderer->driverdata;
SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode);
SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode);
SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode);