]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - keys.c
made darkplaces compile successfully with g++ to test for errors C doesn't care about...
[xonotic/darkplaces.git] / keys.c
diff --git a/keys.c b/keys.c
index 4be917f352ad3a9412ce74101d798fd67c06fc7a..b17c3f66845ffa80bb038bc9c62c4b8ee5c01059 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -348,7 +348,7 @@ Key_Console (int key, char ascii)
        // delete char on cursor
        if (key == K_DEL || key == K_KP_DEL)
        {
-               if ((size_t)key_linepos < strlen(key_lines[edit_line]))
+               if (key_linepos < (int)strlen(key_lines[edit_line]))
                        strcpy(key_lines[edit_line] + key_linepos, key_lines[edit_line] + key_linepos + 1);
                return;
        }
@@ -358,7 +358,7 @@ Key_Console (int key, char ascii)
        // otherwise just go right one
        if (key == K_RIGHTARROW || key == K_KP_RIGHTARROW)
        {
-               if ((size_t)key_linepos < strlen(key_lines[edit_line]))
+               if (key_linepos < (int)strlen(key_lines[edit_line]))
                        key_linepos++;
 
                return;
@@ -553,7 +553,7 @@ Key_KeynumToString (int keynum)
 void
 Key_SetBinding (int keynum, int bindmap, const char *binding)
 {
-       char *new;
+       char *newbinding;
        size_t l;
 
        if (keynum == -1)
@@ -566,10 +566,10 @@ Key_SetBinding (int keynum, int bindmap, const char *binding)
        }
 // allocate memory for new binding
        l = strlen (binding);
-       new = Z_Malloc (l + 1);
-       strcpy (new, binding);
-       new[l] = 0;
-       keybindings[bindmap][keynum] = new;
+       newbinding = (char *)Z_Malloc (l + 1);
+       strcpy (newbinding, binding);
+       newbinding[l] = 0;
+       keybindings[bindmap][keynum] = newbinding;
 }
 
 static void