Skip to content

Commit

Permalink
fix: Remaining compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jan 31, 2025
1 parent e6ab2c3 commit 8d1352d
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 50 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/ImHexPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ macro(add_imhex_plugin)

# Add include directories and link libraries
target_include_directories(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_INCLUDES})
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC libimhex)
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE ${FMT_LIBRARIES} imgui_all_includes libwolv ${IMHEX_PLUGIN_LIBRARIES})
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_LIBRARIES})
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE libimhex ${FMT_LIBRARIES} imgui_all_includes libwolv)
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl)
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl-gen)

Expand Down
6 changes: 3 additions & 3 deletions lib/libimhex/include/hex/api/content_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ namespace hex {
namespace impl {

void add(std::unique_ptr<View> &&view);
const std::map<std::string, std::unique_ptr<View>>& getEntries();
const std::map<UnlocalizedString, std::unique_ptr<View>>& getEntries();

}

Expand Down Expand Up @@ -1110,9 +1110,9 @@ namespace hex {

[[nodiscard]] const UnlocalizedString& getUnlocalizedName() const { return m_unlocalizedName; }

protected:
const static int TextInputFlags;
[[nodiscard]] static int DefaultTextInputFlags();

protected:
bool drawDefaultScalarEditingTextBox(u64 address, const char *format, ImGuiDataType dataType, u8 *data, ImGuiInputTextFlags flags) const;
bool drawDefaultTextEditingTextBox(u64 address, std::string &data, ImGuiInputTextFlags flags) const;

Expand Down
28 changes: 14 additions & 14 deletions lib/libimhex/include/hex/helpers/opengl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,43 +189,43 @@ namespace hex::gl {


T &getElement(int row,int col) {
return this->mat[row*Columns+col];
return this->mat[row * Columns+col];
}

Vector<T,Rows> getColumn(int col) {
Vector<T,Rows> result;
for (size_t i = 0; i < Rows; i++)
result[i] = this->mat[i*Columns+col];
result[i] = this->mat[i * Columns + col];
return result;
}

Vector<T,Columns> getRow(int row) {
Vector<T,Columns> result;
for (size_t i = 0; i < Columns; i++)
result[i] = this->mat[row*Columns+i];
result[i] = this->mat[row * Columns+i];
return result;
}

void updateRow(int row, Vector<T,Columns> values) {
for (size_t i = 0; i < Columns; i++)
this->mat[row*Columns+i] = values[i];
this->mat[row * Columns + i] = values[i];
}

void updateColumn(int col, Vector<T,Rows> values) {
for (size_t i = 0; i < Rows; i++)
this->mat[i*Columns+col] = values[i];
this->mat[i * Columns + col] = values[i];
}

void updateElement( int row,int col, T value) {
this->mat[row*Columns + col] = value;
void updateElement(int row, int col, T value) {
this->mat[row * Columns + col] = value;
}

T &operator()( const unsigned&row, const unsigned&col) {
return this->mat[row*Columns + col];
T &operator()(const unsigned &row, const unsigned &col) {
return this->mat[row * Columns + col];
}

const T &operator()(const unsigned& row, const unsigned& col) const {
return this->mat[row*Columns + col];
const T &operator()(const unsigned &row, const unsigned &col) const {
return this->mat[row * Columns + col];
}

Matrix& operator=(const Matrix& A) {
Expand All @@ -243,7 +243,7 @@ namespace hex::gl {

for (size_t i = 0; i < Rows; i++)
for (size_t j = 0; j < Columns; j++)
result(i, j) = this->mat[i*Columns+j] + A(i, j);
result(i, j) = this->mat[i * Columns + j] + A(i, j);
return result;
}

Expand All @@ -252,7 +252,7 @@ namespace hex::gl {

for (size_t i = 0; i < Rows; i++)
for (size_t j = 0; j < Columns; j++)
result(i, j) = this->mat[i*Columns+j] - A(i, j);
result(i, j) = this->mat[i * Columns + j] - A(i, j);
return result;
}

Expand All @@ -269,7 +269,7 @@ namespace hex::gl {
Matrix t(0);
for (size_t i = 0; i < Columns; i++)
for (size_t j = 0; j < Rows; j++)
t.updateElement(i, j, this->mat[j*Rows+i]);
t.updateElement(i, j, this->mat[j * Rows + i]);

return t;
}
Expand Down
5 changes: 4 additions & 1 deletion lib/third_party/imgui/backend/include/opengl_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

#if !defined(WINGDIAPI)
#define WINGDIAPI extern "C"
#define APIENTRY
#endif

#if !defined(APIENTRY)
#define APIENTRY
#endif

#if defined(OS_WEB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace hex::plugin::builtin {

private:
void executeQuery() {
m_requestTask = TaskManager::createBackgroundTask("hex.builtin.task.query_docs"_lang, [this, input = m_inputBuffer](Task &) {
m_requestTask = TaskManager::createBackgroundTask("hex.builtin.task.query_docs", [this, input = m_inputBuffer](Task &) {
m_noAnswer = false;
for (auto space : { "xj7sbzGbHH260vbpZOu1", "WZzDdGjxmgMSIE3xly6o" }) {
m_answer.clear();
Expand Down
4 changes: 2 additions & 2 deletions plugins/builtin/source/content/init_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace hex::plugin::builtin {
ContentRegistry::Settings::write<std::string>("hex.builtin.setting.general", "hex.builtin.setting.general.uuid", uuid);
}

TaskManager::createBackgroundTask("hex.builtin.task.sending_statistics"_lang, [uuid](auto&) {
TaskManager::createBackgroundTask("hex.builtin.task.sending_statistics", [uuid](auto&) {
// To avoid potentially flooding our database with lots of dead users
// from people just visiting the website, don't send telemetry data from
// the web version
Expand Down Expand Up @@ -93,7 +93,7 @@ namespace hex::plugin::builtin {
}

bool checkForUpdates() {
TaskManager::createBackgroundTask("hex.builtin.task.check_updates"_lang, [](auto&) { checkForUpdatesSync(); });
TaskManager::createBackgroundTask("hex.builtin.task.check_updates", [](auto&) { checkForUpdatesSync(); });
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace hex::plugin::builtin {
this->processInputString();

if (!m_searchTask.isRunning() && !m_searchByteSequence.empty()) {
m_searchTask = TaskManager::createTask("hex.ui.common.processing"_lang,
m_searchTask = TaskManager::createTask("hex.ui.common.processing",
ImHexApi::Provider::get()->getActualSize(),
doSearch);
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/builtin/source/content/providers/file_provider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ namespace hex::plugin::builtin {
}

m_changeEventAcknowledgementPending = true;
ui::BannerButton::open(ICON_VS_INFO, "hex.builtin.provider.file.reload_changes"_lang, ImColor(66, 104, 135), "hex.builtin.provider.file.reload_changes.reload", [this] {
ui::BannerButton::open(ICON_VS_INFO, "hex.builtin.provider.file.reload_changes", ImColor(66, 104, 135), "hex.builtin.provider.file.reload_changes.reload", [this] {
this->close();
(void)this->open(!m_loadedIntoMemory);

Expand Down
2 changes: 1 addition & 1 deletion plugins/builtin/source/content/recent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ namespace hex::plugin::builtin::recent {
}

void updateRecentEntries() {
TaskManager::createBackgroundTask("hex.builtin.task.updating_recents"_lang, [](auto&) {
TaskManager::createBackgroundTask("hex.builtin.task.updating_recents", [](auto&) {
if (s_recentEntriesUpdating)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace hex::plugin::builtin {
ImGuiExt::TextSpinner("hex.builtin.tools.file_tools.combiner.combining"_lang);
} else {
if (ImGui::Button("hex.builtin.tools.file_tools.combiner.combine"_lang)) {
combinerTask = TaskManager::createTask("hex.builtin.tools.file_tools.combiner.combining"_lang, 0, [](auto &task) {
combinerTask = TaskManager::createTask("hex.builtin.tools.file_tools.combiner.combining", 0, [](auto &task) {
wolv::io::File output(outputPath, wolv::io::File::Mode::Create);

if (!output.isValid()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace hex::plugin::builtin {
ImGui::BeginDisabled(selectedFile.empty());
{
if (ImGui::Button("hex.builtin.tools.file_tools.shredder.shred"_lang)) {
shredderTask = TaskManager::createTask("hex.builtin.tools.file_tools.shredder.shredding"_lang, 0, [](auto &task) {
shredderTask = TaskManager::createTask("hex.builtin.tools.file_tools.shredder.shredding", 0, [](auto &task) {
ON_SCOPE_EXIT {
selectedFile.clear();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace hex::plugin::builtin {
ImGuiExt::TextSpinner("hex.builtin.tools.file_tools.splitter.picker.splitting"_lang);
} else {
if (ImGui::Button("hex.builtin.tools.file_tools.splitter.picker.split"_lang)) {
splitterTask = TaskManager::createTask("hex.builtin.tools.file_tools.splitter.picker.splitting"_lang, 0, [](auto &task) {
splitterTask = TaskManager::createTask("hex.builtin.tools.file_tools.splitter.picker.splitting", 0, [](auto &task) {
ON_SCOPE_EXIT {
selectedFile.clear();
baseOutputPath.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace hex::plugin::builtin {
}

void ViewDataInspector::updateInspectorRows() {
m_updateTask = TaskManager::createBackgroundTask("hex.builtin.task.updating_inspector"_lang, [this](auto &) {
m_updateTask = TaskManager::createBackgroundTask("hex.builtin.task.updating_inspector", [this](auto &) {
this->updateInspectorRowsTask();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ namespace hex::plugin::builtin {
// Reset any potential node errors
workspace.currNodeError.reset();

m_evaluationTask = TaskManager::createTask("hex.builtin.task.evaluating_nodes"_lang, 0, [this, workspace = &workspace](Task& task) {
m_evaluationTask = TaskManager::createTask("hex.builtin.task.evaluating_nodes", 0, [this, workspace = &workspace](Task& task) {
task.setInterruptCallback([]{
dp::Node::interrupt();
});
Expand Down
4 changes: 2 additions & 2 deletions plugins/builtin/source/content/views/view_find.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ namespace hex::plugin::builtin {
m_occurrenceTree->clear();
EventHighlightingChanged::post();

m_searchTask = TaskManager::createTask("hex.builtin.view.find.searching"_lang, searchRegion.getSize(), [this, settings = m_searchSettings, searchRegion](auto &task) {
m_searchTask = TaskManager::createTask("hex.builtin.view.find.searching", searchRegion.getSize(), [this, settings = m_searchSettings, searchRegion](auto &task) {
auto provider = ImHexApi::Provider::get();

switch (settings.mode) {
Expand Down Expand Up @@ -974,7 +974,7 @@ namespace hex::plugin::builtin {
m_filterTask.interrupt();

if (!m_currFilter->empty()) {
m_filterTask = TaskManager::createTask("hex.builtin.task.filtering_data"_lang, currOccurrences.size(), [this, provider, &currOccurrences](Task &task) {
m_filterTask = TaskManager::createTask("hex.builtin.task.filtering_data", currOccurrences.size(), [this, provider, &currOccurrences](Task &task) {
u64 progress = 0;
std::erase_if(currOccurrences, [this, provider, &task, &progress](const auto &region) {
task.update(progress);
Expand Down
6 changes: 3 additions & 3 deletions plugins/builtin/source/content/views/view_hex_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ namespace hex::plugin::builtin {
}

[[nodiscard]] UnlocalizedString getTitle() const override {
return "hex.builtin.view.hex_editor.menu.edit.paste.popup.title"_lang;
return "hex.builtin.view.hex_editor.menu.edit.paste.popup.title";
}

private:
Expand Down Expand Up @@ -737,7 +737,7 @@ namespace hex::plugin::builtin {
return;

fs::openFileBrowser(fs::DialogMode::Save, {}, [provider](const auto &path) {
PopupBlockingTask::open(TaskManager::createTask("hex.builtin.task.saving_data"_lang, TaskManager::NoProgress, [=](Task &){
PopupBlockingTask::open(TaskManager::createTask("hex.builtin.task.saving_data", TaskManager::NoProgress, [=](Task &){
provider->saveAs(path);
}));
});
Expand Down Expand Up @@ -1196,7 +1196,7 @@ namespace hex::plugin::builtin {

ui::PopupFileChooser::open(basePaths, paths, std::vector<hex::fs::ItemFilter>{ {"Thingy Table File", "tbl"} }, false,
[this](const auto &path) {
TaskManager::createTask("hex.builtin.task.loading_encoding_file"_lang, 0, [this, path](auto&) {
TaskManager::createTask("hex.builtin.task.loading_encoding_file", 0, [this, path](auto&) {
auto encoding = EncodingFile(EncodingFile::Type::Thingy, path);
ImHexApi::Provider::markDirty();

Expand Down
2 changes: 1 addition & 1 deletion plugins/builtin/source/content/views/view_information.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace hex::plugin::builtin {
}

// Run analyzers for each section
analysis.task = TaskManager::createTask("hex.builtin.view.information.analyzing"_lang, analysis.informationSections.size(), [provider, &analysis](Task &task) {
analysis.task = TaskManager::createTask("hex.builtin.view.information.analyzing", analysis.informationSections.size(), [provider, &analysis](Task &task) {
u32 progress = 0;
for (const auto &section : analysis.informationSections) {
// Only process the section if it is enabled
Expand Down
8 changes: 4 additions & 4 deletions plugins/builtin/source/content/views/view_pattern_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ namespace hex::plugin::builtin {
auto code = m_textEditor.GetText();
EventPatternEditorChanged::post(code);

TaskManager::createBackgroundTask("hex.builtin.task.parsing_pattern"_lang, [this, code = std::move(code), provider](auto &){
TaskManager::createBackgroundTask("hex.builtin.task.parsing_pattern", [this, code = std::move(code), provider](auto &){
this->parsePattern(code, provider);

if (m_runAutomatically)
Expand Down Expand Up @@ -1531,7 +1531,7 @@ namespace hex::plugin::builtin {
if (m_shouldAnalyze) {
m_shouldAnalyze = false;

m_analysisTask = TaskManager::createBackgroundTask("hex.builtin.task.analyzing_data"_lang, [this, provider](const Task &task) {
m_analysisTask = TaskManager::createBackgroundTask("hex.builtin.task.analyzing_data", [this, provider](const Task &task) {
if (!m_autoLoadPatterns)
return;

Expand Down Expand Up @@ -1834,7 +1834,7 @@ namespace hex::plugin::builtin {
m_textEditor.SetText(code);
m_sourceCode.set(provider, code);

TaskManager::createBackgroundTask("hex.builtin.task.parsing_pattern"_lang, [this, code, provider](auto&) { this->parsePattern(code, provider); });
TaskManager::createBackgroundTask("hex.builtin.task.parsing_pattern", [this, code, provider](auto&) { this->parsePattern(code, provider); });
}
}

Expand Down Expand Up @@ -1900,7 +1900,7 @@ namespace hex::plugin::builtin {

EventHighlightingChanged::post();

TaskManager::createTask("hex.builtin.view.pattern_editor.evaluating"_lang, TaskManager::NoProgress, [this, code, provider](auto &task) {
TaskManager::createTask("hex.builtin.view.pattern_editor.evaluating", TaskManager::NoProgress, [this, code, provider](auto &task) {
auto lock = std::scoped_lock(ContentRegistry::PatternLanguage::getRuntimeLock());

auto &runtime = ContentRegistry::PatternLanguage::getRuntime();
Expand Down
2 changes: 1 addition & 1 deletion plugins/builtin/source/content/views/view_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ namespace hex::plugin::builtin {
}

void ViewStore::updateAll() {
m_updateAllTask = TaskManager::createTask("hex.builtin.task.updating_store"_lang, m_updateCount, [this](auto &task) {
m_updateAllTask = TaskManager::createTask("hex.builtin.task.updating_store", m_updateCount, [this](auto &task) {
for (auto &category : m_categories) {
for (auto &entry : category.entries) {
if (entry.hasUpdate) {
Expand Down
4 changes: 2 additions & 2 deletions plugins/builtin/source/content/welcome_screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ namespace hex::plugin::builtin {
}
}

TaskManager::createBackgroundTask("hex.builtin.task.uploading_crash"_lang, [path = m_logFilePath, data](auto&){
TaskManager::createBackgroundTask("hex.builtin.task.uploading_crash", [path = m_logFilePath, data](auto&){
HttpRequest request("POST", ImHexApiURL + std::string("/crash_upload"));
request.uploadFile(std::vector<u8>(data.begin(), data.end()), "file", path.filename()).wait();
});
Expand Down Expand Up @@ -679,7 +679,7 @@ namespace hex::plugin::builtin {
auto allowNetworking = ContentRegistry::Settings::read<bool>("hex.builtin.setting.general", "hex.builtin.setting.general.network_interface", false)
&& ContentRegistry::Settings::read<int>("hex.builtin.setting.general", "hex.builtin.setting.general.server_contact", 0) != 0;
if (!s_infoBannerTexture->isValid() && allowNetworking) {
TaskManager::createBackgroundTask("hex.builtin.task.loading_banner"_lang, [](auto&) {
TaskManager::createBackgroundTask("hex.builtin.task.loading_banner", [](auto&) {
HttpRequest request("GET",
ImHexApiURL + hex::format("/info/{}/image", hex::toLower(ImHexApi::System::getOSName())));

Expand Down
2 changes: 1 addition & 1 deletion plugins/diffing/source/content/views/view_diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace hex::plugin::diffing {

void ViewDiff::analyze(prv::Provider *providerA, prv::Provider *providerB) {
auto commonSize = std::max(providerA->getActualSize(), providerB->getActualSize());
m_diffTask = TaskManager::createTask("hex.diffing.view.diff.task.diffing"_lang, commonSize, [this, providerA, providerB](Task &) {
m_diffTask = TaskManager::createTask("hex.diffing.view.diff.task.diffing", commonSize, [this, providerA, providerB](Task &) {
auto differences = m_algorithm->analyze(providerA, providerB);

auto providers = ImHexApi::Provider::getProviders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace hex::plugin::disasm {

void ViewDisassembler::exportToFile() {
const auto provider = ImHexApi::Provider::get();
TaskManager::createTask("hex.ui.common.processing"_lang, TaskManager::NoProgress, [this, provider](auto &) {
TaskManager::createTask("hex.ui.common.processing", TaskManager::NoProgress, [this, provider](auto &) {
TaskManager::doLater([this, provider] {
fs::openFileBrowser(fs::DialogMode::Save, {}, [this, provider](const std::fs::path &path) {
auto p = path;
Expand Down
Loading

0 comments on commit 8d1352d

Please sign in to comment.