diff --git a/Controllers/CorsairVengeanceProController/RGBController_CorsairVengeancePro.cpp b/Controllers/CorsairVengeanceProController/RGBController_CorsairVengeancePro.cpp index 5be32c43..58a4e130 100644 --- a/Controllers/CorsairVengeanceProController/RGBController_CorsairVengeancePro.cpp +++ b/Controllers/CorsairVengeanceProController/RGBController_CorsairVengeancePro.cpp @@ -213,7 +213,7 @@ void RGBController_CorsairVengeancePro::ResizeZone(int /*zone*/, int /*new_size* void RGBController_CorsairVengeancePro::DeviceUpdateLEDs() { - for(std::size_t led = 0; led < colors.size(); led++) + for(unsigned int led = 0; led < (unsigned int)colors.size(); led++) { RGBColor color = colors[led]; unsigned char red = RGBGetRValue(color); diff --git a/Controllers/CorsairWirelessController/CorsairWirelessController.cpp b/Controllers/CorsairWirelessController/CorsairWirelessController.cpp index 0173e317..95cccd6f 100644 --- a/Controllers/CorsairWirelessController/CorsairWirelessController.cpp +++ b/Controllers/CorsairWirelessController/CorsairWirelessController.cpp @@ -97,7 +97,7 @@ void CorsairWirelessController::SetName(std::string device_name) void CorsairWirelessController::EnterDirectMode() { - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -118,13 +118,13 @@ void CorsairWirelessController::EnterDirectMode() | Send packet using feature reports, as headset stand | | seems to not update completely using HID writes | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); } void CorsairWirelessController::StartDirectMode() { - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -144,13 +144,13 @@ void CorsairWirelessController::StartDirectMode() | Send packet using feature reports, as headset stand | | seems to not update completely using HID writes | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); } void CorsairWirelessController::ExitDirectMode() { - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -171,13 +171,13 @@ void CorsairWirelessController::ExitDirectMode() | Send packet using feature reports, as headset stand | | seems to not update completely using HID writes | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); } void CorsairWirelessController::SendDirectFrame(bool first_frame, unsigned char* data) { - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -214,5 +214,5 @@ void CorsairWirelessController::SendDirectFrame(bool first_frame, unsigned char* | Send packet using feature reports, as headset stand | | seems to not update completely using HID writes | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); } diff --git a/Controllers/CougarController/CougarKeyboardController.cpp b/Controllers/CougarController/CougarKeyboardController.cpp index 3fe1f951..c2ea0ed0 100644 --- a/Controllers/CougarController/CougarKeyboardController.cpp +++ b/Controllers/CougarController/CougarKeyboardController.cpp @@ -137,11 +137,11 @@ void CougarKeyboardController::SetMode(uint8_t mode, uint8_t speed, uint8_t brig case COUGARKEYBOARDCONTROLLER_MODE_RIPPLE: case COUGARKEYBOARDCONTROLLER_MODE_SCAN: { - uint8_t count = colours.size(); + uint8_t count = (uint8_t)colours.size(); uint8_t timer = 100 / count; buffer[COUGARKEYBOARDCONTROLLER_DATA_BYTE + 1] = count; - for(size_t i = 0; i < count; i++) + for(uint8_t i = 0; i < count; i++) { uint8_t offset = 11 + (i * 4); @@ -169,7 +169,7 @@ void CougarKeyboardController::SetMode(uint8_t mode, uint8_t speed, uint8_t brig void CougarKeyboardController::SetLedsDirect(std::vector colours) { uint8_t max_leds = 14; - uint8_t leds_remaining = colours.size(); + uint8_t leds_remaining = (uint8_t)colours.size(); uint8_t packet_flag = COUGARKEYBOARDCONTROLLER_DIRECTION_BYTE; uint8_t buffer[COUGARKEYBOARDCONTROLLER_WRITE_PACKET_SIZE] = { 0x00, 0x14, 0x2C, 0x0B, 0x00, 0xFF, 0x64, 0x00, 0x01 }; @@ -177,7 +177,7 @@ void CougarKeyboardController::SetLedsDirect(std::vector colours) | Set up Direct packet | | keyvalue_map is the index of the Key from full_matrix_map | \*-----------------------------------------------------------------*/ - for(size_t leds2send = 0; leds2send < leds_remaining; leds2send += max_leds) + for(uint8_t leds2send = 0; leds2send < leds_remaining; leds2send += max_leds) { /*-----------------------------------------------------------------*\ | Check if there is enough leds for another pass | @@ -192,7 +192,7 @@ void CougarKeyboardController::SetLedsDirect(std::vector colours) buffer[packet_flag] = 3; } - for(size_t i = 0; i < max_leds; i++) + for(uint8_t i = 0; i < max_leds; i++) { uint8_t offset = COUGARKEYBOARDCONTROLLER_DATA_BYTE + (i * 4); uint8_t led_num = leds2send + i; diff --git a/Controllers/CryorigH7QuadLumiController/CryorigH7QuadLumiController.cpp b/Controllers/CryorigH7QuadLumiController/CryorigH7QuadLumiController.cpp index 5eca8925..b8fbc7d1 100644 --- a/Controllers/CryorigH7QuadLumiController/CryorigH7QuadLumiController.cpp +++ b/Controllers/CryorigH7QuadLumiController/CryorigH7QuadLumiController.cpp @@ -79,12 +79,12 @@ void CryorigH7QuadLumiController::SetChannelEffect \*-----------------------------------------------------*/ else if(num_colors <= 8) { - for(std::size_t color_idx = 0; color_idx < num_colors; color_idx++) + for(unsigned int color_idx = 0; color_idx < num_colors; color_idx++) { /*-----------------------------------------------------*\ | Fill in color data (5 entries per color) | \*-----------------------------------------------------*/ - for (std::size_t idx = 0; idx < 40; idx++) + for(int idx = 0; idx < 40; idx++) { int pixel_idx = idx * 3; RGBColor color = colors[color_idx]; @@ -96,7 +96,7 @@ void CryorigH7QuadLumiController::SetChannelEffect /*-----------------------------------------------------*\ | Send mode and color data | \*-----------------------------------------------------*/ - SendPacket(channel, mode, direction, color_idx, speed, 5, &color_data[0]); + SendPacket(channel, mode, direction, (unsigned char)color_idx, speed, 5, &color_data[0]); } } /*-----------------------------------------------------*\ @@ -107,7 +107,7 @@ void CryorigH7QuadLumiController::SetChannelEffect /*-----------------------------------------------------*\ | Fill in color data (up to 40 colors) | \*-----------------------------------------------------*/ - for (std::size_t idx = 0; idx < num_colors; idx++) + for(int idx = 0; idx < num_colors; idx++) { int pixel_idx = idx * 3; RGBColor color = colors[idx]; @@ -135,7 +135,7 @@ void CryorigH7QuadLumiController::SetChannelLEDs /*-----------------------------------------------------*\ | Fill in color data (up to 40 colors) | \*-----------------------------------------------------*/ - for (std::size_t idx = 0; idx < num_colors; idx++) + for(int idx = 0; idx < num_colors; idx++) { int pixel_idx = idx * 3; RGBColor color = colors[idx]; diff --git a/Controllers/CryorigH7QuadLumiController/RGBController_CryorigH7QuadLumi.cpp b/Controllers/CryorigH7QuadLumiController/RGBController_CryorigH7QuadLumi.cpp index 0aab99b6..256d359d 100644 --- a/Controllers/CryorigH7QuadLumiController/RGBController_CryorigH7QuadLumi.cpp +++ b/Controllers/CryorigH7QuadLumiController/RGBController_CryorigH7QuadLumi.cpp @@ -187,7 +187,7 @@ void RGBController_CryorigH7QuadLumi::ResizeZone(int /*zone*/, int /*new_size*/) void RGBController_CryorigH7QuadLumi::DeviceUpdateLEDs() { - for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++) + for(unsigned char zone_idx = 0; zone_idx < (unsigned char)zones.size(); zone_idx++) { controller->SetChannelLEDs(zone_idx, zones[zone_idx].colors, zones[zone_idx].leds_count); } @@ -218,7 +218,7 @@ void RGBController_CryorigH7QuadLumi::DeviceUpdateMode() } else { - for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++) + for(unsigned char zone_idx = 0; zone_idx < (unsigned char)zones.size(); zone_idx++) { RGBColor* colors = NULL; bool direction = false; diff --git a/Controllers/DasKeyboardController/DasKeyboardController.cpp b/Controllers/DasKeyboardController/DasKeyboardController.cpp index e36c7038..ae69c4d9 100644 --- a/Controllers/DasKeyboardController/DasKeyboardController.cpp +++ b/Controllers/DasKeyboardController/DasKeyboardController.cpp @@ -29,7 +29,7 @@ DasKeyboardController::~DasKeyboardController() std::string DasKeyboardController::GetDeviceLocation() { - return "HID: " + location; + return("HID: " + location); } std::string DasKeyboardController::GetSerialString() @@ -49,14 +49,14 @@ std::string DasKeyboardController::GetSerialString() return_string = version; } - return return_string; + return(return_string); } std::string DasKeyboardController::GetVersionString() { if(version.length() < 17) { - return version; + return(version); } std::string fw_version = "V"; @@ -65,7 +65,7 @@ std::string DasKeyboardController::GetVersionString() fw_version += version.substr(15, 2); fw_version += ".0"; - return fw_version; + return(fw_version); } std::string DasKeyboardController::GetLayoutString() @@ -76,16 +76,16 @@ std::string DasKeyboardController::GetLayoutString() \*-----------------------------------------------------*/ if(version.length() < 17) { - return "NONE"; + return("NONE"); } std::string layout_id = version.substr(3, 2); if(layout_id == "16") { - return "US"; + return("US"); } - return "EU"; + return("EU"); } void DasKeyboardController::SendColors(unsigned char key_id, unsigned char mode, @@ -322,16 +322,16 @@ int DasKeyboardController::ReceiveData(unsigned char *data, const unsigned int m \*-----------------------------------------------------*/ if(chk_sum) { - return -1; + return(-1); } - size_t response_size = 0; + int response_size = 0; if(receive_buf.size() > 1) { response_size = receive_buf.at(1); if(response_size + 2 > receive_buf.size()) { - return -1; + return(-1); } if(response_size > max_length) { @@ -347,5 +347,5 @@ int DasKeyboardController::ReceiveData(unsigned char *data, const unsigned int m } } - return response_size; + return(response_size); } diff --git a/Controllers/DasKeyboardController/RGBController_DasKeyboard.cpp b/Controllers/DasKeyboardController/RGBController_DasKeyboard.cpp index 3bf3609e..77d87e30 100644 --- a/Controllers/DasKeyboardController/RGBController_DasKeyboard.cpp +++ b/Controllers/DasKeyboardController/RGBController_DasKeyboard.cpp @@ -247,7 +247,7 @@ RGBController_DasKeyboard::~RGBController_DasKeyboard() /*---------------------------------------------------------*\ | Delete the matrix map | \*---------------------------------------------------------*/ - unsigned int zone_size = zones.size(); + unsigned int zone_size = (unsigned int)zones.size(); for(unsigned int zone_index = 0; zone_index < zone_size; zone_index++) { diff --git a/Controllers/DebugController/DebugControllerDetect.cpp b/Controllers/DebugController/DebugControllerDetect.cpp index e6a16895..5b57a92f 100644 --- a/Controllers/DebugController/DebugControllerDetect.cpp +++ b/Controllers/DebugController/DebugControllerDetect.cpp @@ -311,7 +311,6 @@ void DetectDebugControllers() std::vector change; const char* change_keys = "change_keys"; - const char* ins_key = "ins_key"; const char* ins_row = "ins_row"; const char* rmv_key = "rmv_key"; const char* rmv_row = "rmv_row"; @@ -402,7 +401,7 @@ void DetectDebugControllers() dummy_keyboard->zones.push_back(dummy_keyboard_matrix_zone); - for(std::size_t led_idx = 0; led_idx < dummy_keyboard_matrix_zone.leds_count; led_idx++) + for(unsigned int led_idx = 0; led_idx < dummy_keyboard_matrix_zone.leds_count; led_idx++) { led dummy_keyboard_led; dummy_keyboard_led.name = new_kb.GetKeyNameAt(led_idx); diff --git a/Controllers/DuckyKeyboardController/DuckyKeyboardController.cpp b/Controllers/DuckyKeyboardController/DuckyKeyboardController.cpp index 0d23eab3..c1ae9362 100644 --- a/Controllers/DuckyKeyboardController/DuckyKeyboardController.cpp +++ b/Controllers/DuckyKeyboardController/DuckyKeyboardController.cpp @@ -74,7 +74,7 @@ void DuckyKeyboardController::SendColors void DuckyKeyboardController::SendInitialize() { - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -91,13 +91,13 @@ void DuckyKeyboardController::SendInitialize() /*-----------------------------------------------------*\ | Send packet | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } void DuckyKeyboardController::SendInitializeColorPacket() { - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -120,7 +120,7 @@ void DuckyKeyboardController::SendInitializeColorPacket() /*-----------------------------------------------------*\ | Send packet | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } @@ -132,7 +132,7 @@ unsigned int DuckyKeyboardController::SendColorDataPacket ) { unsigned int bytes_sent; - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -188,7 +188,7 @@ unsigned int DuckyKeyboardController::SendColorDataPacket /*-----------------------------------------------------*\ | Send packet | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); std::this_thread::sleep_for(std::chrono::milliseconds(2)); return(bytes_sent); @@ -196,7 +196,7 @@ unsigned int DuckyKeyboardController::SendColorDataPacket void DuckyKeyboardController::SendTerminateColorPacket() { - char usb_buf[65]; + unsigned char usb_buf[65]; /*-----------------------------------------------------*\ | Zero out buffer | @@ -214,6 +214,6 @@ void DuckyKeyboardController::SendTerminateColorPacket() /*-----------------------------------------------------*\ | Send packet | \*-----------------------------------------------------*/ - hid_write(dev, (unsigned char *)usb_buf, 65); + hid_write(dev, usb_buf, 65); std::this_thread::sleep_for(std::chrono::milliseconds(2)); } diff --git a/Controllers/E131Controller/RGBController_E131.cpp b/Controllers/E131Controller/RGBController_E131.cpp index bde23f66..6591066d 100644 --- a/Controllers/E131Controller/RGBController_E131.cpp +++ b/Controllers/E131Controller/RGBController_E131.cpp @@ -71,8 +71,8 @@ RGBController_E131::RGBController_E131(std::vector device_list) for(unsigned int device_idx = 0; device_idx < devices.size(); device_idx++) { - float universe_size = devices[device_idx].universe_size; - unsigned int total_universes = ceil( ( ( devices[device_idx].num_leds * 3 ) + devices[device_idx].start_channel ) / universe_size ); + float universe_size = (float)devices[device_idx].universe_size; + unsigned int total_universes = (unsigned int)ceil( ( ( devices[device_idx].num_leds * 3 ) + devices[device_idx].start_channel ) / universe_size ); for(unsigned int univ_idx = 0; univ_idx < total_universes; univ_idx++) { @@ -157,8 +157,8 @@ RGBController_E131::RGBController_E131(std::vector device_list) /*-----------------------------------------*\ | Add Universes | \*-----------------------------------------*/ - float universe_size = devices[device_idx].universe_size; - unsigned int total_universes = ceil( ( ( devices[device_idx].num_leds * 3 ) + devices[device_idx].start_channel ) / universe_size ); + float universe_size = (float)devices[device_idx].universe_size; + unsigned int total_universes = (unsigned int)ceil( ( ( devices[device_idx].num_leds * 3 ) + devices[device_idx].start_channel ) / universe_size ); for (unsigned int univ_idx = 0; univ_idx < total_universes; univ_idx++) { @@ -178,7 +178,7 @@ RGBController_E131::RGBController_E131(std::vector device_list) e131_packet_t packet; e131_addr_t dest_addr; - e131_pkt_init(&packet, universe, universe_size); + e131_pkt_init(&packet, (uint16_t)universe, (uint16_t)universe_size); if(multicast) { @@ -384,8 +384,8 @@ void RGBController_E131::DeviceUpdateLEDs() for(std::size_t device_idx = 0; device_idx < devices.size(); device_idx++) { - float universe_size = devices[device_idx].universe_size; - unsigned int total_universes = ceil( ( ( devices[device_idx].num_leds * 3 ) + devices[device_idx].start_channel ) / universe_size ); + float universe_size = (float)devices[device_idx].universe_size; + unsigned int total_universes = (unsigned int)ceil( ( ( devices[device_idx].num_leds * 3 ) + devices[device_idx].start_channel ) / universe_size ); unsigned int channel_idx = devices[device_idx].start_channel; unsigned int led_idx = 0; unsigned int rgb_idx = 0; diff --git a/Controllers/ENESMBusController/RGBController_ENESMBus.cpp b/Controllers/ENESMBusController/RGBController_ENESMBus.cpp index 23a0f991..54f789df 100644 --- a/Controllers/ENESMBusController/RGBController_ENESMBus.cpp +++ b/Controllers/ENESMBusController/RGBController_ENESMBus.cpp @@ -235,7 +235,7 @@ int RGBController_ENESMBus::GetDeviceMode() break; } - for(std::size_t mode = 0; mode < modes.size(); mode++) + for(int mode = 0; mode < (int)modes.size(); mode++) { if(modes[mode].value == dev_mode) { @@ -342,7 +342,7 @@ void RGBController_ENESMBus::SetupZones() | Search through all LEDs and create zones for each channel | | type | \*---------------------------------------------------------*/ - for(std::size_t cfg_zone_idx = 0; cfg_zone_idx < ENE_NUM_ZONES; cfg_zone_idx++) + for(unsigned int cfg_zone_idx = 0; cfg_zone_idx < ENE_NUM_ZONES; cfg_zone_idx++) { /*---------------------------------------------------------*\ | Get the number of LEDs in the zone | @@ -423,7 +423,7 @@ void RGBController_ENESMBus::SetupZones() /*---------------------------------------------------------*\ | Create LED entries for each zone | \*---------------------------------------------------------*/ - std::size_t led_idx = 0; + unsigned int led_idx = 0; for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++) { for(std::size_t zone_led_idx = 0; zone_led_idx < zones[zone_idx].leds_count; zone_led_idx++) diff --git a/Controllers/ENESMBusController/XPGSpectrixS40GDetect_Windows.cpp b/Controllers/ENESMBusController/XPGSpectrixS40GDetect_Windows.cpp index 072d52a4..bfcd5cff 100644 --- a/Controllers/ENESMBusController/XPGSpectrixS40GDetect_Windows.cpp +++ b/Controllers/ENESMBusController/XPGSpectrixS40GDetect_Windows.cpp @@ -48,7 +48,7 @@ int Search(wchar_t *dev_name) return 1; } - i += wcslen(buff + i); + i += (int)wcslen(buff + i); } return 0; diff --git a/Controllers/EVGATuringGPUController/RGBController_EVGAGPUv2.cpp b/Controllers/EVGATuringGPUController/RGBController_EVGAGPUv2.cpp index f93b4e52..02b60dba 100644 --- a/Controllers/EVGATuringGPUController/RGBController_EVGAGPUv2.cpp +++ b/Controllers/EVGATuringGPUController/RGBController_EVGAGPUv2.cpp @@ -133,15 +133,15 @@ RGBController_EVGAGPUv2::~RGBController_EVGAGPUv2() int RGBController_EVGAGPUv2::getModeIndex(unsigned char mode_value) { - for(std::size_t mode_index = 0; mode_index < modes.size(); mode_index++) + for(int mode_index = 0; mode_index < (int)modes.size(); mode_index++) { - if (modes[mode_index].value == mode_value) + if(modes[mode_index].value == mode_value) { - return mode_index; + return(mode_index); } } - return 0; + return(0); } void RGBController_EVGAGPUv2::SetupZones() diff --git a/Controllers/EVGAUSBController/EVGAKeyboardController.cpp b/Controllers/EVGAUSBController/EVGAKeyboardController.cpp index b877c95e..489da142 100644 --- a/Controllers/EVGAUSBController/EVGAKeyboardController.cpp +++ b/Controllers/EVGAUSBController/EVGAKeyboardController.cpp @@ -248,7 +248,7 @@ void EVGAKeyboardController::SendColour(uint8_t mode, uint16_t speed, uint8_t br | Static, Breathing and Star modes have fixed colour sizes | | buffer[26] will be overwritten for these modes | \*-----------------------------------------------------------------*/ - buffer[EVGA_KB_COLORS_SZ] = colors.size(); + buffer[EVGA_KB_COLORS_SZ] = (uint8_t)colors.size(); switch(mode) { @@ -259,7 +259,7 @@ void EVGAKeyboardController::SendColour(uint8_t mode, uint16_t speed, uint8_t br case EVGA_KEYBOARD_CONTROLLER_MODE_BREATHING: for(size_t i = 0; i < colors.size(); i++) { - uint8_t offset = 26 + (i * 5); + uint8_t offset = (uint8_t)(26 + (i * 5)); buffer[offset + 0] = 0x0A; buffer[offset + 1] = brightness; @@ -316,7 +316,7 @@ void EVGAKeyboardController::FillColours(uint8_t * buffer, uint8_t brightness, s { for(size_t i = 0; i < colors.size(); i++) { - uint8_t offset = (i * 4); + uint8_t offset = (uint8_t)(i * 4); buffer[offset + 0] = brightness; buffer[offset + 1] = RGBGetRValue(colors[i]); @@ -365,7 +365,7 @@ uint8_t EVGAKeyboardController::FindColours(uint8_t * data, uint8_t count, std:: for(size_t i = 0; i < count; i++) { - uint8_t offset = (i * 4); + uint8_t offset = (uint8_t)(i * 4); colors.push_back(ToRGBColor(data[offset + 1],data[offset + 2],data[offset + 3])); } diff --git a/Controllers/EVGAUSBController/EVGAMouseController.cpp b/Controllers/EVGAUSBController/EVGAMouseController.cpp index b17d2616..dc44272e 100644 --- a/Controllers/EVGAUSBController/EVGAMouseController.cpp +++ b/Controllers/EVGAUSBController/EVGAMouseController.cpp @@ -207,7 +207,7 @@ void EVGAMouseController::SetLed(uint8_t index, uint8_t brightness, uint8_t spee /*-----------------------------------------------------------------------*\ | 7 is the maximum number of colors that can be set from the vendor's UI. | \*-----------------------------------------------------------------------*/ - unsigned char color_count = std::min(colors.size(), static_cast::size_type>(7)); + unsigned char color_count = (unsigned char)std::min(colors.size(), static_cast::size_type>(7)); buffer[EVGA_PERIPHERAL_COLOR_COUNT_BYTE] = color_count; for(unsigned char i = 0; i < color_count; i++) { diff --git a/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp b/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp index 3d687590..78a3b479 100644 --- a/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp +++ b/Controllers/ElgatoKeyLightController/ElgatoKeyLightController.cpp @@ -59,7 +59,7 @@ void ElgatoKeyLightController::SetColor(hsv_t hsv_color) port.tcp_client_connect(); std::string buf = GetRequest(hsv_color.value, k_value); - port.tcp_client_write((char *)buf.c_str(), buf.length() + 1); + port.tcp_client_write((char *)buf.c_str(), (int)buf.length() + 1); port.tcp_close(); } diff --git a/Controllers/ElgatoLightStripController/ElgatoLightStripController.cpp b/Controllers/ElgatoLightStripController/ElgatoLightStripController.cpp index 84695d97..9e9467b1 100644 --- a/Controllers/ElgatoLightStripController/ElgatoLightStripController.cpp +++ b/Controllers/ElgatoLightStripController/ElgatoLightStripController.cpp @@ -32,7 +32,7 @@ ElgatoLightStripController::ElgatoLightStripController(std::string ip) \*-----------------------------------------------------------*/ port.tcp_client_connect(); std::string buf = "GET /elgato/accessory-info HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\n\r\n"; - port.tcp_client_write((char *)buf.c_str(), buf.length() + 1); + port.tcp_client_write((char *)buf.c_str(), (int)buf.length() + 1); char recv_buf[1024]; int size = port.tcp_listen(recv_buf, sizeof(recv_buf)); @@ -116,7 +116,7 @@ void ElgatoLightStripController::SetColor(hsv_t hsv_color) port.tcp_client_connect(); std::string buf = GetRequest(hsv_color.hue, hsv_color.saturation, GetBrightness()); - port.tcp_client_write((char *)buf.c_str(), buf.length() + 1); + port.tcp_client_write((char *)buf.c_str(), (int)buf.length() + 1); port.tcp_close(); } diff --git a/Controllers/EspurnaController/EspurnaController.cpp b/Controllers/EspurnaController/EspurnaController.cpp index f3a79ede..03444dc3 100644 --- a/Controllers/EspurnaController/EspurnaController.cpp +++ b/Controllers/EspurnaController/EspurnaController.cpp @@ -26,9 +26,9 @@ void EspurnaController::Initialize(char* ledstring) LPSTR source = NULL; LPSTR udpport_baud = NULL; LPSTR next = NULL; - + source = strtok_s(ledstring, ",", &next); - + //Check for either the UDP port or the serial baud rate if (strlen(next)) { @@ -68,7 +68,7 @@ void EspurnaController::SetLEDs(std::vector colors) char get_request[1024]; snprintf(get_request, 1024, "GET /api/rgb?apikey=%s&value=%%23%02X%02X%02X HTTP/1.1\r\nHost: %s\r\n\r\n", espurna_apikey, RGBGetRValue(color), RGBGetGValue(color), RGBGetBValue(color), client_name.c_str()); tcpport->tcp_client_connect(); - tcpport->tcp_client_write(get_request, strlen(get_request)); + tcpport->tcp_client_write(get_request, (int)strlen(get_request)); tcpport->tcp_close(); } }