diff --git a/Controllers/AsusAuraUSBController/AsusAuraMousematController.cpp b/Controllers/AsusAuraUSBController/AsusAuraMousematController.cpp index 2664583d..c9eb8716 100644 --- a/Controllers/AsusAuraUSBController/AsusAuraMousematController.cpp +++ b/Controllers/AsusAuraUSBController/AsusAuraMousematController.cpp @@ -55,8 +55,8 @@ std::string AuraMousematController::GetVersion() unsigned char usb_buf_out[65]; hid_read(dev, usb_buf_out, 65); - char version[8]; - snprintf(version, 8, "%X.%02X.%02X", usb_buf_out[6], usb_buf_out[7], usb_buf_out[8]); + char version[9]; + snprintf(version, 9, "%X.%02X.%02X", usb_buf_out[6], usb_buf_out[7], usb_buf_out[8]); return std::string(version); } @@ -116,7 +116,7 @@ void AuraMousematController::UpdateDevice usb_buf[0x0b + i * 3] = RGBGetGValue(colors[i]); usb_buf[0x0c + i * 3] = RGBGetBValue(colors[i]); } - + hid_write(dev, usb_buf, 65); } diff --git a/Controllers/AsusAuraUSBController/AsusROGAllyController.cpp b/Controllers/AsusAuraUSBController/AsusROGAllyController.cpp index b09f7c8f..966e8606 100644 --- a/Controllers/AsusAuraUSBController/AsusROGAllyController.cpp +++ b/Controllers/AsusAuraUSBController/AsusROGAllyController.cpp @@ -76,7 +76,7 @@ void ROGAllyController::UpdateDevice unsigned char mode, std::vector colors, unsigned char speed, - unsigned char brightness, + unsigned char /*brightness*/, unsigned char direction ) { diff --git a/Controllers/EpomakerController/RGBController_EpomakerController.cpp b/Controllers/EpomakerController/RGBController_EpomakerController.cpp index d2e033f8..a2c05b64 100644 --- a/Controllers/EpomakerController/RGBController_EpomakerController.cpp +++ b/Controllers/EpomakerController/RGBController_EpomakerController.cpp @@ -400,12 +400,12 @@ void RGBController_EpomakerController::ResizeZone(int /*zone*/, int /*new_size*/ \*---------------------------------------------------------*/ } -void RGBController_EpomakerController::UpdateZoneLEDs(int zone) +void RGBController_EpomakerController::UpdateZoneLEDs(int /*zone*/) { DeviceUpdateLEDs(); } -void RGBController_EpomakerController::UpdateSingleLED(int led) +void RGBController_EpomakerController::UpdateSingleLED(int /*led*/) { DeviceUpdateLEDs(); } diff --git a/Controllers/GaiZongGaiKeyboardController/GaiZhongGaiController.cpp b/Controllers/GaiZongGaiKeyboardController/GaiZhongGaiController.cpp index 473744ff..215cd811 100644 --- a/Controllers/GaiZongGaiKeyboardController/GaiZhongGaiController.cpp +++ b/Controllers/GaiZongGaiKeyboardController/GaiZhongGaiController.cpp @@ -251,15 +251,21 @@ void GaiZhongGaiKeyboardController::SendColors for(uint8_t i = 0; i < 32; i++) //Maximum up to 640 RGB LED { if(i > color_data_size / 60) + { break; + } usb_buf[1] = i; for(uint8_t j = 0; j < 60; j++ ) { - if(i * 60 + j < color_data_size) + if((unsigned int)(i * 60 + j) < color_data_size) + { usb_buf[j + 2] = color_data[i * 60 + j]; + } else + { usb_buf[j + 2] = 0; //Redundant data set 0 + } } hid_write(dev, usb_buf, 65); } diff --git a/Controllers/KasaSmartController/KasaSmartController.cpp b/Controllers/KasaSmartController/KasaSmartController.cpp index f940569e..f61489a1 100644 --- a/Controllers/KasaSmartController/KasaSmartController.cpp +++ b/Controllers/KasaSmartController/KasaSmartController.cpp @@ -161,7 +161,7 @@ void KasaSmartController::SetColor(unsigned char red, unsigned char green, unsig | Normalize case where hue is "-1" undefined | \*------------------------------------------*/ unsigned int normalized_hue = hsv.hue; - if(hsv.hue == (int)-1) + if(hsv.hue == (unsigned int)-1) { normalized_hue = 0; }