Skip to content

Commit 5a34219

Browse files
authored
PR #14427 from remibettan: Fix string pedantic issues
2 parents 77b8fa2 + e4ddeb1 commit 5a34219

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

common/output-model.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,10 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev
583583

584584

585585
ImGui::SetCursorPos(ImVec2(7, h - ImGui::GetTextLineHeightWithSpacing() - 2));
586-
ImGui::Text("%s", textual_icons::minus_square_o); ImGui::SameLine();
586+
std::string minus_square_icon_str = std::string(rsutils::string::from()
587+
<< textual_icons::minus_square_o);
588+
ImGui::Text("%s", minus_square_icon_str.c_str());
589+
ImGui::SameLine();
587590
ImGui::SetCursorPos(ImVec2(30, h - ImGui::GetTextLineHeightWithSpacing() - 4));
588591

589592

common/viewer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,7 @@ namespace rs2
27162716
std::string excl_icon_str = std::string(rsutils::string::from()
27172717
<< textual_icons::exclamation_triangle
27182718
<< " Using GLSL for processing but not for rendering can reduce CPU utilisation, but is likely to hurt overall performance!");
2719-
ImGui::Text(excl_icon_str.c_str());
2719+
ImGui::Text("%s", excl_icon_str.c_str());
27202720
ImGui::PopStyleColor();
27212721
}
27222722
#endif
@@ -2974,7 +2974,7 @@ namespace rs2
29742974
std::string excl_icon_str = std::string(rsutils::string::from()
29752975
<< textual_icons::exclamation_triangle
29762976
<< " DDS changes will take effect only after restarting the application");
2977-
ImGui::Text(excl_icon_str.c_str());
2977+
ImGui::Text("%s", excl_icon_str.c_str());
29782978
ImGui::PopStyleColor();
29792979

29802980
}
@@ -3052,7 +3052,7 @@ namespace rs2
30523052
std::string excl_icon_str = std::string(rsutils::string::from()
30533053
<< textual_icons::exclamation_triangle
30543054
<< " The application will be restarted in order for new settings to take effect");
3055-
ImGui::Text(excl_icon_str.c_str());
3055+
ImGui::Text("%s", excl_icon_str.c_str());
30563056
ImGui::PopStyleColor();
30573057
}
30583058

tools/depth-quality/depth-quality-model.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,9 @@ namespace rs2
430430
ImGui::SetCursorPos({ pos.x + 57, pos.y + bar_spacing * (i - j) + 14 });
431431
ImGui::PushStyleColor(ImGuiCol_Text,
432432
blend(blend(light_grey, alpha), distance_guide ? 1.f : fade_factor));
433-
ImGui::Text(textual_icons::angle_right);
433+
std::string angle_right_str = std::string(rsutils::string::from()
434+
<< textual_icons::angle_right);
435+
ImGui::Text("%s", angle_right_str.c_str());
434436
ImGui::PopStyleColor();
435437
}
436438
}
@@ -445,7 +447,8 @@ namespace rs2
445447
ImGui::SetCursorPos({ pos.x + 57, pos.y + bar_spacing * (i + j) + 14 });
446448
ImGui::PushStyleColor(ImGuiCol_Text,
447449
blend(blend(light_grey, alpha), distance_guide ? 1.f : fade_factor));
448-
ImGui::Text(textual_icons::angle_left);
450+
std::string angle_left_str = std::string(rsutils::string::from() << textual_icons::angle_left);
451+
ImGui::Text("%s", angle_left_str.c_str());
449452
ImGui::PopStyleColor();
450453
}
451454
}
@@ -1240,7 +1243,9 @@ namespace rs2
12401243
auto col0 = ImGui::GetCursorPos();
12411244
ImGui::SetCursorPosX(left_x);
12421245
ImGui::PushFont(win.get_large_font());
1243-
ImGui::Text(textual_icons::angle_double_up);
1246+
std::string angle_double_up_str = std::string(rsutils::string::from()
1247+
<< textual_icons::angle_double_up);
1248+
ImGui::Text("%s", angle_double_up_str.c_str());
12441249
if (ImGui::IsItemHovered())
12451250
{
12461251
RsImGui::CustomTooltip("This metric shows positive trend");
@@ -1256,7 +1261,9 @@ namespace rs2
12561261
auto col0 = ImGui::GetCursorPos();
12571262
ImGui::SetCursorPosX(left_x);
12581263
ImGui::PushFont(win.get_large_font());
1259-
ImGui::Text(textual_icons::angle_double_down);
1264+
std::string angle_double_down_str = std::string(rsutils::string::from()
1265+
<< textual_icons::angle_double_down);
1266+
ImGui::Text("%s", angle_double_down_str.c_str());
12601267
if (ImGui::IsItemHovered())
12611268
{
12621269
RsImGui::CustomTooltip("This metric shows negative trend");

0 commit comments

Comments
 (0)