From 67bfe620958ef65ac4403c4a7aaa480f2c6dfc07 Mon Sep 17 00:00:00 2001 From: Hideaki Tai Date: Wed, 25 Nov 2020 19:52:49 +0900 Subject: [PATCH] change callback arguments to const for safety --- Artnet.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Artnet.h b/Artnet.h index faa69ed..2088710 100644 --- a/Artnet.h +++ b/Artnet.h @@ -118,8 +118,8 @@ namespace arx { static constexpr uint8_t NUM_PIXELS_PER_UNIV{170}; - using CallbackAllType = std::function; - using CallbackType = std::function; + using CallbackAllType = std::function; + using CallbackType = std::function; #if ARX_HAVE_LIBSTDCPLUSPLUS >= 201103L // Have libstdc++11 template @@ -369,7 +369,7 @@ namespace arx { #ifdef FASTLED_VERSION inline void forward(const uint32_t universe, CRGB* leds, const uint16_t num) { - subscribe(universe, [&](uint8_t* data, uint16_t size) { + subscribe(universe, [&](const uint8_t* data, const uint16_t size) { if (size < num * 3) Serial.println(F("ERROR: Too many LEDs to forward")); for (size_t pixel = 0; pixel < num; ++pixel) { size_t idx = pixel * 3;