mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
sys: Enable -Wall, -Wextra, -Werror and fix all warnings on all Platforms (#483)
* sys: Make ImHex compile with -Wall -Wextra -Werror * sys: Fixed various build errors on Linux * sys: Explicitly ignore return value of `system` function * sys: More fixes for the warnings GitHub Actions enables somehow * sys: More fixes * sys: Remove -Werror again to see all GitHub Actions warnings * sys: Hopefully fixed all remaining warnings * sys: Added back -Werror * git: Change windows icon in GitHub Actions
This commit is contained in:
@@ -50,7 +50,7 @@ namespace hex::plugin::builtin {
|
||||
ImGui::SetNextItemWidth(200_scaled);
|
||||
if (ImGui::BeginCombo("", preview.c_str())) {
|
||||
|
||||
for (int i = 0; i < providers.size(); i++) {
|
||||
for (size_t i = 0; i < providers.size(); i++) {
|
||||
if (ImGui::Selectable(providers[i]->getName().c_str())) {
|
||||
provider = i;
|
||||
}
|
||||
@@ -130,7 +130,8 @@ namespace hex::plugin::builtin {
|
||||
ImGui::TableNextColumn();
|
||||
auto other = !curr;
|
||||
|
||||
std::optional<ImVec2> lastHighlightEnd;
|
||||
bool hasLastHighlight = false;
|
||||
ImVec2 lastHighlightEnd = { };
|
||||
|
||||
for (i64 col = 0; col < lineInfo[curr].validBytes; col++) {
|
||||
auto pos = ImGui::GetCursorScreenPos();
|
||||
@@ -162,10 +163,15 @@ namespace hex::plugin::builtin {
|
||||
|
||||
// Draw highlighting
|
||||
if (highlightColor.has_value()) {
|
||||
drawList->AddRectFilled(lastHighlightEnd.value_or(pos), pos + highlightSize, highlightColor.value());
|
||||
if (hasLastHighlight)
|
||||
drawList->AddRectFilled(lastHighlightEnd, pos + highlightSize, highlightColor.value());
|
||||
else
|
||||
drawList->AddRectFilled(pos, pos + highlightSize, highlightColor.value());
|
||||
|
||||
hasLastHighlight = true;
|
||||
lastHighlightEnd = pos + ImVec2((glyphWidth - 1) * 2, 0);
|
||||
} else {
|
||||
lastHighlightEnd.reset();
|
||||
hasLastHighlight = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,7 +223,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
// Draw diff lines
|
||||
while (clipper.Step()) {
|
||||
for (u64 row = clipper.DisplayStart; row < clipper.DisplayEnd; row++) {
|
||||
for (int row = clipper.DisplayStart; row < clipper.DisplayEnd; row++) {
|
||||
ImGui::TableNextRow();
|
||||
drawDiffLine({ this->m_providerA, this->m_providerB }, row);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user