]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Elvis has left the building
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 6 Feb 2024 13:25:08 +0000 (23:25 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 6 Feb 2024 13:25:08 +0000 (23:25 +1000)
Apparently MICROS~1 still doesn't support this (clang and gcc do).

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cl_screen.c
common.c
mvm_cmds.c
netconn.c

index 1d1280e990808143a612042a05a0dda7f20de5ba..fd5188eb3386ebcb2168abb21cdc43b100d8204d 100644 (file)
@@ -738,7 +738,9 @@ SCR_DrawConsole
 void SCR_DrawConsole (void)
 {
        // infobar and loading progress are not drawn simultaneously
-       scr_con_margin_bottom = SCR_InfobarHeight() ?: scr_loading * scr_loadingscreen_barheight.integer;
+       scr_con_margin_bottom = SCR_InfobarHeight();
+       if (!scr_con_margin_bottom && scr_loading)
+               scr_con_margin_bottom = scr_loadingscreen_barheight.integer;
        if (key_consoleactive & KEY_CONSOLEACTIVE_FORCED)
        {
                // full screen
index c14ada56bef03674cd4d8be322e37747545c6291..f4e459af3e104d8a883a3a1447f86f19f044fa2a 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1407,9 +1407,12 @@ size_t dp__strlcpy(char *dst, const char *src, size_t dsize, const char *func, u
  */
 size_t dp__strlcat(char *dst, const char *src, size_t dsize, const char *func, unsigned line)
 {
-       char *p = (char *)memchr(dst, '\0', dsize) ?: dst;
-       size_t offset = p - dst;
+       size_t offset;
+       char *p = (char *)memchr(dst, '\0', dsize);
 
+       if (!p)
+               p = dst;
+       offset = p - dst;
        return dp__strlcpy(p, src, dsize - offset, func, line) + offset;
 }
 
index ba785d59c239c824b953932f3f0d58d8b988959a..8e63f37a563830c3d52208de545795029744974f 100644 (file)
@@ -557,7 +557,7 @@ static void VM_M_getserverlistnumber(prvm_prog_t *prog)
                        break;
                case SLIF_PING:
                        // display inf when a listed server times out and net_slist_pause blocks its removal
-                       PRVM_G_FLOAT( OFS_RETURN ) = cache->info.ping ?: INFINITY;
+                       PRVM_G_FLOAT( OFS_RETURN ) = cache->info.ping ? cache->info.ping : INFINITY;
                        break;
                case SLIF_PROTOCOL:
                        PRVM_G_FLOAT( OFS_RETURN ) = cache->info.protocol;
index 5b569bf713e8494bd194306d1114d452273e6b33..801e6fc88810f6b832e1960a8164dfb8537e242b 100644 (file)
--- a/netconn.c
+++ b/netconn.c
@@ -1787,7 +1787,7 @@ static void NetConn_ClientParsePacket_ServerList_UpdateCache(int n)
        // update description strings for engine menu and console output
        entry->line1_len = dpsnprintf(entry->line1, sizeof(serverlist_cache[n].line1), "^%c%5.0f^7 ^%c%3u^7/%3u %-65.65s",
                   info->ping >= 300 ? '1' : (info->ping >= 200 ? '3' : '7'),
-                  info->ping ?: INFINITY, // display inf when a listed server times out and net_slist_pause blocks its removal
+                  info->ping ? info->ping : INFINITY, // display inf when a listed server times out and net_slist_pause blocks its removal
                   ((info->numhumans > 0 && info->numhumans < info->maxplayers) ? (info->numhumans >= 4 ? '7' : '3') : '1'),
                   info->numplayers,
                   info->maxplayers,