mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 05:05:19 -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:
@@ -1,7 +1,6 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <hex/helpers/utils.hpp>
|
||||
#include <hex/helpers/fmt.hpp>
|
||||
|
||||
#include <windows.h>
|
||||
#include <psapi.h>
|
||||
@@ -14,18 +13,6 @@
|
||||
|
||||
namespace hex::plugin::windows {
|
||||
|
||||
static ULONGLONG subtractTimes(const FILETIME &left, const FILETIME &right) {
|
||||
LARGE_INTEGER a, b;
|
||||
|
||||
a.LowPart = left.dwLowDateTime;
|
||||
a.HighPart = left.dwHighDateTime;
|
||||
|
||||
b.LowPart = right.dwLowDateTime;
|
||||
b.HighPart = right.dwHighDateTime;
|
||||
|
||||
return a.QuadPart - b.QuadPart;
|
||||
}
|
||||
|
||||
void addTitleBarButtons() {
|
||||
#if defined(DEBUG)
|
||||
ContentRegistry::Interface::addTitleBarButton(ICON_VS_DEBUG, "hex.windows.title_bar_button.debug_build", []{
|
||||
@@ -59,15 +46,17 @@ namespace hex::plugin::windows {
|
||||
static u32 numProcessors;
|
||||
static HANDLE self = GetCurrentProcess();
|
||||
|
||||
FILETIME ftime, fsys, fuser;
|
||||
ULARGE_INTEGER now, sys, user;
|
||||
{
|
||||
FILETIME ftime, fsys, fuser;
|
||||
|
||||
GetSystemTimeAsFileTime(&ftime);
|
||||
memcpy(&now, &ftime, sizeof(FILETIME));
|
||||
GetSystemTimeAsFileTime(&ftime);
|
||||
memcpy(&now, &ftime, sizeof(FILETIME));
|
||||
|
||||
GetProcessTimes(self, &ftime, &ftime, &fsys, &fuser);
|
||||
memcpy(&sys, &fsys, sizeof(FILETIME));
|
||||
memcpy(&user, &fuser, sizeof(FILETIME));
|
||||
GetProcessTimes(self, &ftime, &ftime, &fsys, &fuser);
|
||||
memcpy(&sys, &fsys, sizeof(FILETIME));
|
||||
memcpy(&user, &fuser, sizeof(FILETIME));
|
||||
}
|
||||
|
||||
if (lastCPU.QuadPart == 0) {
|
||||
SYSTEM_INFO sysInfo;
|
||||
|
||||
Reference in New Issue
Block a user