Fix more warnings

This commit is contained in:
Adam Honse 2024-04-28 15:37:15 -05:00
parent aa2c557045
commit 06ca1448d1
27 changed files with 108 additions and 100 deletions

View file

@ -125,7 +125,7 @@ void RGBController_BloodyMouse::SetupZones()
zone new_zone;
new_zone.name = mz.name;
new_zone.leds_min = mz.zone_leds.size();
new_zone.leds_min = (unsigned int)mz.zone_leds.size();
new_zone.leds_max = new_zone.leds_min;
new_zone.leds_count = new_zone.leds_min;
new_zone.type = bool_single ? ZONE_TYPE_SINGLE : ZONE_TYPE_LINEAR;

View file

@ -288,7 +288,7 @@ void RGBController_AOCKeyboard::SetupZones()
| Create LEDs for the Matrix zone |
| Place keys in the layout to populate the matrix |
\*---------------------------------------------------------*/
for(size_t led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
for(unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
{
led new_led;
@ -299,8 +299,6 @@ void RGBController_AOCKeyboard::SetupZones()
zones.push_back(new_zone);
SetupColors();
}

View file

@ -55,7 +55,7 @@ PolychromeUSBController::~PolychromeUSBController()
unsigned int PolychromeUSBController::GetChannelCount()
{
return(device_info.size());
return((unsigned int)device_info.size());
}
std::string PolychromeUSBController::GetDeviceLocation()
@ -381,7 +381,7 @@ void PolychromeUSBController::WriteRGSwap
bool chnl8
)
{
unsigned char rgconfig[1] = {static_cast<unsigned char>(((chnl8 << 7) | (pcb << 6) | (io << 5) | (pch << 4) | (ahdr1 << 3) | (ahdr0 << 2) | (hdr1 << 1) | hdr0))};
unsigned char rgconfig[1] = {static_cast<unsigned char>((((unsigned char)chnl8 << 7) | ((unsigned char)pcb << 6) | ((unsigned char)io << 5) | ((unsigned char)pch << 4) | ((unsigned char)ahdr1 << 3) | ((unsigned char)ahdr0 << 2) | ((unsigned char)hdr1 << 1) | (unsigned char)hdr0))};
WriteHeader(POLYCHROME_USB_RGSWAP_CFG, rgconfig, 1);
}

View file

@ -293,7 +293,7 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
set_mode = active_mode;
}
controller->WriteZone(zone_idx, set_mode, zones_info[zone_idx].speed, zones[zone_idx].colors[0], false);
controller->WriteZone((unsigned char)zone_idx, set_mode, zones_info[zone_idx].speed, zones[zone_idx].colors[0], false);
}
}

View file

