mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-29 15:51:02 +00:00
Fix warnings
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|
||||||
#define ACCESS_MASK DWORD
|
#define ACCESS_MASK DWORD
|
||||||
#define DEVICE_TYPE DWORD
|
#define DEVICE_TYPE DWORD
|
||||||
|
|
||||||
@@ -408,3 +410,5 @@ typedef struct _REMOTE_PORT_VIEW64
|
|||||||
EMULATOR_CAST(std::int64_t, SIZE_T) ViewSize;
|
EMULATOR_CAST(std::int64_t, SIZE_T) ViewSize;
|
||||||
EmulatorTraits<Emu64>::PVOID ViewBase;
|
EmulatorTraits<Emu64>::PVOID ViewBase;
|
||||||
} REMOTE_PORT_VIEW64, *PREMOTE_PORT_VIEW64;
|
} REMOTE_PORT_VIEW64, *PREMOTE_PORT_VIEW64;
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|
||||||
#define PROCESSOR_FEATURE_MAX 64
|
#define PROCESSOR_FEATURE_MAX 64
|
||||||
#define GDI_HANDLE_BUFFER_SIZE64 60
|
#define GDI_HANDLE_BUFFER_SIZE64 60
|
||||||
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_RELEASE_ON_DEACTIVATION 0x00000001
|
#define RTL_ACTIVATION_CONTEXT_STACK_FRAME_FLAG_RELEASE_ON_DEACTIVATION 0x00000001
|
||||||
@@ -388,10 +390,10 @@ typedef struct _GDI_TEB_BATCH64
|
|||||||
#ifndef OS_WINDOWS
|
#ifndef OS_WINDOWS
|
||||||
typedef struct _GUID
|
typedef struct _GUID
|
||||||
{
|
{
|
||||||
unsigned long Data1;
|
uint32_t Data1;
|
||||||
unsigned short Data2;
|
uint16_t Data2;
|
||||||
unsigned short Data3;
|
uint16_t Data3;
|
||||||
unsigned char Data4[8];
|
uint8_t Data4[8];
|
||||||
} GUID;
|
} GUID;
|
||||||
|
|
||||||
typedef struct _PROCESSOR_NUMBER
|
typedef struct _PROCESSOR_NUMBER
|
||||||
@@ -913,3 +915,5 @@ struct PROCESS_TLS_INFO
|
|||||||
};
|
};
|
||||||
|
|
||||||
static_assert(sizeof(PROCESS_TLS_INFO) - sizeof(THREAD_TLS_INFO) == 0x10);
|
static_assert(sizeof(PROCESS_TLS_INFO) - sizeof(THREAD_TLS_INFO) == 0x10);
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using)
|
||||||
|
|
||||||
#define PAGE_EXECUTE 0x10
|
#define PAGE_EXECUTE 0x10
|
||||||
#define PAGE_EXECUTE_READ 0x20
|
#define PAGE_EXECUTE_READ 0x20
|
||||||
#define PAGE_EXECUTE_READWRITE 0x40
|
#define PAGE_EXECUTE_READWRITE 0x40
|
||||||
@@ -127,3 +129,5 @@ typedef struct _MEMORY_REGION_INFORMATION
|
|||||||
DWORD64 PartitionId; // 19H1
|
DWORD64 PartitionId; // 19H1
|
||||||
DWORD64 NodePreference; // 20H1
|
DWORD64 NodePreference; // 20H1
|
||||||
} MEMORY_REGION_INFORMATION64, *PMEMORY_REGION_INFORMATION64;
|
} MEMORY_REGION_INFORMATION64, *PMEMORY_REGION_INFORMATION64;
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using)
|
||||||
|
|||||||
@@ -4,7 +4,9 @@
|
|||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4201) // nameless struct/union
|
#pragma warning(disable : 4201) // nameless struct/union
|
||||||
#pragma warning(disable : 4702) // unreachable code
|
#pragma warning(disable : 4702) // unreachable code
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
#endif
|
#endif
|
||||||
@@ -24,8 +26,10 @@
|
|||||||
#include "network.hpp"
|
#include "network.hpp"
|
||||||
#include "threading.hpp"
|
#include "threading.hpp"
|
||||||
|
|
||||||
#ifdef OS_WINDOWS
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
#pragma warning(pop)
|
|
||||||
#else
|
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef OS_WINDOWS
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using)
|
||||||
|
|
||||||
#ifdef OS_WINDOWS
|
#ifdef OS_WINDOWS
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
@@ -51,10 +53,10 @@ using BYTE = std::uint8_t;
|
|||||||
|
|
||||||
using WORD = std::uint16_t;
|
using WORD = std::uint16_t;
|
||||||
|
|
||||||
#define UCHAR unsigned char
|
#define UCHAR uint8_t
|
||||||
#define BOOLEAN UCHAR
|
#define BOOLEAN UCHAR
|
||||||
|
|
||||||
using CSHORT = short;
|
using CSHORT = int16_t;
|
||||||
using USHORT = WORD;
|
using USHORT = WORD;
|
||||||
|
|
||||||
#define DUMMYSTRUCTNAME
|
#define DUMMYSTRUCTNAME
|
||||||
@@ -63,3 +65,5 @@ using USHORT = WORD;
|
|||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|
||||||
#define CONTEXT_X86_MAIN 0x00010000
|
#define CONTEXT_X86_MAIN 0x00010000
|
||||||
#define CONTEXT_AMD64_MAIN 0x100000
|
#define CONTEXT_AMD64_MAIN 0x100000
|
||||||
#define CONTEXT_CONTROL_32 (CONTEXT_X86_MAIN | 0x1L)
|
#define CONTEXT_CONTROL_32 (CONTEXT_X86_MAIN | 0x1L)
|
||||||
@@ -1005,3 +1007,5 @@ _Struct_size_bytes_(Size) struct EMU_SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX64
|
|||||||
EMU_GROUP_RELATIONSHIP64 Group;
|
EMU_GROUP_RELATIONSHIP64 Group;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|
||||||
typedef enum _KEY_INFORMATION_CLASS
|
typedef enum _KEY_INFORMATION_CLASS
|
||||||
{
|
{
|
||||||
KeyBasicInformation, // KEY_BASIC_INFORMATION
|
KeyBasicInformation, // KEY_BASIC_INFORMATION
|
||||||
@@ -77,3 +79,5 @@ struct KEY_VALUE_FULL_INFORMATION
|
|||||||
ULONG NameLength;
|
ULONG NameLength;
|
||||||
char16_t Name[1];
|
char16_t Name[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using)
|
||||||
|
|
||||||
typedef enum _EVENT_TYPE
|
typedef enum _EVENT_TYPE
|
||||||
{
|
{
|
||||||
NotificationEvent,
|
NotificationEvent,
|
||||||
@@ -14,3 +16,5 @@ typedef enum _WAIT_TYPE
|
|||||||
WaitDequeue,
|
WaitDequeue,
|
||||||
WaitDpc,
|
WaitDpc,
|
||||||
} WAIT_TYPE;
|
} WAIT_TYPE;
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using)
|
||||||
|
|
||||||
typedef enum _THREADINFOCLASS
|
typedef enum _THREADINFOCLASS
|
||||||
{
|
{
|
||||||
ThreadBasicInformation, // q: THREAD_BASIC_INFORMATION
|
ThreadBasicInformation, // q: THREAD_BASIC_INFORMATION
|
||||||
@@ -87,3 +89,5 @@ typedef struct _THREAD_TEB_INFORMATION
|
|||||||
ULONG TebOffset; // Offset in TEB to begin reading from.
|
ULONG TebOffset; // Offset in TEB to begin reading from.
|
||||||
ULONG BytesToRead; // Number of bytes to read.
|
ULONG BytesToRead; // Number of bytes to read.
|
||||||
} THREAD_TEB_INFORMATION, *PTHREAD_TEB_INFORMATION;
|
} THREAD_TEB_INFORMATION, *PTHREAD_TEB_INFORMATION;
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ struct UNICODE_STRING
|
|||||||
|
|
||||||
inline std::u16string u8_to_u16(const std::string_view view)
|
inline std::u16string u8_to_u16(const std::string_view view)
|
||||||
{
|
{
|
||||||
return std::u16string(view.begin(), view.end());
|
return {view.begin(), view.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::string u16_to_u8(const std::u16string_view u16_view)
|
inline std::string u16_to_u8(const std::u16string_view u16_view)
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|
||||||
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
|
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
|
||||||
#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
|
#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
|
||||||
#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory
|
#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory
|
||||||
@@ -339,3 +341,5 @@ struct SECTION_IMAGE_INFORMATION
|
|||||||
ULONG ImageFileSize;
|
ULONG ImageFileSize;
|
||||||
ULONG CheckSum;
|
ULONG CheckSum;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace utils::string
|
|||||||
|
|
||||||
inline wchar_t char_to_lower(const wchar_t val)
|
inline wchar_t char_to_lower(const wchar_t val)
|
||||||
{
|
{
|
||||||
return std::towlower(val);
|
return static_cast<wchar_t>(std::towlower(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Elem, class Traits, class Alloc>
|
template <class Elem, class Traits, class Alloc>
|
||||||
|
|||||||
@@ -15,22 +15,22 @@ enum class memory_permission : uint8_t
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
inline constexpr memory_permission operator&(const memory_permission x, const memory_permission y)
|
constexpr memory_permission operator&(const memory_permission x, const memory_permission y)
|
||||||
{
|
{
|
||||||
return static_cast<memory_permission>(static_cast<uint8_t>(x) & static_cast<uint8_t>(y));
|
return static_cast<memory_permission>(static_cast<uint8_t>(x) & static_cast<uint8_t>(y));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constexpr memory_permission operator|(const memory_permission x, const memory_permission y)
|
constexpr memory_permission operator|(const memory_permission x, const memory_permission y)
|
||||||
{
|
{
|
||||||
return static_cast<memory_permission>(static_cast<uint8_t>(x) | static_cast<uint8_t>(y));
|
return static_cast<memory_permission>(static_cast<uint8_t>(x) | static_cast<uint8_t>(y));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constexpr memory_permission operator^(const memory_permission x, const memory_permission y)
|
constexpr memory_permission operator^(const memory_permission x, const memory_permission y)
|
||||||
{
|
{
|
||||||
return static_cast<memory_permission>(static_cast<uint8_t>(x) ^ static_cast<uint8_t>(y));
|
return static_cast<memory_permission>(static_cast<uint8_t>(x) ^ static_cast<uint8_t>(y));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constexpr memory_permission operator~(memory_permission x)
|
constexpr memory_permission operator~(memory_permission x)
|
||||||
{
|
{
|
||||||
return static_cast<memory_permission>(~static_cast<uint8_t>(x));
|
return static_cast<memory_permission>(~static_cast<uint8_t>(x));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -499,8 +499,8 @@ namespace utils
|
|||||||
|
|
||||||
std::optional<size_t> get_diff(const buffer_serializer& other) const
|
std::optional<size_t> get_diff(const buffer_serializer& other) const
|
||||||
{
|
{
|
||||||
auto& b1 = this->get_buffer();
|
const auto& b1 = this->get_buffer();
|
||||||
auto& b2 = other.get_buffer();
|
const auto& b2 = other.get_buffer();
|
||||||
|
|
||||||
const auto s1 = b1.size();
|
const auto s1 = b1.size();
|
||||||
const auto s2 = b2.size();
|
const auto s2 = b2.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user