diff --git a/editors/imhex/Makefile b/editors/imhex/Makefile index 52b93c03f187..dd72a64bc076 100644 --- a/editors/imhex/Makefile +++ b/editors/imhex/Makefile @@ -1,104 +1,112 @@ PORTNAME= imhex -PORTVERSION= 1.28.0 +PORTVERSION= 1.30.1 DISTVERSIONPREFIX= v CATEGORIES= editors MASTER_SITES= https://git.sr.ht/~danyspin97/xdgpp/blob/f01f810714443d0f10c333d4d1d9c0383be41375/:xdg DISTFILES= xdg.hpp:xdg DIST_SUBDIR= imhex MAINTAINER= nobutaka@FreeBSD.org COMMENT= Hex editor for reverse engineers and programmers WWW= https://github.com/WerWolv/ImHex LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE NOT_FOR_ARCHS= i386 powerpc NOT_FOR_ARCHS_REASON= __uint128_t and __int128_t are not supported EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} \ btzy-nativefiledialog-extended-${GH_TAG_NATIVEFILEDIALOG}_GH0${EXTRACT_SUFX} \ capstone-engine-capstone-${GH_TAG_CAPSTONE}_GH0${EXTRACT_SUFX} \ CLIUtils-CLI11-${GH_TAG_CLI11}_GH0${EXTRACT_SUFX} \ fmtlib-fmt-${GH_TAG_FMT}_GH0${EXTRACT_SUFX} \ josuttis-jthread-${GH_TAG_JTHREAD}_GH0${EXTRACT_SUFX} \ VirusTotal-yara-${GH_TAG_YARA}_GH0${EXTRACT_SUFX} \ WerWolv-libromfs-${GH_TAG_LIBROMFS}_GH0${EXTRACT_SUFX} \ WerWolv-libwolv-${GH_TAG_LIBWOLV}_GH0${EXTRACT_SUFX} \ WerWolv-ImHex-Patterns-${GH_TAG_IMHEX_PATTERNS}_GH0${EXTRACT_SUFX} \ WerWolv-PatternLanguage-${GH_TAG_PATTERN_LANGUAGE}_GH0${EXTRACT_SUFX} BUILD_DEPENDS= glm>0:math/glm \ nlohmann-json>0:devel/nlohmann-json \ ${LOCALBASE}/include/hpx/functional.hpp:devel/hpx \ ${LOCALBASE}/include/range/v3/range.hpp:devel/range-v3 \ ${LOCALBASE}/include/tl/expected.hpp:devel/tl-expected LIB_DEPENDS= libcurl.so:ftp/curl \ libglfw.so:graphics/glfw \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ + libinotify.so:devel/libinotify \ libmbedtls.so:security/mbedtls \ libtre.so:textproc/libtre USES= cmake desktop-file-utils gl gnome llvm:min=16,build pkgconfig python xorg USE_GL= gl glu USE_GNOME= cairo gdkpixbuf2 gtk30 USE_XORG= x11 xcb xau xdmcp USE_GITHUB= yes GH_ACCOUNT= WerWolv GH_PROJECT= ImHex GH_TUPLE= btzy:nativefiledialog-extended:${GH_TAG_NATIVEFILEDIALOG}:nativefiledialog \ capstone-engine:capstone:${GH_TAG_CAPSTONE}:capstone \ CLIUtils:CLI11:${GH_TAG_CLI11}:cli11 \ fmtlib:fmt:${GH_TAG_FMT}:fmt \ josuttis:jthread:${GH_TAG_JTHREAD}:jthread \ VirusTotal:yara:${GH_TAG_YARA}:yara \ WerWolv:ImHex-Patterns:${GH_TAG_IMHEX_PATTERNS}:imhex_patterns \ WerWolv:PatternLanguage:${GH_TAG_PATTERN_LANGUAGE}:pattern_language \ WerWolv:libromfs:${GH_TAG_LIBROMFS}:libromfs \ WerWolv:libwolv:${GH_TAG_LIBWOLV}:libwolv \ GH_TAG_CAPSTONE= d5141c0 GH_TAG_CLI11= faea921 -GH_TAG_FMT= a337011 -GH_TAG_IMHEX_PATTERNS= 2ffa4e0 +GH_TAG_FMT= a0b8a92 +GH_TAG_IMHEX_PATTERNS= 759708d GH_TAG_JTHREAD= 0fa8d39 -GH_TAG_LIBROMFS= 40cd303 -GH_TAG_LIBWOLV= bcd987c +GH_TAG_LIBROMFS= 80b9ade +GH_TAG_LIBWOLV= 128bed6 GH_TAG_NATIVEFILEDIALOG= 7909f55 -GH_TAG_PATTERN_LANGUAGE= 68210bd +GH_TAG_PATTERN_LANGUAGE= 57dc02b GH_TAG_YARA= 96790e5 -CXX= ${LOCALBASE}/bin/clang++${LLVM_VERSION} +CC= ${LOCALBASE}/bin/clang16 +CXX= ${LOCALBASE}/bin/clang++16 +CFLAGS+= -I${LOCALBASE}/include +CXXFLAGS+= -I${LOCALBASE}/include \ + -I${WRKSRC}/lib/external/pattern_language/generators/include \ + -Wno-error=deprecated-declarations \ + -Wno-error=literal-conversion CMAKE_ARGS= -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_NLOHMANN_JSON=ON \ -DIMHEX_STRIP_RELEASE=OFF -DIMHEX_PLUGINS_IN_SHARE=ON \ -DIMHEX_OFFLINE_BUILD=ON -DIMHEX_USE_GTK_FILE_PICKER=ON PORTDOCS= README.md OPTIONS_DEFINE= DOCS NLS NLS_USES= gettext post-extract: ${CP} ${DISTDIR}/${DIST_SUBDIR}/xdg.hpp ${WRKSRC}/lib/external/xdgpp ${CP} -R ${WRKSRC_capstone}/* ${WRKSRC}/lib/external/capstone ${CP} -R ${WRKSRC_fmt}/* ${WRKSRC}/lib/external/fmt ${CP} -R ${WRKSRC_jthread}/source/*.hpp ${WRKSRC}/lib/libimhex/include ${CP} -R ${WRKSRC_libromfs}/* ${WRKSRC}/lib/external/libromfs ${CP} -R ${WRKSRC_libwolv}/* ${WRKSRC}/lib/external/libwolv + ${CP} -R ${WRKSRC_jthread}/source/*.hpp ${WRKSRC}/lib/external/libwolv/libs/io/include/wolv/io ${CP} -R ${WRKSRC_nativefiledialog}/* ${WRKSRC}/lib/external/nativefiledialog ${CP} -R ${WRKSRC_pattern_language}/* ${WRKSRC}/lib/external/pattern_language ${CP} -R ${WRKSRC_cli11}/* ${WRKSRC}/lib/external/pattern_language/external/cli11 ${CP} -R ${WRKSRC_yara}/* ${WRKSRC}/lib/external/yara/yara ${MKDIR} ${WRKDIR}/.build/_deps/imhex_patterns_src ${CP} -R ${WRKSRC_imhex_patterns}/* ${WRKDIR}/.build/_deps/imhex_patterns_src post-patch: ${CP} -R ${WRKSRC}/lib/external/libwolv/* ${WRKSRC}/lib/external/pattern_language/external/libwolv post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} .include diff --git a/editors/imhex/distinfo b/editors/imhex/distinfo index dae5dd2ce553..2d5d9ec9eaf8 100644 --- a/editors/imhex/distinfo +++ b/editors/imhex/distinfo @@ -1,25 +1,25 @@ -TIMESTAMP = 1680967037 +TIMESTAMP = 1688829700 SHA256 (imhex/xdg.hpp) = 2e08ce74adb71ff9b9aa9e1c999733fccd4b00967b9cf0c0e51dbf049392a9ec SIZE (imhex/xdg.hpp) = 7674 -SHA256 (imhex/WerWolv-ImHex-v1.28.0_GH0.tar.gz) = 6d6d716b6fd785bfb11929ec33fdcbfced25e735519c1bf451c64ddd13b3383f -SIZE (imhex/WerWolv-ImHex-v1.28.0_GH0.tar.gz) = 11741032 +SHA256 (imhex/WerWolv-ImHex-v1.30.1_GH0.tar.gz) = 8dee5bec767e96031a6949286107222716455fa4ece90e1276f2734bfc6f41ea +SIZE (imhex/WerWolv-ImHex-v1.30.1_GH0.tar.gz) = 11802597 SHA256 (imhex/btzy-nativefiledialog-extended-7909f55_GH0.tar.gz) = eb6c9376ab32dfa1b3f40f197f04d2d3dbe07c8555d57df3945121e843c98a97 SIZE (imhex/btzy-nativefiledialog-extended-7909f55_GH0.tar.gz) = 412738 SHA256 (imhex/capstone-engine-capstone-d5141c0_GH0.tar.gz) = 435d40757928fa73dec19c6d0fbf171bd76341391c8525ce1286927dab44c3e7 SIZE (imhex/capstone-engine-capstone-d5141c0_GH0.tar.gz) = 5761632 SHA256 (imhex/CLIUtils-CLI11-faea921_GH0.tar.gz) = 84773ee9577e6b719e5a84ad62cc381cf3027756690e1db839eaa50bcafc6c78 SIZE (imhex/CLIUtils-CLI11-faea921_GH0.tar.gz) = 299718 -SHA256 (imhex/fmtlib-fmt-a337011_GH0.tar.gz) = ba190d69d8b7994ef2ceb533c56bc34feec296fef2f87efab4cfb981a04601cf -SIZE (imhex/fmtlib-fmt-a337011_GH0.tar.gz) = 837936 +SHA256 (imhex/fmtlib-fmt-a0b8a92_GH0.tar.gz) = 370d03ac94a7ad90d3924667f83bd2bb08e3dc60df6263dc04492b4081a4b7e1 +SIZE (imhex/fmtlib-fmt-a0b8a92_GH0.tar.gz) = 851621 SHA256 (imhex/josuttis-jthread-0fa8d39_GH0.tar.gz) = ccd9c871dc2da9611e6d0cba5fc859cec9b233541be7501e5cef9eaa367e1280 SIZE (imhex/josuttis-jthread-0fa8d39_GH0.tar.gz) = 4450456 SHA256 (imhex/VirusTotal-yara-96790e5_GH0.tar.gz) = f58a3e8e7fa6bec3b5d8631d4bfbd48da801ebf4b5f8e1b26fea4a1115708a1c SIZE (imhex/VirusTotal-yara-96790e5_GH0.tar.gz) = 2179144 -SHA256 (imhex/WerWolv-ImHex-Patterns-2ffa4e0_GH0.tar.gz) = 733697f5444c9622f79b47f9b0e83483a1d50e27da93e894ce83402615887038 -SIZE (imhex/WerWolv-ImHex-Patterns-2ffa4e0_GH0.tar.gz) = 3065433 -SHA256 (imhex/WerWolv-PatternLanguage-68210bd_GH0.tar.gz) = dd1404eda3627ed2426cbb50ca68fb5b8af8399b46dabfde8b91dacda975b869 -SIZE (imhex/WerWolv-PatternLanguage-68210bd_GH0.tar.gz) = 223467 -SHA256 (imhex/WerWolv-libromfs-40cd303_GH0.tar.gz) = e785499616e1dfc2644be61706cf1fba49a8d8282c6aecf78efee02c6fbbca13 -SIZE (imhex/WerWolv-libromfs-40cd303_GH0.tar.gz) = 4301 -SHA256 (imhex/WerWolv-libwolv-bcd987c_GH0.tar.gz) = d170a887ba3d07efabc6180b5b6f077d5b5d261a0144cfe281aa0f04e05f3991 -SIZE (imhex/WerWolv-libwolv-bcd987c_GH0.tar.gz) = 20301 +SHA256 (imhex/WerWolv-ImHex-Patterns-759708d_GH0.tar.gz) = abc623f6441910bcfe05b6aadedbb8c82d2c192bd8706b5523a352e36f7ca6bd +SIZE (imhex/WerWolv-ImHex-Patterns-759708d_GH0.tar.gz) = 3377254 +SHA256 (imhex/WerWolv-PatternLanguage-57dc02b_GH0.tar.gz) = 55d93dd36d776dc7a3d8085904ebe9fc3c2802d904616c4e8f1e79da3f8c49ae +SIZE (imhex/WerWolv-PatternLanguage-57dc02b_GH0.tar.gz) = 228358 +SHA256 (imhex/WerWolv-libromfs-80b9ade_GH0.tar.gz) = 0825f9f80f62bc3c20e1b35efde0f224779402b313d31362537d5273fdee84a7 +SIZE (imhex/WerWolv-libromfs-80b9ade_GH0.tar.gz) = 4527 +SHA256 (imhex/WerWolv-libwolv-128bed6_GH0.tar.gz) = b1e023d17707d95feb01f2f161b18b95adbdf6f4cddf4d9be92dd481e0f96553 +SIZE (imhex/WerWolv-libwolv-128bed6_GH0.tar.gz) = 29336 diff --git a/editors/imhex/files/patch-CMakeLists.txt b/editors/imhex/files/patch-CMakeLists.txt index ba76e857d734..e36ee360d92f 100644 --- a/editors/imhex/files/patch-CMakeLists.txt +++ b/editors/imhex/files/patch-CMakeLists.txt @@ -1,11 +1,11 @@ ---- CMakeLists.txt.orig 2023-04-04 10:04:22 UTC +--- CMakeLists.txt.orig 2023-06-24 10:07:39 UTC +++ CMakeLists.txt @@ -29,8 +29,6 @@ project(imhex # Make sure project is configured correctly setDefaultBuiltTypeIfUnset() -detectBadClone() -verifyCompiler() # List plugin names here. Project name must match folder name set(PLUGINS diff --git a/editors/imhex/files/patch-cmake_build__helpers.cmake b/editors/imhex/files/patch-cmake_build__helpers.cmake index 2791ff6dd58b..976765cb2b41 100644 --- a/editors/imhex/files/patch-cmake_build__helpers.cmake +++ b/editors/imhex/files/patch-cmake_build__helpers.cmake @@ -1,26 +1,18 @@ ---- cmake/build_helpers.cmake.orig 2023-04-04 10:04:22 UTC +--- cmake/build_helpers.cmake.orig 2023-06-24 10:07:39 UTC +++ cmake/build_helpers.cmake -@@ -378,13 +378,13 @@ function(downloadImHexPatternsFiles dest) +@@ -392,13 +392,13 @@ function(downloadImHexPatternsFiles dest) else () # Maybe patterns are cloned to a subdirectory - set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ImHex-Patterns") + set(imhex_patterns_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/imhex_patterns_src") endif () if (EXISTS ${imhex_patterns_SOURCE_DIR}) set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic) foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL}) -- install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION ${dest}) -+ install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "share/imhex/") +- install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION ${dest} PATTERN "**/_schema.json" EXCLUDE) ++ install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "share/imhex/" PATTERN "**/_schema.json" EXCLUDE) endforeach () endif () -@@ -392,7 +392,6 @@ endfunction() - - macro(setupCompilerWarnings target) - set(IMHEX_COMMON_FLAGS "-Wall -Wextra -Wpedantic -Werror") -- set(IMHEX_C_FLAGS "${IMHEX_COMMON_FLAGS} -Wno-restrict -Wno-stringop-overread -Wno-stringop-overflow -Wno-array-bounds") - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_C_FLAGS}") diff --git a/editors/imhex/files/patch-lib_external_libwolv_libs_hash_include_wolv_hash_uuid.hpp b/editors/imhex/files/patch-lib_external_libwolv_libs_hash_include_wolv_hash_uuid.hpp new file mode 100644 index 000000000000..4a8523bcb189 --- /dev/null +++ b/editors/imhex/files/patch-lib_external_libwolv_libs_hash_include_wolv_hash_uuid.hpp @@ -0,0 +1,21 @@ +--- lib/external/libwolv/libs/hash/include/wolv/hash/uuid.hpp.orig 2023-06-24 12:12:43 UTC ++++ lib/external/libwolv/libs/hash/include/wolv/hash/uuid.hpp +@@ -11,15 +11,15 @@ namespace wolv::hash { + std::random_device randomDevice; + std::mt19937 generator(randomDevice()); + +- std::uniform_int_distribution distribution(0, 15); ++ std::uniform_int_distribution distribution(0, 15); + + std::string uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"; + for (char &c : uuid) { + if (c == 'x') { +- c = distribution(generator); ++ c = static_cast(distribution(generator)); + c = c < 10 ? char('0' + c) : char('a' + c - 10); + } else if (c == 'y') { +- c = distribution(generator); ++ c = static_cast(distribution(generator)); + c = char(char(c & u8(0x03)) | char(0x08)); + c = c < 10 ? char('0' + c) : char('a' + c - 10); + } diff --git a/editors/imhex/files/patch-lib_external_libwolv_libs_io_include_wolv_io_file.hpp b/editors/imhex/files/patch-lib_external_libwolv_libs_io_include_wolv_io_file.hpp new file mode 100644 index 000000000000..700380ec30fc --- /dev/null +++ b/editors/imhex/files/patch-lib_external_libwolv_libs_io_include_wolv_io_file.hpp @@ -0,0 +1,10 @@ +--- lib/external/libwolv/libs/io/include/wolv/io/file.hpp.orig 2023-05-21 12:25:30 UTC ++++ lib/external/libwolv/libs/io/include/wolv/io/file.hpp +@@ -10,6 +10,7 @@ + #include + + #include ++#include "jthread.hpp" + + #if defined(OS_MACOS) + diff --git a/editors/imhex/files/patch-lib_external_libwolv_libs_io_source_io_file.cpp b/editors/imhex/files/patch-lib_external_libwolv_libs_io_source_io_file.cpp index 45ee30862e05..fe05c1b2285c 100644 --- a/editors/imhex/files/patch-lib_external_libwolv_libs_io_source_io_file.cpp +++ b/editors/imhex/files/patch-lib_external_libwolv_libs_io_source_io_file.cpp @@ -1,51 +1,61 @@ ---- lib/external/libwolv/libs/io/source/io/file.cpp.orig 2023-04-08 15:55:46 UTC +--- lib/external/libwolv/libs/io/source/io/file.cpp.orig 2023-07-09 11:32:49 UTC +++ lib/external/libwolv/libs/io/source/io/file.cpp -@@ -21,12 +21,12 @@ namespace wolv::io { +@@ -39,12 +39,12 @@ namespace wolv::io { #else if (mode == File::Mode::Read) - this->m_file = fopen64(util::toUTF8String(path).c_str(), "rb"); + this->m_file = fopen(util::toUTF8String(path).c_str(), "rb"); else if (mode == File::Mode::Write) - this->m_file = fopen64(util::toUTF8String(path).c_str(), "r+b"); + this->m_file = fopen(util::toUTF8String(path).c_str(), "r+b"); if (mode == File::Mode::Create || (mode == File::Mode::Write && this->m_file == nullptr)) - this->m_file = fopen64(util::toUTF8String(path).c_str(), "w+b"); + this->m_file = fopen(util::toUTF8String(path).c_str(), "w+b"); #endif - } -@@ -63,7 +63,7 @@ namespace wolv::io { + +@@ -82,7 +82,7 @@ namespace wolv::io { } void File::seek(u64 offset) { - fseeko64(this->m_file, offset, SEEK_SET); + fseeko(this->m_file, offset, SEEK_SET); } void File::close() { -@@ -148,10 +148,10 @@ namespace wolv::io { - size_t File::getSize() const { - if (!isValid()) return 0; +@@ -114,8 +114,7 @@ namespace wolv::io { + auto fd = fileno(this->m_file); + auto size = getSize(); -- auto startPos = ftello64(this->m_file); -- fseeko64(this->m_file, 0, SEEK_END); -- auto size = ftello64(this->m_file); -- fseeko64(this->m_file, startPos, SEEK_SET); -+ auto startPos = ftello(this->m_file); -+ fseeko(this->m_file, 0, SEEK_END); -+ auto size = ftello(this->m_file); -+ fseeko(this->m_file, startPos, SEEK_SET); +- this->m_map = reinterpret_cast(mmap(nullptr, size, this->m_mode == Mode::Read ? PROT_READ : PROT_WRITE, MAP_SHARED, fd, 0)); +- ++ this->m_map = reinterpret_cast(mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)); + #endif + } - if (size < 0) - return 0; -@@ -162,7 +162,7 @@ namespace wolv::io { +@@ -214,7 +213,7 @@ namespace wolv::io { void File::setSize(u64 size) { if (!isValid()) return; - auto result = ftruncate64(fileno(this->m_file), size); + auto result = ftruncate(fileno(this->m_file), size); util::unused(result); + this->updateSize(); } +@@ -225,10 +224,10 @@ namespace wolv::io { + return; + } + +- auto startPos = ftello64(this->m_file); +- fseeko64(this->m_file, 0, SEEK_END); +- auto size = ftello64(this->m_file); +- fseeko64(this->m_file, startPos, SEEK_SET); ++ auto startPos = ftello(this->m_file); ++ fseeko(this->m_file, 0, SEEK_END); ++ auto size = ftello(this->m_file); ++ fseeko(this->m_file, startPos, SEEK_SET); + if (this->m_map != nullptr && size != this->m_fileSize) { + this->unmap(); diff --git a/editors/imhex/files/patch-lib_external_libwolv_libs_net_include_wolv_net_common.hpp b/editors/imhex/files/patch-lib_external_libwolv_libs_net_include_wolv_net_common.hpp new file mode 100644 index 000000000000..871b2d494616 --- /dev/null +++ b/editors/imhex/files/patch-lib_external_libwolv_libs_net_include_wolv_net_common.hpp @@ -0,0 +1,11 @@ +--- lib/external/libwolv/libs/net/include/wolv/net/common.hpp.orig 2023-07-09 14:37:57 UTC ++++ lib/external/libwolv/libs/net/include/wolv/net/common.hpp +@@ -16,6 +16,8 @@ + + #endif + ++#include ++ + namespace wolv::net { + + #if defined(OS_WINDOWS) diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_CMakeLists.txt b/editors/imhex/files/patch-lib_external_pattern__language_lib_CMakeLists.txt index 21819240ed2f..c315fdccd068 100644 --- a/editors/imhex/files/patch-lib_external_pattern__language_lib_CMakeLists.txt +++ b/editors/imhex/files/patch-lib_external_pattern__language_lib_CMakeLists.txt @@ -1,11 +1,11 @@ ---- lib/external/pattern_language/lib/CMakeLists.txt.orig 2023-04-08 15:28:11 UTC +--- lib/external/pattern_language/lib/CMakeLists.txt.orig 2023-06-20 14:11:25 UTC +++ lib/external/pattern_language/lib/CMakeLists.txt -@@ -34,7 +34,7 @@ add_library(libpl ${LIBRARY_TYPE} - source/pl/lib/std/random.cpp +@@ -69,7 +69,7 @@ add_library(libpl ${LIBRARY_TYPE} ) --target_compile_options(libpl PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-unknown-pragmas) -+target_compile_options(libpl PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-unknown-pragmas -Wno-error=deprecated-declarations) - - target_include_directories(libpl PUBLIC include) - target_link_libraries(libpl PRIVATE fmt::fmt-header-only) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") +- target_compile_options(libpl PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-unknown-pragmas -Wno-array-bounds) ++ target_compile_options(libpl PRIVATE -Wall -Wextra -Werror -Wpedantic -Wno-unknown-pragmas -Wno-array-bounds -Wno-error=deprecated-declarations) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_options(libpl PRIVATE -Wno-stringop-overflow) + endif() diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node.hpp b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node.hpp index 89b9ea1731aa..35e2e1ecf4b3 100644 --- a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node.hpp +++ b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node.hpp @@ -1,17 +1,15 @@ ---- lib/external/pattern_language/lib/include/pl/core/ast/ast_node.hpp.orig 2023-04-08 15:28:11 UTC +--- lib/external/pattern_language/lib/include/pl/core/ast/ast_node.hpp.orig 2023-06-20 14:11:25 UTC +++ lib/external/pattern_language/lib/include/pl/core/ast/ast_node.hpp -@@ -16,11 +16,11 @@ namespace pl::core::ast { - - class ASTNode : public Cloneable { +@@ -18,9 +18,9 @@ namespace pl::core::ast { public: -- constexpr ASTNode() = default; -+ ASTNode() = default; + using FunctionResult = std::optional; +- constexpr ASTNode() = default; - constexpr virtual ~ASTNode() = default; -+ virtual ~ASTNode() = default; - - constexpr ASTNode(const ASTNode &) = default; ++ ASTNode() = default; ++ virtual ~ASTNode() = default; + ASTNode(const ASTNode &) = default; - [[nodiscard]] constexpr u32 getLine() const { return this->m_line; } - [[nodiscard]] constexpr u32 getColumn() const { return this->m_column; } + [[nodiscard]] u32 getLine() const; + [[nodiscard]] u32 getColumn() const; diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node__bitfield__field.hpp b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node__bitfield__field.hpp new file mode 100644 index 000000000000..e9cf789b593e --- /dev/null +++ b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node__bitfield__field.hpp @@ -0,0 +1,10 @@ +--- lib/external/pattern_language/lib/include/pl/core/ast/ast_node_bitfield_field.hpp.orig 2023-07-09 14:52:20 UTC ++++ lib/external/pattern_language/lib/include/pl/core/ast/ast_node_bitfield_field.hpp +@@ -2,6 +2,7 @@ + + #include + #include ++#include + + #include + diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node__builtin__type.hpp b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node__builtin__type.hpp deleted file mode 100644 index 28714214c03e..000000000000 --- a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_ast_ast__node__builtin__type.hpp +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/external/pattern_language/lib/include/pl/core/ast/ast_node_builtin_type.hpp.orig 2023-01-05 15:12:35 UTC -+++ lib/external/pattern_language/lib/include/pl/core/ast/ast_node_builtin_type.hpp -@@ -15,7 +15,7 @@ namespace pl::core::ast { - - class ASTNodeBuiltinType : public ASTNode { - public: -- constexpr explicit ASTNodeBuiltinType(Token::ValueType type) -+ explicit ASTNodeBuiltinType(Token::ValueType type) - : ASTNode(), m_type(type) { } - - [[nodiscard]] constexpr const auto &getType() const { return this->m_type; } diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_parser.hpp b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_parser.hpp index 4881cecc95c8..d8205e6ffc90 100644 --- a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_parser.hpp +++ b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_parser.hpp @@ -1,38 +1,38 @@ ---- lib/external/pattern_language/lib/include/pl/core/parser.hpp.orig 2023-04-08 16:22:09 UTC +--- lib/external/pattern_language/lib/include/pl/core/parser.hpp.orig 2023-05-21 11:04:34 UTC +++ lib/external/pattern_language/lib/include/pl/core/parser.hpp -@@ -233,7 +233,7 @@ namespace pl::core { +@@ -234,7 +234,7 @@ namespace pl::core { else if constexpr (S == Not) return false; else - std::unreachable(); + __builtin_unreachable(); } template -@@ -264,7 +264,7 @@ namespace pl::core { +@@ -265,7 +265,7 @@ namespace pl::core { partReset(); return false; } else - std::unreachable(); + __builtin_unreachable(); } template -@@ -279,7 +279,7 @@ namespace pl::core { +@@ -280,7 +280,7 @@ namespace pl::core { else if constexpr (S == Not) return true; else - std::unreachable(); + __builtin_unreachable(); } template -@@ -289,7 +289,7 @@ namespace pl::core { +@@ -290,7 +290,7 @@ namespace pl::core { else if constexpr (S == Not) return sequenceImpl(token) && oneOfImpl(args...); else - std::unreachable(); + __builtin_unreachable(); } template diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_token.hpp b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_token.hpp index 515b59369fe1..f772aefef49e 100644 --- a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_token.hpp +++ b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_core_token.hpp @@ -1,20 +1,20 @@ ---- lib/external/pattern_language/lib/include/pl/core/token.hpp.orig 2023-04-08 15:28:11 UTC +--- lib/external/pattern_language/lib/include/pl/core/token.hpp.orig 2023-06-24 11:43:14 UTC +++ lib/external/pattern_language/lib/include/pl/core/token.hpp -@@ -157,7 +157,7 @@ namespace pl::core { +@@ -161,7 +161,7 @@ namespace pl::core { bool global; std::string comment; - constexpr bool operator==(const DocComment &) const = default; + bool operator==(const DocComment &) const = default; }; - struct Literal : public std::variant { -@@ -185,7 +185,7 @@ namespace pl::core { + struct Literal : public std::variant> { +@@ -189,7 +189,7 @@ namespace pl::core { using ValueTypes = std::variant; - constexpr Token(Type type, auto value, u32 line, u32 column) : type(type), value(std::move(value)), line(line), column(column) {} + inline Token(Type type, auto value, u32 line, u32 column) : type(type), value(std::move(value)), line(line), column(column) {} [[nodiscard]] constexpr static inline bool isInteger(const ValueType &type) { return isUnsigned(type) || isSigned(type); diff --git a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_patterns_pattern.hpp b/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_patterns_pattern.hpp deleted file mode 100644 index 604dfcad4a70..000000000000 --- a/editors/imhex/files/patch-lib_external_pattern__language_lib_include_pl_patterns_pattern.hpp +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/external/pattern_language/lib/include/pl/patterns/pattern.hpp.orig 2023-04-08 16:10:41 UTC -+++ lib/external/pattern_language/lib/include/pl/patterns/pattern.hpp -@@ -336,7 +336,7 @@ namespace pl::ptrn { - auto startOffset = child->getOffset(); - - child->setOffset(offset); -- ON_SCOPE_EXIT { child->setOffset(startOffset); }; -+ [[maybe_unused]] auto WOLV_ANONYMOUS_VARIABLE(SCOPE_EXIT_) = ::wolv::util::scope_guard::ScopeGuardOnExit() + [&, child=child]() { child->setOffset(startOffset); }; - - auto bytes = child->getBytes(); - std::copy(bytes.begin(), bytes.end(), std::back_inserter(result)); diff --git a/editors/imhex/files/patch-lib_libimhex_CMakeLists.txt b/editors/imhex/files/patch-lib_libimhex_CMakeLists.txt new file mode 100644 index 000000000000..15ecad5e6abb --- /dev/null +++ b/editors/imhex/files/patch-lib_libimhex_CMakeLists.txt @@ -0,0 +1,8 @@ +--- lib/libimhex/CMakeLists.txt.orig 2023-06-24 10:07:39 UTC ++++ lib/libimhex/CMakeLists.txt +@@ -70,4 +70,4 @@ elseif (APPLE) + endif () + + target_link_libraries(libimhex PRIVATE ${FMT_LIBRARIES}) +-target_link_libraries(libimhex PUBLIC dl imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${LIBBACKTRACE_LIBRARIES} libpl libpl-gen ${MINIAUDIO_LIBRARIES} libwolv-utils libwolv-io libwolv-hash libwolv-net libwolv-containers) ++target_link_libraries(libimhex PUBLIC dl imgui ${NFD_LIBRARIES} magic ${CAPSTONE_LIBRARIES} LLVMDemangle microtar ${NLOHMANN_JSON_LIBRARIES} ${YARA_LIBRARIES} ${LIBCURL_LIBRARIES} ${MBEDTLS_LIBRARIES} ${LIBBACKTRACE_LIBRARIES} libpl ${MINIAUDIO_LIBRARIES} libwolv-utils libwolv-io libwolv-hash libwolv-net libwolv-containers inotify) diff --git a/editors/imhex/files/patch-lib_libimhex_include_hex_api_content__registry.hpp b/editors/imhex/files/patch-lib_libimhex_include_hex_api_content__registry.hpp new file mode 100644 index 000000000000..646984ea768b --- /dev/null +++ b/editors/imhex/files/patch-lib_libimhex_include_hex_api_content__registry.hpp @@ -0,0 +1,10 @@ +--- lib/libimhex/include/hex/api/content_registry.hpp.orig 2023-05-21 12:30:36 UTC ++++ lib/libimhex/include/hex/api/content_registry.hpp +@@ -17,6 +17,7 @@ + #include + + #include ++#include + + using ImGuiDataType = int; + using ImGuiInputTextFlags = int; diff --git a/editors/imhex/files/patch-lib_libimhex_source_api_imhex__api.cpp b/editors/imhex/files/patch-lib_libimhex_source_api_imhex__api.cpp index 483fdddc1daf..620ee3a6bb2d 100644 --- a/editors/imhex/files/patch-lib_libimhex_source_api_imhex__api.cpp +++ b/editors/imhex/files/patch-lib_libimhex_source_api_imhex__api.cpp @@ -1,19 +1,19 @@ ---- lib/libimhex/source/api/imhex_api.cpp.orig 2023-04-04 10:04:22 UTC +--- lib/libimhex/source/api/imhex_api.cpp.orig 2023-06-24 10:07:39 UTC +++ lib/libimhex/source/api/imhex_api.cpp -@@ -4,6 +4,7 @@ - #include - #include +@@ -8,6 +8,7 @@ + + #include +#include #include #include -@@ -259,7 +260,7 @@ namespace hex { +@@ -269,7 +270,7 @@ namespace hex { } bool isDirty() { - return std::ranges::any_of(s_providers, [](const auto &provider) { + return ranges::any_of(s_providers, [](const auto &provider) { return provider->isDirty(); }); } diff --git a/editors/imhex/files/patch-lib_libimhex_source_api_project__file__manager.cpp b/editors/imhex/files/patch-lib_libimhex_source_api_project__file__manager.cpp deleted file mode 100644 index b5600b88cdf8..000000000000 --- a/editors/imhex/files/patch-lib_libimhex_source_api_project__file__manager.cpp +++ /dev/null @@ -1,11 +0,0 @@ ---- lib/libimhex/source/api/project_file_manager.cpp.orig 2023-04-04 10:04:22 UTC -+++ lib/libimhex/source/api/project_file_manager.cpp -@@ -46,7 +46,7 @@ namespace hex { - return false; - } - -- auto providers = auto(ImHexApi::Provider::getProviders()); -+ auto providers = ImHexApi::Provider::getProviders(); - for (const auto &provider : providers) { - ImHexApi::Provider::remove(provider); - } diff --git a/editors/imhex/files/patch-lib_libimhex_source_helpers_fs.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_fs.cpp index 71a5ad974e02..bd925367ce9e 100644 --- a/editors/imhex/files/patch-lib_libimhex_source_helpers_fs.cpp +++ b/editors/imhex/files/patch-lib_libimhex_source_helpers_fs.cpp @@ -1,27 +1,27 @@ ---- lib/libimhex/source/helpers/fs.cpp.orig 2023-04-04 10:04:22 UTC +--- lib/libimhex/source/helpers/fs.cpp.orig 2023-06-24 10:07:39 UTC +++ lib/libimhex/source/helpers/fs.cpp -@@ -11,10 +11,15 @@ +@@ -12,10 +12,15 @@ #include #elif defined(OS_LINUX) #include +# if defined(__FreeBSD__) + #include +# else #include +# endif #endif #include +#include #include #include -@@ -54,7 +59,7 @@ namespace hex::fs { +@@ -120,7 +125,7 @@ namespace hex::fs { result = NFD::PickFolder(outPath, defaultPath.empty() ? nullptr : defaultPath.c_str()); break; default: - std::unreachable(); + __builtin_unreachable(); } if (result == NFD_OKAY){ diff --git a/editors/imhex/files/patch-lib_libimhex_source_helpers_stacktrace.cpp b/editors/imhex/files/patch-lib_libimhex_source_helpers_stacktrace.cpp new file mode 100644 index 000000000000..0027dae3b29c --- /dev/null +++ b/editors/imhex/files/patch-lib_libimhex_source_helpers_stacktrace.cpp @@ -0,0 +1,11 @@ +--- lib/libimhex/source/helpers/stacktrace.cpp.orig 2023-06-24 11:58:12 UTC ++++ lib/libimhex/source/helpers/stacktrace.cpp +@@ -119,7 +119,7 @@ + auto count = backtrace(addresses.data(), addresses.size()); + auto functions = backtrace_symbols(addresses.data(), count); + +- for (i32 i = 0; i < count; i++) ++ for (size_t i = 0; i < count; i++) + result.push_back(StackFrame { "", functions[i], 0 }); + + return result; diff --git a/editors/imhex/files/patch-main_CMakeLists.txt b/editors/imhex/files/patch-main_CMakeLists.txt index 47e20ae36dda..de956606b3a8 100644 --- a/editors/imhex/files/patch-main_CMakeLists.txt +++ b/editors/imhex/files/patch-main_CMakeLists.txt @@ -1,11 +1,11 @@ ---- main/CMakeLists.txt.orig 2023-02-13 15:50:24 UTC +--- main/CMakeLists.txt.orig 2023-06-24 10:07:39 UTC +++ main/CMakeLists.txt -@@ -30,7 +30,7 @@ set_target_properties(main PROPERTIES +@@ -31,7 +31,7 @@ set_target_properties(main PROPERTIES add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}") -target_link_libraries(main PRIVATE libromfs-imhex libimhex ${FMT_LIBRARIES}) +target_link_libraries(main PRIVATE libromfs-imhex libimhex ${FMT_LIBRARIES} execinfo) if (WIN32) target_link_libraries(main PRIVATE usp10 wsock32 ws2_32 Dwmapi.lib) else () diff --git a/editors/imhex/files/patch-main_source_window_linux__window.cpp b/editors/imhex/files/patch-main_source_window_linux__window.cpp new file mode 100644 index 000000000000..aa1ef665b55d --- /dev/null +++ b/editors/imhex/files/patch-main_source_window_linux__window.cpp @@ -0,0 +1,38 @@ +--- main/source/window/linux_window.cpp.orig 2023-07-08 16:57:04 UTC ++++ main/source/window/linux_window.cpp +@@ -19,8 +19,26 @@ + #include + #include + #include ++ #include ++ #include + + namespace hex { ++ // Brought from lib/external/pattern_language/external/cli11/include/CLI/impl/StringTools_inl.hpp ++ std::vector split(const std::string &s, char delim) { ++ std::vector elems; ++ // Check to see if empty string, give consistent result ++ if(s.empty()) { ++ elems.emplace_back(); ++ } else { ++ std::stringstream ss; ++ ss.str(s); ++ std::string item; ++ while(std::getline(ss, item, delim)) { ++ elems.push_back(item); ++ } ++ } ++ return elems; ++ } + + bool isFileInPath(const std::fs::path &filename) { + auto optPathVar = hex::getEnvironmentVariable("PATH"); +@@ -29,7 +47,7 @@ namespace hex { + return false; + } + +- for (auto dir : std::views::split(optPathVar.value(), ':')) { ++ for (auto dir : split(optPathVar.value(), ':')) { + if (std::fs::exists(std::fs::path(std::string_view(dir)) / filename)) { + return true; + } diff --git a/editors/imhex/files/patch-main_source_window_window.cpp b/editors/imhex/files/patch-main_source_window_window.cpp index 986dbccce8f7..14b266d3d7e1 100644 --- a/editors/imhex/files/patch-main_source_window_window.cpp +++ b/editors/imhex/files/patch-main_source_window_window.cpp @@ -1,11 +1,11 @@ ---- main/source/window/window.cpp.orig 2023-04-09 06:24:47 UTC +--- main/source/window/window.cpp.orig 2023-06-24 10:07:39 UTC +++ main/source/window/window.cpp -@@ -272,7 +272,7 @@ namespace hex { +@@ -220,7 +220,7 @@ namespace hex { } } - static void createNestedMenu(std::span menuItems, const Shortcut &shortcut, const std::function &callback, const std::function &enabledCallback) { + static void createNestedMenu(const std::vector &menuItems, const Shortcut &shortcut, const std::function &callback, const std::function &enabledCallback) { const auto &name = menuItems.front(); if (name == ContentRegistry::Interface::impl::SeparatorValue) { diff --git a/editors/imhex/files/patch-plugins_builtin_include_content_views_view__pattern__editor.hpp b/editors/imhex/files/patch-plugins_builtin_include_content_views_view__pattern__editor.hpp index ccb254965155..2a25fa1ec85a 100644 --- a/editors/imhex/files/patch-plugins_builtin_include_content_views_view__pattern__editor.hpp +++ b/editors/imhex/files/patch-plugins_builtin_include_content_views_view__pattern__editor.hpp @@ -1,19 +1,19 @@ ---- plugins/builtin/include/content/views/view_pattern_editor.hpp.orig 2023-04-04 10:04:22 UTC +--- plugins/builtin/include/content/views/view_pattern_editor.hpp.orig 2023-06-24 14:40:57 UTC +++ plugins/builtin/include/content/views/view_pattern_editor.hpp -@@ -16,6 +16,7 @@ +@@ -19,6 +19,7 @@ #include #include #include +#include #include -@@ -65,7 +66,7 @@ namespace hex::plugin::builtin { +@@ -151,7 +152,7 @@ namespace hex::plugin::builtin { bool m_syncPatternSourceCode = false; bool m_autoLoadPatterns = true; - std::map> m_sectionWindowDrawer; + std::map> m_sectionWindowDrawer; ui::HexEditor m_sectionHexEditor; diff --git a/editors/imhex/files/patch-plugins_builtin_source_content_pl__visualizers.cpp b/editors/imhex/files/patch-plugins_builtin_source_content_pl__visualizers.cpp index 5639a0159ade..cd27742eb021 100644 --- a/editors/imhex/files/patch-plugins_builtin_source_content_pl__visualizers.cpp +++ b/editors/imhex/files/patch-plugins_builtin_source_content_pl__visualizers.cpp @@ -1,31 +1,31 @@ ---- plugins/builtin/source/content/pl_visualizers.cpp.orig 2023-04-08 16:59:02 UTC +--- plugins/builtin/source/content/pl_visualizers.cpp.orig 2023-06-24 10:07:39 UTC +++ plugins/builtin/source/content/pl_visualizers.cpp -@@ -303,11 +303,11 @@ namespace hex::plugin::builtin { +@@ -307,11 +307,11 @@ namespace hex::plugin::builtin { ImGui::TableNextColumn(); ImGui::TextUnformatted("hex.builtin.pl_visualizer.3d.rotation"_lang); - ImGui::VSliderFloat("##X", ImVec2(18_scaled, textureSize.y), &rotation.data()[0], 0, std::numbers::pi * 2, "", ImGuiSliderFlags_AlwaysClamp); + ImGui::VSliderFloat("##X", ImVec2(18_scaled, textureSize.y), &rotation.data()[0], 0, 3.141592653589793238462643383279502884L * 2, "", ImGuiSliderFlags_AlwaysClamp); ImGui::SameLine(); - ImGui::VSliderFloat("##Y", ImVec2(18_scaled, textureSize.y), &rotation.data()[1], 0, std::numbers::pi * 2, "", ImGuiSliderFlags_AlwaysClamp); + ImGui::VSliderFloat("##Y", ImVec2(18_scaled, textureSize.y), &rotation.data()[1], 0, 3.141592653589793238462643383279502884L * 2, "", ImGuiSliderFlags_AlwaysClamp); ImGui::SameLine(); - ImGui::VSliderFloat("##Z", ImVec2(18_scaled, textureSize.y), &rotation.data()[2], 0, std::numbers::pi * 2, "", ImGuiSliderFlags_AlwaysClamp); + ImGui::VSliderFloat("##Z", ImVec2(18_scaled, textureSize.y), &rotation.data()[2], 0, 3.141592653589793238462643383279502884L * 2, "", ImGuiSliderFlags_AlwaysClamp); ImGui::TableNextRow(); ImGui::TableNextColumn(); -@@ -319,10 +319,10 @@ namespace hex::plugin::builtin { +@@ -323,10 +323,10 @@ namespace hex::plugin::builtin { ImGui::PopItemWidth(); for (u8 i = 0; i < 3; i++) { - while (rotation.data()[i] > std::numbers::pi * 2) - rotation.data()[i] -= std::numbers::pi * 2; + while (rotation.data()[i] > 3.141592653589793238462643383279502884L * 2) + rotation.data()[i] -= 3.141592653589793238462643383279502884L * 2; while (rotation.data()[i] < 0) - rotation.data()[i] += std::numbers::pi * 2; + rotation.data()[i] += 3.141592653589793238462643383279502884L * 2; } ImGui::TableNextColumn(); diff --git a/editors/imhex/files/patch-plugins_builtin_source_content_tools__entries.cpp b/editors/imhex/files/patch-plugins_builtin_source_content_tools__entries.cpp new file mode 100644 index 000000000000..4392233ab87e --- /dev/null +++ b/editors/imhex/files/patch-plugins_builtin_source_content_tools__entries.cpp @@ -0,0 +1,25 @@ +--- plugins/builtin/source/content/tools_entries.cpp.orig 2023-05-21 08:44:41 UTC ++++ plugins/builtin/source/content/tools_entries.cpp +@@ -1501,9 +1501,6 @@ namespace hex::plugin::builtin { + enum class InputType { infinity, notANumber, quietNotANumber, signalingNotANumber, regular, invalid }; + std::string specialNumbers[] = {"inf", "Inf", "INF", "nan", "Nan", "NAN", "qnan", "Qnan", "QNAN", "snan", "Snan", "SNAN"}; + +- // We allow any input in order to accept infinities and NaNs, all invalid entries +- // are detected by from_chars. You can also enter -0 or -inf. +- std::from_chars_result res; + if (ImGui::InputText("##resultFloat", decimalFloatingPointNumberString, flags)) { + // Always obtain sign first. + if (decimalFloatingPointNumberString[0] == '-') { +@@ -1531,11 +1528,7 @@ namespace hex::plugin::builtin { + + if (inputType == InputType::regular) { + decimalStrView = decimalFloatingPointNumberString; +- res = std::from_chars(decimalStrView.data(), decimalStrView.data() + decimalStrView.size(), resultFloat); +- // this is why we use from_chars +- if (res.ec != std::errc()) { +- inputType = InputType::invalid; +- } ++ resultFloat = std::strtold(decimalStrView.data(), nullptr); + } else if (inputType == InputType::infinity) { + resultFloat = std::numeric_limits::infinity(); + resultFloat *= (signBits == 1 ? -1 : 1); diff --git a/editors/imhex/files/patch-plugins_builtin_source_content_views_view__find.cpp b/editors/imhex/files/patch-plugins_builtin_source_content_views_view__find.cpp index 94b040b8b8f5..ece991fcbe70 100644 --- a/editors/imhex/files/patch-plugins_builtin_source_content_views_view__find.cpp +++ b/editors/imhex/files/patch-plugins_builtin_source_content_views_view__find.cpp @@ -1,20 +1,20 @@ ---- plugins/builtin/source/content/views/view_find.cpp.orig 2023-04-04 10:04:22 UTC +--- plugins/builtin/source/content/views/view_find.cpp.orig 2023-06-24 10:07:39 UTC +++ plugins/builtin/source/content/views/view_find.cpp -@@ -314,7 +314,7 @@ namespace hex::plugin::builtin { +@@ -265,7 +265,7 @@ namespace hex::plugin::builtin { while (true) { task.update(progress); - occurrence = std::search(reader.begin(), reader.end(), std::boyer_moore_horspool_searcher(bytes.begin(), bytes.end())); + occurrence = std::search(reader.begin(), reader.end(), bytes.begin(), bytes.end()); if (occurrence == reader.end()) break; -@@ -423,7 +423,7 @@ namespace hex::plugin::builtin { +@@ -391,7 +391,7 @@ namespace hex::plugin::builtin { + for (u64 address = searchRegion.getStartAddress(); address < searchRegion.getEndAddress(); address += advance) { + task.update(address); - task.update(address); +- auto result = std::visit([&](auto tag) { ++ auto result = std::visit([&, min=min, max=max](auto tag) { + using T = std::remove_cvref_t>; -- auto result = std::visit([&](auto tag) { -+ auto result = std::visit([&, min=min, max=max](auto tag) { - using T = std::remove_cvref_t>; - - auto minValue = std::get(min); + auto minValue = std::get(min); diff --git a/editors/imhex/files/patch-plugins_builtin_source_content_views_view__hex__editor.cpp b/editors/imhex/files/patch-plugins_builtin_source_content_views_view__hex__editor.cpp index ec2e8357c7dc..4dc2628bfc41 100644 --- a/editors/imhex/files/patch-plugins_builtin_source_content_views_view__hex__editor.cpp +++ b/editors/imhex/files/patch-plugins_builtin_source_content_views_view__hex__editor.cpp @@ -1,11 +1,11 @@ ---- plugins/builtin/source/content/views/view_hex_editor.cpp.orig 2023-04-04 10:04:22 UTC +--- plugins/builtin/source/content/views/view_hex_editor.cpp.orig 2023-06-24 10:07:39 UTC +++ plugins/builtin/source/content/views/view_hex_editor.cpp -@@ -298,7 +298,7 @@ namespace hex::plugin::builtin { +@@ -300,7 +300,7 @@ namespace hex::plugin::builtin { reader.seek(this->m_searchPosition.value_or(provider->getBaseAddress())); constexpr static auto searchFunction = [](const auto &haystackBegin, const auto &haystackEnd, const auto &needleBegin, const auto &needleEnd) { - return std::search(haystackBegin, haystackEnd, std::boyer_moore_horspool_searcher(needleBegin, needleEnd)); + return std::search(haystackBegin, haystackEnd, needleBegin, needleEnd); }; if (!backwards) { diff --git a/editors/imhex/files/patch-plugins_builtin_source_content_views_view__pattern__editor.cpp b/editors/imhex/files/patch-plugins_builtin_source_content_views_view__pattern__editor.cpp index e6d2be7ebd87..76a87920b3d8 100644 --- a/editors/imhex/files/patch-plugins_builtin_source_content_views_view__pattern__editor.cpp +++ b/editors/imhex/files/patch-plugins_builtin_source_content_views_view__pattern__editor.cpp @@ -1,32 +1,32 @@ ---- plugins/builtin/source/content/views/view_pattern_editor.cpp.orig 2023-04-04 10:04:22 UTC +--- plugins/builtin/source/content/views/view_pattern_editor.cpp.orig 2023-06-24 10:07:39 UTC +++ plugins/builtin/source/content/views/view_pattern_editor.cpp -@@ -440,9 +440,9 @@ namespace hex::plugin::builtin { - dataProvider->writeRaw(0x00, section.data.data(), section.data.size()); - dataProvider->setReadOnly(true); +@@ -494,9 +494,9 @@ namespace hex::plugin::builtin { + dataProvider->writeRaw(0x00, section.data.data(), section.data.size()); + dataProvider->setReadOnly(true); -- auto hexEditor = auto(this->m_sectionHexEditor); -+ auto hexEditor = this->m_sectionHexEditor; +- auto hexEditor = auto(this->m_sectionHexEditor); ++ auto hexEditor = this->m_sectionHexEditor; -- hexEditor.setBackgroundHighlightCallback([this, id](u64 address, const u8 *, size_t) -> std::optional { -+ hexEditor.setBackgroundHighlightCallback([this, id=id](u64 address, const u8 *, size_t) -> std::optional { - if (this->m_runningEvaluators != 0) - return std::nullopt; - if (!ImHexApi::Provider::isValid()) -@@ -465,7 +465,7 @@ namespace hex::plugin::builtin { - auto patternProvider = ImHexApi::Provider::get(); +- hexEditor.setBackgroundHighlightCallback([this, id, &runtime](u64 address, const u8 *, size_t) -> std::optional { ++ hexEditor.setBackgroundHighlightCallback([this, id=id, &runtime](u64 address, const u8 *, size_t) -> std::optional { + if (this->m_runningEvaluators != 0) + return std::nullopt; + if (!ImHexApi::Provider::isValid()) +@@ -519,7 +519,7 @@ namespace hex::plugin::builtin { + auto patternProvider = ImHexApi::Provider::get(); -- this->m_sectionWindowDrawer[patternProvider] = [id, patternProvider, dataProvider = std::move(dataProvider), hexEditor = std::move(hexEditor), patternDrawer = ui::PatternDrawer()] mutable { -+ this->m_sectionWindowDrawer[patternProvider] = [id=id, patternProvider, dataProvider = std::move(dataProvider), hexEditor = std::move(hexEditor), patternDrawer = ui::PatternDrawer()] mutable { - hexEditor.setProvider(dataProvider.get()); - hexEditor.draw(480_scaled); - patternDrawer.setSelectionCallback([&](const auto ®ion) { -@@ -952,7 +952,7 @@ namespace hex::plugin::builtin { +- this->m_sectionWindowDrawer[patternProvider] = [this, id, patternProvider, dataProvider = std::move(dataProvider), hexEditor, patternDrawer = ui::PatternDrawer(), &runtime] mutable { ++ this->m_sectionWindowDrawer[patternProvider] = [this, id=id, patternProvider, dataProvider = std::move(dataProvider), hexEditor, patternDrawer = ui::PatternDrawer(), &runtime] mutable { + hexEditor.setProvider(dataProvider.get()); + hexEditor.draw(480_scaled); + patternDrawer.setSelectionCallback([&](const auto ®ion) { +@@ -1138,7 +1138,7 @@ namespace hex::plugin::builtin { if (type->isTemplateType()) continue; -- createNestedMenu(hex::splitString(typeName, "::"), [&] { -+ createNestedMenu(hex::splitString(typeName, "::"), [&, typeName=typeName] { +- createNestedMenu(hex::splitString(typeName, "::"), [&, this] { ++ createNestedMenu(hex::splitString(typeName, "::"), [&, this, typeName=typeName] { std::string variableName; for (char &c : hex::replaceStrings(typeName, "::", "_")) variableName += static_cast(std::tolower(c)); diff --git a/editors/imhex/files/patch-plugins_builtin_source_ui_pattern__drawer.cpp b/editors/imhex/files/patch-plugins_builtin_source_ui_pattern__drawer.cpp index 3ac0ae00d22f..9f53cdcce3dd 100644 --- a/editors/imhex/files/patch-plugins_builtin_source_ui_pattern__drawer.cpp +++ b/editors/imhex/files/patch-plugins_builtin_source_ui_pattern__drawer.cpp @@ -1,12 +1,12 @@ ---- plugins/builtin/source/ui/pattern_drawer.cpp.orig 2023-04-04 10:04:22 UTC +--- plugins/builtin/source/ui/pattern_drawer.cpp.orig 2023-06-24 14:40:57 UTC +++ plugins/builtin/source/ui/pattern_drawer.cpp -@@ -155,7 +155,8 @@ namespace hex::plugin::builtin::ui { +@@ -234,7 +234,8 @@ namespace hex::plugin::builtin::ui { ImGui::TextUnformatted("hex.builtin.pattern_drawer.visualizer.invalid_parameter_count"_lang); } else { try { -- visualizer.callback(pattern, iteratable, reset, { arguments.begin() + 1, arguments.end() }); +- visualizer.callback(pattern, iterable, reset, { arguments.begin() + 1, arguments.end() }); + const std::vector args = { arguments.begin() + 1, arguments.end() }; -+ visualizer.callback(pattern, iteratable, reset, args); ++ visualizer.callback(pattern, iterable, reset, args); } catch (std::exception &e) { this->m_lastVisualizerError = e.what(); } diff --git a/editors/imhex/pkg-plist b/editors/imhex/pkg-plist index 5172463a5756..02c7d66cd8e9 100644 --- a/editors/imhex/pkg-plist +++ b/editors/imhex/pkg-plist @@ -1,161 +1,169 @@ bin/imhex -lib/libimhex.so.1.28.0 +lib/libimhex.so.1.30.1 share/applications/imhex.desktop -%%DATADIR%%/constants/_schema.json %%DATADIR%%/constants/crc16.json %%DATADIR%%/constants/crc32.json %%DATADIR%%/constants/http_status.json %%DATADIR%%/constants/linux_errors.json %%DATADIR%%/encodings/arabic_iso.tbl %%DATADIR%%/encodings/arabic_windows.tbl %%DATADIR%%/encodings/ascii_ansi.tbl %%DATADIR%%/encodings/ascii_oem.tbl %%DATADIR%%/encodings/ascii.tbl %%DATADIR%%/encodings/baltic_iso.tbl %%DATADIR%%/encodings/baltic_windows.tbl %%DATADIR%%/encodings/cyrillic_cp866.tbl %%DATADIR%%/encodings/cyrillic_iso.tbl %%DATADIR%%/encodings/cyrillic_koi8_r.tbl %%DATADIR%%/encodings/cyrillic_koi8_u.tbl %%DATADIR%%/encodings/cyrillic_windows.tbl %%DATADIR%%/encodings/eastern_europe_iso.tbl %%DATADIR%%/encodings/eastern_europe_windows.tbl %%DATADIR%%/encodings/ebcdic.tbl %%DATADIR%%/encodings/euc_jp.tbl %%DATADIR%%/encodings/euc_kr.tbl %%DATADIR%%/encodings/greek_iso.tbl %%DATADIR%%/encodings/greek_windows.tbl %%DATADIR%%/encodings/hebrew_iso.tbl %%DATADIR%%/encodings/hebrew_windows.tbl %%DATADIR%%/encodings/iso_646.tbl %%DATADIR%%/encodings/iso_6937.tbl %%DATADIR%%/encodings/jis_x_0201.tbl %%DATADIR%%/encodings/jis_x_0211.tbl %%DATADIR%%/encodings/jis_x_0213.tbl %%DATADIR%%/encodings/macintosh.tbl %%DATADIR%%/encodings/ms932.tbl %%DATADIR%%/encodings/pokegen1_en.tbl %%DATADIR%%/encodings/pokegen3_en.tbl %%DATADIR%%/encodings/shiftjis.tbl %%DATADIR%%/encodings/thai.tbl %%DATADIR%%/encodings/turkish_iso.tbl %%DATADIR%%/encodings/turkish_windows.tbl %%DATADIR%%/encodings/utf8.tbl %%DATADIR%%/encodings/vietnamese.tbl %%DATADIR%%/includes/hex/core.pat %%DATADIR%%/includes/hex/dec.pat %%DATADIR%%/includes/hex/http.pat %%DATADIR%%/includes/hex/provider.pat %%DATADIR%%/includes/hex/impl/imhex_check.pat %%DATADIR%%/includes/hex/type/mangled.pat %%DATADIR%%/includes/std/array.pat %%DATADIR%%/includes/std/bit.pat %%DATADIR%%/includes/std/core.pat %%DATADIR%%/includes/std/ctype.pat %%DATADIR%%/includes/std/file.pat %%DATADIR%%/includes/std/fxpt.pat %%DATADIR%%/includes/std/hash.pat %%DATADIR%%/includes/std/io.pat %%DATADIR%%/includes/std/limits.pat %%DATADIR%%/includes/std/math.pat %%DATADIR%%/includes/std/mem.pat %%DATADIR%%/includes/std/ptr.pat %%DATADIR%%/includes/std/random.pat %%DATADIR%%/includes/std/string.pat %%DATADIR%%/includes/std/sys.pat %%DATADIR%%/includes/std/time.pat %%DATADIR%%/includes/type/base.pat +%%DATADIR%%/includes/type/base64.pat %%DATADIR%%/includes/type/bcd.pat %%DATADIR%%/includes/type/byte.pat %%DATADIR%%/includes/type/color.pat %%DATADIR%%/includes/type/float16.pat %%DATADIR%%/includes/type/guid.pat %%DATADIR%%/includes/type/ip.pat %%DATADIR%%/includes/type/leb128.pat %%DATADIR%%/includes/type/mac.pat %%DATADIR%%/includes/type/magic.pat %%DATADIR%%/includes/type/path.pat %%DATADIR%%/includes/type/size.pat %%DATADIR%%/includes/type/time.pat %%DATADIR%%/includes/type/types/010.pat %%DATADIR%%/includes/type/types/c.pat %%DATADIR%%/includes/type/types/linux.pat %%DATADIR%%/includes/type/types/rust.pat %%DATADIR%%/includes/type/types/win32.pat %%DATADIR%%/magic/nintendo_switch_magic %%DATADIR%%/magic/portable_executable_magic +%%DATADIR%%/patterns/7z.hexpat +%%DATADIR%%/patterns/Crashlvl.hexpat %%DATADIR%%/patterns/afe2.hexpat %%DATADIR%%/patterns/ar.hexpat %%DATADIR%%/patterns/arm_cm_vtor.hexpat %%DATADIR%%/patterns/bencode.hexpat %%DATADIR%%/patterns/bmp.hexpat %%DATADIR%%/patterns/bson.hexpat %%DATADIR%%/patterns/bsp_goldsrc.hexpat %%DATADIR%%/patterns/cchva.hexpat %%DATADIR%%/patterns/ccpal.hexpat %%DATADIR%%/patterns/ccvxl.hexpat +%%DATADIR%%/patterns/cda.hexpat %%DATADIR%%/patterns/chm.hexpat %%DATADIR%%/patterns/coff.hexpat %%DATADIR%%/patterns/cpio.pat %%DATADIR%%/patterns/dds.hexpat %%DATADIR%%/patterns/dex.hexpat %%DATADIR%%/patterns/dmg.hexpat %%DATADIR%%/patterns/dsstore.hexpat %%DATADIR%%/patterns/elf.hexpat %%DATADIR%%/patterns/evtx.hexpat %%DATADIR%%/patterns/fdt.pat %%DATADIR%%/patterns/flac.hexpat %%DATADIR%%/patterns/fs.hexpat +%%DATADIR%%/patterns/gb.hexpat %%DATADIR%%/patterns/gif.hexpat %%DATADIR%%/patterns/gzip.hexpat %%DATADIR%%/patterns/ico.hexpat %%DATADIR%%/patterns/id3.hexpat %%DATADIR%%/patterns/intel_hex.hexpat %%DATADIR%%/patterns/ip.hexpat %%DATADIR%%/patterns/iso.hexpat %%DATADIR%%/patterns/java_class.hexpat %%DATADIR%%/patterns/jpeg.hexpat %%DATADIR%%/patterns/lnk.hexpat %%DATADIR%%/patterns/lua54.hexpat %%DATADIR%%/patterns/macho.hexpat +%%DATADIR%%/patterns/max_v104.hexpat %%DATADIR%%/patterns/midi.hexpat %%DATADIR%%/patterns/minidump.hexpat +%%DATADIR%%/patterns/mp4.hexpat %%DATADIR%%/patterns/msgpack.hexpat %%DATADIR%%/patterns/nacp.hexpat %%DATADIR%%/patterns/nbt.hexpat %%DATADIR%%/patterns/ne.hexpat %%DATADIR%%/patterns/nro.hexpat %%DATADIR%%/patterns/ntag.hexpat %%DATADIR%%/patterns/ogg.hexpat %%DATADIR%%/patterns/pbz.hexpat %%DATADIR%%/patterns/pcap.hexpat %%DATADIR%%/patterns/pcx.hexpat %%DATADIR%%/patterns/pe.hexpat %%DATADIR%%/patterns/pfs0.hexpat %%DATADIR%%/patterns/pif.hexpat %%DATADIR%%/patterns/png.hexpat %%DATADIR%%/patterns/prodinfo.hexpat %%DATADIR%%/patterns/protobuf.hexpat %%DATADIR%%/patterns/qbcl.hexpat %%DATADIR%%/patterns/qoi.hexpat %%DATADIR%%/patterns/sit5.hexpat %%DATADIR%%/patterns/spirv.hexpat %%DATADIR%%/patterns/stl.hexpat %%DATADIR%%/patterns/tar.hexpat %%DATADIR%%/patterns/tga.hexpat +%%DATADIR%%/patterns/tiff.hexpat %%DATADIR%%/patterns/uefi.hexpat %%DATADIR%%/patterns/uf2.hexpat %%DATADIR%%/patterns/usb.hexpat %%DATADIR%%/patterns/vdf.hexpat %%DATADIR%%/patterns/vhdx.hexpat %%DATADIR%%/patterns/wad.hexpat %%DATADIR%%/patterns/wav.hexpat %%DATADIR%%/patterns/xbeh.hexpat %%DATADIR%%/patterns/xci.hexpat %%DATADIR%%/patterns/xilinx_bit.hexpat %%DATADIR%%/patterns/zip.hexpat +%%DATADIR%%/patterns/zlib.hexpat %%DATADIR%%/patterns/zstd.hexpat %%DATADIR%%/plugins/builtin.hexplug share/metainfo/net.werwolv.imhex.appdata.xml share/metainfo/net.werwolv.imhex.metainfo.xml share/pixmaps/imhex.png