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

@ -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);