]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix a few warnings in VS2019.
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Dec 2020 10:15:44 +0000 (10:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Dec 2020 10:15:44 +0000 (10:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13071 d7cf8633-e32d-0410-b094-e92efae38249

console.c
sv_ccmds.c
zone.c

index ad20495cd9e47df86eb7f5e54fb0b386d42497e6..219a68d7bca0d002cd6920652f15591f10e11315 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1526,7 +1526,7 @@ Modified by EvilTypeGuy eviltypeguy@qeradiant.com
 */
 static void Con_DrawInput(qbool is_console, float x, float v, float inputsize)
 {
-       int y, i, col_out, linepos, text_start, prefix_start;
+       int y, i, col_out, linepos, text_start, prefix_start = 0;
        char text[MAX_INPUTLINE + 5 + 9 + 1]; // space for ^xRGB, "say_team:" and \0
        float xo;
        size_t len_out;
index d9e08c045008e2828b9aec013c67808dc56c28f5..b995ff7a2ad1c4de34677ac488adf4e98a39e2f6 100644 (file)
@@ -1411,7 +1411,6 @@ static void SV_Ent_Create_f(cmd_state_t *cmd)
        int i;
        qbool haveorigin;
 
-       qbool expectval = false;
        void (*print)(const char *, ...) = (cmd->source == src_client ? SV_ClientPrintf : Con_Printf);
 
        if(!Cmd_Argc(cmd))
@@ -1450,31 +1449,24 @@ static void SV_Ent_Create_f(cmd_state_t *cmd)
        }
 
        // Allow more than one key/value pair by cycling between expecting either one.
-       for(i = 2; i < Cmd_Argc(cmd); i++)
+       for(i = 2; i < Cmd_Argc(cmd); i += 2)
        {
-               if(!expectval)
+               if(!(key = PRVM_ED_FindField(prog, Cmd_Argv(cmd, i))))
                {
-                       if(!(key = PRVM_ED_FindField(prog, Cmd_Argv(cmd, i))))
-                       {
-                               print("Key %s not found!\n", Cmd_Argv(cmd, i));
-                               PRVM_ED_Free(prog, ed);
-                               return;
-                       }
+                       print("Key %s not found!\n", Cmd_Argv(cmd, i));
+                       PRVM_ED_Free(prog, ed);
+                       return;
+               }
 
-                       /*
-                        * This is mostly for dedicated server console, but if the
-                        * player gave a custom origin, we can ignore the traceline.
-                        */
-                       if(!strcmp(Cmd_Argv(cmd, i), "origin"))
-                               haveorigin = true;
+               /*
+               * This is mostly for dedicated server console, but if the
+               * player gave a custom origin, we can ignore the traceline.
+               */
+               if(!strcmp(Cmd_Argv(cmd, i), "origin"))
+                       haveorigin = true;
 
-                       expectval = true;
-               }
-               else
-               {
-                       PRVM_ED_ParseEpair(prog, ed, key, Cmd_Argv(cmd, i), false);
-                       expectval = false;
-               }
+               if (i + 1 < Cmd_Argc(cmd))
+                       PRVM_ED_ParseEpair(prog, ed, key, Cmd_Argv(cmd, i+1), false);
        }
 
        if(!haveorigin)
@@ -1509,7 +1501,7 @@ static void SV_Ent_Remove_f(cmd_state_t *cmd)
 {
        prvm_prog_t *prog = SVVM_prog;
        prvm_edict_t *ed;
-       int i, ednum;
+       int i, ednum = 0;
        void (*print)(const char *, ...) = (cmd->source == src_client ? SV_ClientPrintf : Con_Printf);
 
        if(!Cmd_Argc(cmd))
diff --git a/zone.c b/zone.c
index 8657a476ae37647262fa5bd27be042214207908e..b357a013aeec18f0c7d491a081608c37c6c764c7 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -201,14 +201,14 @@ static void *Clump_AllocBlock(size_t size)
 #if MEMCLUMPING
        if (size <= MEMCLUMPSIZE)
        {
-               int index;
-               unsigned int bit;
-               unsigned int needbits;
-               unsigned int startbit;
-               unsigned int endbit;
-               unsigned int needints;
-               int startindex;
-               int endindex;
+               intptr_t index;
+               size_t bit;
+               size_t needbits;
+               size_t startbit;
+               size_t endbit;
+               size_t needints;
+               intptr_t startindex;
+               intptr_t endindex;
                unsigned int value;
                unsigned int mask;
                unsigned int *array;
@@ -312,10 +312,10 @@ nofreeblock:
 static void Clump_FreeBlock(void *base, size_t size)
 {
 #if MEMCLUMPING
-       unsigned int needbits;
-       unsigned int startbit;
-       unsigned int endbit;
-       unsigned int bit;
+       size_t needbits;
+       size_t startbit;
+       size_t endbit;
+       size_t bit;
        memclump_t **clumpchainpointer;
        memclump_t *clump;
        unsigned char *start = (unsigned char *)base;