Fix warnings

This commit is contained in:
Adam Honse 2022-11-27 02:52:39 -06:00
parent 755ce20794
commit be90537d10
12 changed files with 44 additions and 44 deletions

View file

@ -262,12 +262,12 @@ void RGBController_AMDWraithPrism::DeviceUpdateLEDs()
}
}
void RGBController_AMDWraithPrism::UpdateZoneLEDs(int zone)
void RGBController_AMDWraithPrism::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_AMDWraithPrism::UpdateSingleLED(int led)
void RGBController_AMDWraithPrism::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}

View file

@ -137,7 +137,7 @@ int AuraTUFKeyboardController::GetLayout()
}
else
{
char layout[] = "";
char layout[4];
sprintf(layout, "%X", version);
@ -276,7 +276,7 @@ void AuraTUFKeyboardController::UpdateLeds
usb_buf[3] = leds;
usb_buf[4] = 0x00;
for(unsigned int j = 0; j < leds; j++)
for(int j = 0; j < leds; j++)
{
usb_buf[j * 4 + 5] = colors[i * 15 + j].value;
usb_buf[j * 4 + 6] = RGBGetRValue(colors[i * 15 + j].color);

View file

@ -398,7 +398,7 @@ void RGBController_AuraTUFKeyboard::SetupZones()
keyboard_zone.matrix_map->map = keyboard[layout].matrix_map;
zones.push_back(keyboard_zone);
for(unsigned int led_id = 0; led_id < keyboard[layout].size; led_id++)
for(int led_id = 0; led_id < keyboard[layout].size; led_id++)
{
led new_led;
new_led.name = keyboard[layout].led_names[led_id].name;
@ -423,7 +423,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateLEDs()
{
std::vector<led_color> led_color_list = {};
for(int i = 0; i < colors.size(); i++)
for(unsigned int i = 0; i < colors.size(); i++)
{
led_color_list.push_back({ leds[i].value, colors[i] });
}

View file

@ -54,7 +54,7 @@ std::string AsusCerberusKeyboardController::GetSerialString()
std::string AsusCerberusKeyboardController::GetVersion()
{
char versionstr[] = "";
char versionstr[5];
snprintf(versionstr, 3, "%X", version);
return(std::string(versionstr, 3));
}

View file

@ -301,7 +301,7 @@ void RGBController_AsusCerberusKeyboard::SetupZones()
keyboard.matrix_map->map = *matrix_map;
zones.push_back(keyboard);
for(unsigned int led_id = 0; led_id < zone_size; led_id++)
for(int led_id = 0; led_id < zone_size; led_id++)
{
led new_led;
new_led.name = led_names[led_id].name;
@ -320,7 +320,7 @@ void RGBController_AsusCerberusKeyboard::ResizeZone(int /*zone*/, int /*new_size
void RGBController_AsusCerberusKeyboard::DeviceUpdateLEDs()
{
for(int i = 0; i < colors.size(); i++)
for(unsigned int i = 0; i < colors.size(); i++)
{
uint8_t red = RGBGetRValue(colors[i]);
uint8_t green = RGBGetGValue(colors[i]);

View file

@ -188,12 +188,12 @@ void RGBController_IntelArcA770LE::DeviceUpdateLEDs()
}
}
void RGBController_IntelArcA770LE::UpdateZoneLEDs(int zone)
void RGBController_IntelArcA770LE::UpdateZoneLEDs(int /*zone*/)
{
}
void RGBController_IntelArcA770LE::UpdateSingleLED(int led)
void RGBController_IntelArcA770LE::UpdateSingleLED(int /*led*/)
{
}

View file

@ -69,13 +69,14 @@ RGBController_LenovoUSB::RGBController_LenovoUSB(LenovoUSBController* controller
}
std::vector<uint8_t> response;
switch(controller->getPid())
{
/*-----------------------*\
|Default to ANSI keyboard |
\*-----------------------*/
keyboard_type = ANSI;
switch(controller->getPid())
{
case LEGION_Y740:
response = controller->getInformation(0x01);
if(response.size() > 4 && response[4] <= 100)

View file

@ -100,7 +100,7 @@ void RGBController_RoccatVulcanAimo::SetupZones()
keyboard_zone.matrix_map->map = RoccatVulcanLayouts[layout].matrix_map;
zones.push_back(keyboard_zone);
for(unsigned int led_id = 0; led_id < RoccatVulcanLayouts[layout].size; led_id++)
for(int led_id = 0; led_id < RoccatVulcanLayouts[layout].size; led_id++)
{
led new_led;
new_led.name = RoccatVulcanLayouts[layout].led_names[led_id].name;
@ -129,7 +129,7 @@ void RGBController_RoccatVulcanAimo::DeviceUpdateLEDs()
{
std::vector<led_color> led_color_list = {};
for(int i = 0; i < colors.size(); i++)
for(unsigned int i = 0; i < colors.size(); i++)
{
led_color_list.push_back({ leds[i].value, colors[i] });
}
@ -158,7 +158,7 @@ void RGBController_RoccatVulcanAimo::DeviceUpdateMode()
if(modes[active_mode].value == ROCCAT_VULCAN_MODE_STATIC)
{
for(int i = 0; i < colors.size(); i++)
for(unsigned int i = 0; i < colors.size(); i++)
{
led_color_list.push_back({ leds[i].value, colors[i] });
}

View file

@ -81,7 +81,7 @@ void RoccatVulcanAimoController::SendColors(std::vector<led_color> colors)
bufs[0][3] = 0x01;
bufs[0][4] = 0xB4;
for(int i = 0; i < colors.size(); i++)
for(unsigned int i = 0; i < colors.size(); i++)
{
int coloumn = floor(colors[i].value / 12);
int row = colors[i].value % 12;
@ -127,7 +127,7 @@ void RoccatVulcanAimoController::SendMode(unsigned int mode, unsigned int speed,
if(mode == ROCCAT_VULCAN_MODE_STATIC)
{
for(int i = 0; i < colors.size(); i++)
for(unsigned int i = 0; i < colors.size(); i++)
{
int coloumn = floor(colors[i].value / 12);
int row = colors[i].value % 12;

View file

@ -395,16 +395,15 @@ void DetectSinowealthGenesisKeyboard(hid_device_info* info, const std::string& n
hid_device* dev = hid_open_path(info->path);
if(dev)
{
RGBController *rgb_controller;
if(pid == GENESIS_THOR_300_PID)
{
SinowealthKeyboard90Controller* controller = new SinowealthKeyboard90Controller(dev, info->path, pid);
rgb_controller = new RGBController_SinowealthKeyboard90(controller);
}
RGBController_SinowealthKeyboard90* rgb_controller = new RGBController_SinowealthKeyboard90(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
}
#ifdef USE_HID_USAGE

View file

@ -77,7 +77,7 @@ void SteelSeriesApex8ZoneController::SetColor(std::vector<RGBColor> colors, uint
buffer[1] += mode;
for(int i = 0; i < colors.size(); i++)
for(unsigned int i = 0; i < colors.size(); i++)
{
uint8_t index = i * 3;

View file

@ -573,7 +573,7 @@ bool OptionDevice(std::vector<DeviceOptions>* current_devices, std::string argum
{
if(argument.length() > 1)
{
for(int i = 0; i < rgb_controllers.size(); i++)
for(unsigned int i = 0; i < rgb_controllers.size(); i++)
{
/*---------------------------------------------------------*\
| If the argument is not a number then check all the |
@ -640,7 +640,7 @@ bool OptionZone(std::vector<DeviceOptions>* current_devices, std::string argumen
return found;
}
bool OptionColor(std::vector<DeviceOptions>* current_devices, std::string argument, Options* options)
bool OptionColor(std::vector<DeviceOptions>* current_devices, std::string argument, Options* /*options*/)
{
bool found = false;
@ -663,7 +663,7 @@ bool OptionColor(std::vector<DeviceOptions>* current_devices, std::string argume
return found;
}
bool OptionMode(std::vector<DeviceOptions>* current_devices, std::string argument, Options* options)
bool OptionMode(std::vector<DeviceOptions>* current_devices, std::string argument, Options* /*options*/)
{
if(argument.size() == 0)
{
@ -685,7 +685,7 @@ bool OptionMode(std::vector<DeviceOptions>* current_devices, std::string argumen
return found;
}
bool OptionBrightness(std::vector<DeviceOptions>* current_devices, std::string argument, Options* options)
bool OptionBrightness(std::vector<DeviceOptions>* current_devices, std::string argument, Options* /*options*/)
{
if(argument.size() == 0)
{