mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
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:
@@ -126,9 +126,13 @@ namespace hex::pl {
|
||||
this->getEvaluator()->handleAbort();
|
||||
}
|
||||
|
||||
virtual void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) { }
|
||||
virtual void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) {
|
||||
hex::unused(sortSpecs, provider);
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual std::string toString(prv::Provider *provider) const {
|
||||
hex::unused(provider);
|
||||
|
||||
return hex::format("{} {} @ 0x{:X}", this->getTypeName(), this->getVariableName(), this->getOffset());
|
||||
}
|
||||
|
||||
|
||||
@@ -21,8 +21,6 @@ namespace hex::pl {
|
||||
if (this->m_bitField->getEndian() != std::endian::native)
|
||||
std::reverse(value.begin(), value.end());
|
||||
|
||||
u8 numBytes = (this->m_bitSize / 8) + 1;
|
||||
|
||||
return hex::extract(this->m_bitOffset + (this->m_bitSize - 1), this->m_bitOffset, value);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,18 @@ namespace hex::pl {
|
||||
u32 data = 0;
|
||||
provider->read(this->getOffset(), &data, 4);
|
||||
data = hex::changeEndianess(data, 4, this->getEndian());
|
||||
return *reinterpret_cast<float *>(&data);
|
||||
|
||||
float result = 0;
|
||||
std::memcpy(&result, &data, sizeof(float));
|
||||
return result;
|
||||
} else if (this->getSize() == 8) {
|
||||
u64 data = 0;
|
||||
provider->read(this->getOffset(), &data, 8);
|
||||
data = hex::changeEndianess(data, 8, this->getEndian());
|
||||
return *reinterpret_cast<double *>(&data);
|
||||
|
||||
double result = 0;
|
||||
std::memcpy(&result, &data, sizeof(double));
|
||||
return result;
|
||||
} else {
|
||||
assert(false);
|
||||
return std::numeric_limits<double>::quiet_NaN();
|
||||
|
||||
Reference in New Issue
Block a user