]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - zone.c
added r_shadow_bouncegrid 2 which disables rtlights and just renders the
[xonotic/darkplaces.git] / zone.c
diff --git a/zone.c b/zone.c
index 296e85507f69c875699a37f31572ed59719d597a..585c10396d03db32e726ccaef168d1eb32b52043 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -844,8 +844,10 @@ void MemStats_f(void)
 char* Mem_strdup (mempool_t *pool, const char* s)
 {
        char* p;
-       size_t sz = strlen (s) + 1;
-       if (s == NULL) return NULL;
+       size_t sz;
+       if (s == NULL)
+               return NULL;
+       sz = strlen (s) + 1;
        p = (char*)Mem_Alloc (pool, sz);
        strlcpy (p, s, sz);
        return p;
@@ -860,7 +862,7 @@ void Memory_Init (void)
 {
        static union {unsigned short s;unsigned char b[2];} u;
        u.s = 0x100;
-       mem_bigendian = u.b[0];
+       mem_bigendian = u.b[0] != 0;
 
        sentinel_seed = rand();
        poolchain = NULL;
@@ -891,7 +893,7 @@ void Memory_Init_Commands (void)
                Cvar_SetValueQuick(&sys_memsize_virtual, 8388608);
                // then improve
                status.dwLength = sizeof(status);
-               if(!GlobalMemoryStatusEx(&status))
+               if(GlobalMemoryStatusEx(&status))
                {
                        Cvar_SetValueQuick(&sys_memsize_physical, status.ullTotalPhys / 1048576.0);
                        Cvar_SetValueQuick(&sys_memsize_virtual, min(sys_memsize_virtual.value, status.ullTotalVirtual / 1048576.0));