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

@ -60,15 +60,15 @@ const SDL_version *IMG_Linked_Version(void)
return(&linked_version);
}
extern int IMG_InitJPG();
extern void IMG_QuitJPG();
extern int IMG_InitPNG();
extern void IMG_QuitPNG();
extern int IMG_InitTIF();
extern void IMG_QuitTIF();
extern int IMG_InitJPG(void);
extern void IMG_QuitJPG(void);
extern int IMG_InitPNG(void);
extern void IMG_QuitPNG(void);
extern int IMG_InitTIF(void);
extern void IMG_QuitTIF(void);
extern int IMG_InitWEBP();
extern void IMG_QuitWEBP();
extern int IMG_InitWEBP(void);
extern void IMG_QuitWEBP(void);
static int initialized = 0;

View file

@ -60,7 +60,7 @@ static struct {
} lib;
#ifdef LOAD_JPG_DYNAMIC
int IMG_InitJPG()
int IMG_InitJPG(void)
{
if ( lib.loaded == 0 ) {
lib.handle = SDL_LoadObject(LOAD_JPG_DYNAMIC);
@ -135,7 +135,7 @@ int IMG_InitJPG()
return 0;
}
void IMG_QuitJPG()
void IMG_QuitJPG(void)
{
if ( lib.loaded == 0 ) {
return;
@ -146,7 +146,7 @@ void IMG_QuitJPG()
--lib.loaded;
}
#else
int IMG_InitJPG()
int IMG_InitJPG(void)
{
if ( lib.loaded == 0 ) {
lib.jpeg_calc_output_dimensions = jpeg_calc_output_dimensions;
@ -163,7 +163,7 @@ int IMG_InitJPG()
return 0;
}
void IMG_QuitJPG()
void IMG_QuitJPG(void)
{
if ( lib.loaded == 0 ) {
return;
@ -468,13 +468,13 @@ SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src)
#else
int IMG_InitJPG()
int IMG_InitJPG(void)
{
IMG_SetError("JPEG images are not supported");
return(-1);
}
void IMG_QuitJPG()
void IMG_QuitJPG(void)
{
}

View file

@ -102,7 +102,7 @@ static struct {
} lib;
#ifdef LOAD_PNG_DYNAMIC
int IMG_InitPNG()
int IMG_InitPNG(void)
{
if ( lib.loaded == 0 ) {
lib.handle = SDL_LoadObject(LOAD_PNG_DYNAMIC);
@ -249,7 +249,7 @@ int IMG_InitPNG()
return 0;
}
void IMG_QuitPNG()
void IMG_QuitPNG(void)
{
if ( lib.loaded == 0 ) {
return;
@ -260,7 +260,7 @@ void IMG_QuitPNG()
--lib.loaded;
}
#else
int IMG_InitPNG()
int IMG_InitPNG(void)
{
if ( lib.loaded == 0 ) {
lib.png_create_info_struct = png_create_info_struct;
@ -289,7 +289,7 @@ int IMG_InitPNG()
return 0;
}
void IMG_QuitPNG()
void IMG_QuitPNG(void)
{
if ( lib.loaded == 0 ) {
return;
@ -557,13 +557,13 @@ done: /* Clean up and return */
#else
int IMG_InitPNG()
int IMG_InitPNG(void)
{
IMG_SetError("PNG images are not supported");
return(-1);
}
void IMG_QuitPNG()
void IMG_QuitPNG(void)
{
}

View file

@ -42,7 +42,7 @@ static struct {
} lib;
#ifdef LOAD_TIF_DYNAMIC
int IMG_InitTIF()
int IMG_InitTIF(void)
{
if ( lib.loaded == 0 ) {
lib.handle = SDL_LoadObject(LOAD_TIF_DYNAMIC);
@ -89,7 +89,7 @@ int IMG_InitTIF()
return 0;
}
void IMG_QuitTIF()
void IMG_QuitTIF(void)
{
if ( lib.loaded == 0 ) {
return;
@ -100,7 +100,7 @@ void IMG_QuitTIF()
--lib.loaded;
}
#else
int IMG_InitTIF()
int IMG_InitTIF(void)
{
if ( lib.loaded == 0 ) {
lib.TIFFClientOpen = TIFFClientOpen;
@ -113,7 +113,7 @@ int IMG_InitTIF()
return 0;
}
void IMG_QuitTIF()
void IMG_QuitTIF(void)
{
if ( lib.loaded == 0 ) {
return;
@ -271,13 +271,13 @@ error:
#else
int IMG_InitTIF()
int IMG_InitTIF(void)
{
IMG_SetError("TIFF images are not supported");
return(-1);
}
void IMG_QuitTIF()
void IMG_QuitTIF(void)
{
}

View file

@ -53,7 +53,7 @@ static struct {
} lib;
#ifdef LOAD_WEBP_DYNAMIC
int IMG_InitWEBP()
int IMG_InitWEBP(void)
{
if ( lib.loaded == 0 ) {
lib.handle = SDL_LoadObject(LOAD_WEBP_DYNAMIC);
@ -88,7 +88,7 @@ int IMG_InitWEBP()
return 0;
}
void IMG_QuitWEBP()
void IMG_QuitWEBP(void)
{
if ( lib.loaded == 0 ) {
return;
@ -99,7 +99,7 @@ void IMG_QuitWEBP()
--lib.loaded;
}
#else
int IMG_InitWEBP()
int IMG_InitWEBP(void)
{
if ( lib.loaded == 0 ) {
lib.webp_get_features_internal = WebPGetFeaturesInternal;
@ -110,7 +110,7 @@ int IMG_InitWEBP()
return 0;
}
void IMG_QuitWEBP()
void IMG_QuitWEBP(void)
{
if ( lib.loaded == 0 ) {
return;
@ -270,13 +270,13 @@ error:
#else
int IMG_InitWEBP()
int IMG_InitWEBP(void)
{
IMG_SetError("WEBP images are not supported");
return(-1);
}
void IMG_QuitWEBP()
void IMG_QuitWEBP(void)
{
}

View file

@ -62,5 +62,5 @@ extern flac_loader flac;
#endif /* FLAC_MUSIC */
extern int Mix_InitFLAC();
extern void Mix_QuitFLAC();
extern int Mix_InitFLAC(void);
extern void Mix_QuitFLAC(void);

View file

@ -58,5 +58,5 @@ extern mikmod_loader mikmod;
#endif /* MOD_MUSIC */
extern int Mix_InitMOD();
extern void Mix_QuitMOD();
extern int Mix_InitMOD(void);
extern void Mix_QuitMOD(void);

View file

@ -43,5 +43,5 @@ extern smpeg_loader smpeg;
#endif /* MUSIC_MP3 */
extern int Mix_InitMP3();
extern void Mix_QuitMP3();
extern int Mix_InitMP3(void);
extern void Mix_QuitMP3(void);

View file

@ -49,5 +49,5 @@ extern vorbis_loader vorbis;
#endif /* OGG_MUSIC */
extern int Mix_InitOgg();
extern void Mix_QuitOgg();
extern int Mix_InitOgg(void);
extern void Mix_QuitOgg(void);

View file

@ -173,7 +173,7 @@ static void music_internal_initialize_volume(void);
static void music_internal_volume(int volume);
static int music_internal_play(Mix_Music *music, double position);
static int music_internal_position(double position);
static int music_internal_playing();
static int music_internal_playing(void);
static void music_internal_halt(void);

View file

@ -9,7 +9,9 @@
/* This is for use with the SDL library */
#ifndef __TIMIDITY_CONFIG_H__
#define __TIMIDITY_CONFIG_H__
#ifndef SDL
#define SDL
#endif
#include "SDL_config.h"
#include "SDL_endian.h"

View file

@ -6,9 +6,10 @@
it under the terms of the Perl Artistic License, available in COPYING.
*/
#include "config.h"
#include <SDL_rwops.h>
#include "config.h"
#include "common.h"
#include "instrum.h"
#include "playmidi.h"
@ -1743,4 +1744,3 @@ void Timidity_Close(void)
free_instruments();
free_pathlist();
}

View file

@ -6,9 +6,10 @@
it under the terms of the Perl Artistic License, available in COPYING.
*/
#include "config.h"
#include <SDL_rwops.h>
#include "config.h"
#include "common.h"
#include "instrum.h"
#include "playmidi.h"

View file

@ -6,8 +6,8 @@
it under the terms of the Perl Artistic License, available in COPYING.
*/
#include "SDL.h"
#include "config.h"
#include "SDL.h"
#include "common.h"
#include "instrum.h"
#include "playmidi.h"
@ -356,4 +356,3 @@ const char *Timidity_Error(void)
{
return(timidity_error);
}

View file

@ -286,7 +286,7 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec,
/* WAV magic header */
Uint32 RIFFchunk;
Uint32 wavelen;
// Uint32 wavelen;
Uint32 WAVEmagic;
/* FMT chunk */
@ -296,7 +296,7 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec,
/* Check the magic header */
RIFFchunk = SDL_ReadLE32(src);
wavelen = SDL_ReadLE32(src);
// wavelen = SDL_ReadLE32(src);
WAVEmagic = SDL_ReadLE32(src);
if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) {
Mix_SetError("Unrecognized file type (not WAVE)");
@ -416,7 +416,7 @@ static SDL_RWops *LoadAIFFStream (SDL_RWops *src, SDL_AudioSpec *spec,
Uint32 AIFFmagic;
/* SSND chunk */
Uint32 offset;
Uint32 blocksize;
// Uint32 blocksize;
/* COMM format chunk */
Uint16 channels = 0;
Uint32 numsamples = 0;
@ -459,7 +459,7 @@ static SDL_RWops *LoadAIFFStream (SDL_RWops *src, SDL_AudioSpec *spec,
case SSND:
found_SSND = 1;
offset = SDL_ReadBE32(src);
blocksize = SDL_ReadBE32(src);
// blocksize = SDL_ReadBE32(src);
*start = SDL_RWtell(src) + offset;
break;
@ -518,4 +518,3 @@ done:
}
return(src);
}

View file

@ -92,6 +92,9 @@
#undef strdup
/* clock() wraps current_tick */
#ifdef CLOCKS_PER_SEC
#undef CLOCKS_PER_SEC
#endif
#define CLOCKS_PER_SEC HZ
/*
@ -160,9 +163,13 @@
#define strlcpy rb->strlcpy
#define strlen rb->strlen
#define strncasecmp rb->strncasecmp
#ifndef strncat
#define strncat rb->strlcat /* hack */
#endif
#define strncmp rb->strncmp
#ifndef strncat
#define strpbrk strpbrk_wrapper
#endif
#define strrchr rb->strrchr
#define strstr SDL_strstr
#define strtok strtok_wrapper

View file

@ -71,8 +71,8 @@ void cleanup(void)
#endif
}
/* 256KB */
static long main_stack[1024 * 1024 / 2];
static long main_stack[1024 * 1024 / 4]; /* ie 1 MB */
int (*main_fn)(int argc, char *argv[]);
int prog_idx;
static void main_thread(void)

View file

@ -1318,7 +1318,7 @@ void WritePaletteToFile(uint8_t* palette,const char* filename,int width, int hei
}
void WriteLastPaletteToFile(){
void WriteLastPaletteToFile(void){
WritePaletteToFile(lastPalette,"lastPalette.tga",16,16);
}
@ -1913,4 +1913,3 @@ void TIMER_GetPlatformTicks(int64_t* t)
*t = SDL_GetTicks();
}
/* end of sdl_driver.c ... */

View file

@ -96,7 +96,7 @@ void timerhandler(void);
/* resolution inits. sdl_driver.c ... */
int32_t _setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
uint32_t getticks();
uint32_t getticks(void);
void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, uint8_t Color);
void setcolor16(uint8_t color);
@ -106,5 +106,3 @@ void setcolor16(uint8_t color);
void initmultiplayers(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority);
#endif

View file

@ -11,8 +11,8 @@
#include "platform.h"
void Setup_UnstableNetworking();
void Setup_StableNetworking();
void Setup_UnstableNetworking(void);
void Setup_StableNetworking(void);
void callcommit(void);
void initcrc(void);

View file

@ -56,8 +56,12 @@
#define IP_RECVERR SO_BROADCAST
*/
#ifndef stricmp
#define stricmp strcasecmp
#endif
#ifndef strcmpi
#define strcmpi strcasecmp
#endif
#define S_IREAD S_IRUSR

View file

@ -51,7 +51,7 @@ static inline int cnv_offset(int src)
// extern __stdcall OutputDebugStringA(char *);
static inline void check_buffer()
static inline void check_buffer(void)
{
int new_delay = cnv_offset(MV_ReverbDelay);

View file

@ -23,8 +23,8 @@ typedef struct console_element
// Private member functions
void CONSOLE_InsertUsedCommand(const char * szUsedCommand);
void CONSOLE_ClearUsedCommandList();
void CONSOLE_RecalculateDirtyBuffer();
void CONSOLE_ClearUsedCommandList(void);
void CONSOLE_RecalculateDirtyBuffer(void);
// console argument tracker
int argc;
@ -50,7 +50,7 @@ int nConsole_Active = 0;
void CVAR_RegisterDefaultCvarBindings(void);
// Initialize the console
void CONSOLE_Init()
void CONSOLE_Init(void)
{
CONSOLE_Reset();
@ -63,7 +63,7 @@ void CONSOLE_Init()
CONSOLE_Printf("Type \'HELP\' for help with console Commands.");
}
void CONSOLE_Reset()
void CONSOLE_Reset(void)
{
CONSOLEELEMENT *pElement;
CONSOLEELEMENT *pDelElement;
@ -354,7 +354,7 @@ void CONSOLE_HandleInput()
KB_ClearLastScanCode();
}
void CONSOLE_Render()
void CONSOLE_Render(void)
{
if(g_CV_classic)
{
@ -517,7 +517,7 @@ void CONSOLE_InsertUsedCommand(const char * szUsedCommand)
}
}
void CONSOLE_ClearUsedCommandList()
void CONSOLE_ClearUsedCommandList(void)
{
CONSOLEELEMENT *pElement;
CONSOLEELEMENT *pDelElement;
@ -537,7 +537,7 @@ void CONSOLE_ClearUsedCommandList()
}
void CONSOLE_RecalculateDirtyBuffer()
void CONSOLE_RecalculateDirtyBuffer(void)
{
int len;
int l;
@ -605,7 +605,7 @@ void CONSOLE_Printf(const char *newmsg, ...)
}
// Get the current number of args for this keyword
int CONSOLE_GetArgc()
int CONSOLE_GetArgc(void)
{
return argc;
}
@ -617,7 +617,7 @@ char * CONSOLE_GetArgv(unsigned int var)
}
// Is our console showing?
int CONSOLE_IsActive()
int CONSOLE_IsActive(void)
{
return nConsole_Active;

View file

@ -3,17 +3,17 @@
// Public member functions
void CONSOLE_Init();
void CONSOLE_Reset();
void CONSOLE_Term();
void CONSOLE_ParseStartupScript();
void CONSOLE_HandleInput();
void CONSOLE_Render();
void CONSOLE_Init(void);
void CONSOLE_Reset(void);
void CONSOLE_Term(void);
void CONSOLE_ParseStartupScript(void);
void CONSOLE_HandleInput(void);
void CONSOLE_Render(void);
void CONSOLE_ParseCommand(char * command);
void CONSOLE_Printf(const char *newmsg, ...);
int CONSOLE_GetArgc();
int CONSOLE_GetArgc(void);
char * CONSOLE_GetArgv(unsigned int var);
int CONSOLE_IsActive();
int CONSOLE_IsActive(void);
void CONSOLE_SetActive(int i);
#endif

View file

@ -3,8 +3,8 @@
#include <inttypes.h>
void CVARDEFS_Init();
void CVARDEFS_Render();
void CVARDEFS_Init(void);
void CVARDEFS_Render(void);
//
// Function declarations
//

View file

@ -18,8 +18,8 @@ typedef struct t_cvar_binding
void CVAR_RegisterCvar(const char * varname, const char * varhelp, void* variable, function_t function);
int CVAR_GetNumCvarBindings();
int CVAR_GetNumCvarBindings(void);
cvar_binding* CVAR_GetCvarBinding(unsigned int nBinding);
void CVAR_Render();
void CVAR_Render(void);
#endif

View file

@ -31,6 +31,7 @@ void Shutdown(void);
#endif
#ifdef ROCKBOX
#undef BYTE_ORDER
#ifdef ROCKBOX_LITTLE_ENDIAN
#define BYTE_ORDER LITTLE_ENDIAN
#else

View file

@ -67,8 +67,12 @@ typedef float64 appfloat;
//
//***************************************************************************
#ifndef true
#define true ( 1 == 1 )
#endif
#ifndef false
#define false ( ! true )
#endif
//***************************************************************************
//

View file

@ -60,7 +60,7 @@ int16 IntelShort (int16 l);
int32_t Motoint32_t (int32_t l);
int32_t Intelint32_t (int32_t l);
void HeapSort(uint8_t * base, int32 nel, int32 width, int32 (*compare)(), void (*switcher)());
//void HeapSort(uint8_t * base, int32 nel, int32 width, int32 (*compare)(), void (*switcher)());
#ifdef __cplusplus
};

View file

@ -178,26 +178,27 @@ float CL_KeyState (kbutton_t *key)
down = key->state & 1;
val = 0;
if (impulsedown && !impulseup)
if (impulsedown && !impulseup) {
if (down)
val = 0.5; // pressed and held this frame
else
val = 0; // I_Error ();
if (impulseup && !impulsedown)
} else if (impulseup && !impulsedown) {
if (down)
val = 0; // I_Error ();
else
val = 0; // released this frame
if (!impulsedown && !impulseup)
} else if (!impulsedown && !impulseup) {
if (down)
val = 1.0; // held the entire frame
else
val = 0; // up the entire frame
if (impulsedown && impulseup)
} else if (impulsedown && impulseup) {
if (down)
val = 0.75; // released and re-pressed this frame
else
val = 0.25; // pressed and released this frame
}
key->state &= 1; // clear impulses

View file

@ -182,6 +182,9 @@ extern byte *r_skysource;
#define DR_TRANSPARENT 1
// !!! must be kept the same as in quakeasm.h !!!
#ifdef TRANSPARENT_COLOR
#undef TRANSPARENT_COLOR
#endif
#define TRANSPARENT_COLOR 0xFF
extern void *acolormap; // FIXME: should go away

View file

@ -69,6 +69,8 @@ void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
//void VectorNormalizeNoRet (vec3_t v); // uses finvsqrt
//float VectorNormalize (vec3_t v); // returns vector length
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
static inline float InvSqrt( float number ) {
long i;
float x2, y;
@ -84,6 +86,7 @@ static inline float InvSqrt( float number ) {
return y;
}
#pragma GCC diagnostic pop
static inline void VectorNormalizeNoRet (vec3_t v)
{

View file

@ -314,7 +314,7 @@ typedef struct _PollProcedure
{
struct _PollProcedure *next;
double nextTime;
void (*procedure)();
void (*procedure)(void *);
void *arg;
} PollProcedure;

View file

@ -250,7 +250,7 @@ void SV_MoveToGoal (void);
void SV_CheckForNewClients (void);
void SV_RunClients (void);
void SV_SaveSpawnparms ();
void SV_SaveSpawnparms (void);
#ifdef QUAKE2
void SV_SpawnServer (char *server, char *startspot);
#else

View file

@ -165,12 +165,12 @@ extern ScanCode IN_WaitForKey(void);
extern word IN_GetJoyButtonsDB(word joy);
extern const char *IN_GetScanName(ScanCode);
void IN_WaitAndProcessEvents();
void IN_ProcessEvents();
void IN_WaitAndProcessEvents(void);
void IN_ProcessEvents(void);
int IN_MouseButtons (void);
boolean IN_JoyPresent();
boolean IN_JoyPresent(void);
void IN_SetJoyCurrent(int joyIndex);
int IN_JoyButtons (void);
void IN_GetJoyDelta(int *dx,int *dy);
@ -178,6 +178,6 @@ void IN_GetJoyFineDelta(int *dx, int *dy);
void IN_StartAck(void);
boolean IN_CheckAck (void);
bool IN_IsInputGrabbed();
void IN_CenterMouse();
bool IN_IsInputGrabbed(void);
void IN_CenterMouse(void);
#endif

View file

@ -17,40 +17,40 @@ extern bool PMSoundInfoPagePadded;
// The last pointer points one byte after the last page.
extern uint8_t **PMPages;
void PM_Startup();
void PM_Shutdown();
void PM_Startup(void);
void PM_Shutdown(void);
static uint32_t PM_GetPageSize(int page)
static inline uint32_t PM_GetPageSize(int page)
{
if(page < 0 || page >= ChunksInFile)
Quit("PM_GetPageSize: Tried to access illegal page: %i", page);
return (uint32_t) (PMPages[page + 1] - PMPages[page]);
}
static uint8_t *PM_GetPage(int page)
static inline uint8_t *PM_GetPage(int page)
{
if(page < 0 || page >= ChunksInFile)
Quit("PM_GetPage: Tried to access illegal page: %i", page);
return PMPages[page];
}
static uint8_t *PM_GetEnd()
static inline uint8_t *PM_GetEnd(void)
{
return PMPages[ChunksInFile];
}
static byte *PM_GetTexture(int wallpic)
static inline byte *PM_GetTexture(int wallpic)
{
return PM_GetPage(wallpic);
}
static uint16_t *PM_GetSprite(int shapenum)
static inline uint16_t *PM_GetSprite(int shapenum)
{
// correct alignment is enforced by PM_Startup()
return (uint16_t *) (void *) PM_GetPage(PMSpriteStart + shapenum);
}
static byte *PM_GetSound(int soundpagenum)
static inline byte *PM_GetSound(int soundpagenum)
{
return PM_GetPage(PMSoundStart + soundpagenum);
}

View file

@ -96,6 +96,6 @@ void USL_PrintInCenter(const char *s,Rect r);
char *USL_GiveSaveName(word game);
void US_InitRndT(int randomize);
int US_RndT();
int US_RndT(void);
#endif

View file

@ -64,7 +64,7 @@ void VWB_Vlin (int y1, int y2, int x, int color);
#define VWB_HlinScaledCoord VW_Hlin
#define VWB_VlinScaledCoord VW_Vlin
void VH_UpdateScreen();
void VH_UpdateScreen(void);
#define VW_UpdateScreen VH_UpdateScreen
//
@ -91,7 +91,7 @@ void LatchDrawPic (unsigned x, unsigned y, unsigned picnum);
void LatchDrawPicScaledCoord (unsigned scx, unsigned scy, unsigned picnum);
void LoadLatchMem (void);
void VH_Startup();
void VH_Startup(void);
boolean FizzleFade (SDL_Surface *source, int x1, int y1,
unsigned width, unsigned height, unsigned frames, boolean abortable);

View file

@ -961,7 +961,7 @@ void DrawPlayBorder (void);
void DrawStatusBorder (byte color);
void DrawPlayScreen (void);
void DrawPlayBorderSides (void);
void ShowActStatus();
void ShowActStatus(void);
void PlayDemo (int demonumber);
void RecordDemo (void);
@ -1372,7 +1372,7 @@ void GP2X_ButtonUp(int button);
=============================================================================
*/
static fixed FixedMul(fixed a, fixed b)
static inline fixed FixedMul(fixed a, fixed b)
{
return (fixed)(((int64_t)a * b + 0x8000) >> 16);
}
@ -1394,13 +1394,13 @@ static fixed FixedMul(fixed a, fixed b)
#define CHECKMALLOCRESULT(x) if(!(x)) Quit("Out of memory at %s:%i", __FILE__, __LINE__)
static char* itoa(int value, char* string, int radix)
static inline char* itoa(int value, char* string, int radix)
{
sprintf(string, "%d", value);
return string;
}
static char* ltoa(long value, char* string, int radix)
static inline char* ltoa(long value, char* string, int radix)
{
sprintf(string, "%ld", value);
return string;
@ -1409,14 +1409,14 @@ static char* ltoa(long value, char* string, int radix)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define endof(x) ((x) + lengthof(x))
static word READWORD(byte **ptr)
static inline word READWORD(byte **ptr)
{
word val = (*ptr)[0] | (*ptr)[1] << 8;
*ptr += 2;
return val;
}
static longword READLONGWORD(byte **ptr)
static inline longword READLONGWORD(byte **ptr)
{
longword val = (*ptr)[0] | (*ptr)[1] << 8 | (*ptr)[2] << 16 | (*ptr)[3] << 24;
*ptr += 4;
@ -1454,7 +1454,7 @@ static longword READLONGWORD(byte **ptr)
*************************************************************/
// The feature flags are stored as a wall in the upper right corner of each level
static word GetFeatureFlags()
static inline word GetFeatureFlags()
{
return ffDataTopRight;
}

View file

@ -251,7 +251,7 @@ boolean TransformTile (int tx, int ty, short *dispx, short *dispheight)
====================
*/
int CalcHeight()
int CalcHeight(void)
{
fixed z = FixedMul(xintercept - viewx, viewcos)
- FixedMul(yintercept - viewy, viewsin);
@ -275,7 +275,7 @@ byte *postsource;
int postx;
int postwidth;
void ScalePost()
void ScalePost(void)
{
int ywcount, yoffs, yw, yd, yendoffs;
byte col;
@ -1091,7 +1091,7 @@ void CalcTics (void)
//==========================================================================
void AsmRefresh()
void AsmRefresh(void)
{
int32_t xstep,ystep;
longword xpartial,ypartial;
@ -1517,7 +1517,7 @@ void WallRefresh (void)
ScalePost (); // no more optimization on last post
}
void CalcViewVariables()
void CalcViewVariables(void)
{
viewangle = player->angle;
midangle = viewangle*(FINEANGLES/ANGLES);

View file

@ -118,10 +118,10 @@ extern CP_iteminfo MainItems;
void US_ControlPanel(ScanCode);
void EnableEndGameMenuItem();
void EnableEndGameMenuItem(void);
void SetupControlPanel(void);
void SetupSaveGames();
void SetupSaveGames(void);
void CleanupControlPanel(void);
void DrawMenu(CP_iteminfo *item_i,CP_itemtype *items);

View file

@ -32,6 +32,13 @@ SDLFLAGS = -I$(SDL_SRCDIR)/include $(filter-out -O%,$(PLUGINFLAGS)) \
-ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations \
-D_GNU_SOURCE=1 -D_REENTRANT -DSDL -DELF -w # disable all warnings
# WIP SDLFLAGS for warning deletions
#SDLFLAGS = -I$(SDL_SRCDIR)/include $(filter-out -O%,$(PLUGINFLAGS)) \
#-O3 -Wno-unused-parameter -Xpreprocessor -Wno-undef -Wno-sign-compare \
#-Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-unknown-pragmas \
#-ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations \
#-D_GNU_SOURCE=1 -D_REENTRANT -DSDL -DELF
# use FPU on ARMv6
ifeq ($(ARCH_VERSION),6)
SDLFLAGS += -mfloat-abi=softfp

View file

@ -413,6 +413,8 @@ 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);
@ -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"