diff --git a/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp b/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp index 3184e59c..1b13f1f7 100644 --- a/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp +++ b/Controllers/AMDWraithPrismController/RGBController_AMDWraithPrism.cpp @@ -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(); } diff --git a/Controllers/AsusAuraUSBController/AsusAuraTUFKeyboardController.cpp b/Controllers/AsusAuraUSBController/AsusAuraTUFKeyboardController.cpp index 7ef7e869..79d6049e 100644 --- a/Controllers/AsusAuraUSBController/AsusAuraTUFKeyboardController.cpp +++ b/Controllers/AsusAuraUSBController/AsusAuraTUFKeyboardController.cpp @@ -77,7 +77,7 @@ std::string AuraTUFKeyboardController::GetVersion() { snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[5], usb_buf_out[6], usb_buf_out[7]); } - + return std::string(version); } else @@ -111,7 +111,7 @@ std::string AuraTUFKeyboardController::GetVersion() char version[9]; snprintf(version, 9, "%02X.%02X.%02X", usb_buf_out[8], usb_buf_out[9], usb_buf_out[10]); - + return std::string(version); } } @@ -137,12 +137,12 @@ int AuraTUFKeyboardController::GetLayout() } else { - char layout[] = ""; - + char layout[4]; + sprintf(layout, "%X", version); int layoutnum = std::stoi(std::string(layout, 1)); - + switch(layoutnum) { case 1: @@ -276,14 +276,14 @@ 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); usb_buf[j * 4 + 7] = RGBGetGValue(colors[i * 15 + j].color); usb_buf[j * 4 + 8] = RGBGetBValue(colors[i * 15 + j].color); } - + ClearResponses(); hid_write(dev, usb_buf, 65); @@ -352,7 +352,7 @@ void AuraTUFKeyboardController::UpdateDevice usb_buf[12 + i * 3] = RGBGetBValue(colors[i]); } } - + } } else diff --git a/Controllers/AsusAuraUSBController/RGBController_AsusAuraTUFKeyboard.cpp b/Controllers/AsusAuraUSBController/RGBController_AsusAuraTUFKeyboard.cpp index a950878e..a35484f5 100644 --- a/Controllers/AsusAuraUSBController/RGBController_AsusAuraTUFKeyboard.cpp +++ b/Controllers/AsusAuraUSBController/RGBController_AsusAuraTUFKeyboard.cpp @@ -28,7 +28,7 @@ RGBController_AuraTUFKeyboard::RGBController_AuraTUFKeyboard(AuraTUFKeyboardCont pid = controller->device_pid; - if(pid != AURA_ROG_CLAYMORE_PID) + if(pid != AURA_ROG_CLAYMORE_PID) { name = "ASUS Aura Keyboard"; vendor = "ASUS"; @@ -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_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] }); } @@ -448,13 +448,13 @@ void RGBController_AuraTUFKeyboard::UpdateSingleLED(int led) static const uint8_t direction_map[2][6] = { - { 4, 0, 6, 2, 8, 1 }, // Default directions Left, Right, Up, Down, Horizontal, Vertical + { 4, 0, 6, 2, 8, 1 }, // Default directions Left, Right, Up, Down, Horizontal, Vertical { 0, 4, 6, 2, 0xFF, 0xFF }, // AURA_ROG_CLAYMORE directions Left, Right, Up, Down }; void RGBController_AuraTUFKeyboard::DeviceUpdateMode() { - if(pid == AURA_ROG_CLAYMORE_PID) + if(pid == AURA_ROG_CLAYMORE_PID) { controller->AllowRemoteControl(1); } @@ -468,7 +468,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateMode() if(pid == AURA_ROG_CLAYMORE_PID) controller->AllowRemoteControl(3); return; }; - + if(pid != AURA_ROG_CLAYMORE_PID) { brightness = modes[active_mode].brightness * 25; @@ -521,7 +521,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateMode() controller->UpdateDevice(modes[active_mode].value, std::vector(modes[active_mode].colors), direction, color_mode, modes[active_mode].speed, brightness); - if(pid == AURA_ROG_CLAYMORE_PID) + if(pid == AURA_ROG_CLAYMORE_PID) { controller->UpdateMode(modes[active_mode].value); controller->SaveMode(); @@ -534,7 +534,7 @@ void RGBController_AuraTUFKeyboard::DeviceSaveMode() /*----------------------------------------------------------*\ | not available for Claymore | \*----------------------------------------------------------*/ - if(pid != AURA_ROG_CLAYMORE_PID) + if(pid != AURA_ROG_CLAYMORE_PID) { DeviceUpdateMode(); controller->SaveMode(); diff --git a/Controllers/AsusLegacyUSBController/AsusCerberusKeyboardController.cpp b/Controllers/AsusLegacyUSBController/AsusCerberusKeyboardController.cpp index bddfa971..ffd36224 100644 --- a/Controllers/AsusLegacyUSBController/AsusCerberusKeyboardController.cpp +++ b/Controllers/AsusLegacyUSBController/AsusCerberusKeyboardController.cpp @@ -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)); } diff --git a/Controllers/AsusLegacyUSBController/RGBController_AsusCerberusKeyboard.cpp b/Controllers/AsusLegacyUSBController/RGBController_AsusCerberusKeyboard.cpp index 5e91526d..3ec44d04 100644 --- a/Controllers/AsusLegacyUSBController/RGBController_AsusCerberusKeyboard.cpp +++ b/Controllers/AsusLegacyUSBController/RGBController_AsusCerberusKeyboard.cpp @@ -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]); diff --git a/Controllers/IntelArcA770LEController/RGBController_IntelArcA770LE.cpp b/Controllers/IntelArcA770LEController/RGBController_IntelArcA770LE.cpp index 56922ec5..52635ab5 100644 --- a/Controllers/IntelArcA770LEController/RGBController_IntelArcA770LE.cpp +++ b/Controllers/IntelArcA770LEController/RGBController_IntelArcA770LE.cpp @@ -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*/) { } diff --git a/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp b/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp index d340abea..6b64ba70 100644 --- a/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp +++ b/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp @@ -69,13 +69,14 @@ RGBController_LenovoUSB::RGBController_LenovoUSB(LenovoUSBController* controller } std::vector response; + + /*-----------------------*\ + |Default to ANSI keyboard | + \*-----------------------*/ + keyboard_type = ANSI; + switch(controller->getPid()) { - /*-----------------------*\ - |Default to ANSI keyboard | - \*-----------------------*/ - keyboard_type = ANSI; - case LEGION_Y740: response = controller->getInformation(0x01); if(response.size() > 4 && response[4] <= 100) diff --git a/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp b/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp index 02102a46..ff2c8af6 100644 --- a/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp +++ b/Controllers/RoccatController/RGBController_RoccatVulcanAimo.cpp @@ -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_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] }); } diff --git a/Controllers/RoccatController/RoccatVulcanAimoController.cpp b/Controllers/RoccatController/RoccatVulcanAimoController.cpp index 4716643e..2daa7bc3 100644 --- a/Controllers/RoccatController/RoccatVulcanAimoController.cpp +++ b/Controllers/RoccatController/RoccatVulcanAimoController.cpp @@ -81,7 +81,7 @@ void RoccatVulcanAimoController::SendColors(std::vector 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; diff --git a/Controllers/SinowealthController/SinowealthControllerDetect.cpp b/Controllers/SinowealthController/SinowealthControllerDetect.cpp index 7276e3d0..aff41e19 100644 --- a/Controllers/SinowealthController/SinowealthControllerDetect.cpp +++ b/Controllers/SinowealthController/SinowealthControllerDetect.cpp @@ -395,15 +395,14 @@ 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); + SinowealthKeyboard90Controller* controller = new SinowealthKeyboard90Controller(dev, info->path, pid); + RGBController_SinowealthKeyboard90* rgb_controller = new RGBController_SinowealthKeyboard90(controller); + rgb_controller->name = name; + + ResourceManager::get()->RegisterRGBController(rgb_controller); } - rgb_controller->name = name; - ResourceManager::get()->RegisterRGBController(rgb_controller); } } diff --git a/Controllers/SteelSeriesController/SteelSeriesApex8ZoneController.cpp b/Controllers/SteelSeriesController/SteelSeriesApex8ZoneController.cpp index f7461bc5..ba25bfa9 100644 --- a/Controllers/SteelSeriesController/SteelSeriesApex8ZoneController.cpp +++ b/Controllers/SteelSeriesController/SteelSeriesApex8ZoneController.cpp @@ -77,7 +77,7 @@ void SteelSeriesApex8ZoneController::SetColor(std::vector 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; diff --git a/cli.cpp b/cli.cpp index 60849a0e..e2d019e8 100644 --- a/cli.cpp +++ b/cli.cpp @@ -573,7 +573,7 @@ bool OptionDevice(std::vector* 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* current_devices, std::string argumen return found; } -bool OptionColor(std::vector* current_devices, std::string argument, Options* options) +bool OptionColor(std::vector* current_devices, std::string argument, Options* /*options*/) { bool found = false; @@ -663,7 +663,7 @@ bool OptionColor(std::vector* current_devices, std::string argume return found; } -bool OptionMode(std::vector* current_devices, std::string argument, Options* options) +bool OptionMode(std::vector* current_devices, std::string argument, Options* /*options*/) { if(argument.size() == 0) { @@ -685,7 +685,7 @@ bool OptionMode(std::vector* current_devices, std::string argumen return found; } -bool OptionBrightness(std::vector* current_devices, std::string argument, Options* options) +bool OptionBrightness(std::vector* current_devices, std::string argument, Options* /*options*/) { if(argument.size() == 0) {