diff --git a/Controllers/QMKOpenRGBController/QMKOpenRGBRev9Controller/RGBController_QMKOpenRGBRev9.cpp b/Controllers/QMKOpenRGBController/QMKOpenRGBRev9Controller/RGBController_QMKOpenRGBRev9.cpp index 708c0034..f394b5a9 100644 --- a/Controllers/QMKOpenRGBController/QMKOpenRGBRev9Controller/RGBController_QMKOpenRGBRev9.cpp +++ b/Controllers/QMKOpenRGBController/QMKOpenRGBRev9Controller/RGBController_QMKOpenRGBRev9.cpp @@ -331,7 +331,7 @@ void RGBController_QMKOpenRGBRev9::SetupZones() VectorMatrix underglow_map; PlaceLEDsInMaps(rows, columns, divisor, led_points, led_flags, matrix_map, underglow_map); - CleanMatrixMaps(matrix_map, underglow_map, rows.size(), has_underglow); + CleanMatrixMaps(matrix_map, underglow_map, (unsigned int)rows.size(), has_underglow); /*---------------------------------------------------------*\ | These vectors are class members because if they go out of | @@ -351,8 +351,8 @@ void RGBController_QMKOpenRGBRev9::SetupZones() keys_zone.leds_max = keys_zone.leds_min; keys_zone.leds_count = keys_zone.leds_min; keys_zone.matrix_map = new matrix_map_type; - keys_zone.matrix_map->width = matrix_map[0].size(); - keys_zone.matrix_map->height = matrix_map.size(); + keys_zone.matrix_map->width = (unsigned int)matrix_map[0].size(); + keys_zone.matrix_map->height = (unsigned int)matrix_map.size(); keys_zone.matrix_map->map = flat_matrix_map.data(); zones.push_back(keys_zone); @@ -368,8 +368,8 @@ void RGBController_QMKOpenRGBRev9::SetupZones() underglow_zone.leds_max = underglow_zone.leds_min; underglow_zone.leds_count = underglow_zone.leds_min; underglow_zone.matrix_map = new matrix_map_type; - underglow_zone.matrix_map->width = underglow_map[0].size(); - underglow_zone.matrix_map->height = underglow_map.size(); + underglow_zone.matrix_map->width = (unsigned int)underglow_map[0].size(); + underglow_zone.matrix_map->height = (unsigned int)underglow_map.size(); underglow_zone.matrix_map->map = flat_underglow_map.data(); zones.push_back(underglow_zone); } @@ -652,7 +652,7 @@ void RGBController_QMKOpenRGBRev9::CleanMatrixMaps can_break = false; can_break_udg = false; - for(int j = matrix_map[i].size() - 1; j --> 0; ) + for(int j = (int)matrix_map[i].size() - 1; j --> 0; ) { if(matrix_map[i][j] != NO_LED && width < (j + 1) && !can_break) { @@ -688,15 +688,15 @@ void RGBController_QMKOpenRGBRev9::CleanMatrixMaps } } - unsigned int new_height = height - empty_rows.size(); + unsigned int new_height = height - (unsigned int)empty_rows.size(); width = empty_col ? width - 1 : width; width_udg = empty_col_udg && empty_col ? width_udg - 1 : width_udg; LOG_DEBUG("[%s] Key LED Matrix: %ux%u", name.c_str(), width, new_height); LOG_DEBUG("[%s] Underglow LED Matrix: %ux%u", name.c_str(), width_udg, new_height); - for(unsigned int i = empty_rows.size(); i --> 0; ) + for(unsigned int i = (unsigned int)empty_rows.size(); i --> 0; ) { - matrix_map.erase(matrix_map.begin()+empty_rows[i]); + matrix_map.erase(matrix_map.begin() + empty_rows[i]); } for(unsigned int i = 0; i < new_height; i++) diff --git a/Controllers/QMKOpenRGBController/QMKOpenRGBRevBController/RGBController_QMKOpenRGBRevB.cpp b/Controllers/QMKOpenRGBController/QMKOpenRGBRevBController/RGBController_QMKOpenRGBRevB.cpp index 48a8fd8e..f8ee4013 100644 --- a/Controllers/QMKOpenRGBController/QMKOpenRGBRevBController/RGBController_QMKOpenRGBRevB.cpp +++ b/Controllers/QMKOpenRGBController/QMKOpenRGBRevBController/RGBController_QMKOpenRGBRevB.cpp @@ -330,7 +330,7 @@ void RGBController_QMKOpenRGBRevB::SetupZones() VectorMatrix underglow_map; PlaceLEDsInMaps(rows, columns, divisor, led_points, led_flags, matrix_map, underglow_map); - CleanMatrixMaps(matrix_map, underglow_map, rows.size(), has_underglow); + CleanMatrixMaps(matrix_map, underglow_map, (unsigned int)rows.size(), has_underglow); /*---------------------------------------------------------*\ | These vectors are class members because if they go out of | @@ -350,8 +350,8 @@ void RGBController_QMKOpenRGBRevB::SetupZones() keys_zone.leds_max = keys_zone.leds_min; keys_zone.leds_count = keys_zone.leds_min; keys_zone.matrix_map = new matrix_map_type; - keys_zone.matrix_map->width = matrix_map[0].size(); - keys_zone.matrix_map->height = matrix_map.size(); + keys_zone.matrix_map->width = (unsigned int)matrix_map[0].size(); + keys_zone.matrix_map->height = (unsigned int)matrix_map.size(); keys_zone.matrix_map->map = flat_matrix_map.data(); zones.push_back(keys_zone); @@ -367,8 +367,8 @@ void RGBController_QMKOpenRGBRevB::SetupZones() underglow_zone.leds_max = underglow_zone.leds_min; underglow_zone.leds_count = underglow_zone.leds_min; underglow_zone.matrix_map = new matrix_map_type; - underglow_zone.matrix_map->width = underglow_map[0].size(); - underglow_zone.matrix_map->height = underglow_map.size(); + underglow_zone.matrix_map->width = (unsigned int)underglow_map[0].size(); + underglow_zone.matrix_map->height = (unsigned int)underglow_map.size(); underglow_zone.matrix_map->map = flat_underglow_map.data(); zones.push_back(underglow_zone); } @@ -693,7 +693,7 @@ void RGBController_QMKOpenRGBRevB::CleanMatrixMaps can_break = false; can_break_udg = false; - for(int j = matrix_map[i].size() - 1; j --> 0; ) + for(int j = (int)matrix_map[i].size() - 1; j --> 0; ) { if(matrix_map[i][j] != NO_LED && width < (j + 1) && !can_break) { @@ -729,13 +729,13 @@ void RGBController_QMKOpenRGBRevB::CleanMatrixMaps } } - unsigned int new_height = height - empty_rows.size(); + unsigned int new_height = height - (unsigned int)empty_rows.size(); width = empty_col ? width - 1 : width; width_udg = empty_col_udg && empty_col ? width_udg - 1 : width_udg; LOG_DEBUG("[%s] Key LED Matrix: %ux%u", name.c_str(), width, new_height); LOG_DEBUG("[%s] Underglow LED Matrix: %ux%u", name.c_str(), width_udg, new_height); - for(unsigned int i = empty_rows.size(); i --> 0; ) + for(unsigned int i = (unsigned int)empty_rows.size(); i --> 0; ) { matrix_map.erase(matrix_map.begin()+empty_rows[i]); } diff --git a/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/QMKOpenRGBRevDController.cpp b/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/QMKOpenRGBRevDController.cpp index 21fbd4f0..e0822272 100644 --- a/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/QMKOpenRGBRevDController.cpp +++ b/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/QMKOpenRGBRevDController.cpp @@ -78,14 +78,14 @@ void QMKOpenRGBRevDController::GetLEDInfo(unsigned int leds_count) underglow_points.push_back(point_t{usb_buf[offset + QMK_OPENRGB_POINT_X_BYTE], usb_buf[offset + QMK_OPENRGB_POINT_Y_BYTE]}); underglow_flags.push_back(usb_buf[offset + QMK_OPENRGB_FLAG_BYTE]); underglow_colors.push_back(ToRGBColor(usb_buf[offset + QMK_OPENRGB_R_COLOR_BYTE], usb_buf[offset + QMK_OPENRGB_G_COLOR_BYTE], usb_buf[offset + QMK_OPENRGB_B_COLOR_BYTE])); - underglow_values.push_back(underglow_values.size() + led_values.size()); + underglow_values.push_back((unsigned int)(underglow_values.size() + led_values.size())); } else { led_points.push_back(point_t{usb_buf[offset + QMK_OPENRGB_POINT_X_BYTE], usb_buf[offset + QMK_OPENRGB_POINT_Y_BYTE]}); led_flags.push_back(usb_buf[offset + QMK_OPENRGB_FLAG_BYTE]); led_colors.push_back(ToRGBColor(usb_buf[offset + QMK_OPENRGB_R_COLOR_BYTE], usb_buf[offset + QMK_OPENRGB_G_COLOR_BYTE], usb_buf[offset + QMK_OPENRGB_B_COLOR_BYTE])); - led_values.push_back(underglow_values.size() + led_values.size()); + led_values.push_back((unsigned int)(underglow_values.size() + led_values.size())); } } @@ -103,7 +103,8 @@ void QMKOpenRGBRevDController::GetLEDInfo(unsigned int leds_count) led_names.push_back(KEY_EN_UNUSED); } } - else if(usb_buf[offset + QMK_OPENRGB_FLAG_BYTE] & 2){ + else if(usb_buf[offset + QMK_OPENRGB_FLAG_BYTE] & 2) + { underglow_names.push_back("Underglow: " + std::to_string(underglow_names.size() + led_names.size())); } } diff --git a/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/RGBController_QMKOpenRGBRevD.cpp b/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/RGBController_QMKOpenRGBRevD.cpp index 3591fe6e..08a1f9b6 100644 --- a/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/RGBController_QMKOpenRGBRevD.cpp +++ b/Controllers/QMKOpenRGBController/QMKOpenRGBRevDController/RGBController_QMKOpenRGBRevD.cpp @@ -325,7 +325,7 @@ void RGBController_QMKOpenRGBRevD::SetupZones() VectorMatrix underglow_map; PlaceLEDsInMaps(rows, columns, divisor, led_points, led_flags, matrix_map, underglow_map); - CleanMatrixMaps(matrix_map, underglow_map, rows.size(), has_underglow); + CleanMatrixMaps(matrix_map, underglow_map, (unsigned int)rows.size(), has_underglow); /*---------------------------------------------------------*\ | These vectors are class members because if they go out of | @@ -345,8 +345,8 @@ void RGBController_QMKOpenRGBRevD::SetupZones() keys_zone.leds_max = keys_zone.leds_min; keys_zone.leds_count = keys_zone.leds_min; keys_zone.matrix_map = new matrix_map_type; - keys_zone.matrix_map->width = matrix_map[0].size(); - keys_zone.matrix_map->height = matrix_map.size(); + keys_zone.matrix_map->width = (unsigned int)matrix_map[0].size(); + keys_zone.matrix_map->height = (unsigned int)matrix_map.size(); keys_zone.matrix_map->map = flat_matrix_map.data(); zones.push_back(keys_zone); @@ -362,8 +362,8 @@ void RGBController_QMKOpenRGBRevD::SetupZones() underglow_zone.leds_max = underglow_zone.leds_min; underglow_zone.leds_count = underglow_zone.leds_min; underglow_zone.matrix_map = new matrix_map_type; - underglow_zone.matrix_map->width = underglow_map[0].size(); - underglow_zone.matrix_map->height = underglow_map.size(); + underglow_zone.matrix_map->width = (unsigned int)underglow_map[0].size(); + underglow_zone.matrix_map->height = (unsigned int)underglow_map.size(); underglow_zone.matrix_map->map = flat_underglow_map.data(); zones.push_back(underglow_zone); } @@ -694,7 +694,7 @@ void RGBController_QMKOpenRGBRevD::CleanMatrixMaps can_break = false; can_break_udg = false; - for(int j = matrix_map[i].size() - 1; j --> 0; ) + for(int j = (int)matrix_map[i].size() - 1; j --> 0; ) { if(matrix_map[i][j] != NO_LED && width < (j + 1) && !can_break) { @@ -730,13 +730,13 @@ void RGBController_QMKOpenRGBRevD::CleanMatrixMaps } } - unsigned int new_height = height - empty_rows.size(); + unsigned int new_height = height - (unsigned int)empty_rows.size(); width = empty_col ? width - 1 : width; width_udg = empty_col_udg && empty_col ? width_udg - 1 : width_udg; LOG_DEBUG("[%s] Key LED Matrix: %ux%u", name.c_str(), width, new_height); LOG_DEBUG("[%s] Underglow LED Matrix: %ux%u", name.c_str(), width_udg, new_height); - for(unsigned int i = empty_rows.size(); i --> 0; ) + for(unsigned int i = (unsigned int)empty_rows.size(); i --> 0; ) { matrix_map.erase(matrix_map.begin()+empty_rows[i]); } diff --git a/Controllers/QMKOpenRGBController/QMKOpenRGBRevEController/RGBController_QMKOpenRGBRevE.cpp b/Controllers/QMKOpenRGBController/QMKOpenRGBRevEController/RGBController_QMKOpenRGBRevE.cpp index 02f4eaab..a5c42ed1 100644 --- a/Controllers/QMKOpenRGBController/QMKOpenRGBRevEController/RGBController_QMKOpenRGBRevE.cpp +++ b/Controllers/QMKOpenRGBController/QMKOpenRGBRevEController/RGBController_QMKOpenRGBRevE.cpp @@ -341,7 +341,7 @@ void RGBController_QMKOpenRGBRevE::SetupZones() VectorMatrix underglow_map; PlaceLEDsInMaps(rows, columns, divisor, led_points, led_flags, matrix_map, underglow_map); - CleanMatrixMaps(matrix_map, underglow_map, rows.size(), has_underglow); + CleanMatrixMaps(matrix_map, underglow_map, (unsigned int)rows.size(), has_underglow); /*---------------------------------------------------------*\ | These vectors are class members because if they go out of | @@ -361,8 +361,8 @@ void RGBController_QMKOpenRGBRevE::SetupZones() keys_zone.leds_max = keys_zone.leds_min; keys_zone.leds_count = keys_zone.leds_min; keys_zone.matrix_map = new matrix_map_type; - keys_zone.matrix_map->width = matrix_map[0].size(); - keys_zone.matrix_map->height = matrix_map.size(); + keys_zone.matrix_map->width = (unsigned int)matrix_map[0].size(); + keys_zone.matrix_map->height = (unsigned int)matrix_map.size(); keys_zone.matrix_map->map = flat_matrix_map.data(); zones.push_back(keys_zone); @@ -378,8 +378,8 @@ void RGBController_QMKOpenRGBRevE::SetupZones() underglow_zone.leds_max = underglow_zone.leds_min; underglow_zone.leds_count = underglow_zone.leds_min; underglow_zone.matrix_map = new matrix_map_type; - underglow_zone.matrix_map->width = underglow_map[0].size(); - underglow_zone.matrix_map->height = underglow_map.size(); + underglow_zone.matrix_map->width = (unsigned int)underglow_map[0].size(); + underglow_zone.matrix_map->height = (unsigned int)underglow_map.size(); underglow_zone.matrix_map->map = flat_underglow_map.data(); zones.push_back(underglow_zone); } @@ -710,7 +710,7 @@ void RGBController_QMKOpenRGBRevE::CleanMatrixMaps can_break = false; can_break_udg = false; - for(int j = matrix_map[i].size() - 1; j --> 0; ) + for(int j = (int)matrix_map[i].size() - 1; j --> 0; ) { if(matrix_map[i][j] != NO_LED && width < (j + 1) && !can_break) { @@ -746,13 +746,13 @@ void RGBController_QMKOpenRGBRevE::CleanMatrixMaps } } - unsigned int new_height = height - empty_rows.size(); + unsigned int new_height = height - (unsigned int)empty_rows.size(); width = empty_col ? width - 1 : width; width_udg = empty_col_udg && empty_col ? width_udg - 1 : width_udg; LOG_DEBUG("[%s] Key LED Matrix: %ux%u", name.c_str(), width, new_height); LOG_DEBUG("[%s] Underglow LED Matrix: %ux%u", name.c_str(), width_udg, new_height); - for(unsigned int i = empty_rows.size(); i --> 0; ) + for(unsigned int i = (unsigned int)empty_rows.size(); i --> 0; ) { matrix_map.erase(matrix_map.begin()+empty_rows[i]); }