Fixed bug #817
authorSam Lantinga <slouken@libsdl.org>
Sun, 04 Oct 2009 09:55:20 +0000
changeset 33389de326b3099c
parent 3337 9ac6f0782dd6
child 3339 62d208fd5f49
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
test/testaudioinfo.c
test/testhaptic.c
test/testime.c
test/testloadso.c
test/testsprite.c
test/testwm2.c
     1.1 --- a/test/testatomic.c	Sun Oct 04 09:51:04 2009 +0000
     1.2 +++ b/test/testatomic.c	Sun Oct 04 09:55:20 2009 +0000
     1.3 @@ -1,3 +1,4 @@
     1.4 +#include <stdio.h>
     1.5  #include "SDL.h"
     1.6  
     1.7  /* Make sure we have good macros for printing 32 and 64 bit values */
     1.8 @@ -17,7 +18,7 @@
     1.9    after calling each function.
    1.10  */
    1.11  
    1.12 -char * 
    1.13 +char *
    1.14  tf(SDL_bool tf)
    1.15  {
    1.16     static char *t = "true";
    1.17 @@ -30,7 +31,7 @@
    1.18  
    1.19     return f;
    1.20  }
    1.21 -  
    1.22 +
    1.23  int
    1.24  main(int argc, char *argv[])
    1.25  {
     2.1 --- a/test/testaudioinfo.c	Sun Oct 04 09:51:04 2009 +0000
     2.2 +++ b/test/testaudioinfo.c	Sun Oct 04 09:55:20 2009 +0000
     2.3 @@ -1,3 +1,4 @@
     2.4 +#include <stdio.h>
     2.5  #include "SDL.h"
     2.6  
     2.7  static void
     3.1 --- a/test/testhaptic.c	Sun Oct 04 09:51:04 2009 +0000
     3.2 +++ b/test/testhaptic.c	Sun Oct 04 09:55:20 2009 +0000
     3.3 @@ -14,6 +14,7 @@
     3.4  /*
     3.5   * includes
     3.6   */
     3.7 +#include <stdlib.h>
     3.8  #include "SDL.h"
     3.9  #include "SDL_haptic.h"
    3.10  
     4.1 --- a/test/testime.c	Sun Oct 04 09:51:04 2009 +0000
     4.2 +++ b/test/testime.c	Sun Oct 04 09:55:20 2009 +0000
     4.3 @@ -1,5 +1,5 @@
     4.4  /* A simple program to test the Input Method support in the SDL library (1.3+) */
     4.5 - 
     4.6 +
     4.7  #include <stdlib.h>
     4.8  #include <stdio.h>
     4.9  #include <string.h>
    4.10 @@ -8,7 +8,7 @@
    4.11  #ifdef HAVE_SDL_TTF
    4.12  #include "SDL_ttf.h"
    4.13  #endif
    4.14 - 
    4.15 +
    4.16  #define DEFAULT_PTSIZE  30
    4.17  #define DEFAULT_FONT    "/System/Library/Fonts/华文细黑.ttf"
    4.18  #define MAX_TEXT_LENGTH 256
    4.19 @@ -210,13 +210,13 @@
    4.20  
    4.21  int main(int argc, char *argv[])
    4.22  {
    4.23 +    SDL_Event event;
    4.24 +    int done = 0;
    4.25 +
    4.26      InitVideo(argc, argv);
    4.27      InitInput();
    4.28      Redraw();
    4.29  
    4.30 -    SDL_Event event;
    4.31 -    int done = 0;
    4.32 -
    4.33      while (! done && SDL_WaitEvent(&event))
    4.34      {
    4.35          switch (event.type)
     5.1 --- a/test/testloadso.c	Sun Oct 04 09:51:04 2009 +0000
     5.2 +++ b/test/testloadso.c	Sun Oct 04 09:55:20 2009 +0000
     5.3 @@ -1,9 +1,10 @@
     5.4  
     5.5 -/* Test program to test dynamic loading with the loadso subsystem. 
     5.6 +/* Test program to test dynamic loading with the loadso subsystem.
     5.7  */
     5.8  
     5.9  #include <stdio.h>
    5.10  #include <stdlib.h>
    5.11 +#include <string.h>
    5.12  
    5.13  #include "SDL.h"
    5.14  
     6.1 --- a/test/testsprite.c	Sun Oct 04 09:51:04 2009 +0000
     6.2 +++ b/test/testsprite.c	Sun Oct 04 09:55:20 2009 +0000
     6.3 @@ -2,6 +2,8 @@
     6.4  
     6.5  #include <stdlib.h>
     6.6  #include <stdio.h>
     6.7 +#include <string.h>
     6.8 +#include <ctype.h>
     6.9  #include <time.h>
    6.10  #include <math.h>
    6.11  
     7.1 --- a/test/testwm2.c	Sun Oct 04 09:51:04 2009 +0000
     7.2 +++ b/test/testwm2.c	Sun Oct 04 09:55:20 2009 +0000
     7.3 @@ -52,6 +52,8 @@
     7.4          }
     7.5      }
     7.6      quit(0);
     7.7 +	// keep the compiler happy ...
     7.8 +	return(0);
     7.9  }
    7.10  
    7.11  /* vi: set ts=4 sw=4 expandtab: */