sys: Enable -Wall, -Wextra, -Werror and fix all warnings on all Platforms (#483)

* sys: Make ImHex compile with -Wall -Wextra -Werror

* sys: Fixed various build errors on Linux

* sys: Explicitly ignore return value of `system` function

* sys: More fixes for the warnings GitHub Actions enables somehow

* sys: More fixes

* sys: Remove -Werror again to see all GitHub Actions warnings

* sys: Hopefully fixed all remaining warnings

* sys: Added back -Werror

* git: Change windows icon in GitHub Actions
This commit is contained in:
WerWolv
2022-03-27 00:01:28 +01:00
committed by GitHub
parent 965207d688
commit 0462cc3d0c
69 changed files with 502 additions and 370 deletions

View File

@@ -34,7 +34,7 @@ namespace hex::dp {
return outputData.value();
}
u64 Node::getIntegerOnInput(u32 index) {
i64 Node::getIntegerOnInput(u32 index) {
auto attribute = this->getConnectedInputAttribute(index);
if (attribute == nullptr)
@@ -54,7 +54,7 @@ namespace hex::dp {
if (outputData->size() < sizeof(u64))
throw std::runtime_error("Not enough data provided for integer");
return *reinterpret_cast<u64 *>(outputData->data());
return *reinterpret_cast<i64 *>(outputData->data());
}
float Node::getFloatOnInput(u32 index) {
@@ -77,7 +77,9 @@ namespace hex::dp {
if (outputData->size() < sizeof(float))
throw std::runtime_error("Not enough data provided for float");
return *reinterpret_cast<float *>(outputData->data());
float result = 0;
std::memcpy(&result, outputData->data(), sizeof(float));
return result;
}
void Node::setBufferOnOutput(u32 index, const std::vector<u8> &data) {
@@ -92,7 +94,7 @@ namespace hex::dp {
attribute.getOutputData() = data;
}
void Node::setIntegerOnOutput(u32 index, u64 integer) {
void Node::setIntegerOnOutput(u32 index, i64 integer) {
if (index >= this->getAttributes().size())
throw std::runtime_error("Attribute index out of bounds!");