Fix compiling with da strict settings

Moved from gnu99 to gnu11 because I think unnamed union is reasonable, and will also cause a lot of problems down the road if we ever need changes!!
This commit is contained in:
Sally Coolatta 2022-05-07 07:23:26 -04:00
parent f7ec2f182f
commit d262190faf
7 changed files with 22 additions and 35 deletions

View file

@ -45,6 +45,9 @@ endif
ifdef GCC45
#WFLAGS+=-Wc++-compat
WFLAGS+=-std=gnu99
endif
ifdef GCC47
WFLAGS+=-std=gnu11
endif
WFLAGS+=-Wcast-qual
ifndef NOCASTALIGNWARN

View file

@ -683,29 +683,6 @@ static void D_Display(void)
}
}
static boolean D_CheckFrameCap(void)
{
static boolean init = false;
static precise_t startCap = 0;
precise_t endCap = 0;
endCap = I_GetPreciseTime();
if (init == false)
{
startCap = endCap;
init = true;
}
else if (I_CheckFrameCap(startCap, endCap))
{
// Framerate should be capped.
return true;
}
startCap = endCap;
return false;
}
// =========================================================================
// D_SRB2Loop
// =========================================================================

View file

@ -5388,7 +5388,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
if (thing->renderflags & RF_SHADOWEFFECTS)
{
mobj_t *caster = thing->target;
interpmobjstate_t casterinterp = {};
interpmobjstate_t casterinterp = {0};
if (R_UsingFrameInterpolation() && !paused)
{
@ -5481,7 +5481,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer)
{
interpmobjstate_t tracer_interp = {};
interpmobjstate_t tracer_interp = {0};
if (! R_ThingVisible(thing->tracer))
return;

View file

@ -672,7 +672,7 @@ static int libd_drawOnMinimap(lua_State *L)
{
fixed_t x, y, scale; // coordinates of the object
patch_t *patch; // patch we want to draw
const UINT8 *colormap = NULL; // do we want to colormap this patch?
UINT8 *colormap = NULL; // do we want to colormap this patch?
boolean centered; // the patch is centered and doesn't need readjusting on x/y coordinates.
huddrawlist_h list;
@ -898,7 +898,7 @@ static int libd_drawPaddedNum(lua_State *L)
static int libd_drawPingNum(lua_State *L)
{
INT32 x, y, flags, num;
const UINT8 *colormap = NULL;
UINT8 *colormap = NULL;
huddrawlist_h list;
HUDONLY
x = luaL_checkinteger(L, 1);

View file

@ -279,10 +279,17 @@ void LUA_HUD_AddDrawPingNum(
INT32 y,
INT32 flags,
INT32 num,
const UINT8 *colormap
UINT8 *colormap
)
{
*(int*)(NULL + 1);
size_t i = AllocateDrawItem(list);
drawitem_t *item = &list->items[i];
item->type = DI_DrawPingNum;
item->x = x;
item->y = y;
item->flags = flags;
item->num = num;
item->colormap = colormap;
}
void LUA_HUD_AddDrawFill(
@ -363,8 +370,8 @@ void LUA_HUD_AddDrawKartString(
huddrawlist_h list,
fixed_t x,
fixed_t y,
INT32 flags,
const char *str
const char *str,
INT32 flags
)
{
size_t i = AllocateDrawItem(list);

View file

@ -82,7 +82,7 @@ void LUA_HUD_AddDrawPingNum(
INT32 y,
INT32 flags,
INT32 num,
const UINT8 *colormap
UINT8 *colormap
);
void LUA_HUD_AddDrawFill(
huddrawlist_h list,
@ -119,8 +119,8 @@ void LUA_HUD_AddDrawKartString(
huddrawlist_h list,
fixed_t x,
fixed_t y,
INT32 flags,
const char *str
const char *str,
INT32 flags
);
// Draws the given draw list

View file

@ -566,7 +566,7 @@ void M_DrawPerfStats(void)
len = (int)strlen(str);
if (len > 20)
str += len - 20;
snprintf(s, sizeof s - 1, "%20s: %lld", str, (thinkframe_hooks[i].time_taken) / (I_GetPrecisePrecision() / 1000000));
snprintf(s, sizeof s - 1, "%20s: %ld", str, (long)((thinkframe_hooks[i].time_taken) / (I_GetPrecisePrecision() / 1000000)));
V_DrawSmallString(x, y, V_MONOSPACE | V_ALLOWLOWERCASE | text_color, s);
y += 4; // repeated code!
if (y > 192)