impr: Remove hex::format, improve format and logging type safety

This commit is contained in:
WerWolv
2025-08-06 20:01:58 +02:00
parent d429424f67
commit 9cff9043ee
109 changed files with 473 additions and 455 deletions

View File

@@ -22,11 +22,11 @@ namespace hex::plugin::windows {
// Add 'Icon' key to use first icon embedded in exe
std::array<char, MAX_PATH> imHexPath = { 0 };
GetModuleFileNameA(nullptr, imHexPath.data(), imHexPath.size());
auto iconValue = hex::format(R"("{}",0)", imHexPath.data());
auto iconValue = fmt::format(R"("{}",0)", imHexPath.data());
RegSetKeyValueA(imHexRootKey, nullptr, "Icon", REG_SZ, iconValue.c_str(), iconValue.size() + 1);
// Add 'command' key to pass the right-clicked file path as first argument to ImHex
auto commandValue = hex::format(R"("{}" "%1")", imHexPath.data());
auto commandValue = fmt::format(R"("{}" "%1")", imHexPath.data());
RegSetValueA(imHexRootKey, "command", REG_SZ, commandValue.c_str(), commandValue.size() + 1);
RegCloseKey(imHexRootKey);
}

View File

@@ -247,7 +247,7 @@ namespace hex::plugin::windows {
} else if (byte == '\r') {
// Ignore carriage return
} else {
m_receiveLines.back() += hex::format("<{:02X}>", static_cast<unsigned char>(byte));
m_receiveLines.back() += fmt::format("<{:02X}>", static_cast<unsigned char>(byte));
}
};