From 5772cf06bafafd8e1643d09c26bd5d2989bfb8a7 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Thu, 10 Oct 2024 19:58:53 +1100 Subject: [PATCH] Minor tweaks --- src/m_misc.c | 6 +++--- src/md5.c | 2 +- src/p_inter.c | 11 ++++------- src/p_pspr.c | 2 +- src/r_skydefs.c | 1 - 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index 4b493245b..9e02317dc 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -123,7 +123,7 @@ bool M_FileExists(const char *filename) } #if !defined(_WIN32) && !defined(__APPLE__) -bool file_exists_get_path(const char *basedir, const char *filename, char **retpath) +static bool file_exists_get_path(const char *basedir, const char *filename, char **retpath) { *retpath = M_StringJoin(basedir, DIR_SEPARATOR_S, filename, NULL); @@ -540,7 +540,7 @@ char *M_StringReplaceFirst(char *haystack, const char *needle, const char *repla } #if !defined(strrstr) -char *strrstr(const char *haystack, const char *needle) +static char *strrstr(const char *haystack, const char *needle) { char *r = NULL; @@ -668,7 +668,7 @@ void M_snprintf(char *buf, int buf_len, const char *s, ...) } #if !defined(strndup) -char *strndup(const char *s, size_t n) +static char *strndup(const char *s, size_t n) { const size_t len = strnlen(s, n); char *new = malloc(len + 1); diff --git a/src/md5.c b/src/md5.c index b3bb16a2e..9b591d5a5 100644 --- a/src/md5.c +++ b/src/md5.c @@ -41,7 +41,7 @@ #include "md5.h" #ifdef WORDS_BIGENDIAN -void byteswap(uint32_t *buf, unsigned int words) +static void byteswap(uint32_t *buf, unsigned int words) { byte *p = (byte *)buf; diff --git a/src/p_inter.c b/src/p_inter.c index 7d1128a1c..5f313a1e7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -702,12 +702,6 @@ bool P_GiveAllCardsInMap(void) return result; } -void P_UpdatePowerupsStat(void) -{ - viewplayer->itemspickedup_powerups++; - stat_itemspickedup_powerups = SafeAdd(stat_itemspickedup_powerups, 1); -} - // // P_GivePower // @@ -752,7 +746,10 @@ bool P_GivePower(const int power, const bool stat) } if ((given = (viewplayer->powers[power] <= 0)) && stat) - P_UpdatePowerupsStat(); + { + viewplayer->itemspickedup_powerups++; + stat_itemspickedup_powerups = SafeAdd(stat_itemspickedup_powerups, 1); + } viewplayer->powers[power] = tics[power]; return given; diff --git a/src/p_pspr.c b/src/p_pspr.c index b6abb0ff8..2fb4dbe0c 100644 --- a/src/p_pspr.c +++ b/src/p_pspr.c @@ -62,7 +62,7 @@ void A_Recoil(const weapontype_t weapon) // // MBF21: P_SetPlayerSpritePtr // -void P_SetPlayerSpritePtr(pspdef_t *psp, statenum_t stnum) +static void P_SetPlayerSpritePtr(pspdef_t *psp, statenum_t stnum) { do { diff --git a/src/r_skydefs.c b/src/r_skydefs.c index aab3665e7..d57e573ee 100644 --- a/src/r_skydefs.c +++ b/src/r_skydefs.c @@ -180,6 +180,5 @@ skydefs_t *R_ParseSkyDefs(void) } cJSON_Delete(json); - id24compatible = true; return out; }