diff --git a/src/d_main.c b/src/d_main.c index f37d70a2c..ab5fe7a10 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -639,7 +639,7 @@ void D_SRB2Loop(void) tic_t entertic = 0, oldentertics = 0, realtics = 0, rendertimeout = INFTICS; double deltatics = 0.0; double deltasecs = 0.0; - UINT64 precision; + UINT64 precision = 0; boolean interp = false; boolean doDisplay = false; diff --git a/src/d_net.c b/src/d_net.c index 59b31a1fb..c0d8c667b 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -59,7 +59,7 @@ static INT16 reboundsize[MAXREBOUND]; static INT32 rebound_head, rebound_tail; /// \brief max length per packet -INT16 hardware_MAXPACKETLENGTH; +INT16 hardware_MAXPACKETLENGTH = 0; boolean (*I_NetGet)(void) = NULL; void (*I_NetSend)(void) = NULL; @@ -96,7 +96,7 @@ INT32 ticruned = 0, ticmiss = 0; // globals INT32 getbps = 0, sendbps = 0; -float lostpercent = 0, duppercent = 0, gamelostpercent = 0; +float lostpercent = 0.0f, duppercent = 0.0f, gamelostpercent = 0.0f; INT32 packetheaderlength = 0; boolean Net_GetNetStat(void) diff --git a/src/filesrch.c b/src/filesrch.c index f7ff612bd..e34b51c47 100644 --- a/src/filesrch.c +++ b/src/filesrch.c @@ -49,7 +49,7 @@ size_t menupathindex[menudepth] = {}; size_t menudepthleft = menudepth; char menusearchbuf[MAXSTRINGLENGTH+1]; -textinput_t menusearch; +textinput_t menusearch = {}; char **dirmenu = NULL, **coredirmenu = NULL; // core only local for this file size_t sizedirmenu = 0, sizecoredirmenu = 0; // ditto @@ -271,10 +271,13 @@ static boolean filemenucmp(char *haystack, char *needle) { static char localhaystack[128]; strlcpy(localhaystack, haystack, 128); + if (!cv_addons_search_case.value) strupr(localhaystack); + if (cv_addons_search_type.value) - return (strstr(localhaystack, needle) != 0); + return (strstr(localhaystack, needle) != NULL); + return (!strncmp(localhaystack, needle, menusearch.length)); } diff --git a/src/g_game.c b/src/g_game.c index 2d2a49461..892579163 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -132,7 +132,7 @@ UINT8 skincolor_bluering = SKINCOLOR_STEEL; tic_t countdowntimer = 0; boolean countdowntimeup = false; -cutscene_t *cutscenes[128]; +cutscene_t *cutscenes[128] = {}; INT16 nextmapoverride = 0; boolean skipstats = false; @@ -144,7 +144,7 @@ mobj_t *blueflag = NULL; mapthing_t *rflagpoint = NULL; mapthing_t *bflagpoint = NULL; -struct quake quake; +struct quake quake = {}; // Map Header Information mapheader_t* mapheaderinfo[NUMMAPS] = {}; @@ -228,7 +228,7 @@ tic_t racecountdown = 0, exitcountdown = 0; // for racing fixed_t gravity = 0; fixed_t mapobjectscale = FRACUNIT; -struct maplighting maplighting; +struct maplighting maplighting = {}; INT16 autobalance = 0; //for CTF team balance INT16 teamscramble = 0; //for CTF team scramble diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 94656e843..edd2f51a7 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -745,7 +745,7 @@ typedef struct gl_shaderstate_s static gl_shaderstate_t gl_shaderstate; // Shader info -static float shader_leveltime = 0; +static float shader_leveltime = 0.0f; static float shader_light_x = 0.0f; static float shader_light_y = 0.0f; static float shader_light_z = 0.0f; diff --git a/src/i_time.c b/src/i_time.c index 09d5fb3fa..6e5cc3a4d 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -21,7 +21,7 @@ #include "m_fixed.h" #include "i_system.h" -timestate_t g_time; +timestate_t g_time = {}; static CV_PossibleValue_t timescale_cons_t[] = {{FRACUNIT/20, "MIN"}, {20*FRACUNIT, "MAX"}, {0, NULL}}; consvar_t cv_timescale = {"timescale", "1.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, timescale_cons_t, NULL, FRACUNIT, NULL, NULL, 0, 0, NULL}; diff --git a/src/k_hud.c b/src/k_hud.c index 1d9b7fe5b..f4f7f1c1a 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -568,7 +568,7 @@ static patch_t *kp_racefinish[6]; static patch_t *kp_positionnum[NUMPOSNUMS][NUMPOSFRAMES]; static patch_t *kp_winnernum[NUMPOSFRAMES]; -patch_t *kp_facenum[MAXPLAYERS+1]; +patch_t *kp_facenum[MAXPLAYERS+1] = {}; static patch_t *kp_facehighlight[8]; static patch_t *kp_rankbumper; diff --git a/src/r_things.cpp b/src/r_things.cpp index b62d9e5d7..cab9512e3 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -658,7 +658,7 @@ void R_DrawMaskedColumn(drawcolumndata_t* dc, column_t *column) dc->texturemid = basetexturemid; } -INT32 lengthcol; // column->length : for flipped column function pointers and multi-patch on 2sided wall = texture->height +INT32 lengthcol = 0; // column->length : for flipped column function pointers and multi-patch on 2sided wall = texture->height static void R_DrawFlippedMaskedColumn(drawcolumndata_t* dc, column_t *column) { @@ -3086,7 +3086,7 @@ static void R_DrawMaskedList(drawnode_t* head) void R_DrawMasked(maskcount_t* masks, INT32 nummasks) { INT32 i; - drawnode_t *heads; /**< Drawnode lists; as many as number of views/portals. */ + drawnode_t *heads = NULL; /**< Drawnode lists; as many as number of views/portals. */ heads = static_cast(calloc(nummasks, sizeof(drawnode_t)));