From 6a0c52a5aa510be62bcf31768d9c0cdc6824a448 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 30 Jan 2024 22:07:39 +1000 Subject: [PATCH] Fix some mingw warnings Signed-off-by: bones_was_here --- clvm_cmds.c | 1 + common.c | 3 ++- prvm_cmds.c | 3 ++- sys_shared.c | 4 ---- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/clvm_cmds.c b/clvm_cmds.c index 3710852f..a08bb6ba 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -2393,6 +2393,7 @@ static void VM_CL_getplayerkey (prvm_prog_t *prog) return; t[0] = 0; + t_len = 0; if(!strcasecmp(c, "name")) t_len = dp_strlcpy(t, cl.scores[i].name, sizeof(t)); diff --git a/common.c b/common.c index cf2fb248..c14ada56 100644 --- a/common.c +++ b/common.c @@ -1345,7 +1345,8 @@ copy one byte at a time (even at -O3) and its advantage increases with string le #ifdef WIN32 // memccpy() is standard in POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD, C23. // Microsoft supports it, but apparently complains if we use it. - #pragma warning(disable : 4996) + #undef memccpy + #define memccpy _memccpy #endif /** Chain-copies a string with truncation and efficiency (compared to strlcat()). diff --git a/prvm_cmds.c b/prvm_cmds.c index bfe40a3b..f60d2d4e 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -274,7 +274,8 @@ void VM_RemoveEdictSkeleton(prvm_prog_t *prog, prvm_edict_t *ed) #ifdef WIN32 // memccpy() is standard in POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD, C23. // Microsoft supports it, but apparently complains if we use it. - #pragma warning(disable : 4996) + #undef memccpy + #define memccpy _memccpy #endif size_t VM_VarString(prvm_prog_t *prog, int first, char *out, size_t outsize) { diff --git a/sys_shared.c b/sys_shared.c index fde91ce3..7ce69c31 100644 --- a/sys_shared.c +++ b/sys_shared.c @@ -38,10 +38,6 @@ #include "thread.h" #include "libcurl.h" -#ifdef WIN32 - // Microsoft's compiler complains about portable code - #pragma warning(disable : 4996) -#endif sys_t sys; -- 2.39.2