mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-12 08:36:22 +00:00
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:
parent
f7ec2f182f
commit
d262190faf
7 changed files with 22 additions and 35 deletions
|
|
@ -45,6 +45,9 @@ endif
|
||||||
ifdef GCC45
|
ifdef GCC45
|
||||||
#WFLAGS+=-Wc++-compat
|
#WFLAGS+=-Wc++-compat
|
||||||
WFLAGS+=-std=gnu99
|
WFLAGS+=-std=gnu99
|
||||||
|
endif
|
||||||
|
ifdef GCC47
|
||||||
|
WFLAGS+=-std=gnu11
|
||||||
endif
|
endif
|
||||||
WFLAGS+=-Wcast-qual
|
WFLAGS+=-Wcast-qual
|
||||||
ifndef NOCASTALIGNWARN
|
ifndef NOCASTALIGNWARN
|
||||||
|
|
|
||||||
23
src/d_main.c
23
src/d_main.c
|
|
@ -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
|
// D_SRB2Loop
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
|
||||||
|
|
@ -5388,7 +5388,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
if (thing->renderflags & RF_SHADOWEFFECTS)
|
if (thing->renderflags & RF_SHADOWEFFECTS)
|
||||||
{
|
{
|
||||||
mobj_t *caster = thing->target;
|
mobj_t *caster = thing->target;
|
||||||
interpmobjstate_t casterinterp = {};
|
interpmobjstate_t casterinterp = {0};
|
||||||
|
|
||||||
if (R_UsingFrameInterpolation() && !paused)
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
{
|
{
|
||||||
|
|
@ -5481,7 +5481,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
||||||
|
|
||||||
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer)
|
if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer)
|
||||||
{
|
{
|
||||||
interpmobjstate_t tracer_interp = {};
|
interpmobjstate_t tracer_interp = {0};
|
||||||
|
|
||||||
if (! R_ThingVisible(thing->tracer))
|
if (! R_ThingVisible(thing->tracer))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -672,7 +672,7 @@ static int libd_drawOnMinimap(lua_State *L)
|
||||||
{
|
{
|
||||||
fixed_t x, y, scale; // coordinates of the object
|
fixed_t x, y, scale; // coordinates of the object
|
||||||
patch_t *patch; // patch we want to draw
|
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.
|
boolean centered; // the patch is centered and doesn't need readjusting on x/y coordinates.
|
||||||
huddrawlist_h list;
|
huddrawlist_h list;
|
||||||
|
|
||||||
|
|
@ -898,7 +898,7 @@ static int libd_drawPaddedNum(lua_State *L)
|
||||||
static int libd_drawPingNum(lua_State *L)
|
static int libd_drawPingNum(lua_State *L)
|
||||||
{
|
{
|
||||||
INT32 x, y, flags, num;
|
INT32 x, y, flags, num;
|
||||||
const UINT8 *colormap = NULL;
|
UINT8 *colormap = NULL;
|
||||||
huddrawlist_h list;
|
huddrawlist_h list;
|
||||||
HUDONLY
|
HUDONLY
|
||||||
x = luaL_checkinteger(L, 1);
|
x = luaL_checkinteger(L, 1);
|
||||||
|
|
|
||||||
|
|
@ -279,10 +279,17 @@ void LUA_HUD_AddDrawPingNum(
|
||||||
INT32 y,
|
INT32 y,
|
||||||
INT32 flags,
|
INT32 flags,
|
||||||
INT32 num,
|
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(
|
void LUA_HUD_AddDrawFill(
|
||||||
|
|
@ -363,8 +370,8 @@ void LUA_HUD_AddDrawKartString(
|
||||||
huddrawlist_h list,
|
huddrawlist_h list,
|
||||||
fixed_t x,
|
fixed_t x,
|
||||||
fixed_t y,
|
fixed_t y,
|
||||||
INT32 flags,
|
const char *str,
|
||||||
const char *str
|
INT32 flags
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
size_t i = AllocateDrawItem(list);
|
size_t i = AllocateDrawItem(list);
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ void LUA_HUD_AddDrawPingNum(
|
||||||
INT32 y,
|
INT32 y,
|
||||||
INT32 flags,
|
INT32 flags,
|
||||||
INT32 num,
|
INT32 num,
|
||||||
const UINT8 *colormap
|
UINT8 *colormap
|
||||||
);
|
);
|
||||||
void LUA_HUD_AddDrawFill(
|
void LUA_HUD_AddDrawFill(
|
||||||
huddrawlist_h list,
|
huddrawlist_h list,
|
||||||
|
|
@ -119,8 +119,8 @@ void LUA_HUD_AddDrawKartString(
|
||||||
huddrawlist_h list,
|
huddrawlist_h list,
|
||||||
fixed_t x,
|
fixed_t x,
|
||||||
fixed_t y,
|
fixed_t y,
|
||||||
INT32 flags,
|
const char *str,
|
||||||
const char *str
|
INT32 flags
|
||||||
);
|
);
|
||||||
|
|
||||||
// Draws the given draw list
|
// Draws the given draw list
|
||||||
|
|
|
||||||
|
|
@ -566,7 +566,7 @@ void M_DrawPerfStats(void)
|
||||||
len = (int)strlen(str);
|
len = (int)strlen(str);
|
||||||
if (len > 20)
|
if (len > 20)
|
||||||
str += 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);
|
V_DrawSmallString(x, y, V_MONOSPACE | V_ALLOWLOWERCASE | text_color, s);
|
||||||
y += 4; // repeated code!
|
y += 4; // repeated code!
|
||||||
if (y > 192)
|
if (y > 192)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue