diff --git a/src/kaleidoscope/device/virtual/Virtual.cpp b/src/kaleidoscope/device/virtual/Virtual.cpp index a4bd2b17..387719d8 100644 --- a/src/kaleidoscope/device/virtual/Virtual.cpp +++ b/src/kaleidoscope/device/virtual/Virtual.cpp @@ -360,7 +360,7 @@ void VirtualLEDDriver::syncLeds() { } void VirtualLEDDriver::setCrgbAt(uint8_t i, cRGB color) { - if ((int)i >= (int)led_count) { + if (static_cast(i) >= static_cast(led_count)) { log_error("Virtual::setCrgbAt: Index %d out of bounds\n", i); return; } @@ -368,7 +368,7 @@ void VirtualLEDDriver::setCrgbAt(uint8_t i, cRGB color) { } cRGB VirtualLEDDriver::getCrgbAt(uint8_t i) const { - if ((int)i >= (int)led_count) { + if (static_cast(i) >= static_cast(led_count)) { log_error("Virtual::getCrgbAt: Index %d out of bounds\n", i); return CRGB(0, 0, 0); } diff --git a/src/kaleidoscope/driver/led/WS2812.h b/src/kaleidoscope/driver/led/WS2812.h index a79daa85..0b041d69 100644 --- a/src/kaleidoscope/driver/led/WS2812.h +++ b/src/kaleidoscope/driver/led/WS2812.h @@ -85,7 +85,7 @@ class WS2812 { bool modified_ = false; void sendArrayWithMask(uint8_t maskhi) { - uint8_t *data = (uint8_t *)leds_; + uint8_t *data = reinterpret_cast(leds_); uint16_t datalen = ledCount * sizeof(Color); uint8_t curbyte, ctr, masklo; uint8_t sreg_prev;