SDL: reduced a few ifdefs, fixed an unused warning if built w/o SDL_HAVE_YUV.

From bf698689242598b25352d2e59ebaa15dfad1dd2e Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Thu, 10 Mar 2022 01:55:04 +0300
Subject: [PATCH] reduced a few ifdefs, fixed an unused warning if built w/o
 SDL_HAVE_YUV.

---
 src/render/direct3d/SDL_render_d3d.c |  7 ++++---
 src/render/metal/SDL_render_metal.m  | 12 +++++-------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c
index 2bc61d6922d..b267fb23edc 100644
--- a/src/render/direct3d/SDL_render_d3d.c
+++ b/src/render/direct3d/SDL_render_d3d.c
@@ -670,10 +670,9 @@ D3D_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
             (void *) ((Uint8 *) texturedata->pixels + rect->y * texturedata->pitch +
                       rect->x * SDL_BYTESPERPIXEL(texture->format));
         *pitch = texturedata->pitch;
-    } else {
-#else
-    {
+    } else
 #endif
+    {
         RECT d3drect;
         D3DLOCKED_RECT locked;
         HRESULT result;
@@ -992,8 +991,10 @@ SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd)
     const SDL_BlendMode blend = cmd->data.draw.blend;
 
     if (texture != data->drawstate.texture) {
+#if SDL_HAVE_YUV
         D3D_TextureData *oldtexturedata = data->drawstate.texture ? (D3D_TextureData *) data->drawstate.texture->driverdata : NULL;
         D3D_TextureData *newtexturedata = texture ? (D3D_TextureData *) texture->driverdata : NULL;
+#endif
         LPDIRECT3DPIXELSHADER9 shader = NULL;
 
         /* disable any enabled textures we aren't going to use, let SetupTextureState() do the rest. */
diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m
index cd6ab699d27..4e51a6d4ea2 100644
--- a/src/render/metal/SDL_render_metal.m
+++ b/src/render/metal/SDL_render_metal.m
@@ -606,7 +606,7 @@ - (void)dealloc
             mtltexdesc.usage = MTLTextureUsageShaderRead;
         }
     }
-    
+
     id<MTLTexture> mtltexture = [data.mtldevice newTextureWithDescriptor:mtltexdesc];
     if (mtltexture == nil) {
         return SDL_SetError("Texture allocation failed");
@@ -657,10 +657,9 @@ - (void)dealloc
         texturedata.fragmentFunction = SDL_METAL_FRAGMENT_NV12;
     } else if (texture->format == SDL_PIXELFORMAT_NV21) {
         texturedata.fragmentFunction = SDL_METAL_FRAGMENT_NV21;
-    } else {
-#else
+    } else
+#endif
     {
-#endif /* SDL_HAVE_YUV*/
         texturedata.fragmentFunction = SDL_METAL_FRAGMENT_COPY;
     }
 #if SDL_HAVE_YUV
@@ -903,10 +902,9 @@ - (void)dealloc
 #if SDL_HAVE_YUV
     if (texturedata.yuv || texturedata.nv12) {
         buffersize = ((*pitch) * rect->h) + (2 * (*pitch + 1) / 2) * ((rect->h + 1) / 2);
-    } else {
-#else
-    {
+    } else
 #endif
+    {
         buffersize = (*pitch) * rect->h;
     }