From 59224fd9cb5b78d48a1448854932d6b4bef5001d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 4 Oct 2009 09:55:20 +0000 Subject: [PATCH] Fixed bug #817 Daniele Forghieri 2009-09-30 15:48:24 PDT Some tests doesn't use the correct include statement (and there are some missing declaration) and some test use C++ variable after statement, preventing compile wicth Open Watcom The patch attached fixes this --- test/testatomic.c | 5 +++-- test/testaudioinfo.c | 1 + test/testhaptic.c | 1 + test/testime.c | 10 +++++----- test/testloadso.c | 3 ++- test/testsprite.c | 2 ++ test/testwm2.c | 2 ++ 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/test/testatomic.c b/test/testatomic.c index 48e3e8736..bd9873408 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -1,3 +1,4 @@ +#include #include "SDL.h" /* Make sure we have good macros for printing 32 and 64 bit values */ @@ -17,7 +18,7 @@ after calling each function. */ -char * +char * tf(SDL_bool tf) { static char *t = "true"; @@ -30,7 +31,7 @@ tf(SDL_bool tf) return f; } - + int main(int argc, char *argv[]) { diff --git a/test/testaudioinfo.c b/test/testaudioinfo.c index 4ae0089d0..ecfaaa680 100644 --- a/test/testaudioinfo.c +++ b/test/testaudioinfo.c @@ -1,3 +1,4 @@ +#include #include "SDL.h" static void diff --git a/test/testhaptic.c b/test/testhaptic.c index 079f2b101..34975117c 100644 --- a/test/testhaptic.c +++ b/test/testhaptic.c @@ -14,6 +14,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND /* * includes */ +#include #include "SDL.h" #include "SDL_haptic.h" diff --git a/test/testime.c b/test/testime.c index c9f6a53a7..7a9cc2bb2 100644 --- a/test/testime.c +++ b/test/testime.c @@ -1,5 +1,5 @@ /* A simple program to test the Input Method support in the SDL library (1.3+) */ - + #include #include #include @@ -8,7 +8,7 @@ #ifdef HAVE_SDL_TTF #include "SDL_ttf.h" #endif - + #define DEFAULT_PTSIZE 30 #define DEFAULT_FONT "/System/Library/Fonts/华文细黑.ttf" #define MAX_TEXT_LENGTH 256 @@ -210,13 +210,13 @@ HotKey_ToggleFullScreen(void) int main(int argc, char *argv[]) { + SDL_Event event; + int done = 0; + InitVideo(argc, argv); InitInput(); Redraw(); - SDL_Event event; - int done = 0; - while (! done && SDL_WaitEvent(&event)) { switch (event.type) diff --git a/test/testloadso.c b/test/testloadso.c index 6eda3eace..d0e129879 100644 --- a/test/testloadso.c +++ b/test/testloadso.c @@ -1,9 +1,10 @@ -/* Test program to test dynamic loading with the loadso subsystem. +/* Test program to test dynamic loading with the loadso subsystem. */ #include #include +#include #include "SDL.h" diff --git a/test/testsprite.c b/test/testsprite.c index 1937bda0d..6a740724b 100644 --- a/test/testsprite.c +++ b/test/testsprite.c @@ -2,6 +2,8 @@ #include #include +#include +#include #include #include diff --git a/test/testwm2.c b/test/testwm2.c index 36ff75812..5e41a9e8f 100644 --- a/test/testwm2.c +++ b/test/testwm2.c @@ -52,6 +52,8 @@ main(int argc, char *argv[]) } } quit(0); + // keep the compiler happy ... + return(0); } /* vi: set ts=4 sw=4 expandtab: */