From ecd4af10c93ce75680f260bf0f7f5d53311f457d Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Wed, 15 Jul 2015 23:26:58 -0700 Subject: [PATCH] Fixing some clang warnings/errors. --- libxenia.vcxproj | 52 +++++- src/xenia/apu/xaudio2/xaudio2_audio_system.h | 2 +- src/xenia/apu/xma_context.cc | 11 +- src/xenia/apu/xma_context.h | 24 ++- src/xenia/apu/xma_decoder.cc | 2 - src/xenia/cpu/backend/x64/x64_code_cache.cc | 1 - src/xenia/cpu/backend/x64/x64_code_cache.h | 4 +- src/xenia/cpu/backend/x64/x64_function.h | 6 +- .../passes/constant_propagation_pass.cc | 4 +- src/xenia/cpu/debug_info.h | 2 +- src/xenia/cpu/export_resolver.h | 1 - src/xenia/cpu/processor.cc | 7 +- src/xenia/cpu/processor.h | 12 +- src/xenia/cpu/test_module.cc | 2 +- src/xenia/debug/debugger.cc | 14 +- src/xenia/debug/debugger.h | 8 +- src/xenia/emulator.cc | 2 +- src/xenia/gpu/ucode.h | 4 +- src/xenia/kernel/kernel_state.cc | 3 +- src/xenia/kernel/kernel_state.h | 2 +- src/xenia/kernel/util/xex2.h | 2 +- src/xenia/kernel/util/xex2_info.h | 148 +++++++++--------- src/xenia/memory.h | 2 +- src/xenia/vfs/devices/host_path_device.h | 2 +- third_party/elemental-forms | 2 +- third_party/microprofile/microprofile.h | 2 +- xenia.sln | 12 +- 27 files changed, 180 insertions(+), 153 deletions(-) diff --git a/libxenia.vcxproj b/libxenia.vcxproj index 8ba588138..f0ce68fb1 100644 --- a/libxenia.vcxproj +++ b/libxenia.vcxproj @@ -5,6 +5,10 @@ Checked x64 + + Clang + x64 + Debug x64 @@ -192,56 +196,67 @@ CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp CompileAsCpp + CompileAsCpp CompileAsCpp CompileAsCpp @@ -491,6 +506,7 @@ {0CE149F6-41C3-4224-9E57-C02E8C7CD312} Win32Proj libxenia + 8.1 @@ -499,6 +515,12 @@ v140 Unicode + + StaticLibrary + true + LLVM-vs2014 + Unicode + StaticLibrary true @@ -522,6 +544,12 @@ + + + + + + @@ -535,6 +563,7 @@ + @@ -543,7 +572,24 @@ Level3 BEA_ENGINE_STATIC=1;_LIB;%(PreprocessorDefinitions) - $(SolutionDir)\third_party\libav-xma-bin\include\;$(SolutionDir)\third_party\beaengine\include\;$(SolutionDir)\third_party\llvm\include\;$(SolutionDir)\third_party\capstone\include\;%(AdditionalIncludeDirectories) + $(SolutionDir)\third_party\libav-xma-bin\include;$(SolutionDir)\third_party\beaengine\include;$(SolutionDir)\third_party\llvm\include;$(SolutionDir)\third_party\capstone\include;%(AdditionalIncludeDirectories) + + + Windows + true + + + libelemental.lib;libxenia-base.lib;libavcodec.a;libavutil.a;libgflags.lib;libglew.lib + $(SolutionDir)third_party\libav-xma-bin\lib\Debug;%(AdditionalLibraryDirectories) + + + + + + + Level3 + BEA_ENGINE_STATIC=1;_LIB;%(PreprocessorDefinitions) + $(SolutionDir)\third_party\libav-xma-bin\include;$(SolutionDir)\third_party\beaengine\include;$(SolutionDir)\third_party\llvm\include;$(SolutionDir)\third_party\capstone\include;%(AdditionalIncludeDirectories) Windows @@ -560,7 +606,7 @@ Level3 BEA_ENGINE_STATIC=1;_LIB;%(PreprocessorDefinitions) - $(SolutionDir)\third_party\libav-xma-bin\include\;$(SolutionDir)\third_party\beaengine\include\;$(SolutionDir)\third_party\llvm\include\;$(SolutionDir)\third_party\capstone\include\;%(AdditionalIncludeDirectories) + $(SolutionDir)\third_party\libav-xma-bin\include;$(SolutionDir)\third_party\beaengine\include;$(SolutionDir)\third_party\llvm\include;$(SolutionDir)\third_party\capstone\include;%(AdditionalIncludeDirectories) Windows @@ -577,7 +623,7 @@ true BEA_ENGINE_STATIC=1;_LIB;%(PreprocessorDefinitions) - $(SolutionDir)\third_party\libav-xma-bin\include\;$(SolutionDir)\third_party\beaengine\include\;$(SolutionDir)\third_party\llvm\include\;$(SolutionDir)\third_party\capstone\include\;%(AdditionalIncludeDirectories) + $(SolutionDir)\third_party\libav-xma-bin\include;$(SolutionDir)\third_party\beaengine\include;$(SolutionDir)\third_party\llvm\include;$(SolutionDir)\third_party\capstone\include;%(AdditionalIncludeDirectories) Windows diff --git a/src/xenia/apu/xaudio2/xaudio2_audio_system.h b/src/xenia/apu/xaudio2/xaudio2_audio_system.h index 4c7c45ab4..1753d2093 100644 --- a/src/xenia/apu/xaudio2/xaudio2_audio_system.h +++ b/src/xenia/apu/xaudio2/xaudio2_audio_system.h @@ -28,7 +28,7 @@ class XAudio2AudioSystem : public AudioSystem { void DestroyDriver(AudioDriver* driver) override; protected: - virtual void Initialize(); + void Initialize() override; }; } // namespace xaudio2 diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index 927e2af03..f5ab94ac3 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -26,16 +26,7 @@ extern "C" { namespace xe { namespace apu { -XmaContext::XmaContext() - : id_(0), - guest_ptr_(0), - is_allocated_(false), - is_enabled_(false), - decoding_packet_(false), - codec_(nullptr), - context_(nullptr), - decoded_frame_(nullptr), - packet_(nullptr) {} +XmaContext::XmaContext() = default; XmaContext::~XmaContext() { if (context_) { diff --git a/src/xenia/apu/xma_context.h b/src/xenia/apu/xma_context.h index 69cee7664..818a082f2 100644 --- a/src/xenia/apu/xma_context.h +++ b/src/xenia/apu/xma_context.h @@ -175,24 +175,22 @@ class XmaContext { Memory* memory_; - uint32_t id_; - uint32_t guest_ptr_; + uint32_t id_ = 0; + uint32_t guest_ptr_ = 0; xe::mutex lock_; - bool is_allocated_; - bool is_enabled_; - - bool decoding_packet_; + bool is_allocated_ = false; + bool is_enabled_ = false; // libav structures - AVCodec* codec_; - AVCodecContext* context_; - AVFrame* decoded_frame_; - AVPacket* packet_; + AVCodec* codec_ = nullptr; + AVCodecContext* context_ = nullptr; + AVFrame* decoded_frame_ = nullptr; + AVPacket* packet_ = nullptr; WmaProExtraData extra_data_; - size_t current_frame_pos_; - uint8_t* current_frame_; - uint32_t frame_samples_size_; + size_t current_frame_pos_ = 0; + uint8_t* current_frame_ = nullptr; + uint32_t frame_samples_size_ = 0; uint8_t packet_data_[kBytesPerPacket]; }; diff --git a/src/xenia/apu/xma_decoder.cc b/src/xenia/apu/xma_decoder.cc index c895c4496..83327d7f0 100644 --- a/src/xenia/apu/xma_decoder.cc +++ b/src/xenia/apu/xma_decoder.cc @@ -255,8 +255,6 @@ void XmaDecoder::WriteRegister(uint32_t addr, uint64_t value) { context.Clear(); } } - } else { - value = value; } } diff --git a/src/xenia/cpu/backend/x64/x64_code_cache.cc b/src/xenia/cpu/backend/x64/x64_code_cache.cc index 4e072ef4a..e06b772fb 100644 --- a/src/xenia/cpu/backend/x64/x64_code_cache.cc +++ b/src/xenia/cpu/backend/x64/x64_code_cache.cc @@ -372,7 +372,6 @@ uint32_t X64CodeCache::PlaceData(const void* data, size_t length) { // Hold a lock while we bump the pointers up. size_t high_mark; uint8_t* data_address = nullptr; - size_t unwind_table_slot = 0; { std::lock_guard allocation_lock(allocation_mutex_); diff --git a/src/xenia/cpu/backend/x64/x64_code_cache.h b/src/xenia/cpu/backend/x64/x64_code_cache.h index 40bbb8dc4..ed88d8c2e 100644 --- a/src/xenia/cpu/backend/x64/x64_code_cache.h +++ b/src/xenia/cpu/backend/x64/x64_code_cache.h @@ -81,14 +81,14 @@ class X64CodeCache : public CodeCache { // Current offset to empty space in generated code. size_t generated_code_offset_ = 0; // Current high water mark of COMMITTED code. - std::atomic generated_code_commit_mark_ = 0; + std::atomic generated_code_commit_mark_ = {0}; // Growable function table system handle. void* unwind_table_handle_ = nullptr; // Actual unwind table entries. std::vector unwind_table_; // Current number of entries in the table. - std::atomic unwind_table_count_ = 0; + std::atomic unwind_table_count_ = {0}; }; } // namespace x64 diff --git a/src/xenia/cpu/backend/x64/x64_function.h b/src/xenia/cpu/backend/x64/x64_function.h index 71e90ceac..86a08b18b 100644 --- a/src/xenia/cpu/backend/x64/x64_function.h +++ b/src/xenia/cpu/backend/x64/x64_function.h @@ -30,9 +30,9 @@ class X64Function : public Function { void Setup(uint8_t* machine_code, size_t machine_code_length); protected: - virtual bool AddBreakpointImpl(debug::Breakpoint* breakpoint); - virtual bool RemoveBreakpointImpl(debug::Breakpoint* breakpoint); - virtual bool CallImpl(ThreadState* thread_state, uint32_t return_address); + bool AddBreakpointImpl(debug::Breakpoint* breakpoint) override; + bool RemoveBreakpointImpl(debug::Breakpoint* breakpoint) override; + bool CallImpl(ThreadState* thread_state, uint32_t return_address) override; private: uint8_t* machine_code_; diff --git a/src/xenia/cpu/compiler/passes/constant_propagation_pass.cc b/src/xenia/cpu/compiler/passes/constant_propagation_pass.cc index b92b5997a..05c4ab0f2 100644 --- a/src/xenia/cpu/compiler/passes/constant_propagation_pass.cc +++ b/src/xenia/cpu/compiler/passes/constant_propagation_pass.cc @@ -330,7 +330,7 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) { case OPCODE_ADD: if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) { v->set_from(i->src1.value); - bool did_carry = v->Add(i->src2.value); + v->Add(i->src2.value); i->Remove(); } break; @@ -357,7 +357,7 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) { case OPCODE_SUB: if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) { v->set_from(i->src1.value); - bool did_carry = v->Sub(i->src2.value); + v->Sub(i->src2.value); i->Remove(); } break; diff --git a/src/xenia/cpu/debug_info.h b/src/xenia/cpu/debug_info.h index 41ed6aa01..e3d80601a 100644 --- a/src/xenia/cpu/debug_info.h +++ b/src/xenia/cpu/debug_info.h @@ -18,7 +18,7 @@ namespace xe { namespace cpu { -enum DebugInfoFlags { +enum DebugInfoFlags : uint32_t { kDebugInfoNone = 0, kDebugInfoDisasmSource = (1 << 1), kDebugInfoDisasmRawHir = (1 << 2), diff --git a/src/xenia/cpu/export_resolver.h b/src/xenia/cpu/export_resolver.h index 4ea882cc6..c336b9465 100644 --- a/src/xenia/cpu/export_resolver.h +++ b/src/xenia/cpu/export_resolver.h @@ -66,7 +66,6 @@ class Export { : ordinal(ordinal), type(type), tags(tags), - variable_ptr(0), function_data({nullptr, nullptr, 0}) { std::strncpy(this->name, name, xe::countof(this->name)); } diff --git a/src/xenia/cpu/processor.cc b/src/xenia/cpu/processor.cc index ca5c43668..8db6474f0 100644 --- a/src/xenia/cpu/processor.cc +++ b/src/xenia/cpu/processor.cc @@ -71,12 +71,7 @@ class BuiltinModule : public Module { Processor::Processor(xe::Memory* memory, ExportResolver* export_resolver, debug::Debugger* debugger) - : memory_(memory), - debugger_(debugger), - debug_info_flags_(0), - builtin_module_(nullptr), - next_builtin_address_(0xFFFF0000ul), - export_resolver_(export_resolver) { + : memory_(memory), debugger_(debugger), export_resolver_(export_resolver) { InitializeIfNeeded(); } diff --git a/src/xenia/cpu/processor.h b/src/xenia/cpu/processor.h index a8a6e825f..7f18f9691 100644 --- a/src/xenia/cpu/processor.h +++ b/src/xenia/cpu/processor.h @@ -83,20 +83,20 @@ class Processor { private: bool DemandFunction(FunctionInfo* symbol_info, Function** out_function); - Memory* memory_; - debug::Debugger* debugger_; + Memory* memory_ = nullptr; + debug::Debugger* debugger_ = nullptr; - uint32_t debug_info_flags_; + uint32_t debug_info_flags_ = 0; std::unique_ptr frontend_; std::unique_ptr backend_; - ExportResolver* export_resolver_; + ExportResolver* export_resolver_ = nullptr; EntryTable entry_table_; xe::mutex modules_lock_; std::vector> modules_; - Module* builtin_module_; - uint32_t next_builtin_address_; + Module* builtin_module_ = nullptr; + uint32_t next_builtin_address_ = 0xFFFF0000u; Irql irql_; }; diff --git a/src/xenia/cpu/test_module.cc b/src/xenia/cpu/test_module.cc index 99915c816..c93aba42b 100644 --- a/src/xenia/cpu/test_module.cc +++ b/src/xenia/cpu/test_module.cc @@ -33,7 +33,7 @@ TestModule::TestModule(Processor* processor, const std::string& name, generate_(generate) { builder_.reset(new HIRBuilder()); compiler_.reset(new Compiler(processor)); - assembler_ = std::move(processor->backend()->CreateAssembler()); + assembler_ = processor->backend()->CreateAssembler(); assembler_->Initialize(); // Merge blocks early. This will let us use more context in other passes. diff --git a/src/xenia/debug/debugger.cc b/src/xenia/debug/debugger.cc index c14745ed2..a778df488 100644 --- a/src/xenia/debug/debugger.cc +++ b/src/xenia/debug/debugger.cc @@ -61,8 +61,7 @@ Breakpoint::~Breakpoint() = default; Debugger::Debugger(Emulator* emulator) : emulator_(emulator), listen_socket_(INVALID_SOCKET), - client_socket_(INVALID_SOCKET), - accept_thread_running_(false) { + client_socket_(INVALID_SOCKET) { WSADATA wsa_data; WSAStartup(MAKEWORD(2, 2), &wsa_data); } @@ -114,7 +113,7 @@ bool Debugger::StartSession() { if (bind(listen_socket_, reinterpret_cast(&socket_addr), sizeof(socket_addr)) == SOCKET_ERROR) { int e = WSAGetLastError(); - XELOGE("Unable to bind debug socket"); + XELOGE("Unable to bind debug socket: %d", e); return false; } if (listen(listen_socket_, 5) == SOCKET_ERROR) { @@ -300,11 +299,12 @@ void Debugger::OnMessage(std::vector buffer) { module_builder.add_path(module_path_offset); switch (module->module_type()) { case XModule::ModuleType::kKernelModule: { - auto kernel_module = reinterpret_cast(module.get()); + // auto kernel_module = + // reinterpret_cast(module.get()); break; } case XModule::ModuleType::kUserModule: { - auto user_module = reinterpret_cast(module.get()); + // auto user_module = reinterpret_cast(module.get()); // user_module->xex? break; } @@ -475,8 +475,8 @@ void Debugger::OnMessage(std::vector buffer) { break; } - SendResponse(client_socket_, std::move(fbb), request->id(), - response_data_type, response_data_offset); + SendResponse(client_socket_, fbb, request->id(), response_data_type, + response_data_offset); } void Debugger::StopSession() { diff --git a/src/xenia/debug/debugger.h b/src/xenia/debug/debugger.h index 08b3d4266..72963bfcc 100644 --- a/src/xenia/debug/debugger.h +++ b/src/xenia/debug/debugger.h @@ -108,13 +108,13 @@ class Debugger { private: void OnMessage(std::vector buffer); - Emulator* emulator_; + Emulator* emulator_ = nullptr; - uintptr_t listen_socket_; - bool accept_thread_running_; + uintptr_t listen_socket_ = ~0; + bool accept_thread_running_ = false; std::thread accept_thread_; xe::threading::Fence accept_fence_; - uintptr_t client_socket_; + uintptr_t client_socket_ = ~0; std::thread receive_thread_; std::wstring functions_path_; diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index 9b75cef35..c03a97012 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -125,7 +125,7 @@ X_STATUS Emulator::Setup(ui::Window* display_window) { }); // Initialize the HID. - input_system_ = std::move(xe::hid::InputSystem::Create(this)); + input_system_ = xe::hid::InputSystem::Create(this); if (!input_system_) { return X_STATUS_NOT_IMPLEMENTED; } diff --git a/src/xenia/gpu/ucode.h b/src/xenia/gpu/ucode.h index 15bbac763..3d970b563 100644 --- a/src/xenia/gpu/ucode.h +++ b/src/xenia/gpu/ucode.h @@ -19,7 +19,7 @@ namespace gpu { namespace ucode { -#if XE_COMPILER_MSVC +#if XE_PLATFORM_WIN32 #define XEPACKEDSTRUCT(name, value) \ __pragma(pack(push, 1)) struct name##_s value __pragma(pack(pop)); \ typedef struct name##_s name; @@ -32,7 +32,7 @@ namespace ucode { #define XEPACKEDSTRUCT(name, value) struct __attribute__((packed)) name #define XEPACKEDSTRUCTANONYMOUS(value) struct __attribute__((packed)) #define XEPACKEDUNION(name, value) union __attribute__((packed)) name -#endif // MSVC +#endif // XE_PLATFORM_WIN32 // Closest AMD doc: // http://developer.amd.com/wordpress/media/2012/10/R600_Instruction_Set_Architecture.pdf diff --git a/src/xenia/kernel/kernel_state.cc b/src/xenia/kernel/kernel_state.cc index b90571b06..f98b3feed 100644 --- a/src/xenia/kernel/kernel_state.cc +++ b/src/xenia/kernel/kernel_state.cc @@ -51,7 +51,8 @@ KernelState::KernelState(Emulator* emulator) object_table_(nullptr), has_notified_startup_(false), process_type_(X_PROCTYPE_USER), - process_info_block_address_(0) { + process_info_block_address_(0), + dispatch_thread_running_(false) { processor_ = emulator->processor(); file_system_ = emulator->file_system(); diff --git a/src/xenia/kernel/kernel_state.h b/src/xenia/kernel/kernel_state.h index 28e074698..a52c11ebd 100644 --- a/src/xenia/kernel/kernel_state.h +++ b/src/xenia/kernel/kernel_state.h @@ -182,7 +182,7 @@ class KernelState { uint32_t process_info_block_address_; - std::atomic dispatch_thread_running_ = false; + std::atomic dispatch_thread_running_; object_ref dispatch_thread_; std::mutex dispatch_mutex_; std::condition_variable dispatch_cond_; diff --git a/src/xenia/kernel/util/xex2.h b/src/xenia/kernel/util/xex2.h index f4499ef11..796878d9b 100644 --- a/src/xenia/kernel/util/xex2.h +++ b/src/xenia/kernel/util/xex2.h @@ -26,7 +26,7 @@ typedef struct { uint32_t thunk_address; // NULL or address of thunk } xe_xex2_import_info_t; -enum xe_pe_section_flags_e { +enum xe_pe_section_flags_e : uint32_t { kXEPESectionContainsCode = 0x00000020, kXEPESectionContainsDataInit = 0x00000040, kXEPESectionContainsDataUninit = 0x00000080, diff --git a/src/xenia/kernel/util/xex2_info.h b/src/xenia/kernel/util/xex2_info.h index 2df16edf6..8df772034 100644 --- a/src/xenia/kernel/util/xex2_info.h +++ b/src/xenia/kernel/util/xex2_info.h @@ -14,7 +14,7 @@ #include "xenia/base/byte_order.h" -typedef enum { +enum xe_xex2_header_keys : uint32_t { XEX_HEADER_RESOURCE_INFO = 0x000002FF, XEX_HEADER_FILE_FORMAT_INFO = 0x000003FF, XEX_HEADER_DELTA_PATCH_DESCRIPTOR = 0x000005FF, @@ -45,9 +45,9 @@ typedef enum { XEX_HEADER_ALTERNATE_TITLE_IDS = 0x000407FF, XEX_HEADER_ADDITIONAL_TITLE_MEMORY = 0x00040801, XEX_HEADER_EXPORTS_BY_NAME = 0x00E10402, -} xe_xex2_header_keys; +}; -typedef enum { +enum xe_xex2_module_flags : uint32_t { XEX_MODULE_TITLE = 0x00000001, XEX_MODULE_EXPORTS_TO_TITLE = 0x00000002, XEX_MODULE_SYSTEM_DEBUGGER = 0x00000004, @@ -56,9 +56,9 @@ typedef enum { XEX_MODULE_PATCH_FULL = 0x00000020, XEX_MODULE_PATCH_DELTA = 0x00000040, XEX_MODULE_USER_MODE = 0x00000080, -} xe_xex2_module_flags; +}; -typedef enum { +enum xe_xex2_system_flags : uint32_t { XEX_SYSTEM_NO_FORCED_REBOOT = 0x00000001, XEX_SYSTEM_FOREGROUND_TASKS = 0x00000002, XEX_SYSTEM_NO_ODD_MAPPING = 0x00000004, @@ -99,10 +99,10 @@ typedef enum { XEX_SYSTEM_CAMERA_ANGLE = 0x0, XEX_SYSTEM_SKELETAL_TRACKING_REQUIRED = 0x0, XEX_SYSTEM_SKELETAL_TRACKING_SUPPORTED = 0x0,*/ -} xe_xex2_system_flags; +}; // ESRB (Entertainment Software Rating Board) -typedef enum { +enum xe_xex2_rating_esrb_value : uint32_t { XEX_RATING_ESRB_eC = 0x00, XEX_RATING_ESRB_E = 0x02, XEX_RATING_ESRB_E10 = 0x04, @@ -110,36 +110,36 @@ typedef enum { XEX_RATING_ESRB_M = 0x08, XEX_RATING_ESRB_AO = 0x0E, XEX_RATING_ESRB_UNRATED = 0xFF, -} xe_xex2_rating_esrb_value; +}; // PEGI (Pan European Game Information) -typedef enum { +enum xe_xex2_rating_pegi_value : uint32_t { XEX_RATING_PEGI_3_PLUS = 0, XEX_RATING_PEGI_7_PLUS = 4, XEX_RATING_PEGI_12_PLUS = 9, XEX_RATING_PEGI_16_PLUS = 13, XEX_RATING_PEGI_18_PLUS = 14, XEX_RATING_PEGI_UNRATED = 0xFF, -} xe_xex2_rating_pegi_value; +}; // PEGI (Pan European Game Information) - Finland -typedef enum { +enum xe_xex2_rating_pegi_fi_value : uint32_t { XEX_RATING_PEGI_FI_3_PLUS = 0, XEX_RATING_PEGI_FI_7_PLUS = 4, XEX_RATING_PEGI_FI_11_PLUS = 8, XEX_RATING_PEGI_FI_15_PLUS = 12, XEX_RATING_PEGI_FI_18_PLUS = 14, XEX_RATING_PEGI_FI_UNRATED = 0xFF, -} xe_xex2_rating_pegi_fi_value; +}; // PEGI (Pan European Game Information) - Portugal -typedef enum { +enum xe_xex2_rating_pegi_pt_value : uint32_t { XEX_RATING_PEGI_PT_4_PLUS = 1, XEX_RATING_PEGI_PT_6_PLUS = 3, XEX_RATING_PEGI_PT_12_PLUS = 9, XEX_RATING_PEGI_PT_16_PLUS = 13, XEX_RATING_PEGI_PT_18_PLUS = 14, XEX_RATING_PEGI_PT_UNRATED = 0xFF, -} xe_xex2_rating_pegi_pt_value; +}; // BBFC (British Board of Film Classification) - UK/Ireland -typedef enum { +enum xe_xex2_rating_bbfc_value : uint32_t { XEX_RATING_BBFC_UNIVERSAL = 1, XEX_RATING_BBFC_PG = 5, XEX_RATING_BBFC_3_PLUS = 0, @@ -149,60 +149,60 @@ typedef enum { XEX_RATING_BBFC_16_PLUS = 13, XEX_RATING_BBFC_18_PLUS = 14, XEX_RATING_BBFC_UNRATED = 0xFF, -} xe_xex2_rating_bbfc_value; +}; // CERO (Computer Entertainment Rating Organization) -typedef enum { +enum xe_xex2_rating_cero_value : uint32_t { XEX_RATING_CERO_A = 0, XEX_RATING_CERO_B = 2, XEX_RATING_CERO_C = 4, XEX_RATING_CERO_D = 6, XEX_RATING_CERO_Z = 8, XEX_RATING_CERO_UNRATED = 0xFF, -} xe_xex2_rating_cero_value; +}; // USK (Unterhaltungssoftware SelbstKontrolle) -typedef enum { +enum xe_xex2_rating_usk_value : uint32_t { XEX_RATING_USK_ALL = 0, XEX_RATING_USK_6_PLUS = 2, XEX_RATING_USK_12_PLUS = 4, XEX_RATING_USK_16_PLUS = 6, XEX_RATING_USK_18_PLUS = 8, XEX_RATING_USK_UNRATED = 0xFF, -} xe_xex2_rating_usk_value; +}; // OFLC (Office of Film and Literature Classification) - Australia -typedef enum { +enum xe_xex2_rating_oflc_au_value : uint32_t { XEX_RATING_OFLC_AU_G = 0, XEX_RATING_OFLC_AU_PG = 2, XEX_RATING_OFLC_AU_M = 4, XEX_RATING_OFLC_AU_MA15_PLUS = 6, XEX_RATING_OFLC_AU_UNRATED = 0xFF, -} xe_xex2_rating_oflc_au_value; +}; // OFLC (Office of Film and Literature Classification) - New Zealand -typedef enum { +enum xe_xex2_rating_oflc_nz_value : uint32_t { XEX_RATING_OFLC_NZ_G = 0, XEX_RATING_OFLC_NZ_PG = 2, XEX_RATING_OFLC_NZ_M = 4, XEX_RATING_OFLC_NZ_MA15_PLUS = 6, XEX_RATING_OFLC_NZ_UNRATED = 0xFF, -} xe_xex2_rating_oflc_nz_value; +}; // KMRB (Korea Media Rating Board) -typedef enum { +enum xe_xex2_rating_kmrb_value : uint32_t { XEX_RATING_KMRB_ALL = 0, XEX_RATING_KMRB_12_PLUS = 2, XEX_RATING_KMRB_15_PLUS = 4, XEX_RATING_KMRB_18_PLUS = 6, XEX_RATING_KMRB_UNRATED = 0xFF, -} xe_xex2_rating_kmrb_value; +}; // Brazil -typedef enum { +enum xe_xex2_rating_brazil_value : uint32_t { XEX_RATING_BRAZIL_ALL = 0, XEX_RATING_BRAZIL_12_PLUS = 2, XEX_RATING_BRAZIL_14_PLUS = 4, XEX_RATING_BRAZIL_16_PLUS = 5, XEX_RATING_BRAZIL_18_PLUS = 8, XEX_RATING_BRAZIL_UNRATED = 0xFF, -} xe_xex2_rating_brazil_value; +}; // FPB (Film and Publication Board) -typedef enum { +enum xe_xex2_rating_fpb_value : uint32_t { XEX_RATING_FPB_ALL = 0, XEX_RATING_FPB_PG = 6, XEX_RATING_FPB_10_PLUS = 7, @@ -210,9 +210,9 @@ typedef enum { XEX_RATING_FPB_16_PLUS = 13, XEX_RATING_FPB_18_PLUS = 14, XEX_RATING_FPB_UNRATED = 0xFF, -} xe_xex2_rating_fpb_value; +}; -typedef struct { +struct xe_xex2_game_ratings_t { xe_xex2_rating_esrb_value esrb; xe_xex2_rating_pegi_value pegi; xe_xex2_rating_pegi_fi_value pegifi; @@ -225,9 +225,9 @@ typedef struct { xe_xex2_rating_kmrb_value kmrb; xe_xex2_rating_brazil_value brazil; xe_xex2_rating_fpb_value fpb; -} xe_xex2_game_ratings_t; +}; -typedef union { +union xe_xex2_version_t { uint32_t value; struct { uint32_t major : 4; @@ -235,24 +235,24 @@ typedef union { uint32_t build : 16; uint32_t qfe : 8; }; -} xe_xex2_version_t; +}; -typedef struct { +struct xe_xex2_opt_header_t { uint32_t key; uint32_t length; union { uint32_t value; uint32_t offset; }; -} xe_xex2_opt_header_t; +}; -typedef struct { +struct xe_xex2_resource_info_t { char name[9]; uint32_t address; uint32_t size; -} xe_xex2_resource_info_t; +}; -typedef struct { +struct xe_xex2_execution_info_t { uint32_t media_id; xe_xex2_version_t version; xe_xex2_version_t base_version; @@ -262,16 +262,16 @@ typedef struct { uint8_t disc_number; uint8_t disc_count; uint32_t savegame_id; -} xe_xex2_execution_info_t; +}; -typedef struct { +struct xe_xex2_tls_info_t { uint32_t slot_count; uint32_t raw_data_address; uint32_t data_size; uint32_t raw_data_size; -} xe_xex2_tls_info_t; +}; -typedef struct { +struct xe_xex2_import_library_t { char name[32]; uint8_t digest[20]; uint32_t import_id; @@ -279,63 +279,63 @@ typedef struct { xe_xex2_version_t min_version; size_t record_count; uint32_t* records; -} xe_xex2_import_library_t; +}; -typedef enum { +enum xe_xex2_approval_type : uint32_t { XEX_APPROVAL_UNAPPROVED = 0, XEX_APPROVAL_POSSIBLE = 1, XEX_APPROVAL_APPROVED = 2, XEX_APPROVAL_EXPIRED = 3, -} xe_xex2_approval_type; +}; -typedef struct { +struct xe_xex2_static_library_t { char name[9]; // 8 + 1 for \0 uint16_t major; uint16_t minor; uint16_t build; uint16_t qfe; xe_xex2_approval_type approval; -} xe_xex2_static_library_t; +}; -typedef enum { +enum xe_xex2_encryption_type : uint32_t { XEX_ENCRYPTION_NONE = 0, XEX_ENCRYPTION_NORMAL = 1, -} xe_xex2_encryption_type; +}; -typedef enum { +enum xe_xex2_compression_type : uint32_t { XEX_COMPRESSION_NONE = 0, XEX_COMPRESSION_BASIC = 1, XEX_COMPRESSION_NORMAL = 2, XEX_COMPRESSION_DELTA = 3, -} xe_xex2_compression_type; +}; -typedef struct { +struct xe_xex2_file_basic_compression_block_t { uint32_t data_size; uint32_t zero_size; -} xe_xex2_file_basic_compression_block_t; +}; -typedef struct { +struct xe_xex2_file_basic_compression_info_t { uint32_t block_count; xe_xex2_file_basic_compression_block_t* blocks; -} xe_xex2_file_basic_compression_info_t; +}; -typedef struct { +struct xe_xex2_file_normal_compression_info_t { uint32_t window_size; uint32_t window_bits; uint32_t block_size; uint8_t block_hash[20]; -} xe_xex2_file_normal_compression_info_t; +}; -typedef struct { +struct xe_xex2_file_format_info_t { xe_xex2_encryption_type encryption_type; xe_xex2_compression_type compression_type; union { xe_xex2_file_basic_compression_info_t basic; xe_xex2_file_normal_compression_info_t normal; } compression_info; -} xe_xex2_file_format_info_t; +}; -typedef enum { +enum xe_xex2_image_flags : uint32_t { XEX_IMAGE_MANUFACTURING_UTILITY = 0x00000002, XEX_IMAGE_MANUFACTURING_SUPPORT_TOOLS = 0x00000004, XEX_IMAGE_XGD2_MEDIA_ONLY = 0x00000008, @@ -354,9 +354,9 @@ typedef enum { XEX_IMAGE_REGION_FREE = 0x20000000, XEX_IMAGE_REVOCATION_CHECK_OPTIONAL = 0x40000000, XEX_IMAGE_REVOCATION_CHECK_REQUIRED = 0x80000000, -} xe_xex2_image_flags; +}; -typedef enum { +enum xe_xex2_media_flags : uint32_t { XEX_MEDIA_HARDDISK = 0x00000001, XEX_MEDIA_DVD_X2 = 0x00000002, XEX_MEDIA_DVD_CD = 0x00000004, @@ -374,9 +374,9 @@ typedef enum { XEX_MEDIA_LOCALLY_SIGNED_PACKAGE = 0x04000000, XEX_MEDIA_LIVE_SIGNED_PACKAGE = 0x08000000, XEX_MEDIA_XBOX_PACKAGE = 0x10000000, -} xe_xex2_media_flags; +}; -typedef enum { +enum xe_xex2_region_flags : uint32_t { XEX_REGION_NTSCU = 0x000000FF, XEX_REGION_NTSCJ = 0x0000FF00, XEX_REGION_NTSCJ_JAPAN = 0x00000100, @@ -385,9 +385,9 @@ typedef enum { XEX_REGION_PAL_AU_NZ = 0x00010000, XEX_REGION_OTHER = 0xFF000000, XEX_REGION_ALL = 0xFFFFFFFF, -} xe_xex2_region_flags; +}; -typedef struct { +struct xe_xex2_loader_info_t { uint32_t header_size; uint32_t image_size; uint8_t rsa_signature[256]; @@ -403,15 +403,15 @@ typedef struct { uint8_t header_digest[20]; xe_xex2_region_flags game_regions; xe_xex2_media_flags media_flags; -} xe_xex2_loader_info_t; +}; -typedef enum { +enum xe_xex2_section_type : uint32_t { XEX_SECTION_CODE = 1, XEX_SECTION_DATA = 2, XEX_SECTION_READONLY_DATA = 3, -} xe_xex2_section_type; +}; -typedef struct { +struct xe_xex2_section_t { uint32_t page_size; union { struct { @@ -421,9 +421,9 @@ typedef struct { uint32_t value; // To make uint8_t swapping easier } info; uint8_t digest[20]; -} xe_xex2_section_t; +}; -typedef struct { +struct xe_xex2_header_t { uint32_t xex2; xe_xex2_module_flags module_flags; uint32_t exe_offset; @@ -455,7 +455,7 @@ typedef struct { xe_xex2_resource_info_t* resource_infos; size_t section_count; xe_xex2_section_t* sections; -} xe_xex2_header_t; +}; namespace xe { union xex2_version { diff --git a/src/xenia/memory.h b/src/xenia/memory.h index 98e39f1fc..51eb9611b 100644 --- a/src/xenia/memory.h +++ b/src/xenia/memory.h @@ -236,7 +236,7 @@ class Memory { uint8_t* physical; }; uint8_t* all_views[9]; - } views_ = {0}; + } views_ = {{0}}; std::unique_ptr mmio_handler_; diff --git a/src/xenia/vfs/devices/host_path_device.h b/src/xenia/vfs/devices/host_path_device.h index 0b02c30d5..248ee324a 100644 --- a/src/xenia/vfs/devices/host_path_device.h +++ b/src/xenia/vfs/devices/host_path_device.h @@ -27,7 +27,7 @@ class HostPathDevice : public Device { bool Initialize() override; - bool is_read_only() const { return read_only_; } + bool is_read_only() const override { return read_only_; } uint32_t total_allocation_units() const override { return 128 * 1024; } uint32_t available_allocation_units() const override { return 128 * 1024; } diff --git a/third_party/elemental-forms b/third_party/elemental-forms index 3b5df11e0..275ad4155 160000 --- a/third_party/elemental-forms +++ b/third_party/elemental-forms @@ -1 +1 @@ -Subproject commit 3b5df11e07ed160410f39d105eca88d773b7b385 +Subproject commit 275ad4155a436883964f16b64c6b32b11fbb027a diff --git a/third_party/microprofile/microprofile.h b/third_party/microprofile/microprofile.h index 345358cc6..e34f78890 100644 --- a/third_party/microprofile/microprofile.h +++ b/third_party/microprofile/microprofile.h @@ -469,7 +469,7 @@ enum MicroProfileDrawMask MP_DRAW_HIDDEN = 0x3, }; -enum MicroProfileDrawBarsMask +enum MicroProfileDrawBarsMask : uint32_t { MP_DRAW_TIMERS = 0x1, MP_DRAW_AVERAGE = 0x2, diff --git a/xenia.sln b/xenia.sln index 555094e71..76b380207 100644 --- a/xenia.sln +++ b/xenia.sln @@ -85,8 +85,8 @@ Global {88F908AF-79A3-4ED4-87C7-A76368205264}.Release|x64.Build.0 = Release|x64 {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Checked|x64.ActiveCfg = Checked|x64 {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Checked|x64.Build.0 = Checked|x64 - {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Clang|x64.ActiveCfg = Debug|x64 - {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Clang|x64.Build.0 = Debug|x64 + {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Clang|x64.ActiveCfg = Clang|x64 + {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Clang|x64.Build.0 = Clang|x64 {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Debug|x64.ActiveCfg = Debug|x64 {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Debug|x64.Build.0 = Debug|x64 {0CE149F6-41C3-4224-9E57-C02E8C7CD312}.Release|x64.ActiveCfg = Release|x64 @@ -165,16 +165,16 @@ Global {93533067-6449-4691-88A8-026EBCFDCA97}.Release|x64.Build.0 = Release|x64 {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Checked|x64.ActiveCfg = Checked|x64 {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Checked|x64.Build.0 = Checked|x64 - {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Clang|x64.ActiveCfg = Debug|x64 - {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Clang|x64.Build.0 = Debug|x64 + {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Clang|x64.ActiveCfg = Clang|x64 + {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Clang|x64.Build.0 = Clang|x64 {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Debug|x64.ActiveCfg = Debug|x64 {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Debug|x64.Build.0 = Debug|x64 {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Release|x64.ActiveCfg = Release|x64 {156102D7-F2DD-4618-B2EB-2DFE607EE6DD}.Release|x64.Build.0 = Release|x64 {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Checked|x64.ActiveCfg = Checked|x64 {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Checked|x64.Build.0 = Checked|x64 - {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Clang|x64.ActiveCfg = Debug|x64 - {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Clang|x64.Build.0 = Debug|x64 + {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Clang|x64.ActiveCfg = Clang|x64 + {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Clang|x64.Build.0 = Clang|x64 {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Debug|x64.ActiveCfg = Debug|x64 {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Debug|x64.Build.0 = Debug|x64 {C3FDE1FE-1FCB-4156-BB37-2E38F5C2DFE7}.Release|x64.ActiveCfg = Release|x64