]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fix some mingw warnings
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 30 Jan 2024 12:07:39 +0000 (22:07 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 30 Jan 2024 12:09:19 +0000 (22:09 +1000)
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
clvm_cmds.c
common.c
prvm_cmds.c
sys_shared.c

index 3710852f4a05e85a1e9a88711018efbc8e6f6517..a08bb6ba8a9b95e5a8ec818aac8b889c62eafd60 100644 (file)
@@ -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));
index cf2fb248dd2737bc8bf22dd843aaaec88532f494..c14ada56bef03674cd4d8be322e37747545c6291 100644 (file)
--- 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()).
index bfe40a3b31e877d45bc434bf57471ffb0936798d..f60d2d4e5b28b1d60332ddea881865035329fa28 100644 (file)
@@ -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)
 {
index fde91ce36d147a4cf68f511885d2ab85d23557d7..7ce69c3132be521c6173760e6df715c5bc2c6d4e 100644 (file)
 #include "thread.h"
 #include "libcurl.h"
 
-#ifdef WIN32
-       // Microsoft's compiler complains about portable code
-       #pragma warning(disable : 4996)
-#endif
 
 sys_t sys;