From c4d24f7553a141db36f4680c56384fca4c14b005 Mon Sep 17 00:00:00 2001 From: Markus Zehnder Date: Wed, 5 Feb 2025 09:17:12 +0100 Subject: [PATCH] build: C++20 compatibility A small fix to remove "volatile ++" build warning. Source: https://github.com/crankyoldgit/IRremoteESP8266/pull/2040 --- src/IRrecv.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/IRrecv.cpp b/src/IRrecv.cpp index 645fcbbb2..e76cacbd9 100644 --- a/src/IRrecv.cpp +++ b/src/IRrecv.cpp @@ -219,7 +219,7 @@ static void USE_IRAM_ATTR gpio_intr() { else params.rawbuf[rawlen] = (now - start) / kRawTick; } - params.rawlen++; + params.rawlen = params.rawlen + 1; // C++20 fix start = now; @@ -540,8 +540,8 @@ void IRrecv::crudeNoiseFilter(decode_results *results, const uint16_t floor) { for (uint16_t i = offset + 2; i <= results->rawlen && i < kBufSize; i++) results->rawbuf[i - 2] = results->rawbuf[i]; if (offset > 1) { // There is a previous pair we can add to. - // Merge this pair into into the previous space. - results->rawbuf[offset - 1] += addition; + // Merge this pair into into the previous space. // C++20 fix applied + results->rawbuf[offset - 1] = results->rawbuf[offset - 1] + addition; } results->rawlen -= 2; // Adjust the length. } else {