mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-24 05:11:08 +00:00
Clang: clean up conditional-uninitialized warnings
This commit is contained in:
parent
7d26b173e5
commit
a9ef21aa50
8 changed files with 14 additions and 8 deletions
|
@ -245,6 +245,7 @@ target_compile_options(SRB2SDL2 PRIVATE
|
|||
# This is a direct translation from versions.mk
|
||||
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:GNU>>:
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wno-trigraphs
|
||||
-W # Was controlled by RELAXWARNINGS
|
||||
-Wfloat-equal
|
||||
|
@ -329,7 +330,9 @@ target_compile_options(SRB2SDL2 PRIVATE
|
|||
$<$<AND:$<COMPILE_LANGUAGE:C>,$<OR:$<C_COMPILER_ID:AppleClang>,$<C_COMPILER_ID:Clang>>>:
|
||||
-Wall
|
||||
-Wno-absolute-value
|
||||
-Wextra
|
||||
-Wno-trigraphs
|
||||
-Wconditional-uninitialized
|
||||
-Wno-error=non-literal-null-conversion
|
||||
-Wno-error=constant-conversion
|
||||
-Wno-error=unused-but-set-variable
|
||||
|
@ -346,6 +349,9 @@ target_compile_options(SRB2SDL2 PRIVATE
|
|||
# C++, GNU, Clang and Apple Clang
|
||||
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<OR:$<C_COMPILER_ID:GNU>,$<C_COMPILER_ID:AppleClang>,$<C_COMPILER_ID:Clang>>>:
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wno-trigraphs
|
||||
-Wconditional-uninitialized
|
||||
>
|
||||
|
||||
# C++, MSVC
|
||||
|
|
|
@ -134,7 +134,7 @@ void luaV_gettable (lua_State *L, TValue *t, TValue *key, StkId val) {
|
|||
void luaV_settable (lua_State *L, TValue *t, TValue *key, StkId val) {
|
||||
int loop;
|
||||
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
||||
TValue *tm;
|
||||
TValue *tm = NULL;
|
||||
if (ttistable(t)) { /* `t' is a table? */
|
||||
Table *h = hvalue(t);
|
||||
TValue *oldval = luaH_set(L, h, key); /* do a primitive set */
|
||||
|
|
|
@ -1650,7 +1650,7 @@ static void G_LoadDemoExtraFiles(UINT8 **pp, UINT16 this_demo_version)
|
|||
UINT16 totalfiles;
|
||||
char filename[MAX_WADPATH];
|
||||
UINT8 md5sum[16];
|
||||
filestatus_t ncs;
|
||||
filestatus_t ncs = FS_NOTFOUND;
|
||||
boolean toomany = false;
|
||||
boolean alreadyloaded;
|
||||
UINT16 i, j;
|
||||
|
|
|
@ -5403,7 +5403,7 @@ void G_FreeMapSearch(mapsearchfreq_t *freq, INT32 freqc)
|
|||
INT32 G_FindMapByNameOrCode(const char *mapname, char **realmapnamep)
|
||||
{
|
||||
boolean usemapcode = false;
|
||||
INT32 newmapnum;
|
||||
INT32 newmapnum = -1;
|
||||
size_t mapnamelen = strlen(mapname);
|
||||
char *p;
|
||||
|
||||
|
|
|
@ -940,7 +940,7 @@ void Command_Droprate(void)
|
|||
static boolean ShouldDropPacket(void)
|
||||
{
|
||||
return (packetdropquantity[netbuffer->packettype])
|
||||
|| (packetdroprate != 0 && rand() < (RAND_MAX * (packetdroprate / 100.f))) || packetdroprate == 100;
|
||||
|| (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -11307,7 +11307,7 @@ void P_DoTailsOverlay(player_t *player, mobj_t *tails)
|
|||
fixed_t backwards = -1*FRACUNIT;
|
||||
boolean doswim = (player->panim == PA_ABILITY && (player->mo->eflags & MFE_UNDERWATER));
|
||||
boolean doroll = (player->panim == PA_ROLL || (player->panim == PA_JUMP && !(player->charflags & SF_NOJUMPSPIN)) || doswim);
|
||||
angle_t rollangle;
|
||||
angle_t rollangle = 0;
|
||||
boolean panimchange;
|
||||
INT32 ticnum = 0;
|
||||
statenum_t chosenstate;
|
||||
|
@ -12089,7 +12089,7 @@ void P_PlayerThink(player_t *player)
|
|||
// deez New User eXperiences.
|
||||
{
|
||||
angle_t oldang = player->drawangle, diff = 0;
|
||||
UINT8 factor;
|
||||
UINT8 factor = 0;
|
||||
// Directionchar!
|
||||
// Camera angle stuff.
|
||||
if (player->exiting // no control, no modification
|
||||
|
|
|
@ -2857,7 +2857,7 @@ size_t I_GetRandomBytes(char *destination, size_t count)
|
|||
{
|
||||
#if defined (__unix__) || defined (UNIXCOMMON) || defined(__APPLE__)
|
||||
FILE *rndsource;
|
||||
size_t actual_bytes;
|
||||
size_t actual_bytes = 0;
|
||||
|
||||
if (!(rndsource = fopen("/dev/urandom", "r")))
|
||||
if (!(rndsource = fopen("/dev/random", "r")))
|
||||
|
|
|
@ -815,7 +815,7 @@ static inline void ST_drawRings(void)
|
|||
|
||||
static void ST_drawLivesArea(void)
|
||||
{
|
||||
INT32 v_colmap = V_YELLOWMAP, livescount;
|
||||
INT32 v_colmap = V_YELLOWMAP, livescount = -1;
|
||||
boolean notgreyedout = false;
|
||||
|
||||
if (!stplyr->skincolor)
|
||||
|
|
Loading…
Reference in a new issue