Skip to content

Commit

Permalink
Merge pull request #1071 from zivsha/format_security_flag
Browse files Browse the repository at this point in the history
-Wformat-security
  • Loading branch information
dorodnic authored Jan 25, 2018
2 parents 239a518 + 6f13938 commit 9735d20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ if(UNIX)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -pedantic -g -D_BSD_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pedantic -g -Wno-missing-field-initializers")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-multichar -Wsequence-point")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-multichar -Wsequence-point -Wformat-security")

execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE)
if(${MACHINE} MATCHES "arm-linux-gnueabihf")
Expand Down
6 changes: 3 additions & 3 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3277,7 +3277,7 @@ namespace rs2
auto relative_mouse_y = ImGui::GetMousePos().y - top_y_ruler;
auto y = (bottom_y_ruler - top_y_ruler) - relative_mouse_y;
ss << std::fixed << std::setprecision(2) << (y / ratio) << ruler_units;
ImGui::SetTooltip(ss.str().c_str());
ImGui::SetTooltip("%s", ss.str().c_str());
colored_ruler_opac = 1.f;
numbered_ruler_background_opac = hovered_numbered_ruler_opac;
}
Expand All @@ -3297,7 +3297,7 @@ namespace rs2
static const float x_ruler_val = 4.0f;
ImGui::SetCursorPos({ x_ruler_val, y_ruler_val });
const auto font_size = ImGui::GetFontSize();
ImGui::Text(std::to_string(static_cast<int>(ruler_length)).c_str());
ImGui::TextUnformatted(std::to_string(static_cast<int>(ruler_length)).c_str());
const auto skip_numbers = ((ruler_length / 10.f) - 1.f);
auto to_skip = (skip_numbers < 0.f)?0.f: skip_numbers;
for (int i = ruler_length - 1; i > 0; --i)
Expand All @@ -3307,7 +3307,7 @@ namespace rs2
if (((to_skip--) > 0))
continue;

ImGui::Text(std::to_string(i).c_str());
ImGui::TextUnformatted(std::to_string(i).c_str());
to_skip = skip_numbers;
}
y_ruler_val += ((bottom_y_ruler - top_y_ruler) / ruler_length);
Expand Down

0 comments on commit 9735d20

Please sign in to comment.