@ -167,7 +167,7 @@ void RGBController_ASRockASRRGBSMBus::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_ASRockASRRGBSMBus::DeviceUpdateLEDs()
{
for (std::size_t led = 0; led < colors.size(); led++)
for(int led = 0; led < colors.size(); led++)
{
UpdateSingleLED(led);
}

View file

@ -287,7 +287,7 @@ void RGBController_ASRockPolychromeV2SMBus::ResizeZone(int /*zone*/, int /*new_s
void RGBController_ASRockPolychromeV2SMBus::DeviceUpdateLEDs()
{
for (std::size_t led = 0; led < colors.size(); led++)
for(int led = 0; led < colors.size(); led++)
{
UpdateSingleLED(led);
}

View file

@ -167,7 +167,7 @@ AlienwareController::~AlienwareController()
unsigned int AlienwareController::GetZoneCount()
{
return(zones.size());
return((unsigned int)zones.size());
}
std::vector<const char*> AlienwareController::GetZoneNames()
@ -272,7 +272,7 @@ bool AlienwareController::Dim(std::vector<uint8_t> zones, double percent)
/*-----------------------------------------------------*\
| Set up message packet with leading 00, per hidapi |
\*-----------------------------------------------------*/
uint16_t num_zones = zones.size();
uint16_t num_zones = (uint16_t)zones.size();
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x03;
@ -376,7 +376,7 @@ bool AlienwareController::SelectZones(const std::vector<uint8_t>& zones)
/*-----------------------------------------------------*\
| Set up message packet with leading 00, per hidapi |
\*-----------------------------------------------------*/
uint16_t num_zones = zones.size();
uint16_t num_zones = (uint16_t)zones.size();
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x03;
@ -515,7 +515,7 @@ bool AlienwareController::SetColorDirect(RGBColor color, std::vector<uint8_t> zo
/*-----------------------------------------------------*\
| Set up message packet with leading 00, per hidapi |
\*-----------------------------------------------------*/
uint16_t num_zones = zones.size();
uint16_t num_zones = (uint16_t)zones.size();
usb_buf[0x00] = 0x00;
usb_buf[0x01] = 0x03;

View file

@ -213,7 +213,7 @@ void RGBController_Alienware::DeviceUpdateMode()
/*-----------------------------------------------------*\
| Setup state per zone |
\*-----------------------------------------------------*/
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
for(uint8_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
zone current_zone = zones[zone_idx];

View file

@ -47,7 +47,7 @@ std::string AlienwareAW410KController::GetSerialString()
void AlienwareAW410KController::SendCommit()
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -69,7 +69,7 @@ void AlienwareAW410KController::SendCommit()
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 20 milliseconds |
@ -77,7 +77,6 @@ void AlienwareAW410KController::SendCommit()
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
void AlienwareAW410KController::SendfeatureReport
(
unsigned char first_byte,
@ -86,7 +85,7 @@ void AlienwareAW410KController::SendfeatureReport
unsigned char forth_byte
)
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -105,7 +104,7 @@ void AlienwareAW410KController::SendfeatureReport
/*-----------------------------------------------------*\
| Send Feature report packet |
\*-----------------------------------------------------*/
hid_send_feature_report(dev, (unsigned char *)usb_buf, 65);
hid_send_feature_report(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 10 milliseconds |
@ -115,7 +114,7 @@ void AlienwareAW410KController::SendfeatureReport
void AlienwareAW410KController::SendEdit()
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -133,7 +132,7 @@ void AlienwareAW410KController::SendEdit()
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 2 milliseconds |
@ -143,7 +142,7 @@ void AlienwareAW410KController::SendEdit()
void AlienwareAW410KController::SendInitialize()
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -168,7 +167,7 @@ void AlienwareAW410KController::SendInitialize()
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 2 milliseconds |
@ -222,7 +221,7 @@ void AlienwareAW410KController::SendDirectOn
std::vector<SelectedButtons> &frame_data
)
{
SendfeatureReport(0x0E, frame_data.size(), 0x00, 0x01);
SendfeatureReport(0x0E, (unsigned char)frame_data.size(), 0x00, 0x01);
/*-----------------------------------------------*\
| To Guarantee the data are always %4 =0 append |
@ -324,7 +323,7 @@ void AlienwareAW410KController::UpdateSingleLED
{
SendfeatureReport(0x0E, 0x01, 0x00, 0x01);
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -354,7 +353,7 @@ void AlienwareAW410KController::UpdateSingleLED
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 20 milliseconds |
@ -374,7 +373,7 @@ void AlienwareAW410KController::SendMode
unsigned char blue
)
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -400,7 +399,7 @@ void AlienwareAW410KController::SendMode
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
}
void AlienwareAW410KController::SetMorphMode
@ -415,7 +414,7 @@ void AlienwareAW410KController::SetMorphMode
unsigned char blue2
)
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -444,5 +443,5 @@ void AlienwareAW410KController::SetMorphMode
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
}

View file

@ -41,7 +41,7 @@ std::string AlienwareAW510KController::GetSerialString()
void AlienwareAW510KController::SendCommit()
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -63,7 +63,7 @@ void AlienwareAW510KController::SendCommit()
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 20 milliseconds |
@ -71,7 +71,6 @@ void AlienwareAW510KController::SendCommit()
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
void AlienwareAW510KController::SendfeatureReport
(
unsigned char first_byte,
@ -80,7 +79,7 @@ void AlienwareAW510KController::SendfeatureReport
unsigned char forth_byte
)
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -99,7 +98,7 @@ void AlienwareAW510KController::SendfeatureReport
/*-----------------------------------------------------*\
| Send Feature report packet |
\*-----------------------------------------------------*/
hid_send_feature_report(dev, (unsigned char *)usb_buf, 65);
hid_send_feature_report(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 10 milliseconds |
@ -109,7 +108,7 @@ void AlienwareAW510KController::SendfeatureReport
void AlienwareAW510KController::SendEdit()
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -127,7 +126,7 @@ void AlienwareAW510KController::SendEdit()
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 2 milliseconds |
@ -137,7 +136,7 @@ void AlienwareAW510KController::SendEdit()
void AlienwareAW510KController::SendInitialize()
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -162,7 +161,7 @@ void AlienwareAW510KController::SendInitialize()
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 2 milliseconds |
@ -318,7 +317,7 @@ void AlienwareAW510KController::UpdateSingleLED
{
SendfeatureReport(0x0E, 0x01, 0x00, 0x01);
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -348,7 +347,7 @@ void AlienwareAW510KController::UpdateSingleLED
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
/*-----------------------------------------------------*\
| Delay 20 milliseconds |
@ -368,7 +367,7 @@ void AlienwareAW510KController::SendMode
unsigned char blue
)
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -394,7 +393,7 @@ void AlienwareAW510KController::SendMode
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
}
void AlienwareAW510KController::SetMorphMode
@ -409,7 +408,7 @@ void AlienwareAW510KController::SetMorphMode
unsigned char blue2
)
{
char usb_buf[65];
unsigned char usb_buf[65];
/*-----------------------------------------------------*\
| Zero out buffer |
@ -438,5 +437,5 @@ void AlienwareAW510KController::SetMorphMode
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 65);
hid_write(dev, usb_buf, 65);
}

View file

@ -169,14 +169,14 @@ void AsusAuraCoreLaptopController::SetLedsDirect(std::vector<RGBColor> colors)
for(size_t i = 0; i < key_set; i+=leds_per_packet)
{
uint8_t leds_remaining = key_set - i;
uint8_t leds_remaining = key_set - (uint8_t)i;
if(leds_remaining < leds_per_packet)
{
buffer[07] = leds_remaining;
}
buffer[06] = i;
buffer[06] = (uint8_t)i;
memcpy(&buffer[ASUSAURACORELAPTOP_DATA_BYTE], &key_buf[3 * i], (3 * buffer[07]));
hid_send_feature_report(dev, buffer, ASUSAURACORELAPTOP_WRITE_PACKET_SIZE);

View file

@ -434,7 +434,7 @@ void RGBController_AsusAuraCoreLaptop::SetupZones()
\*---------------------------------------------------------*/
for(std::size_t zone_index = 0; zone_index < zones.size(); zone_index++)
{
int zone_offset = leds.size();
int zone_offset = (int)leds.size();
for(unsigned int led_index = 0; led_index < zones[zone_index].leds_count; led_index++)
{

View file

@ -29,7 +29,7 @@ int RGBController_AuraGPU::GetDeviceMode()
break;
}
for(std::size_t mode = 0; mode < modes.size(); mode++)
for(int mode = 0; mode < modes.size(); mode++)
{
if(modes[mode].value == dev_mode)
{

View file

@ -31,7 +31,7 @@ std::string AuraMouseController::GetDeviceLocation()
std::string AuraMouseController::CleanSerial(const std::wstring& wstr)
{
/*---------------------------------------------------------------*\
| Cleanes garbage at the end of serial numbers |
| Cleans garbage at the end of serial numbers |
| (apparently 2 characters too much, but maybe variable) |
| Limited to new devices, old ones don't even have serial numbers |
\*---------------------------------------------------------------*/
@ -48,7 +48,7 @@ std::string AuraMouseController::CleanSerial(const std::wstring& wstr)
break;
}
result += c;
result += (char)c;
}
return(result);
@ -162,7 +162,7 @@ void AuraMouseController::SendUpdate
/*-----------------------------------------------------*\
| Set up message packet |
\*-----------------------------------------------------*/
if (device_pid == AURA_ROG_GLADIUS_II_ORIGIN_PNK_LTD_PID)
{
// this device supports 2 color for breathing,

View file

@ -39,11 +39,13 @@ std::string AuraTUFKeyboardController::GetDeviceLocation()
std::string clean_serial(const std::wstring& wstr)
{
// Skip non-ASCII, trailing garbage in serial numbers. Required by the
// Scope II 96, whose original firmware outputs garbage, which even differs
// after computer reboots and therefore breaks OpenRGB profile matching.
/*-------------------------------------------------------------------------*\
| Skip non-ASCII, trailing garbage in serial numbers. Required by the |
| Scope II 96, whose original firmware outputs garbage, which even differs |
| after computer reboots and therefore breaks OpenRGB profile matching. |
\*-------------------------------------------------------------------------*/
std::string result;
for(auto c : wstr)
for(wchar_t c : wstr)
{
// Forbid control chars and anything above final printable low-ASCII.
if(c < 32 || c > 126)
@ -51,7 +53,7 @@ std::string clean_serial(const std::wstring& wstr)
break;
}
result += c;
result += (char)c;
}
return(result);
@ -92,7 +94,7 @@ std::string AuraTUFKeyboardController::GetVersion()
hid_read(dev, usb_buf_out, 65);
char version[9];
switch(device_pid)
{
case AURA_ROG_AZOTH_USB_PID:
@ -275,14 +277,14 @@ void AuraTUFKeyboardController::UpdateLeds
std::vector<led_color> colors
)
{
int packets = ceil((float) colors.size() / 15);
int packets = (int)ceil((float)colors.size() / 15.0f);
for(int i = 0; i < packets; i++)
{
unsigned char usb_buf[65];
memset(usb_buf, 0x00, sizeof(usb_buf));
int remaining = colors.size() - i * 15;
int remaining = (int)colors.size() - i * 15;
int leds = (remaining > 0x0F) ? 0x0F : remaining;
@ -375,12 +377,16 @@ void AuraTUFKeyboardController::UpdateScopeIIRainbowRipple
usb_buf[0x07] = color_mode;
usb_buf[0x08] = direction;
usb_buf[0x09] = 0x02;
usb_buf[0x0A] = colors.size();
usb_buf[0x0A] = (unsigned char)colors.size();
for(unsigned int i = 0; i < 2; i ++)
for(unsigned int i = 0; i < 2; i++)
{
if (i >= colors.size()) continue;
usb_buf[11 + i * 4] = 100/(double)colors.size()*(i+1);
if(i >= colors.size())
{
continue;
}
usb_buf[11 + i * 4] = (unsigned char)(100.0f / (float)colors.size() * (i + 1));
usb_buf[12 + i * 4] = RGBGetRValue(colors[i]);
usb_buf[13 + i * 4] = RGBGetGValue(colors[i]);
usb_buf[14 + i * 4] = RGBGetBValue(colors[i]);
@ -394,13 +400,16 @@ void AuraTUFKeyboardController::UpdateScopeIIRainbowRipple
usb_buf[0x04] = 0x01;
for(unsigned int i = 0; i < 4; i ++)
for(unsigned int i = 0; i < 4; i++)
{
if (i + 2 >= colors.size()) continue;
usb_buf[5 + i * 4] = 100/(double)colors.size()*(i+1+2);
usb_buf[6 + i * 4] = RGBGetRValue(colors[i+2]);
usb_buf[7 + i * 4] = RGBGetGValue(colors[i+2]);
usb_buf[8 + i * 4] = RGBGetBValue(colors[i+2]);
if((i + 2) >= colors.size())
{
continue;
}
usb_buf[5 + i * 4] = (unsigned char)(100.0f / (float)colors.size() * (i + 1 + 2));
usb_buf[6 + i * 4] = RGBGetRValue(colors[i + 2]);
usb_buf[7 + i * 4] = RGBGetGValue(colors[i + 2]);
usb_buf[8 + i * 4] = RGBGetBValue(colors[i + 2]);
}
ClearResponses();
@ -413,11 +422,15 @@ void AuraTUFKeyboardController::UpdateScopeIIRainbowRipple
for(unsigned int i = 0; i < 1; i ++)
{
if (i + 6 >= colors.size()) continue;
usb_buf[5 + i * 4] = 100/(double)colors.size()*(i+1+6);
usb_buf[6 + i * 4] = RGBGetRValue(colors[i+6]);
usb_buf[7 + i * 4] = RGBGetGValue(colors[i+6]);
usb_buf[8 + i * 4] = RGBGetBValue(colors[i+6]);
if((i + 6) >= colors.size())
{
continue;
}
usb_buf[5 + i * 4] = (100.0f / (float)colors.size() * (i + 1 + 6));
usb_buf[6 + i * 4] = RGBGetRValue(colors[i + 6]);
usb_buf[7 + i * 4] = RGBGetGValue(colors[i + 6]);
usb_buf[8 + i * 4] = RGBGetBValue(colors[i + 6]);
}
ClearResponses();
@ -531,7 +544,7 @@ void AuraTUFKeyboardController::UpdateDevice
if(mode == AURA_KEYBOARD_MODE_WAVE || mode == AURA_KEYBOARD_MODE_RIPPLE)
{
usb_buf[0x0A] = colors.size();
usb_buf[0x0A] = (unsigned char)colors.size();
/*-----------------------------------------------------*\
| Loop over every color given |
@ -540,7 +553,7 @@ void AuraTUFKeyboardController::UpdateDevice
{
if(colors[i])
{
usb_buf[11 + i * 4] = 100/(double)colors.size()*(i+1);
usb_buf[11 + i * 4] = (unsigned char)(100.0f / (float)colors.size() * (i + 1));
usb_buf[12 + i * 4] = RGBGetRValue(colors[i]);
usb_buf[13 + i * 4] = RGBGetGValue(colors[i]);
usb_buf[14 + i * 4] = RGBGetBValue(colors[i]);
@ -561,7 +574,7 @@ void AuraTUFKeyboardController::UpdateDevice
usb_buf[12 + i * 3] = RGBGetBValue(colors[i]);
}
}
}
}
else

View file

@ -28,7 +28,7 @@ AuraUSBController::~AuraUSBController()
unsigned int AuraUSBController::GetChannelCount()
{
return(device_info.size());
return((unsigned int)device_info.size());
}
std::string AuraUSBController::GetDeviceLocation()

View file

@ -514,7 +514,7 @@ void RGBController_AuraKeyboard::DeviceUpdateLEDs()
frame_buf[(led_idx * 4) + 3] = RGBGetBValue(colors[led_idx]);
}
controller->SendDirect(leds.size(), frame_buf.data());
controller->SendDirect((unsigned char)leds.size(), frame_buf.data());
}
void RGBController_AuraKeyboard::UpdateZoneLEDs(int /*zone*/)

View file

@ -249,11 +249,11 @@ void RGBController_AuraMousemat::DeviceUpdateMode()
}
else
{
pattern = modes[active_mode].colors.size() - 1;
pattern = (int)modes[active_mode].colors.size() - 1;
}
break;
case AURA_MOUSEMAT_MODE_WAVE:
pattern = modes[active_mode].colors.size() * 16 + modes[active_mode].direction;
pattern = (int)modes[active_mode].colors.size() * 16 + modes[active_mode].direction;
break;
case AURA_MOUSEMAT_MODE_WAVE_PLANE:
switch(modes[active_mode].direction)

View file

@ -12,7 +12,7 @@
#include "RGBController_AsusAuraRyuoAIO.h"
/**------------------------------------------------------------------*\
@name Asus Aura Ryuo AIO
@name Asus Aura Ryuo AIO
@type USB
@save :white_check_mark:
@direct :white_check_mark:
@ -178,7 +178,7 @@ void RGBController_AsusAuraRyuoAIO::ResizeZone(int /*zone*/, int /*new_size*/)
void RGBController_AsusAuraRyuoAIO::DeviceUpdateLEDs()
{
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
UpdateZoneLEDs(zone_idx);
}
@ -203,16 +203,16 @@ void RGBController_AsusAuraRyuoAIO::DeviceUpdateMode()
int RGBController_AsusAuraRyuoAIO::GetLED_Zone(int led_idx)
{
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
int zone_start = zones[zone_idx].start_idx;
int zone_end = zone_start + zones[zone_idx].leds_count - 1;
if( zone_start <= led_idx && zone_end >= led_idx)
if(zone_start <= led_idx && zone_end >= led_idx)
{
return(zone_idx);
}
}
return -1;
return(-1);
}

View file

@ -223,7 +223,7 @@ void RGBController_AuraUSB::DeviceUpdateLEDs()
}
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
controller->SetChannelLEDs(zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count);
controller->SetChannelLEDs((unsigned char)zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count);
}
}

View file

@ -118,7 +118,7 @@ void RGBController_AsusROGStrixEvolve::UpdateZoneLEDs(int zone)
UpdateSingleLED(zone);
}
void RGBController_AsusROGStrixEvolve::UpdateSingleLED(int led)
void RGBController_AsusROGStrixEvolve::UpdateSingleLED(int /*led*/)
{
controller->SendUpdate(0x1C, RGBGetRValue(colors[0]));
controller->SendUpdate(0x1D, RGBGetGValue(colors[0]));

View file

@ -180,7 +180,7 @@ void RGBController_ROGStrixLC_Controller::ResizeZone(int /*zone*/, int /*new_siz
void RGBController_ROGStrixLC_Controller::DeviceUpdateLEDs()
{
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
UpdateZoneLEDs(zone_idx);
}
@ -205,12 +205,12 @@ void RGBController_ROGStrixLC_Controller::DeviceUpdateMode()
int RGBController_ROGStrixLC_Controller::GetLED_Zone(int led_idx)
{
for(size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
for(int zone_idx = 0; zone_idx < zones.size(); zone_idx++)
{
int zone_start = zones[zone_idx].start_idx;
int zone_end = zone_start + zones[zone_idx].leds_count - 1;
if( zone_start <= led_idx && zone_end >= led_idx)
if(zone_start <= led_idx && zone_end >= led_idx)
{
return(zone_idx);
}

View file

@ -195,9 +195,9 @@ void RGBController_AsusSagarisKeyboard::UpdateZoneLEDs(int /*zone*/)
}
void RGBController_AsusSagarisKeyboard::UpdateSingleLED(int led)
void RGBController_AsusSagarisKeyboard::UpdateSingleLED(int /*led*/)
{
}
void RGBController_AsusSagarisKeyboard::DeviceUpdateMode()

View file

@ -18,7 +18,6 @@ static GUID CLSID_GUID_DEVCLASS_SYSTEM = { 0x4D36E97D, 0xE325, 0x11CE, {0xBF, 0x
int AsusTUFLaptopController::checkWMIType()
{
int n;
int v6;
int result = 0;
struct _SP_DEVINFO_DATA DeviceInfoData;
const int bufsize = 260;

View file

@ -74,7 +74,7 @@ void BlinkyTapeController::SetLEDs(std::vector<RGBColor> colors)
| 0-n: Data Byte (0-254) |
| n+1: Packet End Byte (0xFF) |
\*-------------------------------------------------------------*/
const unsigned int payload_size = (colors.size() * 3);
const unsigned int payload_size = ((unsigned int)colors.size() * 3);
const unsigned int packet_size = payload_size + 1;
std::vector<unsigned char> serial_buf(packet_size);

View file

@ -70,9 +70,9 @@ RGBController_ColorfulTuringGPU::~RGBController_ColorfulTuringGPU()
int RGBController_ColorfulTuringGPU::getModeIndex(int mode_value)
{
for(std::size_t mode_index = 0; mode_index < modes.size(); mode_index++)
for(int mode_index = 0; mode_index < modes.size(); mode_index++)
{
if (modes[mode_index].value == mode_value)
if(modes[mode_index].value == mode_value)
{
return mode_index;
}

View file

@ -974,7 +974,7 @@ bool DeviceView::selectSegment(int zone, int segment, bool add)
int zoneStart = controller->zones[zone].start_idx;
int segStart = controller->zones[zone].segments[segment].start_idx;
for(int led_idx = 0; led_idx < controller->zones[zone].segments[segment].leds_count; ++led_idx)
for(int led_idx = 0; led_idx < (int)controller->zones[zone].segments[segment].leds_count; led_idx++)
{
if(!selectionFlags[zoneStart + segStart + led_idx])
{
@ -1009,7 +1009,7 @@ bool DeviceView::selectZone(int zone, bool add)
int zoneStart = controller->zones[zone].start_idx;
for(int led_idx = 0; led_idx < controller->zones[zone].leds_count; ++led_idx)
for(int led_idx = 0; led_idx < (int)controller->zones[zone].leds_count; led_idx++)
{
if(!selectionFlags[zoneStart + led_idx])
{