From 254fb2c8e0839e249b961fb9f6fa57cab65b8c6e Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 6 Feb 2024 23:25:08 +1000 Subject: [PATCH] Elvis has left the building Apparently MICROS~1 still doesn't support this (clang and gcc do). Signed-off-by: bones_was_here --- cl_screen.c | 4 +++- common.c | 7 +++++-- mvm_cmds.c | 2 +- netconn.c | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 1d1280e9..fd5188eb 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -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 diff --git a/common.c b/common.c index c14ada56..f4e459af 100644 --- 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; } diff --git a/mvm_cmds.c b/mvm_cmds.c index ba785d59..8e63f37a 100644 --- a/mvm_cmds.c +++ b/mvm_cmds.c @@ -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; diff --git a/netconn.c b/netconn.c index 5b569bf7..801e6fc8 100644 --- 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, -- 2.39.2