Fixed warnings in -pedantic mode
authorSam Lantinga <slouken@libsdl.org>
Sun, 26 Feb 2006 05:02:14 +0000
changeset 14394d3bb026cd16
parent 1438 1f4f09641645
child 1440 ae78374ac894
Fixed warnings in -pedantic mode
test/testdyngl.c
test/testgl.c
test/testoverlay.c
test/testoverlay2.c
test/testsem.c
     1.1 --- a/test/testdyngl.c	Sun Feb 26 04:54:01 2006 +0000
     1.2 +++ b/test/testdyngl.c	Sun Feb 26 05:02:14 2006 +0000
     1.3 @@ -42,6 +42,7 @@
     1.4  		printf("Unable to get function pointer for %s\n",p);
     1.5  		quit(1);
     1.6  	}
     1.7 +	return NULL;
     1.8  }
     1.9  
    1.10  typedef struct
     2.1 --- a/test/testgl.c	Sun Feb 26 04:54:01 2006 +0000
     2.2 +++ b/test/testgl.c	Sun Feb 26 05:02:14 2006 +0000
     2.3 @@ -245,8 +245,6 @@
     2.4  	static int w, h;
     2.5  	int x, y;
     2.6  
     2.7 -	SDL_Surface *screen = SDL_GetVideoSurface();
     2.8 -
     2.9  	if ( ! cursor_texture ) {
    2.10  		SDL_Surface *image;
    2.11  		GLfloat texcoord[4];
    2.12 @@ -303,7 +301,6 @@
    2.13  	static int w, h;
    2.14  	static int delta_x = 1;
    2.15  	static int delta_y = 1;
    2.16 -	static Uint32 last_moved = 0;
    2.17  
    2.18  	SDL_Surface *screen = SDL_GetVideoSurface();
    2.19  
    2.20 @@ -377,7 +374,6 @@
    2.21  	static int w, h;
    2.22  	static int delta_x = 1;
    2.23  	static int delta_y = 1;
    2.24 -	static Uint32 last_moved = 0;
    2.25  
    2.26  	SDL_Rect dst;
    2.27  	SDL_Surface *screen = SDL_GetVideoSurface();
    2.28 @@ -657,7 +653,7 @@
    2.29  			glVertex3fv(cube[2]);
    2.30  			glColor3fv(color[7]);
    2.31  			glVertex3fv(cube[7]);
    2.32 -#else // flat cube
    2.33 +#else /* flat cube */
    2.34  			glColor3f(1.0, 0.0, 0.0);
    2.35  			glVertex3fv(cube[0]);
    2.36  			glVertex3fv(cube[1]);
    2.37 @@ -767,7 +763,7 @@
    2.38  
    2.39  int main(int argc, char *argv[])
    2.40  {
    2.41 -	int i, logo, logocursor;
    2.42 +	int i, logo, logocursor = 0;
    2.43  	int numtests;
    2.44  	int bpp = 0;
    2.45  	int slowly;
     3.1 --- a/test/testoverlay.c	Sun Feb 26 04:54:01 2006 +0000
     3.2 +++ b/test/testoverlay.c	Sun Feb 26 05:02:14 2006 +0000
     3.3 @@ -34,8 +34,6 @@
     3.4  
     3.5  void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
     3.6  {
     3.7 -    int i;
     3.8 -
     3.9      if (monochrome)
    3.10      {
    3.11  #if 1 /* these are the two formulas that I found on the FourCC site... */
    3.12 @@ -80,7 +78,7 @@
    3.13      */
    3.14  }
    3.15  
    3.16 -ConvertRGBtoYV12(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.17 +void ConvertRGBtoYV12(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.18  {
    3.19  	int x,y;
    3.20  	int yuv[3];
    3.21 @@ -120,7 +118,7 @@
    3.22  	SDL_UnlockSurface(s);
    3.23  }
    3.24  
    3.25 -ConvertRGBtoIYUV(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.26 +void ConvertRGBtoIYUV(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.27  {
    3.28  	int x,y;
    3.29  	int yuv[3];
    3.30 @@ -160,7 +158,7 @@
    3.31  	SDL_UnlockSurface(s);
    3.32  }
    3.33  
    3.34 -ConvertRGBtoUYVY(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.35 +void ConvertRGBtoUYVY(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.36  {
    3.37  	int x,y;
    3.38  	int yuv[3];
    3.39 @@ -193,7 +191,7 @@
    3.40  	SDL_UnlockSurface(s);
    3.41  }
    3.42  
    3.43 -ConvertRGBtoYVYU(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.44 +void ConvertRGBtoYVYU(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.45  {
    3.46  	int x,y;
    3.47  	int yuv[3];
    3.48 @@ -229,7 +227,7 @@
    3.49  	SDL_UnlockSurface(s);
    3.50  }
    3.51  
    3.52 -ConvertRGBtoYUY2(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.53 +void ConvertRGBtoYUY2(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    3.54  {
    3.55  	int x,y;
    3.56  	int yuv[3];
     4.1 --- a/test/testoverlay2.c	Sun Feb 26 04:54:01 2006 +0000
     4.2 +++ b/test/testoverlay2.c	Sun Feb 26 05:02:14 2006 +0000
     4.3 @@ -57,8 +57,6 @@
     4.4  
     4.5  void RGBtoYUV(Uint8 *rgb, int *yuv, int monochrome, int luminance)
     4.6  {
     4.7 -    int i;
     4.8 -
     4.9      if (monochrome)
    4.10      {
    4.11  #if 1 /* these are the two formulas that I found on the FourCC site... */
    4.12 @@ -92,7 +90,7 @@
    4.13      }
    4.14  }
    4.15  
    4.16 -ConvertRGBtoYV12(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.17 +void ConvertRGBtoYV12(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.18  {
    4.19  	int x,y;
    4.20  	int yuv[3];
    4.21 @@ -125,7 +123,7 @@
    4.22  	SDL_UnlockSurface(s);
    4.23  }
    4.24  
    4.25 -ConvertRGBtoIYUV(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.26 +void ConvertRGBtoIYUV(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.27  {
    4.28  	int x,y;
    4.29  	int yuv[3];
    4.30 @@ -158,7 +156,7 @@
    4.31  	SDL_UnlockSurface(s);
    4.32  }
    4.33  
    4.34 -ConvertRGBtoUYVY(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.35 +void ConvertRGBtoUYVY(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.36  {
    4.37  	int x,y;
    4.38  	int yuv[3];
    4.39 @@ -191,7 +189,7 @@
    4.40  	SDL_UnlockSurface(s);
    4.41  }
    4.42  
    4.43 -ConvertRGBtoYVYU(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.44 +void ConvertRGBtoYVYU(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.45  {
    4.46  	int x,y;
    4.47  	int yuv[3];
    4.48 @@ -227,7 +225,7 @@
    4.49  	SDL_UnlockSurface(s);
    4.50  }
    4.51  
    4.52 -ConvertRGBtoYUY2(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.53 +void ConvertRGBtoYUY2(SDL_Surface *s, SDL_Overlay *o, int monochrome, int luminance)
    4.54  {
    4.55  	int x,y;
    4.56  	int yuv[3];
    4.57 @@ -416,7 +414,7 @@
    4.58      /* Set video mode */
    4.59      if ( (screen=SDL_SetVideoMode(MOOSEPIC_W*scale, MOOSEPIC_H*scale, 0, SDL_RESIZABLE | SDL_SWSURFACE)) == NULL )
    4.60      {
    4.61 -        fprintf(stderr, "Couldn't set video mode: %s\n", 0, SDL_GetError());
    4.62 +        fprintf(stderr, "Couldn't set video mode: %s\n", SDL_GetError());
    4.63          free(RawMooseData);
    4.64          quit(4);
    4.65      }
    4.66 @@ -430,7 +428,7 @@
    4.67                                                 MOOSEPIC_H, 8, MOOSEPIC_W, 0, 0, 0, 0);
    4.68          if (MooseFrame[i]==NULL)
    4.69          {
    4.70 -            fprintf(stderr, "Couldn't create SDL_Surfaces:%s\n", 0, SDL_GetError());
    4.71 +            fprintf(stderr, "Couldn't create SDL_Surfaces:%s\n", SDL_GetError());
    4.72              free(RawMooseData);
    4.73              quit(5);
    4.74          }
     5.1 --- a/test/testsem.c	Sun Feb 26 04:54:01 2006 +0000
     5.2 +++ b/test/testsem.c	Sun Feb 26 05:02:14 2006 +0000
     5.3 @@ -13,13 +13,6 @@
     5.4  static SDL_sem *sem;
     5.5  int alive = 1;
     5.6  
     5.7 -/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
     5.8 -static void quit(int rc)
     5.9 -{
    5.10 -	SDL_Quit();
    5.11 -	exit(rc);
    5.12 -}
    5.13 -
    5.14  int ThreadFunc(void *data)
    5.15  {
    5.16  	while ( alive ) {