From b05bdf28fc600129888ebec647656ed4b3d1698b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 9 Oct 2017 17:34:37 +0200 Subject: [PATCH] Fix compilation with older clang Older clang would expand the macros and spot that clamping unsigned values to [0, MAX] is a tautological operation and produce an error. As these are tautological operations, no network version change should be needed. --- src/openrct2/core/textinputbuffer.c | 2 +- src/openrct2/peep/peep.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/core/textinputbuffer.c b/src/openrct2/core/textinputbuffer.c index 33adfc46d8..f3ec628f9d 100644 --- a/src/openrct2/core/textinputbuffer.c +++ b/src/openrct2/core/textinputbuffer.c @@ -108,7 +108,7 @@ void textinputbuffer_cursor_right(textinputbuffer * tib) selectionOffset++; } while (!utf8_is_codepoint_start(ch) && selectionOffset < selectionMaxOffset); - tib->selection_size = max(0, tib->selection_size - (selectionOffset - tib->selection_offset)); + tib->selection_size = tib->selection_size - (selectionOffset - tib->selection_offset); tib->selection_offset = selectionOffset; } } diff --git a/src/openrct2/peep/peep.c b/src/openrct2/peep/peep.c index f52fb3f24b..9003d635d8 100644 --- a/src/openrct2/peep/peep.c +++ b/src/openrct2/peep/peep.c @@ -10830,7 +10830,7 @@ static void peep_update_ride_nausea_growth(rct_peep *peep, Ride *ride) uint32 nauseaGrowthRateChange = (ride->nausea * nauseaMultiplier) / 512; nauseaGrowthRateChange *= max(128, peep->hunger) / 64; nauseaGrowthRateChange >>= (peep->nausea_tolerance & 3); - peep->nausea_target = (uint8)clamp(0, peep->nausea_target + nauseaGrowthRateChange, 255); + peep->nausea_target = (uint8)max(peep->nausea_target + nauseaGrowthRateChange, 255); } static bool peep_should_go_on_ride_again(rct_peep *peep, Ride *ride)