From fca7b4a837b80ee62924dc6e4cc10e42596dac40 Mon Sep 17 00:00:00 2001 From: Indev Date: Tue, 1 Jul 2025 15:15:36 +0300 Subject: [PATCH 1/2] Use std::min --- src/m_emotes.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/m_emotes.cpp b/src/m_emotes.cpp index 27c66be14..052fbfec4 100644 --- a/src/m_emotes.cpp +++ b/src/m_emotes.cpp @@ -9,11 +9,13 @@ extern "C" { #include "w_wad.h" #include "z_zone.h" #include "hu_stuff.h" - -// Goddammit #include "v_video.h" } +// No thanks +#undef min +#undef max + consvar_t cv_emotes = {"emotes", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};; static std::map emotes; @@ -186,11 +188,11 @@ emote_t *M_FindEmote(const char *name, int len, int skip) return nullptr; char query[MAXEMOTENAME+1] = {0}; - std::strncpy(query, name, min(len, MAXEMOTENAME)); + std::strncpy(query, name, std::min(len, MAXEMOTENAME)); for (auto &pair: emotes) { - if (pair.first.rfind(query, 0, min(len, MAXEMOTENAME)) != 0) + if (pair.first.rfind(query, 0, std::min(len, MAXEMOTENAME)) != 0) continue; if (skip > 0) From 5d8bb3223f5d861d0245ee10e84a693707095ef4 Mon Sep 17 00:00:00 2001 From: Indev Date: Tue, 1 Jul 2025 15:25:48 +0300 Subject: [PATCH 2/2] No need for this now --- src/m_emotes.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/m_emotes.cpp b/src/m_emotes.cpp index 052fbfec4..facc7fb54 100644 --- a/src/m_emotes.cpp +++ b/src/m_emotes.cpp @@ -12,10 +12,6 @@ extern "C" { #include "v_video.h" } -// No thanks -#undef min -#undef max - consvar_t cv_emotes = {"emotes", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};; static std::map emotes;