Fix more warnings
This commit is contained in:
parent
25d7ea3e6a
commit
b8f4b081a4
5 changed files with 14 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ void ROGAllyController::UpdateDevice
|
|||
unsigned char mode,
|
||||
std::vector<RGBColor> colors,
|
||||
unsigned char speed,
|
||||
unsigned char brightness,
|
||||
unsigned char /*brightness*/,
|
||||
unsigned char direction
|
||||
)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue