diff options
author | rtk0c <[email protected]> | 2021-06-30 11:53:50 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-06-30 11:53:50 -0700 |
commit | c2c9452cdd6f50923c02d59c68087add8d17f03a (patch) | |
tree | daad31af4f828cb7396da64dc33488c3d7698a4f /core/src/UI | |
parent | 782e95613da7fb2eb7a2fe9c3c9fbb5b6f756b09 (diff) |
Fix notable warnings (from gcc)
Diffstat (limited to 'core/src/UI')
-rw-r--r-- | core/src/UI/UI_Items.cpp | 4 | ||||
-rw-r--r-- | core/src/UI/UI_Templates.cpp | 13 |
2 files changed, 7 insertions, 10 deletions
diff --git a/core/src/UI/UI_Items.cpp b/core/src/UI/UI_Items.cpp index 2685c82..5b84cb8 100644 --- a/core/src/UI/UI_Items.cpp +++ b/core/src/UI/UI_Items.cpp @@ -32,8 +32,6 @@ ActionResult ItemEditor(ItemList<T>& list, T* item) t.GetEmail(); }; - auto& gs = GlobalStates::GetInstance(); - static bool duplicateName = false; static std::string name; @@ -116,8 +114,6 @@ void ItemListEntries(ItemList<T>& list, int& selectedIdx) }; constexpr int kColumns = 1 /* Name column */ + kHasDescription + kHasEmail + kHasStock + kHasPrice; - auto& gs = GlobalStates::GetInstance(); - if (ImGui::BeginTable("", kColumns, ImGuiTableFlags_Borders)) { ImGui::TableSetupColumn(I18N_TEXT("Name", L10N_ITEM_COLUMN_NAME)); diff --git a/core/src/UI/UI_Templates.cpp b/core/src/UI/UI_Templates.cpp index b4e3aa5..0320ea0 100644 --- a/core/src/UI/UI_Templates.cpp +++ b/core/src/UI/UI_Templates.cpp @@ -194,7 +194,6 @@ private: if (!IsSelected()) { ImGui::Text(I18N_TEXT("Select a cell to edit", L10N_TABLE_CELL_SELECT_MSG)); } else if (mSelectionTL == mSelectionBR) { - auto& selectCell = mTable->GetCell(mSelectionTL); DisplayCellProperties(mSelectionTL); } else { DisplayRangeProperties(mSelectionTL, mSelectionBR); @@ -260,9 +259,9 @@ private: int dividend = column; int modulo; - char* lastChar = bufferEnd - 1; - *lastChar = '\0'; - char* writeHead = lastChar - 1; + char* writeHead = bufferEnd - 1; + *writeHead = '\0'; + --writeHead; while (dividend > 0) { if (writeHead < bufferBegin) { @@ -730,17 +729,19 @@ std::unique_ptr<TemplateUI> TemplateUI::CreateByKind(Template::Kind kind, std::u #define UNIQUE_CAST(TargetType, input) std::unique_ptr<TargetType>(static_cast<TargetType*>(input.release())) switch (kind) { case Template::KD_Table: return std::make_unique<TableTemplateUI>(UNIQUE_CAST(TableTemplate, tmpl)); - case Template::InvalidKind: return nullptr; + case Template::InvalidKind: break; } #pragma pop_macro("UNIQUE_CAST") + return nullptr; } std::unique_ptr<TemplateUI> TemplateUI::CreateByKind(Template::Kind kind) { switch (kind) { case Template::KD_Table: return std::make_unique<TableTemplateUI>(std::make_unique<TableTemplate>()); - case Template::InvalidKind: return nullptr; + case Template::InvalidKind: break; } + return nullptr; } } // namespace |