1
0
Fork 0
forked from len0rd/rockbox

SDL: Silence a large number of compile warnings (WIP)

There are some real bugs in here, but we're drowning in warnings.

Change-Id: I7c2c0eafc8426327521bdd8a3ac2d3742ac16864
This commit is contained in:
Solomon Peachy 2020-04-04 20:24:33 -04:00
parent 2ad6c3438e
commit e28d1fe916
44 changed files with 424 additions and 395 deletions

View file

@ -125,7 +125,7 @@ static int MS_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
encoded_len = *audio_len;
encoded = *audio_buf;
freeable = *audio_buf;
*audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) *
*audio_len = (encoded_len/MS_ADPCM_state.wavefmt.blockalign) *
MS_ADPCM_state.wSamplesPerBlock*
MS_ADPCM_state.wavefmt.channels*sizeof(Sint16);
*audio_buf = (Uint8 *)SDL_malloc(*audio_len);
@ -340,7 +340,7 @@ static int IMA_ADPCM_decode(Uint8 **audio_buf, Uint32 *audio_len)
encoded_len = *audio_len;
encoded = *audio_buf;
freeable = *audio_buf;
*audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) *
*audio_len = (encoded_len/IMA_ADPCM_state.wavefmt.blockalign) *
IMA_ADPCM_state.wSamplesPerBlock*
IMA_ADPCM_state.wavefmt.channels*sizeof(Sint16);
*audio_buf = (Uint8 *)SDL_malloc(*audio_len);
@ -413,7 +413,9 @@ SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc,
was_error = 1;
goto done;
}
chunk.data = NULL;
chunk.length = 0;
/* Check the magic header */
RIFFchunk = SDL_ReadLE32(src);
wavelen = SDL_ReadLE32(src);
@ -432,7 +434,6 @@ SDL_AudioSpec * SDL_LoadWAV_RW (SDL_RWops *src, int freesrc,
headerDiff += sizeof(Uint32); /* for WAVE */
/* Read the audio data format chunk */
chunk.data = NULL;
do {
if ( chunk.data != NULL ) {
SDL_free(chunk.data);

View file

@ -29,10 +29,10 @@
/* Math routines from uClibc: http://www.uclibc.org */
#include "math_private.h"
#include "e_sqrt.h"
#include "e_pow.h"
#include "e_log.h"
#define pow(x, y) __ieee754_pow(x, y)
#define log(x) __ieee754_log(x)
//#include "e_pow.h"
//#include "e_log.h"
//#define pow(x, y) __ieee754_pow(x, y)
//#define log(x) __ieee754_log(x)
#endif
#include "SDL_sysvideo.h"
@ -94,7 +94,7 @@ int SDL_SetGamma(float red, float green, float blue)
{
int succeeded;
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
SDL_VideoDevice *this = current_video;
succeeded = -1;
/* Prefer using SetGammaRamp(), as it's more flexible */
@ -120,7 +120,7 @@ int SDL_GetGamma(float *red, float *green, float *blue)
{
int succeeded;
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
SDL_VideoDevice *this = current_video;
succeeded = -1;
/* Prefer using GetGammaRamp(), as it's more flexible */
@ -145,7 +145,7 @@ int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
{
int succeeded;
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
SDL_VideoDevice *this = current_video;
SDL_Surface *screen = SDL_PublicSurface;
/* Verify the screen parameter */
@ -177,7 +177,7 @@ int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
/* If physical palette has been set independently, use it */
if(video->physpal)
pal = video->physpal;
SDL_SetPalette(screen, SDL_PHYSPAL,
pal->colors, 0, pal->ncolors);
return 0;
@ -196,7 +196,7 @@ int SDL_SetGammaRamp(const Uint16 *red, const Uint16 *green, const Uint16 *blue)
int SDL_GetGammaRamp(Uint16 *red, Uint16 *green, Uint16 *blue)
{
SDL_VideoDevice *video = current_video;
SDL_VideoDevice *this = current_video;
SDL_VideoDevice *this = current_video;
/* Lazily allocate the gamma table */
if ( ! video->gamma ) {