From 626c34dce89da0727899a9418498adddb47aaa52 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 15 Jul 2022 11:37:10 +0200 Subject: [PATCH] sys: Upgrade codebase to C++23 --- CMakeLists.txt | 2 +- plugins/builtin/source/content/data_processor_nodes.cpp | 4 ++-- plugins/builtin/source/content/tools_entries.cpp | 4 ++-- plugins/builtin/source/content/views/view_constants.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cabaa6d4..47ab66faf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ file(READ "VERSION" IMHEX_VERSION) project(imhex VERSION ${IMHEX_VERSION}) message("Project version ${IMHEX_VERSION}") -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) set(IMHEX_BASE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_MODULE_PATH "${IMHEX_BASE_FOLDER}/cmake/modules") include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake") diff --git a/plugins/builtin/source/content/data_processor_nodes.cpp b/plugins/builtin/source/content/data_processor_nodes.cpp index 37f86da08..10037c258 100644 --- a/plugins/builtin/source/content/data_processor_nodes.cpp +++ b/plugins/builtin/source/content/data_processor_nodes.cpp @@ -91,7 +91,7 @@ namespace hex::plugin::builtin { } void load(nlohmann::json &j) override { - this->m_value = j["data"]; + this->m_value = j["data"].get(); } private: @@ -213,7 +213,7 @@ namespace hex::plugin::builtin { } void load(nlohmann::json &j) override { - this->m_comment = j["comment"]; + this->m_comment = j["comment"].get(); } private: diff --git a/plugins/builtin/source/content/tools_entries.cpp b/plugins/builtin/source/content/tools_entries.cpp index a1281c7cb..ff4c3dea4 100644 --- a/plugins/builtin/source/content/tools_entries.cpp +++ b/plugins/builtin/source/content/tools_entries.cpp @@ -712,8 +712,8 @@ namespace hex::plugin::builtin { auto json = nlohmann::json::parse(response.body); - resultTitle = json["query"]["pages"][0]["title"]; - resultExtract = json["query"]["pages"][0]["extract"]; + resultTitle = json["query"]["pages"][0]["title"].get(); + resultExtract = json["query"]["pages"][0]["extract"].get(); if (!extendedSearch && resultExtract.ends_with(':')) { extendedSearch = true; diff --git a/plugins/builtin/source/content/views/view_constants.cpp b/plugins/builtin/source/content/views/view_constants.cpp index 5be2e15f2..4d1ee2b14 100644 --- a/plugins/builtin/source/content/views/view_constants.cpp +++ b/plugins/builtin/source/content/views/view_constants.cpp @@ -34,11 +34,11 @@ namespace hex::plugin::builtin { for (auto value : content["values"]) { Constant constant; - constant.category = content["name"]; - constant.name = value["name"]; + constant.category = content["name"].get(); + constant.name = value["name"].get(); if (value.contains("desc")) - constant.description = value["desc"]; - constant.value = value["value"]; + constant.description = value["desc"].get(); + constant.value = value["value"].get(); auto type = value["type"]; if (type == "int10")