Fix MSVC C4701 possible uninitalized variable used

Signed-off-by: Ibrahim Zidan <brahem@aotsw.com>
This commit is contained in:
Ibrahim Zidan 2026-07-10 01:08:25 +03:00
parent 0a59d80d23
commit 84407e167a
No known key found for this signature in database
GPG key ID: 0F0A43C7FE4C7B9A
6 changed files with 9 additions and 6 deletions

View file

@ -41,4 +41,6 @@ add_library(hercules-http_parser STATIC
if(NOT MSVC)
target_compile_options(hercules-http_parser PRIVATE -Wno-shadow -Wno-switch-enum)
else()
target_compile_options(hercules-http_parser PRIVATE /wd4456)
endif()

View file

@ -6530,7 +6530,7 @@ static void battle_reflect_damage(struct block_list *target, struct block_list *
trdamage -= rdamage;/* wont count towards total */
enum autocast_type ac_type;
enum autocast_type ac_type = AUTOCAST_NONE;
if (sd != NULL) {
ac_type = sd->auto_cast_current.type;

View file

@ -101,7 +101,7 @@ static void rodex_add_item(struct map_session_data *sd, int16 idx, int16 amount)
}
bool is_new = true;
int i;
int i = RODEX_MAX_ITEM;
// stackable item, try to find it in the current list
if (itemdb->isstackable(inv_item->nameid) == 1) {

View file

@ -6361,7 +6361,7 @@ static bool script_sprintf_helper(struct script_state *st, int start, struct Str
np++;
} else if (*np == '*') {
bool positional_widtharg = false;
int width_arg;
int width_arg = 0;
np++;
// pos-parameter = number "$"
if (ISDIGIT(*np) && *np != '0') {
@ -18141,7 +18141,7 @@ static BUILDIN(getnpcdir)
// set npc direction [4144]
static BUILDIN(setnpcdir)
{
int newdir;
int newdir = 0;
struct npc_data *nd = NULL;
if (script_hasdata(st, 3)) {

View file

@ -20112,7 +20112,8 @@ static int skill_can_produce_mix(struct map_session_data *sd, int nameid, int tr
static int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, int slot1, int slot2, int slot3, int qty)
{
int slot[3];
int i,sc,ele,idx,equip,wlv,make_per = 0,flag = 0,skill_lv = 0;
int i,sc,ele,idx,equip,make_per = 0,flag = 0,skill_lv = 0;
int wlv = 0; // Consider weapon level 0 until actually a weapon is picked later in code
int num = -1; // exclude the recipe
struct status_data *st;
struct item_data* data;

View file

@ -107,7 +107,7 @@ bool write_mapcache(const uint8 *buf, int32 buf_len, bool is_compressed, const c
struct map_cache_header header = { 0 };
char file_path[255];
int mapname_len;
unsigned long compressed_buf_len;
unsigned long compressed_buf_len = 0;
uint8 *compressed_buf = NULL;
FILE *new_mapcache_fp;