]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix several warnings with gcc-5 and an error with mingw (where
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 8 Nov 2015 19:33:00 +0000 (19:33 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 24 Nov 2015 13:37:33 +0000 (14:37 +0100)
HAVE_CLOCKGETTIME was somehow being defined)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12230 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=641d75aeb3b3934d9bbe1e2603bdd05d14a15ff1

prvm_cmds.c
prvm_cmds.h
prvm_edict.c
sys_shared.c
vid_sdl.c

index ba832b81f63853aeba10e2a0952c3952fa261c74..e1b248dd0169b05f10aa33ea16a110a746969751 100644 (file)
@@ -4639,7 +4639,7 @@ static int BufStr_SortStringsDOWN (const void *in1, const void *in2)
        return strncmp(b, a, stringbuffers_sortlength);
 }
 
-prvm_stringbuffer_t *BufStr_FindCreateReplace (prvm_prog_t *prog, int bufindex, int flags, char *format)
+prvm_stringbuffer_t *BufStr_FindCreateReplace (prvm_prog_t *prog, int bufindex, int flags, const char *format)
 {
        prvm_stringbuffer_t *stringbuffer;
        int i;
index 708a3621151c07e70a88b39e3e2224b12e161658..0120975805c24be28016c5a7c3848b84c2a808b5 100644 (file)
@@ -220,7 +220,7 @@ void PR_Cmd_Init(void);
 // general functions
 void VM_CheckEmptyString (prvm_prog_t *prog, const char *s);
 void VM_VarString(prvm_prog_t *prog, int first, char *out, int outlength);
-prvm_stringbuffer_t *BufStr_FindCreateReplace (prvm_prog_t *prog, int bufindex, int flags, char *format);
+prvm_stringbuffer_t *BufStr_FindCreateReplace (prvm_prog_t *prog, int bufindex, int flags, const char *format);
 void BufStr_Set(prvm_prog_t *prog, prvm_stringbuffer_t *stringbuffer, int strindex, const char *str);
 void BufStr_Del(prvm_prog_t *prog, prvm_stringbuffer_t *stringbuffer);
 void BufStr_Flush(prvm_prog_t *prog);
index bc6c5ad53efa731413ba8ad91ddd4dc239801741..a002fd43c71d8f3cea1426b03c791e76f06e4762 100644 (file)
@@ -3105,7 +3105,11 @@ int PRVM_AllocString(prvm_prog_t *prog, size_t bufferlength, char **pointer)
 {
        int i;
        if (!bufferlength)
+       {
+               if (pointer)
+                       *pointer = NULL;
                return 0;
+       }
        for (i = prog->firstfreeknownstring;i < prog->numknownstrings;i++)
                if (!prog->knownstrings[i])
                        break;
index 03c059850eaf8183e6a192656adf0df0080d3af5..c32e9d2390415f6ee633a1179a85eb578e3175f7 100644 (file)
@@ -238,11 +238,10 @@ void* Sys_GetProcAddress (dllhandle_t handle, const char* name)
 # define HAVE_Sleep 1
 #endif
 
+#ifndef WIN32
 #if defined(CLOCK_MONOTONIC) || defined(CLOCK_HIRES)
 # define HAVE_CLOCKGETTIME 1
 #endif
-
-#ifndef WIN32
 // FIXME improve this check, manpage hints to DST_NONE
 # define HAVE_GETTIMEOFDAY 1
 #endif
index a6edf127d361e7231e7cdca5a360cfcf5b9f3df7..a1bef3b39c1149f613fad8b8b77f372454cc38ec 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -2453,7 +2453,7 @@ static void AdjustWindowBounds(viddef_mode_t *mode, RECT *rect)
        else 
        {
                rect->left = workArea.left + max(0, (workWidth - width) / 2);
-               rect->top = workArea.top + (0, (workHeight - height) / 2);
+               rect->top = workArea.top + ((workHeight - height) / 2);
        }
 }
 #endif