More warning fixes

This commit is contained in:
Adam Honse 2020-09-02 19:03:43 -05:00
parent f568253c51
commit 0345eb582b
19 changed files with 35 additions and 20 deletions

View file

@ -43,7 +43,7 @@ void DetectAorusCPUCoolerControllers(std::vector<RGBController*>& rgb_controller
{
hid_init();
for(int device_idx = 0; device_idx < NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < NUM_DEVICES; device_idx++)
{
hid_device_info* info = hid_enumerate(device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);

View file

@ -44,7 +44,7 @@ void DetectCoolerMasterControllers(std::vector<RGBController*>& rgb_controllers)
hid_device* dev = NULL;
if(info->vendor_id == COOLERMASTER_VID)
{
for(int cm_pid_idx = 0; cm_pid_idx < COOLERMASTER_NUM_DEVICES; cm_pid_idx++)
for(unsigned int cm_pid_idx = 0; cm_pid_idx < COOLERMASTER_NUM_DEVICES; cm_pid_idx++)
{
if((info->product_id == cm_pids[cm_pid_idx][CM_PID])
&&(info->interface_number == cm_pids[cm_pid_idx][CM_INTERFACE]))

View file

@ -42,7 +42,7 @@ void DetectEKControllers(std::vector<RGBController*>& rgb_controllers)
hid_device* dev = NULL;
if(info->vendor_id == EK_VID)
{
for(int ek_pid_idx = 0; ek_pid_idx < EK_NUM_DEVICES; ek_pid_idx++)
for(unsigned int ek_pid_idx = 0; ek_pid_idx < EK_NUM_DEVICES; ek_pid_idx++)
{
if((info->product_id == ek_pids[ek_pid_idx][EK_PID])
&&(info->interface_number == ek_pids[ek_pid_idx][EK_INTERFACE]))

View file

@ -37,7 +37,7 @@ void DetectHoltekControllers(std::vector<RGBController*>& rgb_controllers)
{
hid_init();
for(int device_idx = 0; device_idx < HOLTEK_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < HOLTEK_NUM_DEVICES; device_idx++)
{
switch(device_list[device_idx].type)
{

View file

@ -72,7 +72,7 @@ void HyperXPulsefireSurgeController::SetProfileBrightness
buf[0x03] = 0x01;
buf[0x04] = 0x01;
buf[0x05] = 0x01;
buf[0x06] = 0x64;
buf[0x06] = brightness;
/*-----------------------------------------------------*\
| Send packet |

View file

@ -90,7 +90,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
{
hid_init();
for(int device_idx = 0; device_idx < LOGITECH_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < LOGITECH_NUM_DEVICES; device_idx++)
{
switch(device_list[device_idx].type)
{

View file

@ -19,7 +19,6 @@ PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_
unsigned short fw_version = ReadFirmwareVersion();
unsigned char major_version = fw_version >> 8;
unsigned char minor_version = fw_version & 0xFF;
/*-----------------------------------------------------*\
| Determine whether the device uses ASR LED or |

View file

@ -35,7 +35,7 @@ void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers
return;
}
for(int dev_idx = 0; dev_idx < COUNT_RGBFUSION2_PIDS; dev_idx++)
for(unsigned int dev_idx = 0; dev_idx < COUNT_RGBFUSION2_PIDS; dev_idx++)
{
dev = NULL;
@ -54,7 +54,8 @@ void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers
&&(info->product_id == tmpPID))
#endif
{
hid_device * dev = hid_open_path(info->path);
dev = hid_open_path(info->path);
if (dev)
{
RGBFusion2USBController * controller = new RGBFusion2USBController(dev, info->path, MB_info.getMainboard());

View file

@ -73,7 +73,7 @@ void DetectRedragonControllers(std::vector<RGBController*>& rgb_controllers)
hid_init();
for(int device_idx = 0; device_idx < REDRAGON_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < REDRAGON_NUM_DEVICES; device_idx++)
{
dev = NULL;

View file

@ -45,7 +45,7 @@ SteelSeriesApexController::~SteelSeriesApexController()
void SteelSeriesApexController::SetMode
(
unsigned char mode,
std::vector<RGBColor> colors
std::vector<RGBColor> /*colors*/
)
{
unsigned char mode_colors[9];

View file

@ -98,7 +98,7 @@ void DetectSteelSeriesControllers(std::vector<RGBController*>& rgb_controllers)
hid_init();
for(int device_idx = 0; device_idx < STEELSERIES_NUM_DEVICES; device_idx++)
for(unsigned int device_idx = 0; device_idx < STEELSERIES_NUM_DEVICES; device_idx++)
{
dev = NULL;

View file

@ -70,15 +70,20 @@ void SteelSeriesRivalController::SetLightEffect
{
char usb_buf[9];
memset(usb_buf, 0x00, sizeof(usb_buf));
switch (proto) {
switch (proto)
{
case RIVAL_100:
usb_buf[0x00] = 0x07;
usb_buf[0x01] = 0x00;
break;
case RIVAL_300:
usb_buf[0x00] = 0x07;
usb_buf[0x01] = zone_id + 1;
break;
default:
break;
}
usb_buf[0x02] = effect;
send_usb_msg(dev, usb_buf, 9);
@ -100,8 +105,10 @@ void SteelSeriesRivalController::SetLightEffectAll
SetLightEffect(0, effect);
SetLightEffect(1, effect);
break;
default:
break;
}
}
@ -126,7 +133,11 @@ void SteelSeriesRivalController::SetColor
usb_buf[0x00] = 0x08;
usb_buf[0x01] = zone_id + 1;
break;
default:
break;
}
usb_buf[0x02] = red;
usb_buf[0x03] = green;
usb_buf[0x04] = blue;
@ -151,6 +162,9 @@ void SteelSeriesRivalController::SetColorAll
SetColor(0, red, green, blue);
SetColor(1, red, green, blue);
break;
default:
break;
}
}

View file

@ -55,7 +55,7 @@ void DetectTecknetControllers(std::vector<RGBController*>& rgb_controllers)
hid_device* dev = NULL;
if(info->vendor_id == TECKNET_VID)
{
for(int pid_idx = 0; pid_idx < TECKNET_NUM_DEVICES; pid_idx++)
for(unsigned int pid_idx = 0; pid_idx < TECKNET_NUM_DEVICES; pid_idx++)
{
if((info->vendor_id == TECKNET_VID)
#ifdef USE_HID_USAGE

View file

@ -18,7 +18,7 @@ RGBController::~RGBController()
/*---------------------------------------------------------*\
| Delete the matrix map |
\*---------------------------------------------------------*/
for(int zone_index = 0; zone_index < zones.size(); zone_index++)
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
{
if(zones[zone_index].matrix_map != NULL)
{

View file

@ -76,7 +76,7 @@ void RGBController_AuraCore::DeviceUpdateLEDs()
void RGBController_AuraCore::UpdateZoneLEDs(int /*zone*/)
{
for(int led_idx = 0; led_idx < leds.size(); led_idx++)
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
{
UpdateSingleLED(led_idx);
}

View file

@ -105,6 +105,9 @@ void RGBController_SteelSeriesRival::UpdateZoneLEDs(int zone)
case RIVAL_300:
rival->SetColor(zone, red, grn, blu);
break;
default:
break;
}
}
}

View file

@ -54,7 +54,6 @@ void i2c_smbus_linux_detect(std::vector<i2c_smbus_interface*> &busses)
if(dir == NULL)
{
closedir(dir);
return;
}

View file

@ -276,7 +276,7 @@ void DeviceView::setController(RGBController * controller_ptr)
}
else if(controller->leds[color_idx].name == "Key: Space")
{
for(int map_idx2 = map_idx - 1; map_idx2 > led_y * map->width && map->map[map_idx2] == 0xFFFFFFFF; --map_idx2)
for(unsigned int map_idx2 = map_idx - 1; map_idx2 > led_y * map->width && map->map[map_idx2] == 0xFFFFFFFF; --map_idx2)
{
led_pos[color_idx].matrix_x -= atom;
led_pos[color_idx].matrix_w += atom;

View file

@ -33,7 +33,6 @@ std::vector<std::string *> find_usb_serial_port(unsigned short vid, unsigned sho
if(dir == NULL)
{
closedir(dir);
return ret_vector;
}