impr: Replace hex::unused with std::ignore

This commit is contained in:
WerWolv
2024-12-14 21:35:54 +01:00
parent 3f316e42f2
commit 7f75706584
43 changed files with 173 additions and 139 deletions

View File

@@ -60,7 +60,7 @@ namespace hex::plugin::builtin {
// Draw hex editor background highlights for bookmarks
ImHexApi::HexEditor::addBackgroundHighlightingProvider([this](u64 address, const u8* data, size_t size, bool) -> std::optional<color_t> {
hex::unused(data);
std::ignore = data;
// Check all bookmarks for potential overlaps with the current address
for (const auto &bookmark : *m_bookmarks) {
@@ -73,7 +73,7 @@ namespace hex::plugin::builtin {
// Draw hex editor tooltips for bookmarks
ImHexApi::HexEditor::addTooltipProvider([this](u64 address, const u8 *data, size_t size) {
hex::unused(data);
std::ignore = data;
// Loop over all bookmarks
for (const auto &[bookmark, editor] : *m_bookmarks) {

View File

@@ -21,7 +21,8 @@ namespace hex::plugin::builtin {
const static auto HighlightColor = [] { return (ImGuiExt::GetCustomColorU32(ImGuiCustomCol_FindHighlight) & 0x00FFFFFF) | 0x70000000; };
ImHexApi::HexEditor::addBackgroundHighlightingProvider([this](u64 address, const u8* data, size_t size, bool) -> std::optional<color_t> {
hex::unused(data, size);
std::ignore = data;
std::ignore = size;
if (m_searchTask.isRunning())
return { };
@@ -33,7 +34,8 @@ namespace hex::plugin::builtin {
});
ImHexApi::HexEditor::addTooltipProvider([this](u64 address, const u8* data, size_t size) {
hex::unused(data, size);
std::ignore = data;
std::ignore = size;
if (m_searchTask.isRunning())
return;

View File

@@ -44,7 +44,7 @@ namespace hex::plugin::builtin {
});
ImHexApi::HexEditor::addForegroundHighlightingProvider([this](u64 offset, const u8* buffer, size_t, bool) -> std::optional<color_t> {
hex::unused(buffer);
std::ignore = buffer;
if (!ImHexApi::Provider::isValid())
return std::nullopt;

View File

@@ -1535,7 +1535,7 @@ namespace hex::plugin::builtin {
auto mimeType = magic::getMIMEType(provider, 0, 100_KiB, true);
runtime.addPragma("MIME", [&mimeType, &foundCorrectType](const pl::PatternLanguage &runtime, const std::string &value) {
hex::unused(runtime);
std::ignore = runtime;
if (!magic::isValidMIMEType(value))
return false;
@@ -2191,7 +2191,8 @@ namespace hex::plugin::builtin {
});
ImHexApi::HexEditor::addBackgroundHighlightingProvider([this](u64 address, const u8 *data, size_t size, bool) -> std::optional<color_t> {
hex::unused(data, size);
std::ignore = data;
std::ignore = size;
if (m_runningEvaluators != 0)
return std::nullopt;
@@ -2232,7 +2233,8 @@ namespace hex::plugin::builtin {
});
ImHexApi::HexEditor::addTooltipProvider([this](u64 address, const u8 *data, size_t size) {
hex::unused(data, size);
std::ignore = data;
std::ignore = size;
if (TRY_LOCK(ContentRegistry::PatternLanguage::getRuntimeLock())) {
const auto &runtime = ContentRegistry::PatternLanguage::getRuntime();