Compare commits

..

10 Commits

Author SHA1 Message Date
WerWolv
e5ff987392 build: Bumped version to 1.18.1 2022-05-28 20:14:30 +02:00
WerWolv
8a24517fb9 fix: Disable warnings only on GCC 12 and higher 2022-05-28 19:59:38 +02:00
WerWolv
a4c8bcab18 fix: Disable another warning to make macOS happy 2022-05-28 16:36:00 +02:00
WerWolv
4fd8ada4ff fix: Crash on exit 2022-05-28 16:33:52 +02:00
WerWolv
7bf94ffe42 fix: Compile errors on platforms that don't support -Wstringop-overread yet 2022-05-28 16:24:57 +02:00
WerWolv
088205385f fix: Workaround that broke functionality. Instead disable warnings
This actually fixes #515 for now
2022-05-28 16:19:08 +02:00
WerWolv
39c743631b fix: Weird build error on GCC 12.1.0 again
This fixes #515
2022-05-28 15:46:39 +02:00
WerWolv
603a95debb patterns: Updated pattern language 2022-05-28 14:14:12 +02:00
WerWolv
28a8adb26d fix: Hex editor selection scrolling not working correctly 2022-05-28 13:38:36 +02:00
WerWolv
e2bfd26bb3 fix: Bookmark menu entry causing wrong region to be marked 2022-05-28 12:56:26 +02:00
7 changed files with 26 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16)
# Updating the version here will update it throughout ImHex as well
set(IMHEX_VERSION "1.18.0")
set(IMHEX_VERSION "1.18.1")
project(imhex VERSION ${IMHEX_VERSION})
set(CMAKE_CXX_STANDARD 20)

View File

@@ -2,9 +2,19 @@
#include <hex.hpp>
#include <map>
#include <string_view>
#include <vector>
// TODO: Workaround for weird issue picked up by GCC 12.1.0 and later. This seems like a compiler bug mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465
#pragma GCC diagnostic push
#if (__GNUC__ >= 12)
#pragma GCC diagnostic ignored "-Wrestrict"
#pragma GCC diagnostic ignored "-Wstringop-overread"
#endif
#include <map>
#include <string_view>
#include <vector>
#pragma GCC diagnostic pop
#include <hex/helpers/fs.hpp>
#include <hex/helpers/file.hpp>

View File

@@ -204,11 +204,15 @@ namespace hex {
}
std::vector<std::string> splitString(const std::string &string, const std::string &delimiter) {
size_t start = 0, end;
size_t start = 0, end = 0;
std::string token;
std::vector<std::string> res;
while ((end = string.find(delimiter, start)) != std::string::npos) {
size_t size = end - start;
if (start + size > string.length())
break;
token = string.substr(start, end - start);
start = end + delimiter.length();
res.push_back(token);

View File

@@ -178,10 +178,6 @@ namespace hex::init {
ImHexApi::HexEditor::impl::getForegroundHighlightingFunctions().clear();
ImHexApi::HexEditor::impl::getTooltips().clear();
while (ImHexApi::Provider::isValid())
ImHexApi::Provider::remove(ImHexApi::Provider::get());
ContentRegistry::Provider::getEntries().clear();
ContentRegistry::Settings::getEntries().clear();
ContentRegistry::Settings::getSettingsData().clear();
@@ -217,6 +213,10 @@ namespace hex::init {
ContentRegistry::DataFormatter::getEntries().clear();
ContentRegistry::FileHandler::getEntries().clear();
while (ImHexApi::Provider::isValid())
ImHexApi::Provider::remove(ImHexApi::Provider::get());
ContentRegistry::Provider::getEntries().clear();
return true;
}

View File

@@ -257,7 +257,7 @@ namespace hex::plugin::builtin {
if (ImGui::MenuItem("hex.builtin.menu.edit.bookmark"_lang, nullptr, false, selection.has_value() && providerValid)) {
auto base = provider->getBaseAddress();
ImHexApi::Bookmarks::add(base + selection->getStartAddress(), selection->getEndAddress(), {}, {});
ImHexApi::Bookmarks::add(base + selection->getStartAddress(), selection->size, {}, {});
}
});

View File

@@ -845,7 +845,7 @@ namespace hex::plugin::builtin {
}
// If the cursor is off-screen, directly jump to the byte
{
if (!ImGui::IsMouseDown(ImGuiMouseButton_Left)) {
const auto newSelection = this->getSelection();
if (newSelection.getStartAddress() < u64(clipper.DisplayStart * this->m_bytesPerRow))
this->jumpToSelection();