Code Cleanup (#2191)

* constexpr const -> constexpr
* const char* -> std::string_view
This commit is contained in:
Alexander Bock
2022-07-25 15:57:45 +02:00
committed by GitHub
parent ea1f4bbf40
commit 9cc4c595a8
267 changed files with 1425 additions and 1565 deletions
+4 -4
View File
@@ -44,13 +44,13 @@
// #define SHOW_IMGUI_HELPERS
namespace {
constexpr const char* _loggerCat = "GUI";
constexpr const char* GuiFont = "${FONTS}/arimo/Arimo-Regular.ttf";
constexpr const float FontSize = 14.f;
constexpr std::string_view _loggerCat = "GUI";
constexpr std::string_view GuiFont = "${FONTS}/arimo/Arimo-Regular.ttf";
constexpr float FontSize = 14.f;
ImFont* captionFont = nullptr;
constexpr const std::array<const char*, 2> UniformNames = { "tex", "ortho" };
constexpr std::array<const char*, 2> UniformNames = { "tex", "ortho" };
constexpr openspace::properties::Property::PropertyInfo EnabledInfo = {
"Enabled",
@@ -225,7 +225,7 @@ void GuiGlobeBrowsingComponent::render() {
}
if (ImGui::BeginPopup("globebrowsing_add_server")) {
constexpr const int InputBufferSize = 512;
constexpr int InputBufferSize = 512;
static char NameInputBuffer[InputBufferSize];
ImGui::InputText("Server Name", NameInputBuffer, InputBufferSize);
@@ -276,7 +276,7 @@ void GuiGlobeBrowsingComponent::render() {
ImGui::Columns(6, nullptr, false);
const float width = ImGui::GetWindowWidth();
constexpr const float ButtonWidth = 60.f;
constexpr float ButtonWidth = 60.f;
ImGui::SetColumnOffset(5, width - 1.5f * ButtonWidth);
ImGui::SetColumnOffset(4, width - 2.5f * ButtonWidth);
ImGui::SetColumnOffset(3, width - 3.5f * ButtonWidth);
+4 -3
View File
@@ -59,9 +59,10 @@ namespace {
}
}
constexpr const char* AnchorProperty = "NavigationHandler.OrbitalNavigator.Anchor";
constexpr std::string_view AnchorProperty =
"NavigationHandler.OrbitalNavigator.Anchor";
constexpr const char* RetargetAnchorProperty =
constexpr std::string_view RetargetAnchorProperty =
"NavigationHandler.OrbitalNavigator.RetargetAnchor";
} // namespace
@@ -347,7 +348,7 @@ void GuiSpaceTimeComponent::render() {
openspace::TimeUnits.end(),
std::string(""),
[](const std::string& a, const openspace::TimeUnit& unit) {
return a + nameForTimeUnit(unit, true) + " / second" + '\0';
return fmt::format("{}{} / second\0", a, nameForTimeUnit(unit, true));
}
);