Fix various warnings for uninitialized or unused variables and functions SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Fri, 26 Aug 2011 14:37:39 +0200
branchSDL-1.2
changeset 564902ab15cfa992
parent 5648 0d28cf898765
child 5651 abba6814a65c
Fix various warnings for uninitialized or unused variables and functions
src/audio/mint/SDL_mintaudio_gsxb.c
src/audio/mint/SDL_mintaudio_mcsn.c
src/audio/mint/SDL_mintaudio_stfa.c
src/audio/mint/SDL_mintaudio_xbios.c
src/video/ataricommon/SDL_atarigl.c
src/video/ataricommon/SDL_biosevents.c
src/video/ataricommon/SDL_gemdosevents.c
src/video/ataricommon/SDL_ikbdevents.c
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemmouse.c
src/video/gem/SDL_gemvideo.c
src/video/xbios/SDL_xbios.c
src/video/xbios/SDL_xbios_tveille.c
     1.1 --- a/src/audio/mint/SDL_mintaudio_gsxb.c	Fri Aug 26 03:39:54 2011 -0400
     1.2 +++ b/src/audio/mint/SDL_mintaudio_gsxb.c	Fri Aug 26 14:37:39 2011 +0200
     1.3 @@ -199,7 +199,7 @@
     1.4  
     1.5  static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
     1.6  {
     1.7 -	long snd_format;
     1.8 +	long snd_format = 0;
     1.9  	int i, resolution, format_signed, format_bigendian;
    1.10      Uint16 test_format = SDL_FirstAudioFormat(spec->format);
    1.11      int valid_datatype = 0;
     2.1 --- a/src/audio/mint/SDL_mintaudio_mcsn.c	Fri Aug 26 03:39:54 2011 -0400
     2.2 +++ b/src/audio/mint/SDL_mintaudio_mcsn.c	Fri Aug 26 14:37:39 2011 +0200
     2.3 @@ -112,10 +112,11 @@
     2.4  	}
     2.5  
     2.6  	/* Cookie MCSN present ? */
     2.7 -	if (Getcookie(C_McSn, (long *) &cookie_mcsn) != C_FOUND) {
     2.8 +	if (Getcookie(C_McSn, &dummy) != C_FOUND) {
     2.9  		DEBUG_PRINT((DEBUG_NAME "no MCSN audio\n"));
    2.10  		return(0);
    2.11  	}
    2.12 +	cookie_mcsn = (cookie_mcsn_t *) dummy;
    2.13  
    2.14  	/* Check if interrupt at end of replay */
    2.15  	if (cookie_mcsn->pint == 0) {
     3.1 --- a/src/audio/mint/SDL_mintaudio_stfa.c	Fri Aug 26 03:39:54 2011 -0400
     3.2 +++ b/src/audio/mint/SDL_mintaudio_stfa.c	Fri Aug 26 14:37:39 2011 +0200
     3.3 @@ -84,6 +84,7 @@
     3.4  
     3.5  static int Audio_Available(void)
     3.6  {
     3.7 +	unsigned long dummy;
     3.8  	const char *envr = SDL_getenv("SDL_AUDIODRIVER");
     3.9  
    3.10  	/* Check if user asked a different audio driver */
    3.11 @@ -103,10 +104,11 @@
    3.12  	}
    3.13  
    3.14  	/* Cookie STFA present ? */
    3.15 -	if (Getcookie(C_STFA, (long *) &cookie_stfa) != C_FOUND) {
    3.16 +	if (Getcookie(C_STFA, &dummy) != C_FOUND) {
    3.17  		DEBUG_PRINT((DEBUG_NAME "no STFA audio\n"));
    3.18  		return(0);
    3.19  	}
    3.20 +	cookie_stfa = (cookie_stfa_t *) dummy;
    3.21  
    3.22  	SDL_MintAudio_stfa = cookie_stfa;
    3.23  
     4.1 --- a/src/audio/mint/SDL_mintaudio_xbios.c	Fri Aug 26 03:39:54 2011 -0400
     4.2 +++ b/src/audio/mint/SDL_mintaudio_xbios.c	Fri Aug 26 14:37:39 2011 +0200
     4.3 @@ -79,7 +79,7 @@
     4.4  
     4.5  static int Audio_Available(void)
     4.6  {
     4.7 -	unsigned long dummy;
     4.8 +/*	unsigned long dummy;*/
     4.9  	const char *envr = SDL_getenv("SDL_AUDIODRIVER");
    4.10  
    4.11  	/*SDL_MintAudio_mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);*/
    4.12 @@ -104,7 +104,7 @@
    4.13  	/* Check if we have 16 bits audio */
    4.14  	if ((cookie_snd & SND_16BIT)==0) {
    4.15  		DEBUG_PRINT((DEBUG_NAME "no 16 bits sound\n"));
    4.16 -	    return(0);
    4.17 +		return(0);
    4.18  	}
    4.19  
    4.20  	/* Check if audio is lockable */
    4.21 @@ -334,7 +334,6 @@
    4.22  static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec)
    4.23  {
    4.24  	int i;
    4.25 -	Uint32 extclock;
    4.26  
    4.27  	DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",spec->format & 0x00ff));
    4.28  	DEBUG_PRINT(("signed=%d, ", ((spec->format & 0x8000)!=0)));
     5.1 --- a/src/video/ataricommon/SDL_atarigl.c	Fri Aug 26 03:39:54 2011 -0400
     5.2 +++ b/src/video/ataricommon/SDL_atarigl.c	Fri Aug 26 14:37:39 2011 +0200
     5.3 @@ -48,9 +48,9 @@
     5.4  
     5.5  /*--- Functions prototypes ---*/
     5.6  
     5.7 +#if SDL_VIDEO_OPENGL
     5.8  static void SDL_AtariGL_UnloadLibrary(_THIS);
     5.9  
    5.10 -#if SDL_VIDEO_OPENGL
    5.11  static void CopyShadowNull(_THIS, SDL_Surface *surface);
    5.12  static void CopyShadowDirect(_THIS, SDL_Surface *surface);
    5.13  static void CopyShadowRGBTo555(_THIS, SDL_Surface *surface);
    5.14 @@ -389,9 +389,9 @@
    5.15  
    5.16  /*--- Private functions ---*/
    5.17  
    5.18 +#if SDL_VIDEO_OPENGL
    5.19  static void SDL_AtariGL_UnloadLibrary(_THIS)
    5.20  {
    5.21 -#if SDL_VIDEO_OPENGL
    5.22  	if (this->gl_config.dll_handle) {
    5.23  		SDL_UnloadObject(this->gl_config.dll_handle);
    5.24  		this->gl_config.dll_handle = NULL;
    5.25 @@ -399,12 +399,10 @@
    5.26  		/* Restore pointers to static library */
    5.27  		SDL_AtariGL_InitPointers(this);
    5.28  	}
    5.29 -#endif
    5.30  }
    5.31  
    5.32  /*--- Creation of an OpenGL context using new/old functions ---*/
    5.33  
    5.34 -#if SDL_VIDEO_OPENGL
    5.35  static int InitNew(_THIS, SDL_Surface *current)
    5.36  {
    5.37  	GLenum osmesa_format;
     6.1 --- a/src/video/ataricommon/SDL_biosevents.c	Fri Aug 26 03:39:54 2011 -0400
     6.2 +++ b/src/video/ataricommon/SDL_biosevents.c	Fri Aug 26 14:37:39 2011 +0200
     6.3 @@ -47,8 +47,8 @@
     6.4  
     6.5  void AtariBios_InitOSKeymap(_THIS)
     6.6  {
     6.7 -	int i, vectors_mask;
     6.8 -	unsigned long dummy;
     6.9 +	int vectors_mask;
    6.10 +/*	unsigned long dummy;*/
    6.11  
    6.12  	SDL_memset(bios_currentkeyboard, 0, sizeof(bios_currentkeyboard));
    6.13  	SDL_memset(bios_previouskeyboard, 0, sizeof(bios_previouskeyboard));
     7.1 --- a/src/video/ataricommon/SDL_gemdosevents.c	Fri Aug 26 03:39:54 2011 -0400
     7.2 +++ b/src/video/ataricommon/SDL_gemdosevents.c	Fri Aug 26 14:37:39 2011 +0200
     7.3 @@ -56,8 +56,8 @@
     7.4  
     7.5  void AtariGemdos_InitOSKeymap(_THIS)
     7.6  {
     7.7 -	int i, vectors_mask;
     7.8 -	unsigned long dummy;
     7.9 +	int vectors_mask;
    7.10 +/*	unsigned long dummy;*/
    7.11  
    7.12  	SDL_memset(gemdos_currentkeyboard, 0, sizeof(gemdos_currentkeyboard));
    7.13  	SDL_memset(gemdos_previouskeyboard, 0, sizeof(gemdos_previouskeyboard));
     8.1 --- a/src/video/ataricommon/SDL_ikbdevents.c	Fri Aug 26 03:39:54 2011 -0400
     8.2 +++ b/src/video/ataricommon/SDL_ikbdevents.c	Fri Aug 26 14:37:39 2011 +0200
     8.3 @@ -45,9 +45,7 @@
     8.4  
     8.5  void AtariIkbd_InitOSKeymap(_THIS)
     8.6  {
     8.7 -	int i;
     8.8 -
     8.9 -	SDL_memset(SDL_AtariIkbd_keyboard, KEY_UNDEFINED, sizeof(SDL_AtariIkbd_keyboard));
    8.10 +	SDL_memset((void *) SDL_AtariIkbd_keyboard, KEY_UNDEFINED, sizeof(SDL_AtariIkbd_keyboard));
    8.11  
    8.12  	/* Now install our handler */
    8.13  	SDL_AtariIkbd_mouseb = SDL_AtariIkbd_mousex = SDL_AtariIkbd_mousey = 0;
    8.14 @@ -72,7 +70,7 @@
    8.15  
    8.16  void AtariIkbd_PumpEvents(_THIS)
    8.17  {
    8.18 -	int i, specialkeys;
    8.19 +	int i;
    8.20  	SDL_keysym keysym;
    8.21  
    8.22  	/*--- Send keyboard events ---*/
     9.1 --- a/src/video/gem/SDL_gemevents.c	Fri Aug 26 03:39:54 2011 -0400
     9.2 +++ b/src/video/gem/SDL_gemevents.c	Fri Aug 26 14:37:39 2011 +0200
     9.3 @@ -36,6 +36,7 @@
     9.4  #include "../../events/SDL_events_c.h"
     9.5  #include "SDL_gemvideo.h"
     9.6  #include "SDL_gemevents_c.h"
     9.7 +#include "SDL_gemmouse_c.h"
     9.8  #include "../ataricommon/SDL_atarikeys.h"	/* for keyboard scancodes */
     9.9  #include "../ataricommon/SDL_atarievents_c.h"
    9.10  #include "../ataricommon/SDL_xbiosevents_c.h"
    10.1 --- a/src/video/gem/SDL_gemmouse.c	Fri Aug 26 03:39:54 2011 -0400
    10.2 +++ b/src/video/gem/SDL_gemmouse.c	Fri Aug 26 14:37:39 2011 +0200
    10.3 @@ -34,6 +34,7 @@
    10.4  #include "../SDL_cursor_c.h"
    10.5  #include "SDL_gemmouse_c.h"
    10.6  #include "SDL_gemvideo.h"
    10.7 +#include "../ataricommon/SDL_xbiosevents_c.h"
    10.8  
    10.9  /* Defines */
   10.10  
    11.1 --- a/src/video/gem/SDL_gemvideo.c	Fri Aug 26 03:39:54 2011 -0400
    11.2 +++ b/src/video/gem/SDL_gemvideo.c	Fri Aug 26 14:37:39 2011 +0200
    11.3 @@ -129,7 +129,7 @@
    11.4  {
    11.5  	SDL_VideoDevice *device;
    11.6  	int vectors_mask;
    11.7 -	unsigned long dummy;
    11.8 +/*	unsigned long dummy;*/
    11.9  
   11.10  	/* Initialize all variables that we clean on shutdown */
   11.11  	device = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice));
    12.1 --- a/src/video/xbios/SDL_xbios.c	Fri Aug 26 03:39:54 2011 -0400
    12.2 +++ b/src/video/xbios/SDL_xbios.c	Fri Aug 26 14:37:39 2011 +0200
    12.3 @@ -138,7 +138,7 @@
    12.4  
    12.5  static int XBIOS_Available(void)
    12.6  {
    12.7 -	unsigned long cookie_vdo, cookie_mil, cookie_hade, cookie_scpn;
    12.8 +	unsigned long cookie_vdo, /*cookie_mil,*/ cookie_hade, cookie_scpn;
    12.9  	unsigned long cookie_fvdi;
   12.10  	const char *envr = SDL_getenv("SDL_VIDEODRIVER");
   12.11  
   12.12 @@ -361,8 +361,7 @@
   12.13  
   12.14  static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
   12.15  {
   12.16 -	int i,j8,j16;
   12.17 -	xbiosmode_t *current_mode;
   12.18 +	int i;
   12.19  	unsigned long cookie_blow, cookie_scpn, cookie_cnts;
   12.20  
   12.21  	/* Initialize all variables that we clean on shutdown */
   12.22 @@ -1101,7 +1100,7 @@
   12.23  
   12.24  	/* Restore screensavers */
   12.25  	if (SDL_XBIOS_TveillePresent(this)) {
   12.26 -		SDL_XBIOS_TveilleRestore(this);
   12.27 +		SDL_XBIOS_TveilleEnable(this);
   12.28  	}
   12.29  }
   12.30  
    13.1 --- a/src/video/xbios/SDL_xbios_tveille.c	Fri Aug 26 03:39:54 2011 -0400
    13.2 +++ b/src/video/xbios/SDL_xbios_tveille.c	Fri Aug 26 14:37:39 2011 +0200
    13.3 @@ -32,21 +32,32 @@
    13.4  #include "SDL_xbios.h"
    13.5  #include "SDL_xbios_tveille.h"
    13.6  
    13.7 -static tveille_t *cookie_veil;
    13.8 +static tveille_t *cookie_veil = NULL;
    13.9  static int status;
   13.10  
   13.11  int SDL_XBIOS_TveillePresent(_THIS)
   13.12  {
   13.13 -	return (Getcookie(C_VeiL, (unsigned long *)&cookie_veil) == C_FOUND);
   13.14 +	unsigned long dummy;
   13.15 +
   13.16 +	cookie_veil = NULL;
   13.17 +	if (Getcookie(C_VeiL, &dummy) == C_FOUND) {
   13.18 +		cookie_veil = (tveille_t *) dummy;
   13.19 +	}
   13.20 +
   13.21 +	return (cookie_veil != NULL);
   13.22  }
   13.23  
   13.24  void SDL_XBIOS_TveilleDisable(_THIS)
   13.25  {
   13.26 -	status = cookie_veil->enabled;
   13.27 -	cookie_veil->enabled = 0xff;
   13.28 +	if (cookie_veil) {
   13.29 +		status = cookie_veil->enabled;
   13.30 +		cookie_veil->enabled = 0xff;
   13.31 +	}
   13.32  }
   13.33  
   13.34 -void SDL_XBIOS_TveilleRestore(_THIS)
   13.35 +void SDL_XBIOS_TveilleEnable(_THIS)
   13.36  {
   13.37 -	cookie_veil->enabled = status;
   13.38 +	if (cookie_veil) {
   13.39 +		cookie_veil->enabled = status;
   13.40 +	}
   13.41  }