[Commits] SDL: Fixed compile warnings about unused variables in IME test p...

libsdl.org revision control commits-owner at libsdl.org
Thu Mar 3 11:18:55 PST 2016


details:   https://hg.libsdl.org/SDL/rev/a18ec339c8d3
changeset: 10100:a18ec339c8d3
user:      Philipp Wiesemann <philipp.wiesemann at arcor.de>
date:      Thu Mar 03 20:11:43 2016 +0100
description:
Fixed compile warnings about unused variables in IME test program.

diffstat:

 test/testime.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r c7932bb6dcee -r a18ec339c8d3 test/testime.c
--- a/test/testime.c	Wed Mar 02 20:25:23 2016 +0100
+++ b/test/testime.c	Thu Mar 03 20:11:43 2016 +0100
@@ -29,8 +29,10 @@
 static SDLTest_CommonState *state;
 static SDL_Rect textRect, markedRect;
 static SDL_Color lineColor = {0,0,0,0};
-static SDL_Color backColor = {255,255,255,0};
+static SDL_Color backColor = {255,255,255,255};
+#ifdef HAVE_SDL_TTF
 static SDL_Color textColor = {0,0,0,0};
+#endif
 static char text[MAX_TEXT_LENGTH], markedText[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
 static int cursor = 0;
 #ifdef HAVE_SDL_TTF
@@ -113,7 +115,7 @@
     int w = 0, h = textRect.h;
     SDL_Rect cursorRect, underlineRect;
 
-    SDL_SetRenderDrawColor(renderer, 255,255,255,255);
+    SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a);
     SDL_RenderFillRect(renderer,&textRect);
 
 #ifdef HAVE_SDL_TTF
@@ -148,7 +150,7 @@
     cursorRect.w = 2;
     cursorRect.h = h;
 
-    SDL_SetRenderDrawColor(renderer, 255,255,255,255);
+    SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a);
     SDL_RenderFillRect(renderer,&markedRect);
 
     if (markedText[0])
@@ -182,11 +184,11 @@
         underlineRect.h = 2;
         underlineRect.w = w;
 
-        SDL_SetRenderDrawColor(renderer, 0,0,0,0);
+        SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a);
         SDL_RenderFillRect(renderer,&markedRect);
     }
 
-    SDL_SetRenderDrawColor(renderer, 0,0,0,0);
+    SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a);
     SDL_RenderFillRect(renderer,&cursorRect);
 
     SDL_SetTextInputRect(&markedRect);


More information about the commits mailing list