Remove FUNCMATH from functions with a void return value or args, or examine variables other than their args (which could be modified)

This commit is contained in:
Monster Iestyn 2018-11-08 16:26:55 +00:00
parent c47f0045d6
commit 0bdbdd1b1e
12 changed files with 26 additions and 33 deletions

View file

@ -7769,7 +7769,7 @@ fixed_t get_number(const char *word)
#endif
}
void FUNCMATH DEH_Check(void)
void DEH_Check(void)
{
#if defined(_DEBUG) || defined(PARANOIA)
const size_t dehstates = sizeof(STATE_LIST)/sizeof(const char*);

View file

@ -1401,6 +1401,7 @@ void F_StartGameEnd(void)
//
void F_GameEndDrawer(void)
{
// this function does nothing
}
//

View file

@ -35,7 +35,7 @@ void F_CutsceneTicker(void);
void F_TitleDemoTicker(void);
// Called by main loop.
FUNCMATH void F_GameEndDrawer(void);
void F_GameEndDrawer(void);
void F_IntroDrawer(void);
void F_TitleScreenDrawer(void);

View file

@ -87,7 +87,7 @@ extern lighttable_t **planezlight;
extern fixed_t *yslope;
extern fixed_t distscale[MAXVIDWIDTH];
FUNCMATH void R_InitPlanes(void);
void R_InitPlanes(void);
void R_PortalStoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor, fixed_t *scale);
void R_PortalRestoreClipValues(INT32 start, INT32 end, INT16 *ceil, INT16 *floor, fixed_t *scale);
void R_ClearPlanes(void);

View file

@ -63,11 +63,7 @@ typedef struct floorsplat_s
fixed_t P_SegLength(seg_t *seg);
// call at P_SetupLevel()
#if !(defined (WALLSPLATS) || defined (FLOORSPLATS))
FUNCMATH void R_ClearLevelSplats(void);
#else
void R_ClearLevelSplats(void);
#endif
#ifdef WALLSPLATS
void R_AddWallSplat(line_t *wallline, INT16 sectorside, const char *patchname, fixed_t top,

View file

@ -71,11 +71,7 @@ consvar_t cv_scr_depth = {"scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NUL
#endif
consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
#ifdef DIRECTFULLSCREEN
static FUNCMATH void SCR_ChangeFullscreen (void);
#else
static void SCR_ChangeFullscreen (void);
#endif
consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_ChangeFullscreen, 0, NULL, NULL, 0, 0, NULL};

View file

@ -12,19 +12,19 @@ consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NUL
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
FUNCMATH void I_InitCD(void){}
void I_InitCD(void){}
FUNCMATH void I_StopCD(void){}
void I_StopCD(void){}
FUNCMATH void I_PauseCD(void){}
void I_PauseCD(void){}
FUNCMATH void I_ResumeCD(void){}
void I_ResumeCD(void){}
FUNCMATH void I_ShutdownCD(void){}
void I_ShutdownCD(void){}
FUNCMATH void I_UpdateCD(void){}
void I_UpdateCD(void){}
FUNCMATH void I_PlayCD(UINT8 track, UINT8 looping)
void I_PlayCD(UINT8 track, UINT8 looping)
{
(void)track;
(void)looping;

View file

@ -1927,14 +1927,14 @@ void I_StartupMouse2(void)
//
// I_Tactile
//
FUNCMATH void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect)
void I_Tactile(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
(void)FFEffect;
}
FUNCMATH void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
{
// UNUSED.
(void)pFFType;
@ -1945,7 +1945,7 @@ FUNCMATH void I_Tactile2(FFType pFFType, const JoyFF_t *FFEffect)
*/
static ticcmd_t emptycmd;
FUNCMATH ticcmd_t *I_BaseTiccmd(void)
ticcmd_t *I_BaseTiccmd(void)
{
return &emptycmd;
}
@ -1954,7 +1954,7 @@ FUNCMATH ticcmd_t *I_BaseTiccmd(void)
*/
static ticcmd_t emptycmd2;
FUNCMATH ticcmd_t *I_BaseTiccmd2(void)
ticcmd_t *I_BaseTiccmd2(void)
{
return &emptycmd2;
}
@ -2048,7 +2048,7 @@ tic_t I_GetTime (void)
//
//I_StartupTimer
//
FUNCMATH void I_StartupTimer(void)
void I_StartupTimer(void)
{
#ifdef _WIN32
// for win2k time bug
@ -2147,11 +2147,11 @@ void I_WaitVBL(INT32 count)
SDL_Delay(count);
}
FUNCMATH void I_BeginRead(void)
void I_BeginRead(void)
{
}
FUNCMATH void I_EndRead(void)
void I_EndRead(void)
{
}
@ -2939,5 +2939,5 @@ const CPUInfoFlags *I_CPUInfo(void)
}
// note CPUAFFINITY code used to reside here
FUNCMATH void I_RegisterSysCommands(void) {}
void I_RegisterSysCommands(void) {}
#endif

View file

@ -1053,7 +1053,7 @@ void I_SetPalette(RGBA_t *palette)
}
// return number of fullscreen + X11 modes
FUNCMATH INT32 VID_NumModes(void)
INT32 VID_NumModes(void)
{
if (USE_FULLSCREEN && numVidModes != -1)
return numVidModes - firstEntry;
@ -1061,7 +1061,7 @@ FUNCMATH INT32 VID_NumModes(void)
return MAXWINMODES;
}
FUNCMATH const char *VID_GetModeName(INT32 modeNum)
const char *VID_GetModeName(INT32 modeNum)
{
#if 0
if (USE_FULLSCREEN && numVidModes != -1) // fullscreen modes
@ -1091,7 +1091,7 @@ FUNCMATH const char *VID_GetModeName(INT32 modeNum)
return &vidModeName[modeNum][0];
}
FUNCMATH INT32 VID_GetModeForSize(INT32 w, INT32 h)
INT32 VID_GetModeForSize(INT32 w, INT32 h)
{
int i;
for (i = 0; i < MAXWINMODES; i++)

View file

@ -135,7 +135,7 @@ void I_ShutdownSound(void)
#endif
}
FUNCMATH void I_UpdateSound(void)
void I_UpdateSound(void)
{
}
@ -504,7 +504,7 @@ static void mix_gme(void *udata, Uint8 *stream, int len)
/// Music System
/// ------------------------
FUNCMATH void I_InitMusic(void)
void I_InitMusic(void)
{
}

View file

@ -219,7 +219,7 @@ static void Snd_UnlockAudio(void) //Alam: Unlock audio data and reinstall audio
#endif
}
FUNCMATH static inline Uint16 Snd_LowerRate(Uint16 sr)
static inline Uint16 Snd_LowerRate(Uint16 sr)
{
if (sr <= audio.freq) // already lowered rate?
return sr; // good then

View file

@ -236,7 +236,7 @@ static void Snd_UnlockAudio(void) //Alam: Unlock audio data and reinstall audio
#endif
}
FUNCMATH static inline Uint16 Snd_LowerRate(Uint16 sr)
static inline Uint16 Snd_LowerRate(Uint16 sr)
{
if (sr <= audio.freq) // already lowered rate?
return sr; // good then