From d7a5c74bf3e3b59ba30138e82bdbe9a44b4fe98f Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 30 Jun 2015 16:16:33 -0700 Subject: [PATCH] Formatting: force pointers to the left side. --- .clang-format | 2 + src/xenia/apu/xma_context.cc | 24 +- src/xenia/base/byte_order.h | 20 +- src/xenia/base/debugging.h | 2 +- src/xenia/base/debugging_win.cc | 2 +- src/xenia/base/math.cc | 4 +- src/xenia/debug/proto/breakpoints_generated.h | 134 ++++---- src/xenia/debug/proto/control_generated.h | 112 +++---- src/xenia/debug/proto/messages_generated.h | 148 ++++----- src/xenia/debug/proto/modules_generated.h | 164 +++++----- src/xenia/debug/proto/threads_generated.h | 52 +-- src/xenia/kernel/util/xex2.cc | 295 +++++++++--------- 12 files changed, 478 insertions(+), 481 deletions(-) diff --git a/.clang-format b/.clang-format index 9f3e95ce0..a5f9bf0bb 100644 --- a/.clang-format +++ b/.clang-format @@ -1,2 +1,4 @@ --- BasedOnStyle: Google +DerivePointerAlignment: false +PointerAlignment: Left diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index cd109b1cb..499739cf6 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -52,7 +52,7 @@ XmaContext::~XmaContext() { } } -int XmaContext::Setup(uint32_t id, Memory *memory, uint32_t guest_ptr) { +int XmaContext::Setup(uint32_t id, Memory* memory, uint32_t guest_ptr) { id_ = id; memory_ = memory; guest_ptr_ = guest_ptr; @@ -94,7 +94,7 @@ int XmaContext::Setup(uint32_t id, Memory *memory, uint32_t guest_ptr) { extra_data_.decode_flags = 0x10D6; context_->extradata_size = sizeof(extra_data_); - context_->extradata = (uint8_t *)&extra_data_; + context_->extradata = (uint8_t*)&extra_data_; // Current frame stuff whatever // samples per frame * 2 max channels * output bytes @@ -204,7 +204,7 @@ int XmaContext::GetSampleRate(int id) { return 0; } -void XmaContext::DecodePackets(XMA_CONTEXT_DATA &data) { +void XmaContext::DecodePackets(XMA_CONTEXT_DATA& data) { SCOPE_profile_cpu_f("apu"); // What I see: @@ -236,7 +236,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA &data) { // Output buffers are in raw PCM samples, 256 bytes per block. // Output buffer is a ring buffer. We need to write from the write offset // to the read offset. - uint8_t *output_buffer = memory()->TranslatePhysical(data.output_buffer_ptr); + uint8_t* output_buffer = memory()->TranslatePhysical(data.output_buffer_ptr); uint32_t output_capacity = data.output_buffer_block_count * kBytesPerSubframe; uint32_t output_read_offset = data.output_buffer_read_offset * kBytesPerSubframe; @@ -315,12 +315,12 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA &data) { data.output_buffer_valid = 0; } -int XmaContext::StartPacket(XMA_CONTEXT_DATA &data) { +int XmaContext::StartPacket(XMA_CONTEXT_DATA& data) { // Translate pointers for future use. - uint8_t *in0 = data.input_buffer_0_valid + uint8_t* in0 = data.input_buffer_0_valid ? memory()->TranslatePhysical(data.input_buffer_0_ptr) : nullptr; - uint8_t *in1 = data.input_buffer_1_valid + uint8_t* in1 = data.input_buffer_1_valid ? memory()->TranslatePhysical(data.input_buffer_1_ptr) : nullptr; @@ -373,7 +373,7 @@ int XmaContext::StartPacket(XMA_CONTEXT_DATA &data) { return input_remaining_bytes; } -int XmaContext::PreparePacket(uint8_t *input, size_t seq_offset, size_t size, +int XmaContext::PreparePacket(uint8_t* input, size_t seq_offset, size_t size, int sample_rate, int channels) { if (size != kBytesPerPacket) { // Invalid packet size! @@ -388,8 +388,8 @@ int XmaContext::PreparePacket(uint8_t *input, size_t seq_offset, size_t size, std::memcpy(packet_data_, input, size); // Modify the packet header so it's WMAPro compatible - *((int *)packet_data_) = (((seq_offset & 0x7800) | 0x400) >> 7) | - (*((int *)packet_data_) & 0xFFFEFF08); + *((int*)packet_data_) = (((seq_offset & 0x7800) | 0x400) >> 7) | + (*((int*)packet_data_) & 0xFFFEFF08); packet_->data = packet_data_; packet_->size = kBytesPerPacket; @@ -422,7 +422,7 @@ void XmaContext::DiscardPacket() { } } -int XmaContext::DecodePacket(uint8_t *output, size_t output_offset, +int XmaContext::DecodePacket(uint8_t* output, size_t output_offset, size_t output_size) { size_t to_copy = 0; size_t original_offset = output_offset; @@ -478,7 +478,7 @@ int XmaContext::DecodePacket(uint8_t *output, size_t output_offset, for (int i = 0; i < decoded_frame_->nb_samples; i++) { for (int j = 0; j < context_->channels; j++) { // Select the appropriate array based on the current channel. - float *sample_array = (float *)decoded_frame_->data[j]; + float* sample_array = (float*)decoded_frame_->data[j]; // Raw sample should be within [-1, 1]. // Clamp it, just in case. diff --git a/src/xenia/base/byte_order.h b/src/xenia/base/byte_order.h index ef875145e..da74c0be0 100644 --- a/src/xenia/base/byte_order.h +++ b/src/xenia/base/byte_order.h @@ -61,12 +61,12 @@ inline uint64_t byte_swap(uint64_t value) { return XENIA_BASE_BYTE_SWAP_64(value); } inline float byte_swap(float value) { - uint32_t temp = byte_swap(*reinterpret_cast(&value)); - return *reinterpret_cast(&temp); + uint32_t temp = byte_swap(*reinterpret_cast(&value)); + return *reinterpret_cast(&temp); } inline double byte_swap(double value) { - uint64_t temp = byte_swap(*reinterpret_cast(&value)); - return *reinterpret_cast(&temp); + uint64_t temp = byte_swap(*reinterpret_cast(&value)); + return *reinterpret_cast(&temp); } template inline T byte_swap(T value) { @@ -80,19 +80,19 @@ inline T byte_swap(T value) { template struct be { be() = default; - be(const T &src) : value(xe::byte_swap(src)) {} - be(const be &other) { value = other.value; } + be(const T& src) : value(xe::byte_swap(src)) {} + be(const be& other) { value = other.value; } operator T() const { return xe::byte_swap(value); } - be &operator+=(int a) { + be& operator+=(int a) { *this = *this + a; return *this; } - be &operator-=(int a) { + be& operator-=(int a) { *this = *this - a; return *this; } - be &operator++() { + be& operator++() { *this += 1; return *this; } // ++a @@ -100,7 +100,7 @@ struct be { *this += 1; return (*this - 1); } // a++ - be &operator--() { + be& operator--() { *this -= 1; return *this; } // --a diff --git a/src/xenia/base/debugging.h b/src/xenia/base/debugging.h index cebd80a4d..401890fa4 100644 --- a/src/xenia/base/debugging.h +++ b/src/xenia/base/debugging.h @@ -25,7 +25,7 @@ bool IsDebuggerAttached(); // If no debugger is present, a signal will be raised. void Break(); -void DebugPrint(const char *fmt, ...); +void DebugPrint(const char* fmt, ...); } // namespace debugging } // namespace xe diff --git a/src/xenia/base/debugging_win.cc b/src/xenia/base/debugging_win.cc index abbb9777f..826c807c1 100644 --- a/src/xenia/base/debugging_win.cc +++ b/src/xenia/base/debugging_win.cc @@ -19,7 +19,7 @@ bool IsDebuggerAttached() { return IsDebuggerPresent() ? true : false; } void Break() { __debugbreak(); } -void DebugPrint(const char *fmt, ...) { +void DebugPrint(const char* fmt, ...) { StringBuffer buff; va_list va; diff --git a/src/xenia/base/math.cc b/src/xenia/base/math.cc index 1dff7c143..b36b28e63 100644 --- a/src/xenia/base/math.cc +++ b/src/xenia/base/math.cc @@ -16,7 +16,7 @@ namespace xe { // Copyright (c) Microsoft Corporation. All rights reserved. uint16_t float_to_half(float value) { uint32_t Result; - uint32_t IValue = ((uint32_t *)(&value))[0]; + uint32_t IValue = ((uint32_t*)(&value))[0]; uint32_t Sign = (IValue & 0x80000000U) >> 16U; IValue = IValue & 0x7FFFFFFFU; // Hack off the sign if (IValue > 0x47FFEFFFU) { @@ -63,7 +63,7 @@ float half_to_float(uint16_t value) { uint32_t Result = ((value & 0x8000) << 16) | // Sign ((Exponent + 112) << 23) | // Exponent (Mantissa << 13); // Mantissa - return *(float *)&Result; + return *(float*)&Result; } } // namespace xe diff --git a/src/xenia/debug/proto/breakpoints_generated.h b/src/xenia/debug/proto/breakpoints_generated.h index e651cb80a..48405f776 100644 --- a/src/xenia/debug/proto/breakpoints_generated.h +++ b/src/xenia/debug/proto/breakpoints_generated.h @@ -43,20 +43,20 @@ STRUCT_END(Breakpoint, 4); struct ListBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct ListBreakpointsRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - ListBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + ListBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListBreakpointsRequestBuilder &operator=( - const ListBreakpointsRequestBuilder &); + ListBreakpointsRequestBuilder& operator=( + const ListBreakpointsRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); @@ -65,17 +65,17 @@ struct ListBreakpointsRequestBuilder { }; inline flatbuffers::Offset CreateListBreakpointsRequest( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { ListBreakpointsRequestBuilder builder_(_fbb); return builder_.Finish(); } struct ListBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::Vector *breakpoints() const { - return GetPointer *>(4); + const flatbuffers::Vector* breakpoints() const { + return GetPointer*>(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* breakpoints */) && verifier.Verify(breakpoints()) && verifier.EndTable(); @@ -83,18 +83,18 @@ struct ListBreakpointsResponse FLATBUFFERS_FINAL_CLASS }; struct ListBreakpointsResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - void add_breakpoints(flatbuffers::Offset< - flatbuffers::Vector> breakpoints) { + void add_breakpoints( + flatbuffers::Offset> breakpoints) { fbb_.AddOffset(4, breakpoints); } - ListBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + ListBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListBreakpointsResponseBuilder &operator=( - const ListBreakpointsResponseBuilder &); + ListBreakpointsResponseBuilder& operator=( + const ListBreakpointsResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); @@ -104,8 +104,8 @@ struct ListBreakpointsResponseBuilder { inline flatbuffers::Offset CreateListBreakpointsResponse( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> breakpoints = + flatbuffers::FlatBufferBuilder& _fbb, + flatbuffers::Offset> breakpoints = 0) { ListBreakpointsResponseBuilder builder_(_fbb); builder_.add_breakpoints(breakpoints); @@ -114,10 +114,10 @@ CreateListBreakpointsResponse( struct AddBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::Vector *breakpoints() const { - return GetPointer *>(4); + const flatbuffers::Vector* breakpoints() const { + return GetPointer*>(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* breakpoints */) && verifier.Verify(breakpoints()) && verifier.EndTable(); @@ -125,17 +125,17 @@ struct AddBreakpointsRequest FLATBUFFERS_FINAL_CLASS }; struct AddBreakpointsRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - void add_breakpoints(flatbuffers::Offset< - flatbuffers::Vector> breakpoints) { + void add_breakpoints( + flatbuffers::Offset> breakpoints) { fbb_.AddOffset(4, breakpoints); } - AddBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + AddBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - AddBreakpointsRequestBuilder &operator=(const AddBreakpointsRequestBuilder &); + AddBreakpointsRequestBuilder& operator=(const AddBreakpointsRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); @@ -144,8 +144,8 @@ struct AddBreakpointsRequestBuilder { }; inline flatbuffers::Offset CreateAddBreakpointsRequest( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> breakpoints = + flatbuffers::FlatBufferBuilder& _fbb, + flatbuffers::Offset> breakpoints = 0) { AddBreakpointsRequestBuilder builder_(_fbb); builder_.add_breakpoints(breakpoints); @@ -154,20 +154,20 @@ inline flatbuffers::Offset CreateAddBreakpointsRequest( struct AddBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct AddBreakpointsResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - AddBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + AddBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - AddBreakpointsResponseBuilder &operator=( - const AddBreakpointsResponseBuilder &); + AddBreakpointsResponseBuilder& operator=( + const AddBreakpointsResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); @@ -176,17 +176,17 @@ struct AddBreakpointsResponseBuilder { }; inline flatbuffers::Offset CreateAddBreakpointsResponse( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { AddBreakpointsResponseBuilder builder_(_fbb); return builder_.Finish(); } struct UpdateBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::Vector *breakpoints() const { - return GetPointer *>(4); + const flatbuffers::Vector* breakpoints() const { + return GetPointer*>(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* breakpoints */) && verifier.Verify(breakpoints()) && verifier.EndTable(); @@ -194,18 +194,18 @@ struct UpdateBreakpointsRequest FLATBUFFERS_FINAL_CLASS }; struct UpdateBreakpointsRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - void add_breakpoints(flatbuffers::Offset< - flatbuffers::Vector> breakpoints) { + void add_breakpoints( + flatbuffers::Offset> breakpoints) { fbb_.AddOffset(4, breakpoints); } - UpdateBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + UpdateBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - UpdateBreakpointsRequestBuilder &operator=( - const UpdateBreakpointsRequestBuilder &); + UpdateBreakpointsRequestBuilder& operator=( + const UpdateBreakpointsRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); @@ -215,8 +215,8 @@ struct UpdateBreakpointsRequestBuilder { inline flatbuffers::Offset CreateUpdateBreakpointsRequest( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> breakpoints = + flatbuffers::FlatBufferBuilder& _fbb, + flatbuffers::Offset> breakpoints = 0) { UpdateBreakpointsRequestBuilder builder_(_fbb); builder_.add_breakpoints(breakpoints); @@ -225,20 +225,20 @@ CreateUpdateBreakpointsRequest( struct UpdateBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct UpdateBreakpointsResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - UpdateBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + UpdateBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - UpdateBreakpointsResponseBuilder &operator=( - const UpdateBreakpointsResponseBuilder &); + UpdateBreakpointsResponseBuilder& operator=( + const UpdateBreakpointsResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset( fbb_.EndTable(start_, 0)); @@ -247,17 +247,17 @@ struct UpdateBreakpointsResponseBuilder { }; inline flatbuffers::Offset -CreateUpdateBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) { +CreateUpdateBreakpointsResponse(flatbuffers::FlatBufferBuilder& _fbb) { UpdateBreakpointsResponseBuilder builder_(_fbb); return builder_.Finish(); } struct RemoveBreakpointsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::Vector *breakpoints() const { - return GetPointer *>(4); + const flatbuffers::Vector* breakpoints() const { + return GetPointer*>(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* breakpoints */) && verifier.Verify(breakpoints()) && verifier.EndTable(); @@ -265,18 +265,18 @@ struct RemoveBreakpointsRequest FLATBUFFERS_FINAL_CLASS }; struct RemoveBreakpointsRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - void add_breakpoints(flatbuffers::Offset< - flatbuffers::Vector> breakpoints) { + void add_breakpoints( + flatbuffers::Offset> breakpoints) { fbb_.AddOffset(4, breakpoints); } - RemoveBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + RemoveBreakpointsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - RemoveBreakpointsRequestBuilder &operator=( - const RemoveBreakpointsRequestBuilder &); + RemoveBreakpointsRequestBuilder& operator=( + const RemoveBreakpointsRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); @@ -286,8 +286,8 @@ struct RemoveBreakpointsRequestBuilder { inline flatbuffers::Offset CreateRemoveBreakpointsRequest( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> breakpoints = + flatbuffers::FlatBufferBuilder& _fbb, + flatbuffers::Offset> breakpoints = 0) { RemoveBreakpointsRequestBuilder builder_(_fbb); builder_.add_breakpoints(breakpoints); @@ -296,20 +296,20 @@ CreateRemoveBreakpointsRequest( struct RemoveBreakpointsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct RemoveBreakpointsResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - RemoveBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + RemoveBreakpointsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - RemoveBreakpointsResponseBuilder &operator=( - const RemoveBreakpointsResponseBuilder &); + RemoveBreakpointsResponseBuilder& operator=( + const RemoveBreakpointsResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset( fbb_.EndTable(start_, 0)); @@ -318,7 +318,7 @@ struct RemoveBreakpointsResponseBuilder { }; inline flatbuffers::Offset -CreateRemoveBreakpointsResponse(flatbuffers::FlatBufferBuilder &_fbb) { +CreateRemoveBreakpointsResponse(flatbuffers::FlatBufferBuilder& _fbb) { RemoveBreakpointsResponseBuilder builder_(_fbb); return builder_.Finish(); } diff --git a/src/xenia/debug/proto/control_generated.h b/src/xenia/debug/proto/control_generated.h index fd6e9f975..26871018e 100644 --- a/src/xenia/debug/proto/control_generated.h +++ b/src/xenia/debug/proto/control_generated.h @@ -33,12 +33,12 @@ enum ContinueAction { ContinueAction_ContinueTo = 1 }; -inline const char **EnumNamesContinueAction() { - static const char *names[] = {"Continue", "ContinueTo", nullptr}; +inline const char** EnumNamesContinueAction() { + static const char* names[] = {"Continue", "ContinueTo", nullptr}; return names; } -inline const char *EnumNameContinueAction(ContinueAction e) { +inline const char* EnumNameContinueAction(ContinueAction e) { return EnumNamesContinueAction()[e]; } @@ -48,28 +48,28 @@ enum StepAction { StepAction_StepOut = 2 }; -inline const char **EnumNamesStepAction() { - static const char *names[] = {"StepIn", "StepOver", "StepOut", nullptr}; +inline const char** EnumNamesStepAction() { + static const char* names[] = {"StepIn", "StepOver", "StepOut", nullptr}; return names; } -inline const char *EnumNameStepAction(StepAction e) { +inline const char* EnumNameStepAction(StepAction e) { return EnumNamesStepAction()[e]; } struct StopRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct StopRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - StopRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + StopRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - StopRequestBuilder &operator=(const StopRequestBuilder &); + StopRequestBuilder& operator=(const StopRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -77,24 +77,24 @@ struct StopRequestBuilder { }; inline flatbuffers::Offset CreateStopRequest( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { StopRequestBuilder builder_(_fbb); return builder_.Finish(); } struct StopResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct StopResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - StopResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + StopResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - StopResponseBuilder &operator=(const StopResponseBuilder &); + StopResponseBuilder& operator=(const StopResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -102,24 +102,24 @@ struct StopResponseBuilder { }; inline flatbuffers::Offset CreateStopResponse( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { StopResponseBuilder builder_(_fbb); return builder_.Finish(); } struct BreakRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct BreakRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - BreakRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + BreakRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - BreakRequestBuilder &operator=(const BreakRequestBuilder &); + BreakRequestBuilder& operator=(const BreakRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -127,24 +127,24 @@ struct BreakRequestBuilder { }; inline flatbuffers::Offset CreateBreakRequest( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { BreakRequestBuilder builder_(_fbb); return builder_.Finish(); } struct BreakResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct BreakResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - BreakResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + BreakResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - BreakResponseBuilder &operator=(const BreakResponseBuilder &); + BreakResponseBuilder& operator=(const BreakResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -152,7 +152,7 @@ struct BreakResponseBuilder { }; inline flatbuffers::Offset CreateBreakResponse( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { BreakResponseBuilder builder_(_fbb); return builder_.Finish(); } @@ -162,7 +162,7 @@ struct ContinueRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { return static_cast(GetField(4, 0)); } uint32_t target_address() const { return GetField(6, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* action */) && VerifyField(verifier, 6 /* target_address */) && @@ -171,7 +171,7 @@ struct ContinueRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct ContinueRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_action(ContinueAction action) { fbb_.AddElement(4, static_cast(action), 0); @@ -179,10 +179,10 @@ struct ContinueRequestBuilder { void add_target_address(uint32_t target_address) { fbb_.AddElement(6, target_address, 0); } - ContinueRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + ContinueRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ContinueRequestBuilder &operator=(const ContinueRequestBuilder &); + ContinueRequestBuilder& operator=(const ContinueRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 2)); return o; @@ -190,7 +190,7 @@ struct ContinueRequestBuilder { }; inline flatbuffers::Offset CreateContinueRequest( - flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::FlatBufferBuilder& _fbb, ContinueAction action = ContinueAction_Continue, uint32_t target_address = 0) { ContinueRequestBuilder builder_(_fbb); @@ -200,18 +200,18 @@ inline flatbuffers::Offset CreateContinueRequest( } struct ContinueResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct ContinueResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - ContinueResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + ContinueResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ContinueResponseBuilder &operator=(const ContinueResponseBuilder &); + ContinueResponseBuilder& operator=(const ContinueResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -219,7 +219,7 @@ struct ContinueResponseBuilder { }; inline flatbuffers::Offset CreateContinueResponse( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { ContinueResponseBuilder builder_(_fbb); return builder_.Finish(); } @@ -229,7 +229,7 @@ struct StepRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { return static_cast(GetField(4, 0)); } uint32_t thread_id() const { return GetField(6, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* action */) && VerifyField(verifier, 6 /* thread_id */) && @@ -238,7 +238,7 @@ struct StepRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct StepRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_action(StepAction action) { fbb_.AddElement(4, static_cast(action), 0); @@ -246,10 +246,10 @@ struct StepRequestBuilder { void add_thread_id(uint32_t thread_id) { fbb_.AddElement(6, thread_id, 0); } - StepRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + StepRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - StepRequestBuilder &operator=(const StepRequestBuilder &); + StepRequestBuilder& operator=(const StepRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 2)); return o; @@ -257,7 +257,7 @@ struct StepRequestBuilder { }; inline flatbuffers::Offset CreateStepRequest( - flatbuffers::FlatBufferBuilder &_fbb, StepAction action = StepAction_StepIn, + flatbuffers::FlatBufferBuilder& _fbb, StepAction action = StepAction_StepIn, uint32_t thread_id = 0) { StepRequestBuilder builder_(_fbb); builder_.add_thread_id(thread_id); @@ -266,18 +266,18 @@ inline flatbuffers::Offset CreateStepRequest( } struct StepResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct StepResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - StepResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + StepResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - StepResponseBuilder &operator=(const StepResponseBuilder &); + StepResponseBuilder& operator=(const StepResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -285,7 +285,7 @@ struct StepResponseBuilder { }; inline flatbuffers::Offset CreateStepResponse( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { StepResponseBuilder builder_(_fbb); return builder_.Finish(); } @@ -293,7 +293,7 @@ inline flatbuffers::Offset CreateStepResponse( struct BreakpointEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { uint32_t thread_id() const { return GetField(4, 0); } uint32_t breakpoint_id() const { return GetField(6, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* thread_id */) && VerifyField(verifier, 6 /* breakpoint_id */) && @@ -302,7 +302,7 @@ struct BreakpointEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct BreakpointEventBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_thread_id(uint32_t thread_id) { fbb_.AddElement(4, thread_id, 0); @@ -310,10 +310,10 @@ struct BreakpointEventBuilder { void add_breakpoint_id(uint32_t breakpoint_id) { fbb_.AddElement(6, breakpoint_id, 0); } - BreakpointEventBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + BreakpointEventBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - BreakpointEventBuilder &operator=(const BreakpointEventBuilder &); + BreakpointEventBuilder& operator=(const BreakpointEventBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 2)); return o; @@ -321,7 +321,7 @@ struct BreakpointEventBuilder { }; inline flatbuffers::Offset CreateBreakpointEvent( - flatbuffers::FlatBufferBuilder &_fbb, uint32_t thread_id = 0, + flatbuffers::FlatBufferBuilder& _fbb, uint32_t thread_id = 0, uint32_t breakpoint_id = 0) { BreakpointEventBuilder builder_(_fbb); builder_.add_breakpoint_id(breakpoint_id); @@ -333,7 +333,7 @@ struct AccessViolationEvent FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { uint32_t thread_id() const { return GetField(4, 0); } uint32_t target_address() const { return GetField(6, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* thread_id */) && VerifyField(verifier, 6 /* target_address */) && @@ -342,7 +342,7 @@ struct AccessViolationEvent FLATBUFFERS_FINAL_CLASS }; struct AccessViolationEventBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_thread_id(uint32_t thread_id) { fbb_.AddElement(4, thread_id, 0); @@ -350,11 +350,11 @@ struct AccessViolationEventBuilder { void add_target_address(uint32_t target_address) { fbb_.AddElement(6, target_address, 0); } - AccessViolationEventBuilder(flatbuffers::FlatBufferBuilder &_fbb) + AccessViolationEventBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - AccessViolationEventBuilder &operator=(const AccessViolationEventBuilder &); + AccessViolationEventBuilder& operator=(const AccessViolationEventBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 2)); @@ -363,7 +363,7 @@ struct AccessViolationEventBuilder { }; inline flatbuffers::Offset CreateAccessViolationEvent( - flatbuffers::FlatBufferBuilder &_fbb, uint32_t thread_id = 0, + flatbuffers::FlatBufferBuilder& _fbb, uint32_t thread_id = 0, uint32_t target_address = 0) { AccessViolationEventBuilder builder_(_fbb); builder_.add_target_address(target_address); diff --git a/src/xenia/debug/proto/messages_generated.h b/src/xenia/debug/proto/messages_generated.h index e7c8d4546..105f70ba4 100644 --- a/src/xenia/debug/proto/messages_generated.h +++ b/src/xenia/debug/proto/messages_generated.h @@ -98,8 +98,8 @@ enum RequestData { RequestData_StepRequest = 14 }; -inline const char **EnumNamesRequestData() { - static const char *names[] = { +inline const char** EnumNamesRequestData() { + static const char* names[] = { "NONE", "AttachRequest", "ListBreakpointsRequest", "AddBreakpointsRequest", "UpdateBreakpointsRequest", "RemoveBreakpointsRequest", "ListModulesRequest", "GetModuleRequest", @@ -108,12 +108,12 @@ inline const char **EnumNamesRequestData() { return names; } -inline const char *EnumNameRequestData(RequestData e) { +inline const char* EnumNameRequestData(RequestData e) { return EnumNamesRequestData()[e]; } -inline bool VerifyRequestData(flatbuffers::Verifier &verifier, - const void *union_obj, RequestData type); +inline bool VerifyRequestData(flatbuffers::Verifier& verifier, + const void* union_obj, RequestData type); enum ResponseData { ResponseData_NONE = 0, @@ -135,8 +135,8 @@ enum ResponseData { ResponseData_AccessViolationEvent = 16 }; -inline const char **EnumNamesResponseData() { - static const char *names[] = { +inline const char** EnumNamesResponseData() { + static const char* names[] = { "NONE", "AttachResponse", "ListBreakpointsResponse", "AddBreakpointsResponse", "UpdateBreakpointsResponse", "RemoveBreakpointsResponse", "ListModulesResponse", "GetModuleResponse", @@ -146,26 +146,26 @@ inline const char **EnumNamesResponseData() { return names; } -inline const char *EnumNameResponseData(ResponseData e) { +inline const char* EnumNameResponseData(ResponseData e) { return EnumNamesResponseData()[e]; } -inline bool VerifyResponseData(flatbuffers::Verifier &verifier, - const void *union_obj, ResponseData type); +inline bool VerifyResponseData(flatbuffers::Verifier& verifier, + const void* union_obj, ResponseData type); struct AttachRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct AttachRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - AttachRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + AttachRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - AttachRequestBuilder &operator=(const AttachRequestBuilder &); + AttachRequestBuilder& operator=(const AttachRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -173,27 +173,27 @@ struct AttachRequestBuilder { }; inline flatbuffers::Offset CreateAttachRequest( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { AttachRequestBuilder builder_(_fbb); return builder_.Finish(); } struct AttachResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::String *memory_file() const { - return GetPointer(4); + const flatbuffers::String* memory_file() const { + return GetPointer(4); } - const flatbuffers::String *code_cache_file() const { - return GetPointer(6); + const flatbuffers::String* code_cache_file() const { + return GetPointer(6); } uint32_t code_cache_base() const { return GetField(8, 0); } uint32_t code_cache_size() const { return GetField(10, 0); } - const flatbuffers::String *functions_file() const { - return GetPointer(12); + const flatbuffers::String* functions_file() const { + return GetPointer(12); } - const flatbuffers::String *functions_trace_file() const { - return GetPointer(14); + const flatbuffers::String* functions_trace_file() const { + return GetPointer(14); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* memory_file */) && verifier.Verify(memory_file()) && @@ -212,7 +212,7 @@ struct AttachResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct AttachResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_memory_file(flatbuffers::Offset memory_file) { fbb_.AddOffset(4, memory_file); @@ -235,10 +235,10 @@ struct AttachResponseBuilder { flatbuffers::Offset functions_trace_file) { fbb_.AddOffset(14, functions_trace_file); } - AttachResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + AttachResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - AttachResponseBuilder &operator=(const AttachResponseBuilder &); + AttachResponseBuilder& operator=(const AttachResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 6)); return o; @@ -246,7 +246,7 @@ struct AttachResponseBuilder { }; inline flatbuffers::Offset CreateAttachResponse( - flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::FlatBufferBuilder& _fbb, flatbuffers::Offset memory_file = 0, flatbuffers::Offset code_cache_file = 0, uint32_t code_cache_base = 0, uint32_t code_cache_size = 0, @@ -267,8 +267,8 @@ struct Request FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { RequestData request_data_type() const { return static_cast(GetField(6, 0)); } - const void *request_data() const { return GetPointer(8); } - bool Verify(flatbuffers::Verifier &verifier) const { + const void* request_data() const { return GetPointer(8); } + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* id */) && VerifyField(verifier, 6 /* request_data_type */) && @@ -280,7 +280,7 @@ struct Request FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct RequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_id(uint32_t id) { fbb_.AddElement(4, id, 0); } void add_request_data_type(RequestData request_data_type) { @@ -289,10 +289,10 @@ struct RequestBuilder { void add_request_data(flatbuffers::Offset request_data) { fbb_.AddOffset(8, request_data); } - RequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + RequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - RequestBuilder &operator=(const RequestBuilder &); + RequestBuilder& operator=(const RequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 3)); return o; @@ -300,7 +300,7 @@ struct RequestBuilder { }; inline flatbuffers::Offset CreateRequest( - flatbuffers::FlatBufferBuilder &_fbb, uint32_t id = 0, + flatbuffers::FlatBufferBuilder& _fbb, uint32_t id = 0, RequestData request_data_type = RequestData_NONE, flatbuffers::Offset request_data = 0) { RequestBuilder builder_(_fbb); @@ -315,8 +315,8 @@ struct Response FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { ResponseData response_data_type() const { return static_cast(GetField(6, 0)); } - const void *response_data() const { return GetPointer(8); } - bool Verify(flatbuffers::Verifier &verifier) const { + const void* response_data() const { return GetPointer(8); } + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* id */) && VerifyField(verifier, 6 /* response_data_type */) && @@ -329,7 +329,7 @@ struct Response FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct ResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_id(uint32_t id) { fbb_.AddElement(4, id, 0); } void add_response_data_type(ResponseData response_data_type) { @@ -338,10 +338,10 @@ struct ResponseBuilder { void add_response_data(flatbuffers::Offset response_data) { fbb_.AddOffset(8, response_data); } - ResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + ResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ResponseBuilder &operator=(const ResponseBuilder &); + ResponseBuilder& operator=(const ResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 3)); return o; @@ -349,7 +349,7 @@ struct ResponseBuilder { }; inline flatbuffers::Offset CreateResponse( - flatbuffers::FlatBufferBuilder &_fbb, uint32_t id = 0, + flatbuffers::FlatBufferBuilder& _fbb, uint32_t id = 0, ResponseData response_data_type = ResponseData_NONE, flatbuffers::Offset response_data = 0) { ResponseBuilder builder_(_fbb); @@ -359,132 +359,132 @@ inline flatbuffers::Offset CreateResponse( return builder_.Finish(); } -inline bool VerifyRequestData(flatbuffers::Verifier &verifier, - const void *union_obj, RequestData type) { +inline bool VerifyRequestData(flatbuffers::Verifier& verifier, + const void* union_obj, RequestData type) { switch (type) { case RequestData_NONE: return true; case RequestData_AttachRequest: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); case RequestData_ListBreakpointsRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_AddBreakpointsRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_UpdateBreakpointsRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_RemoveBreakpointsRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_ListModulesRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_GetModuleRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_ListFunctionsRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_GetFunctionRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_ListThreadsRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_StopRequest: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); case RequestData_BreakRequest: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); case RequestData_ContinueRequest: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case RequestData_StepRequest: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); default: return false; } } -inline bool VerifyResponseData(flatbuffers::Verifier &verifier, - const void *union_obj, ResponseData type) { +inline bool VerifyResponseData(flatbuffers::Verifier& verifier, + const void* union_obj, ResponseData type) { switch (type) { case ResponseData_NONE: return true; case ResponseData_AttachResponse: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); case ResponseData_ListBreakpointsResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_AddBreakpointsResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_UpdateBreakpointsResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_RemoveBreakpointsResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_ListModulesResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_GetModuleResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_ListFunctionsResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_GetFunctionResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_ListThreadsResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_StopResponse: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); case ResponseData_BreakResponse: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); case ResponseData_ContinueResponse: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_StepResponse: return verifier.VerifyTable( - reinterpret_cast(union_obj)); + reinterpret_cast(union_obj)); case ResponseData_BreakpointEvent: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); case ResponseData_AccessViolationEvent: return verifier.VerifyTable( - reinterpret_cast( + reinterpret_cast( union_obj)); default: return false; diff --git a/src/xenia/debug/proto/modules_generated.h b/src/xenia/debug/proto/modules_generated.h index 3684a4a2e..dda192750 100644 --- a/src/xenia/debug/proto/modules_generated.h +++ b/src/xenia/debug/proto/modules_generated.h @@ -32,12 +32,12 @@ struct GetFunctionResponse; enum ModuleType { ModuleType_Kernel = 0, ModuleType_User = 1 }; -inline const char **EnumNamesModuleType() { - static const char *names[] = {"Kernel", "User", nullptr}; +inline const char** EnumNamesModuleType() { + static const char* names[] = {"Kernel", "User", nullptr}; return names; } -inline const char *EnumNameModuleType(ModuleType e) { +inline const char* EnumNameModuleType(ModuleType e) { return EnumNamesModuleType()[e]; } @@ -59,19 +59,19 @@ MANUALLY_ALIGNED_STRUCT(4) ListModuleEntry FLATBUFFERS_FINAL_CLASS { STRUCT_END(ListModuleEntry, 8); struct Module FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const xe::debug::proto::XObject *object() const { - return GetStruct(4); + const xe::debug::proto::XObject* object() const { + return GetStruct(4); } ModuleType type() const { return static_cast(GetField(6, 0)); } - const flatbuffers::String *name() const { - return GetPointer(8); + const flatbuffers::String* name() const { + return GetPointer(8); } - const flatbuffers::String *path() const { - return GetPointer(10); + const flatbuffers::String* path() const { + return GetPointer(10); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* object */) && VerifyField(verifier, 6 /* type */) && @@ -83,9 +83,9 @@ struct Module FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct ModuleBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - void add_object(const xe::debug::proto::XObject *object) { + void add_object(const xe::debug::proto::XObject* object) { fbb_.AddStruct(4, object); } void add_type(ModuleType type) { @@ -97,10 +97,10 @@ struct ModuleBuilder { void add_path(flatbuffers::Offset path) { fbb_.AddOffset(10, path); } - ModuleBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + ModuleBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ModuleBuilder &operator=(const ModuleBuilder &); + ModuleBuilder& operator=(const ModuleBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 4)); return o; @@ -108,8 +108,8 @@ struct ModuleBuilder { }; inline flatbuffers::Offset CreateModule( - flatbuffers::FlatBufferBuilder &_fbb, - const xe::debug::proto::XObject *object = 0, + flatbuffers::FlatBufferBuilder& _fbb, + const xe::debug::proto::XObject* object = 0, ModuleType type = ModuleType_Kernel, flatbuffers::Offset name = 0, flatbuffers::Offset path = 0) { @@ -122,18 +122,18 @@ inline flatbuffers::Offset CreateModule( } struct ListModulesRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct ListModulesRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - ListModulesRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + ListModulesRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListModulesRequestBuilder &operator=(const ListModulesRequestBuilder &); + ListModulesRequestBuilder& operator=(const ListModulesRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -141,17 +141,17 @@ struct ListModulesRequestBuilder { }; inline flatbuffers::Offset CreateListModulesRequest( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { ListModulesRequestBuilder builder_(_fbb); return builder_.Finish(); } struct ListModulesResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::Vector *entry() const { - return GetPointer *>(4); + const flatbuffers::Vector* entry() const { + return GetPointer*>(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* entry */) && verifier.Verify(entry()) && verifier.EndTable(); @@ -159,17 +159,17 @@ struct ListModulesResponse FLATBUFFERS_FINAL_CLASS }; struct ListModulesResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_entry( - flatbuffers::Offset> entry) { + flatbuffers::Offset> entry) { fbb_.AddOffset(4, entry); } - ListModulesResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + ListModulesResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListModulesResponseBuilder &operator=(const ListModulesResponseBuilder &); + ListModulesResponseBuilder& operator=(const ListModulesResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); return o; @@ -177,8 +177,8 @@ struct ListModulesResponseBuilder { }; inline flatbuffers::Offset CreateListModulesResponse( - flatbuffers::FlatBufferBuilder &_fbb, - flatbuffers::Offset> entry = + flatbuffers::FlatBufferBuilder& _fbb, + flatbuffers::Offset> entry = 0) { ListModulesResponseBuilder builder_(_fbb); builder_.add_entry(entry); @@ -187,7 +187,7 @@ inline flatbuffers::Offset CreateListModulesResponse( struct GetModuleRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { uint32_t module_id() const { return GetField(4, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* module_id */) && verifier.EndTable(); @@ -195,15 +195,15 @@ struct GetModuleRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct GetModuleRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_module_id(uint32_t module_id) { fbb_.AddElement(4, module_id, 0); } - GetModuleRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + GetModuleRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - GetModuleRequestBuilder &operator=(const GetModuleRequestBuilder &); + GetModuleRequestBuilder& operator=(const GetModuleRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); return o; @@ -211,15 +211,15 @@ struct GetModuleRequestBuilder { }; inline flatbuffers::Offset CreateGetModuleRequest( - flatbuffers::FlatBufferBuilder &_fbb, uint32_t module_id = 0) { + flatbuffers::FlatBufferBuilder& _fbb, uint32_t module_id = 0) { GetModuleRequestBuilder builder_(_fbb); builder_.add_module_id(module_id); return builder_.Finish(); } struct GetModuleResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const Module *module() const { return GetPointer(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + const Module* module() const { return GetPointer(4); } + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* module */) && verifier.VerifyTable(module()) && verifier.EndTable(); @@ -227,15 +227,15 @@ struct GetModuleResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct GetModuleResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_module(flatbuffers::Offset module) { fbb_.AddOffset(4, module); } - GetModuleResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + GetModuleResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - GetModuleResponseBuilder &operator=(const GetModuleResponseBuilder &); + GetModuleResponseBuilder& operator=(const GetModuleResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); return o; @@ -243,7 +243,7 @@ struct GetModuleResponseBuilder { }; inline flatbuffers::Offset CreateGetModuleResponse( - flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::FlatBufferBuilder& _fbb, flatbuffers::Offset module = 0) { GetModuleResponseBuilder builder_(_fbb); builder_.add_module(module); @@ -254,10 +254,10 @@ struct FunctionEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { uint64_t identifier() const { return GetField(4, 0); } uint32_t address_start() const { return GetField(6, 0); } uint32_t address_end() const { return GetField(8, 0); } - const flatbuffers::String *name() const { - return GetPointer(10); + const flatbuffers::String* name() const { + return GetPointer(10); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* identifier */) && VerifyField(verifier, 6 /* address_start */) && @@ -268,7 +268,7 @@ struct FunctionEntry FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct FunctionEntryBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_identifier(uint64_t identifier) { fbb_.AddElement(4, identifier, 0); @@ -282,10 +282,10 @@ struct FunctionEntryBuilder { void add_name(flatbuffers::Offset name) { fbb_.AddOffset(10, name); } - FunctionEntryBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + FunctionEntryBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - FunctionEntryBuilder &operator=(const FunctionEntryBuilder &); + FunctionEntryBuilder& operator=(const FunctionEntryBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 4)); return o; @@ -293,7 +293,7 @@ struct FunctionEntryBuilder { }; inline flatbuffers::Offset CreateFunctionEntry( - flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0, + flatbuffers::FlatBufferBuilder& _fbb, uint64_t identifier = 0, uint32_t address_start = 0, uint32_t address_end = 0, flatbuffers::Offset name = 0) { FunctionEntryBuilder builder_(_fbb); @@ -308,18 +308,18 @@ struct Function FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { uint64_t identifier() const { return GetField(4, 0); } uint32_t address_start() const { return GetField(6, 0); } uint32_t address_end() const { return GetField(8, 0); } - const flatbuffers::String *name() const { - return GetPointer(10); + const flatbuffers::String* name() const { + return GetPointer(10); } uint32_t machine_code_start() const { return GetField(12, 0); } uint32_t machine_code_end() const { return GetField(14, 0); } - const flatbuffers::String *disasm_hir_raw() const { - return GetPointer(16); + const flatbuffers::String* disasm_hir_raw() const { + return GetPointer(16); } - const flatbuffers::String *disasm_hir_opt() const { - return GetPointer(18); + const flatbuffers::String* disasm_hir_opt() const { + return GetPointer(18); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* identifier */) && VerifyField(verifier, 6 /* address_start */) && @@ -338,7 +338,7 @@ struct Function FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct FunctionBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_identifier(uint64_t identifier) { fbb_.AddElement(4, identifier, 0); @@ -366,10 +366,10 @@ struct FunctionBuilder { flatbuffers::Offset disasm_hir_opt) { fbb_.AddOffset(18, disasm_hir_opt); } - FunctionBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + FunctionBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - FunctionBuilder &operator=(const FunctionBuilder &); + FunctionBuilder& operator=(const FunctionBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 8)); return o; @@ -377,7 +377,7 @@ struct FunctionBuilder { }; inline flatbuffers::Offset CreateFunction( - flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0, + flatbuffers::FlatBufferBuilder& _fbb, uint64_t identifier = 0, uint32_t address_start = 0, uint32_t address_end = 0, flatbuffers::Offset name = 0, uint32_t machine_code_start = 0, uint32_t machine_code_end = 0, @@ -400,7 +400,7 @@ struct ListFunctionsRequest FLATBUFFERS_FINAL_CLASS uint32_t module_id() const { return GetField(4, 0); } uint32_t function_index_start() const { return GetField(6, 0); } uint32_t function_index_end() const { return GetField(8, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* module_id */) && VerifyField(verifier, 6 /* function_index_start */) && @@ -410,7 +410,7 @@ struct ListFunctionsRequest FLATBUFFERS_FINAL_CLASS }; struct ListFunctionsRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_module_id(uint32_t module_id) { fbb_.AddElement(4, module_id, 0); @@ -421,11 +421,11 @@ struct ListFunctionsRequestBuilder { void add_function_index_end(uint32_t function_index_end) { fbb_.AddElement(8, function_index_end, 0); } - ListFunctionsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) + ListFunctionsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListFunctionsRequestBuilder &operator=(const ListFunctionsRequestBuilder &); + ListFunctionsRequestBuilder& operator=(const ListFunctionsRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 3)); @@ -434,7 +434,7 @@ struct ListFunctionsRequestBuilder { }; inline flatbuffers::Offset CreateListFunctionsRequest( - flatbuffers::FlatBufferBuilder &_fbb, uint32_t module_id = 0, + flatbuffers::FlatBufferBuilder& _fbb, uint32_t module_id = 0, uint32_t function_index_start = 0, uint32_t function_index_end = 0) { ListFunctionsRequestBuilder builder_(_fbb); builder_.add_function_index_end(function_index_end); @@ -445,11 +445,11 @@ inline flatbuffers::Offset CreateListFunctionsRequest( struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::Vector> *entry() const { + const flatbuffers::Vector>* entry() const { return GetPointer< - const flatbuffers::Vector> *>(4); + const flatbuffers::Vector>*>(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* entry */) && verifier.Verify(entry()) && verifier.VerifyVectorOfTables(entry()) && @@ -458,17 +458,17 @@ struct ListFunctionsResponse FLATBUFFERS_FINAL_CLASS }; struct ListFunctionsResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_entry(flatbuffers::Offset< flatbuffers::Vector>> entry) { fbb_.AddOffset(4, entry); } - ListFunctionsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + ListFunctionsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListFunctionsResponseBuilder &operator=(const ListFunctionsResponseBuilder &); + ListFunctionsResponseBuilder& operator=(const ListFunctionsResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); @@ -477,7 +477,7 @@ struct ListFunctionsResponseBuilder { }; inline flatbuffers::Offset CreateListFunctionsResponse( - flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::FlatBufferBuilder& _fbb, flatbuffers::Offset>> entry = 0) { ListFunctionsResponseBuilder builder_(_fbb); @@ -487,7 +487,7 @@ inline flatbuffers::Offset CreateListFunctionsResponse( struct GetFunctionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { uint64_t identifier() const { return GetField(4, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* identifier */) && verifier.EndTable(); @@ -495,15 +495,15 @@ struct GetFunctionRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct GetFunctionRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_identifier(uint64_t identifier) { fbb_.AddElement(4, identifier, 0); } - GetFunctionRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + GetFunctionRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - GetFunctionRequestBuilder &operator=(const GetFunctionRequestBuilder &); + GetFunctionRequestBuilder& operator=(const GetFunctionRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); return o; @@ -511,7 +511,7 @@ struct GetFunctionRequestBuilder { }; inline flatbuffers::Offset CreateGetFunctionRequest( - flatbuffers::FlatBufferBuilder &_fbb, uint64_t identifier = 0) { + flatbuffers::FlatBufferBuilder& _fbb, uint64_t identifier = 0) { GetFunctionRequestBuilder builder_(_fbb); builder_.add_identifier(identifier); return builder_.Finish(); @@ -519,8 +519,8 @@ inline flatbuffers::Offset CreateGetFunctionRequest( struct GetFunctionResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const Function *function() const { return GetPointer(4); } - bool Verify(flatbuffers::Verifier &verifier) const { + const Function* function() const { return GetPointer(4); } + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* function */) && verifier.VerifyTable(function()) && verifier.EndTable(); @@ -528,16 +528,16 @@ struct GetFunctionResponse FLATBUFFERS_FINAL_CLASS }; struct GetFunctionResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_function(flatbuffers::Offset function) { fbb_.AddOffset(4, function); } - GetFunctionResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + GetFunctionResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - GetFunctionResponseBuilder &operator=(const GetFunctionResponseBuilder &); + GetFunctionResponseBuilder& operator=(const GetFunctionResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); return o; @@ -545,7 +545,7 @@ struct GetFunctionResponseBuilder { }; inline flatbuffers::Offset CreateGetFunctionResponse( - flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::FlatBufferBuilder& _fbb, flatbuffers::Offset function = 0) { GetFunctionResponseBuilder builder_(_fbb); builder_.add_function(function); diff --git a/src/xenia/debug/proto/threads_generated.h b/src/xenia/debug/proto/threads_generated.h index 634004b17..0396441e1 100644 --- a/src/xenia/debug/proto/threads_generated.h +++ b/src/xenia/debug/proto/threads_generated.h @@ -23,18 +23,18 @@ struct ListThreadsResponse; enum ThreadType { ThreadType_Kernel = 0, ThreadType_User = 1 }; -inline const char **EnumNamesThreadType() { - static const char *names[] = {"Kernel", "User", nullptr}; +inline const char** EnumNamesThreadType() { + static const char* names[] = {"Kernel", "User", nullptr}; return names; } -inline const char *EnumNameThreadType(ThreadType e) { +inline const char* EnumNameThreadType(ThreadType e) { return EnumNamesThreadType()[e]; } struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const xe::debug::proto::XObject *object() const { - return GetStruct(4); + const xe::debug::proto::XObject* object() const { + return GetStruct(4); } ThreadType type() const { return static_cast(GetField(6, 0)); @@ -48,13 +48,13 @@ struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { uint32_t pcr_address() const { return GetField(20, 0); } uint32_t thread_state_address() const { return GetField(22, 0); } uint32_t thread_id() const { return GetField(24, 0); } - const flatbuffers::String *name() const { - return GetPointer(26); + const flatbuffers::String* name() const { + return GetPointer(26); } uint32_t priority() const { return GetField(28, 0); } uint32_t affinity() const { return GetField(30, 0); } uint32_t state() const { return GetField(32, 0); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* object */) && VerifyField(verifier, 6 /* type */) && @@ -77,9 +77,9 @@ struct Thread FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { }; struct ThreadBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - void add_object(const xe::debug::proto::XObject *object) { + void add_object(const xe::debug::proto::XObject* object) { fbb_.AddStruct(4, object); } void add_type(ThreadType type) { @@ -122,10 +122,10 @@ struct ThreadBuilder { fbb_.AddElement(30, affinity, 0); } void add_state(uint32_t state) { fbb_.AddElement(32, state, 0); } - ThreadBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + ThreadBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ThreadBuilder &operator=(const ThreadBuilder &); + ThreadBuilder& operator=(const ThreadBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 15)); return o; @@ -133,8 +133,8 @@ struct ThreadBuilder { }; inline flatbuffers::Offset CreateThread( - flatbuffers::FlatBufferBuilder &_fbb, - const xe::debug::proto::XObject *object = 0, + flatbuffers::FlatBufferBuilder& _fbb, + const xe::debug::proto::XObject* object = 0, ThreadType type = ThreadType_Kernel, uint32_t stack_size = 0, uint32_t xapi_thread_startup = 0, uint32_t start_address = 0, uint32_t start_context = 0, uint32_t creation_flags = 0, @@ -162,18 +162,18 @@ inline flatbuffers::Offset CreateThread( } struct ListThreadsRequest FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && verifier.EndTable(); } }; struct ListThreadsRequestBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; - ListThreadsRequestBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { + ListThreadsRequestBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListThreadsRequestBuilder &operator=(const ListThreadsRequestBuilder &); + ListThreadsRequestBuilder& operator=(const ListThreadsRequestBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 0)); return o; @@ -181,18 +181,18 @@ struct ListThreadsRequestBuilder { }; inline flatbuffers::Offset CreateListThreadsRequest( - flatbuffers::FlatBufferBuilder &_fbb) { + flatbuffers::FlatBufferBuilder& _fbb) { ListThreadsRequestBuilder builder_(_fbb); return builder_.Finish(); } struct ListThreadsResponse FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - const flatbuffers::Vector> *thread() const { - return GetPointer> *>( + const flatbuffers::Vector>* thread() const { + return GetPointer>*>( 4); } - bool Verify(flatbuffers::Verifier &verifier) const { + bool Verify(flatbuffers::Verifier& verifier) const { return VerifyTableStart(verifier) && VerifyField(verifier, 4 /* thread */) && verifier.Verify(thread()) && @@ -201,17 +201,17 @@ struct ListThreadsResponse FLATBUFFERS_FINAL_CLASS }; struct ListThreadsResponseBuilder { - flatbuffers::FlatBufferBuilder &fbb_; + flatbuffers::FlatBufferBuilder& fbb_; flatbuffers::uoffset_t start_; void add_thread(flatbuffers::Offset< flatbuffers::Vector>> thread) { fbb_.AddOffset(4, thread); } - ListThreadsResponseBuilder(flatbuffers::FlatBufferBuilder &_fbb) + ListThreadsResponseBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } - ListThreadsResponseBuilder &operator=(const ListThreadsResponseBuilder &); + ListThreadsResponseBuilder& operator=(const ListThreadsResponseBuilder&); flatbuffers::Offset Finish() { auto o = flatbuffers::Offset(fbb_.EndTable(start_, 1)); return o; @@ -219,7 +219,7 @@ struct ListThreadsResponseBuilder { }; inline flatbuffers::Offset CreateListThreadsResponse( - flatbuffers::FlatBufferBuilder &_fbb, + flatbuffers::FlatBufferBuilder& _fbb, flatbuffers::Offset>> thread = 0) { ListThreadsResponseBuilder builder_(_fbb); diff --git a/src/xenia/kernel/util/xex2.cc b/src/xenia/kernel/util/xex2.cc index b7c8c13ce..238ecb64d 100644 --- a/src/xenia/kernel/util/xex2.cc +++ b/src/xenia/kernel/util/xex2.cc @@ -29,7 +29,7 @@ namespace xe { namespace kernel { -uint32_t xex2_get_header_size(const xex2_header *header) { +uint32_t xex2_get_header_size(const xex2_header* header) { return header->exe_offset; } } // namespace kernel @@ -48,41 +48,40 @@ uint32_t xex2_get_header_size(const xex2_header *header) { DEFINE_bool(xex_dev_key, false, "Use the devkit key."); typedef struct xe_xex2 { - xe::Memory *memory; + xe::Memory* memory; xe_xex2_header_t header; - std::vector *sections; + std::vector* sections; struct { size_t count; - xe_xex2_import_info_t *infos; + xe_xex2_import_info_t* infos; } library_imports[16]; } xe_xex2_t; -int xe_xex2_read_header(const uint8_t *addr, const size_t length, - xe_xex2_header_t *header); -int xe_xex2_decrypt_key(xe_xex2_header_t *header); -int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t *xex_addr, - const uint32_t xex_length, xe::Memory *memory); +int xe_xex2_read_header(const uint8_t* addr, const size_t length, + xe_xex2_header_t* header); +int xe_xex2_decrypt_key(xe_xex2_header_t* header); +int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t* xex_addr, + const uint32_t xex_length, xe::Memory* memory); int xe_xex2_load_pe(xe_xex2_ref xex); int xe_xex2_find_import_infos(xe_xex2_ref xex, - const xe_xex2_import_library_t *library); + const xe_xex2_import_library_t* library); -xe_xex2_ref xe_xex2_load(xe::Memory *memory, const void *addr, +xe_xex2_ref xe_xex2_load(xe::Memory* memory, const void* addr, const size_t length, xe_xex2_options_t options) { xe_xex2_ref xex = (xe_xex2_ref)calloc(1, sizeof(xe_xex2)); xex->memory = memory; - xex->sections = new std::vector(); + xex->sections = new std::vector(); - XEEXPECTZERO( - xe_xex2_read_header((const uint8_t *)addr, length, &xex->header)); + XEEXPECTZERO(xe_xex2_read_header((const uint8_t*)addr, length, &xex->header)); XEEXPECTZERO(xe_xex2_decrypt_key(&xex->header)); XEEXPECTZERO( - xe_xex2_read_image(xex, (const uint8_t *)addr, uint32_t(length), memory)); + xe_xex2_read_image(xex, (const uint8_t*)addr, uint32_t(length), memory)); XEEXPECTZERO(xe_xex2_load_pe(xex)); @@ -103,35 +102,35 @@ void xe_xex2_dealloc(xe_xex2_ref xex) { return; } - for (std::vector::iterator it = xex->sections->begin(); + for (std::vector::iterator it = xex->sections->begin(); it != xex->sections->end(); ++it) { delete *it; } - xe_xex2_header_t *header = &xex->header; + xe_xex2_header_t* header = &xex->header; free(header->sections); free(header->resource_infos); if (header->file_format_info.compression_type == XEX_COMPRESSION_BASIC) { free(header->file_format_info.compression_info.basic.blocks); } for (size_t n = 0; n < header->import_library_count; n++) { - xe_xex2_import_library_t *library = &header->import_libraries[n]; + xe_xex2_import_library_t* library = &header->import_libraries[n]; free(library->records); } xex->memory = NULL; } -const xe_xex2_header_t *xe_xex2_get_header(xe_xex2_ref xex) { +const xe_xex2_header_t* xe_xex2_get_header(xe_xex2_ref xex) { return &xex->header; } -int xe_xex2_read_header(const uint8_t *addr, const size_t length, - xe_xex2_header_t *header) { - const uint8_t *p = addr; - const uint8_t *pc; - const uint8_t *ps; - xe_xex2_loader_info_t *ldr; +int xe_xex2_read_header(const uint8_t* addr, const size_t length, + xe_xex2_header_t* header) { + const uint8_t* p = addr; + const uint8_t* pc; + const uint8_t* ps; + xe_xex2_loader_info_t* ldr; header->xex2 = xe::load_and_swap(p + 0x00); if (header->xex2 != 'XEX2') { @@ -146,11 +145,11 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, header->header_count = xe::load_and_swap(p + 0x14); for (size_t n = 0; n < header->header_count; n++) { - const uint8_t *ph = p + 0x18 + (n * 8); + const uint8_t* ph = p + 0x18 + (n * 8); const uint32_t key = xe::load_and_swap(ph + 0x00); const uint32_t data_offset = xe::load_and_swap(ph + 0x04); - xe_xex2_opt_header_t *opt_header = &header->headers[n]; + xe_xex2_opt_header_t* opt_header = &header->headers[n]; opt_header->key = key; switch (key & 0xFF) { case 0x01: @@ -170,18 +169,18 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, break; } - const uint8_t *pp = p + opt_header->offset; + const uint8_t* pp = p + opt_header->offset; switch (opt_header->key) { case XEX_HEADER_SYSTEM_FLAGS: header->system_flags = (xe_xex2_system_flags)data_offset; break; case XEX_HEADER_RESOURCE_INFO: { header->resource_info_count = (opt_header->length - 4) / 16; - header->resource_infos = (xe_xex2_resource_info_t *)calloc( + header->resource_infos = (xe_xex2_resource_info_t*)calloc( header->resource_info_count, sizeof(xe_xex2_resource_info_t)); - const uint8_t *phi = pp + 0x04; + const uint8_t* phi = pp + 0x04; for (size_t m = 0; m < header->resource_info_count; m++) { - auto &res = header->resource_infos[m]; + auto& res = header->resource_infos[m]; memcpy(res.name, phi + 0x00, 8); res.address = xe::load_and_swap(phi + 0x08); res.size = xe::load_and_swap(phi + 0x0C); @@ -189,7 +188,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, } } break; case XEX_HEADER_EXECUTION_INFO: { - xe_xex2_execution_info_t *ex = &header->execution_info; + xe_xex2_execution_info_t* ex = &header->execution_info; ex->media_id = xe::load_and_swap(pp + 0x00); ex->version.value = xe::load_and_swap(pp + 0x04); ex->base_version.value = xe::load_and_swap(pp + 0x08); @@ -201,7 +200,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, ex->savegame_id = xe::load_and_swap(pp + 0x14); } break; case XEX_HEADER_GAME_RATINGS: { - xe_xex2_game_ratings_t *ratings = &header->game_ratings; + xe_xex2_game_ratings_t* ratings = &header->game_ratings; ratings->esrb = (xe_xex2_rating_esrb_value)xe::load_and_swap(pp + 0x00); ratings->pegi = @@ -228,7 +227,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, (xe_xex2_rating_fpb_value)xe::load_and_swap(pp + 0x0B); } break; case XEX_HEADER_TLS_INFO: { - xe_xex2_tls_info_t *tls = &header->tls_info; + xe_xex2_tls_info_t* tls = &header->tls_info; tls->slot_count = xe::load_and_swap(pp + 0x00); tls->raw_data_address = xe::load_and_swap(pp + 0x04); tls->data_size = xe::load_and_swap(pp + 0x08); @@ -263,11 +262,11 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, header->import_library_count = count; uint32_t string_table_size = xe::load_and_swap(pp + 0x04); - const char *string_table = (const char *)(pp + 0x0C); + const char* string_table = (const char*)(pp + 0x0C); pp += 12 + string_table_size; for (size_t m = 0; m < count; m++) { - xe_xex2_import_library_t *library = &header->import_libraries[m]; + xe_xex2_import_library_t* library = &header->import_libraries[m]; memcpy(library->digest, pp + 0x04, 20); library->import_id = xe::load_and_swap(pp + 0x18); library->version.value = xe::load_and_swap(pp + 0x1C); @@ -295,7 +294,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, library->record_count = xe::load_and_swap(pp + 0x26); library->records = - (uint32_t *)calloc(library->record_count, sizeof(uint32_t)); + (uint32_t*)calloc(library->record_count, sizeof(uint32_t)); XEEXPECTNOTNULL(library->records); pp += 0x28; for (size_t i = 0; i < library->record_count; i++) { @@ -316,7 +315,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, header->static_library_count = count; pp += 4; for (size_t m = 0; m < count; m++) { - xe_xex2_static_library_t *library = &header->static_libraries[m]; + xe_xex2_static_library_t* library = &header->static_libraries[m]; memcpy(library->name, pp + 0x00, 8); library->name[8] = 0; library->major = xe::load_and_swap(pp + 0x08); @@ -329,7 +328,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, } } break; case XEX_HEADER_FILE_FORMAT_INFO: { - xe_xex2_file_format_info_t *fmt = &header->file_format_info; + xe_xex2_file_format_info_t* fmt = &header->file_format_info; fmt->encryption_type = (xe_xex2_encryption_type)xe::load_and_swap(pp + 0x04); fmt->compression_type = @@ -340,17 +339,16 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, assert_always(); break; case XEX_COMPRESSION_BASIC: { - xe_xex2_file_basic_compression_info_t *comp_info = + xe_xex2_file_basic_compression_info_t* comp_info = &fmt->compression_info.basic; uint32_t info_size = xe::load_and_swap(pp + 0x00); comp_info->block_count = (info_size - 8) / 8; - comp_info->blocks = - (xe_xex2_file_basic_compression_block_t *)calloc( - comp_info->block_count, - sizeof(xe_xex2_file_basic_compression_block_t)); + comp_info->blocks = (xe_xex2_file_basic_compression_block_t*)calloc( + comp_info->block_count, + sizeof(xe_xex2_file_basic_compression_block_t)); XEEXPECTNOTNULL(comp_info->blocks); for (size_t m = 0; m < comp_info->block_count; m++) { - xe_xex2_file_basic_compression_block_t *block = + xe_xex2_file_basic_compression_block_t* block = &comp_info->blocks[m]; block->data_size = xe::load_and_swap(pp + 0x08 + (m * 8)); @@ -359,7 +357,7 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, } } break; case XEX_COMPRESSION_NORMAL: { - xe_xex2_file_normal_compression_info_t *comp_info = + xe_xex2_file_normal_compression_info_t* comp_info = &fmt->compression_info.normal; uint32_t window_size = xe::load_and_swap(pp + 0x08); uint32_t window_bits = 0; @@ -409,11 +407,11 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length, ps = p + header->certificate_offset + 0x180; header->section_count = xe::load_and_swap(ps + 0x000); ps += 4; - header->sections = (xe_xex2_section_t *)calloc(header->section_count, - sizeof(xe_xex2_section_t)); + header->sections = (xe_xex2_section_t*)calloc(header->section_count, + sizeof(xe_xex2_section_t)); XEEXPECTNOTNULL(header->sections); for (size_t n = 0; n < header->section_count; n++) { - xe_xex2_section_t *section = &header->sections[n]; + xe_xex2_section_t* section = &header->sections[n]; section->page_size = header->exe_address <= 0x90000000 ? 64 * 1024 : 4 * 1024; section->info.value = xe::load_and_swap(ps); @@ -428,7 +426,7 @@ XECLEANUP: return 1; } -int xe_xex2_decrypt_key(xe_xex2_header_t *header) { +int xe_xex2_decrypt_key(xe_xex2_header_t* header) { const static uint8_t xe_xex2_retail_key[16] = { 0x20, 0xB1, 0x85, 0xA5, 0x9D, 0x28, 0xFD, 0xC3, 0x40, 0x58, 0x3F, 0xBB, 0x08, 0x96, 0xBF, 0x91}; @@ -438,7 +436,7 @@ int xe_xex2_decrypt_key(xe_xex2_header_t *header) { // Guess key based on file info. // TODO: better way to finding out which key to use? - const uint8_t *xexkey; + const uint8_t* xexkey; if (header->execution_info.title_id && !FLAGS_xex_dev_key) { xexkey = xe_xex2_retail_key; } else { @@ -455,18 +453,18 @@ int xe_xex2_decrypt_key(xe_xex2_header_t *header) { typedef struct mspack_memory_file_t { struct mspack_system sys; - void *buffer; + void* buffer; off_t buffer_size; off_t offset; } mspack_memory_file; -mspack_memory_file *mspack_memory_open(struct mspack_system *sys, void *buffer, +mspack_memory_file* mspack_memory_open(struct mspack_system* sys, void* buffer, const size_t buffer_size) { assert_true(buffer_size < INT_MAX); if (buffer_size >= INT_MAX) { return NULL; } - mspack_memory_file *memfile = - (mspack_memory_file *)calloc(1, sizeof(mspack_memory_file)); + mspack_memory_file* memfile = + (mspack_memory_file*)calloc(1, sizeof(mspack_memory_file)); if (!memfile) { return NULL; } @@ -475,36 +473,36 @@ mspack_memory_file *mspack_memory_open(struct mspack_system *sys, void *buffer, memfile->offset = 0; return memfile; } -void mspack_memory_close(mspack_memory_file *file) { - mspack_memory_file *memfile = (mspack_memory_file *)file; +void mspack_memory_close(mspack_memory_file* file) { + mspack_memory_file* memfile = (mspack_memory_file*)file; free(memfile); } -int mspack_memory_read(struct mspack_file *file, void *buffer, int chars) { - mspack_memory_file *memfile = (mspack_memory_file *)file; +int mspack_memory_read(struct mspack_file* file, void* buffer, int chars) { + mspack_memory_file* memfile = (mspack_memory_file*)file; const off_t remaining = memfile->buffer_size - memfile->offset; const off_t total = std::min(static_cast(chars), remaining); - memcpy(buffer, (uint8_t *)memfile->buffer + memfile->offset, total); + memcpy(buffer, (uint8_t*)memfile->buffer + memfile->offset, total); memfile->offset += total; return (int)total; } -int mspack_memory_write(struct mspack_file *file, void *buffer, int chars) { - mspack_memory_file *memfile = (mspack_memory_file *)file; +int mspack_memory_write(struct mspack_file* file, void* buffer, int chars) { + mspack_memory_file* memfile = (mspack_memory_file*)file; const off_t remaining = memfile->buffer_size - memfile->offset; const off_t total = std::min(static_cast(chars), remaining); - memcpy((uint8_t *)memfile->buffer + memfile->offset, buffer, total); + memcpy((uint8_t*)memfile->buffer + memfile->offset, buffer, total); memfile->offset += total; return (int)total; } -void *mspack_memory_alloc(struct mspack_system *sys, size_t chars) { +void* mspack_memory_alloc(struct mspack_system* sys, size_t chars) { return calloc(chars, 1); } -void mspack_memory_free(void *ptr) { free(ptr); } -void mspack_memory_copy(void *src, void *dest, size_t chars) { +void mspack_memory_free(void* ptr) { free(ptr); } +void mspack_memory_copy(void* src, void* dest, size_t chars) { memcpy(dest, src, chars); } -struct mspack_system *mspack_memory_sys_create() { - struct mspack_system *sys = - (struct mspack_system *)calloc(1, sizeof(struct mspack_system)); +struct mspack_system* mspack_memory_sys_create() { + struct mspack_system* sys = + (struct mspack_system*)calloc(1, sizeof(struct mspack_system)); if (!sys) { return NULL; } @@ -515,17 +513,17 @@ struct mspack_system *mspack_memory_sys_create() { sys->copy = mspack_memory_copy; return sys; } -void mspack_memory_sys_destroy(struct mspack_system *sys) { free(sys); } +void mspack_memory_sys_destroy(struct mspack_system* sys) { free(sys); } -void xe_xex2_decrypt_buffer(const uint8_t *session_key, - const uint8_t *input_buffer, - const size_t input_size, uint8_t *output_buffer, +void xe_xex2_decrypt_buffer(const uint8_t* session_key, + const uint8_t* input_buffer, + const size_t input_size, uint8_t* output_buffer, const size_t output_size) { uint32_t rk[4 * (MAXNR + 1)]; uint8_t ivec[16] = {0}; int32_t Nr = rijndaelKeySetupDec(rk, session_key, 128); - const uint8_t *ct = input_buffer; - uint8_t *pt = output_buffer; + const uint8_t* ct = input_buffer; + uint8_t* pt = output_buffer; for (size_t n = 0; n < input_size; n += 16, ct += 16, pt += 16) { // Decrypt 16 uint8_ts from input -> output. rijndaelDecrypt(rk, Nr, ct, pt); @@ -538,10 +536,10 @@ void xe_xex2_decrypt_buffer(const uint8_t *session_key, } } -int xe_xex2_read_image_uncompressed(const xe_xex2_header_t *header, - const uint8_t *xex_addr, +int xe_xex2_read_image_uncompressed(const xe_xex2_header_t* header, + const uint8_t* xex_addr, const uint32_t xex_length, - xe::Memory *memory) { + xe::Memory* memory) { // Allocate in-place the XEX memory. const uint32_t exe_length = xex_length - header->exe_offset; uint32_t uncompressed_size = exe_length; @@ -556,10 +554,10 @@ int xe_xex2_read_image_uncompressed(const xe_xex2_header_t *header, uncompressed_size); return 2; } - uint8_t *buffer = memory->TranslateVirtual(header->exe_address); + uint8_t* buffer = memory->TranslateVirtual(header->exe_address); std::memset(buffer, 0, uncompressed_size); - const uint8_t *p = (const uint8_t *)xex_addr + header->exe_offset; + const uint8_t* p = (const uint8_t*)xex_addr + header->exe_offset; switch (header->file_format_info.encryption_type) { case XEX_ENCRYPTION_NONE: @@ -580,17 +578,17 @@ int xe_xex2_read_image_uncompressed(const xe_xex2_header_t *header, return 0; } -int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header, - const uint8_t *xex_addr, +int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t* header, + const uint8_t* xex_addr, const uint32_t xex_length, - xe::Memory *memory) { + xe::Memory* memory) { const uint32_t exe_length = xex_length - header->exe_offset; - const uint8_t *source_buffer = (const uint8_t *)xex_addr + header->exe_offset; - const uint8_t *p = source_buffer; + const uint8_t* source_buffer = (const uint8_t*)xex_addr + header->exe_offset; + const uint8_t* p = source_buffer; // Calculate uncompressed length. uint32_t uncompressed_size = 0; - const xe_xex2_file_basic_compression_info_t *comp_info = + const xe_xex2_file_basic_compression_info_t* comp_info = &header->file_format_info.compression_info.basic; for (uint32_t n = 0; n < comp_info->block_count; n++) { const uint32_t data_size = comp_info->blocks[n].data_size; @@ -601,7 +599,7 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header, // Calculate the total size of the XEX image from its headers. uint32_t total_size = 0; for (uint32_t i = 0; i < header->section_count; i++) { - xe_xex2_section_t §ion = header->sections[i]; + xe_xex2_section_t& section = header->sections[i]; total_size += section.info.page_count * section.page_size; } @@ -618,9 +616,9 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header, uncompressed_size); return 1; } - uint8_t *buffer = memory->TranslateVirtual(header->exe_address); + uint8_t* buffer = memory->TranslateVirtual(header->exe_address); std::memset(buffer, 0, total_size); // Quickly zero the contents. - uint8_t *d = buffer; + uint8_t* d = buffer; uint32_t rk[4 * (MAXNR + 1)]; uint8_t ivec[16] = {0}; @@ -640,8 +638,8 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header, memcpy(d, p, exe_length - (p - source_buffer)); break; case XEX_ENCRYPTION_NORMAL: { - const uint8_t *ct = p; - uint8_t *pt = d; + const uint8_t* ct = p; + uint8_t* pt = d; for (size_t m = 0; m < data_size; m += 16, ct += 16, pt += 16) { // Decrypt 16 uint8_ts from input -> output. rijndaelDecrypt(rk, Nr, ct, pt); @@ -665,12 +663,12 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header, return 0; } -int xe_xex2_read_image_compressed(const xe_xex2_header_t *header, - const uint8_t *xex_addr, +int xe_xex2_read_image_compressed(const xe_xex2_header_t* header, + const uint8_t* xex_addr, const uint32_t xex_length, - xe::Memory *memory) { + xe::Memory* memory) { const uint32_t exe_length = xex_length - header->exe_offset; - const uint8_t *exe_buffer = (const uint8_t *)xex_addr + header->exe_offset; + const uint8_t* exe_buffer = (const uint8_t*)xex_addr + header->exe_offset; // src -> dest: // - decrypt (if encrypted) @@ -682,20 +680,20 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header, int result_code = 1; - uint8_t *compress_buffer = NULL; - const uint8_t *p = NULL; - uint8_t *d = NULL; - uint8_t *deblock_buffer = NULL; + uint8_t* compress_buffer = NULL; + const uint8_t* p = NULL; + uint8_t* d = NULL; + uint8_t* deblock_buffer = NULL; size_t block_size = 0; uint32_t uncompressed_size = 0; - struct mspack_system *sys = NULL; - mspack_memory_file *lzxsrc = NULL; - mspack_memory_file *lzxdst = NULL; - struct lzxd_stream *lzxd = NULL; + struct mspack_system* sys = NULL; + mspack_memory_file* lzxsrc = NULL; + mspack_memory_file* lzxdst = NULL; + struct lzxd_stream* lzxd = NULL; // Decrypt (if needed). bool free_input = false; - const uint8_t *input_buffer = exe_buffer; + const uint8_t* input_buffer = exe_buffer; const size_t input_size = exe_length; switch (header->file_format_info.encryption_type) { case XEX_ENCRYPTION_NONE: @@ -704,28 +702,28 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header, case XEX_ENCRYPTION_NORMAL: // TODO: a way to do without a copy/alloc? free_input = true; - input_buffer = (const uint8_t *)calloc(1, input_size); + input_buffer = (const uint8_t*)calloc(1, input_size); XEEXPECTNOTNULL(input_buffer); xe_xex2_decrypt_buffer(header->session_key, exe_buffer, exe_length, - (uint8_t *)input_buffer, input_size); + (uint8_t*)input_buffer, input_size); break; default: assert_always(); return false; } - compress_buffer = (uint8_t *)calloc(1, exe_length); + compress_buffer = (uint8_t*)calloc(1, exe_length); XEEXPECTNOTNULL(compress_buffer); p = input_buffer; d = compress_buffer; // De-block. - deblock_buffer = (uint8_t *)calloc(1, input_size); + deblock_buffer = (uint8_t*)calloc(1, input_size); XEEXPECTNOTNULL(deblock_buffer); block_size = header->file_format_info.compression_info.normal.block_size; while (block_size) { - const uint8_t *pnext = p + block_size; + const uint8_t* pnext = p + block_size; const size_t next_size = xe::load_and_swap(p); p += 4; p += 20; // skip 20b hash @@ -760,19 +758,18 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header, result_code = 2; goto XECLEANUP; } - uint8_t *buffer = memory->TranslateVirtual(header->exe_address); + uint8_t* buffer = memory->TranslateVirtual(header->exe_address); std::memset(buffer, 0, uncompressed_size); // Setup decompressor and decompress. sys = mspack_memory_sys_create(); XEEXPECTNOTNULL(sys); - lzxsrc = - mspack_memory_open(sys, (void *)compress_buffer, d - compress_buffer); + lzxsrc = mspack_memory_open(sys, (void*)compress_buffer, d - compress_buffer); XEEXPECTNOTNULL(lzxsrc); lzxdst = mspack_memory_open(sys, buffer, uncompressed_size); XEEXPECTNOTNULL(lzxdst); lzxd = - lzxd_init(sys, (struct mspack_file *)lzxsrc, (struct mspack_file *)lzxdst, + lzxd_init(sys, (struct mspack_file*)lzxsrc, (struct mspack_file*)lzxdst, header->file_format_info.compression_info.normal.window_bits, 0, 32768, (off_t)header->loader_info.image_size); XEEXPECTNOTNULL(lzxd); @@ -800,14 +797,14 @@ XECLEANUP: free(compress_buffer); free(deblock_buffer); if (free_input) { - free((void *)input_buffer); + free((void*)input_buffer); } return result_code; } -int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t *xex_addr, - const uint32_t xex_length, xe::Memory *memory) { - const xe_xex2_header_t *header = &xex->header; +int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t* xex_addr, + const uint32_t xex_length, xe::Memory* memory) { + const xe_xex2_header_t* header = &xex->header; switch (header->file_format_info.compression_type) { case XEX_COMPRESSION_NONE: return xe_xex2_read_image_uncompressed(header, xex_addr, xex_length, @@ -825,11 +822,11 @@ int xe_xex2_read_image(xe_xex2_ref xex, const uint8_t *xex_addr, } int xe_xex2_load_pe(xe_xex2_ref xex) { - const xe_xex2_header_t *header = &xex->header; - const uint8_t *p = xex->memory->TranslateVirtual(header->exe_address); + const xe_xex2_header_t* header = &xex->header; + const uint8_t* p = xex->memory->TranslateVirtual(header->exe_address); // Verify DOS signature (MZ). - const IMAGE_DOS_HEADER *doshdr = (const IMAGE_DOS_HEADER *)p; + const IMAGE_DOS_HEADER* doshdr = (const IMAGE_DOS_HEADER*)p; if (doshdr->e_magic != IMAGE_DOS_SIGNATURE) { XELOGE("PE signature mismatch; likely bad decryption/decompression"); return 1; @@ -839,13 +836,13 @@ int xe_xex2_load_pe(xe_xex2_ref xex) { p += doshdr->e_lfanew; // Verify NT signature (PE\0\0). - const IMAGE_NT_HEADERS32 *nthdr = (const IMAGE_NT_HEADERS32 *)(p); + const IMAGE_NT_HEADERS32* nthdr = (const IMAGE_NT_HEADERS32*)(p); if (nthdr->Signature != IMAGE_NT_SIGNATURE) { return 1; } // Verify matches an Xbox PE. - const IMAGE_FILE_HEADER *filehdr = &nthdr->FileHeader; + const IMAGE_FILE_HEADER* filehdr = &nthdr->FileHeader; if ((filehdr->Machine != IMAGE_FILE_MACHINE_POWERPCBE) || !(filehdr->Characteristics & IMAGE_FILE_32BIT_MACHINE)) { return 1; @@ -856,7 +853,7 @@ int xe_xex2_load_pe(xe_xex2_ref xex) { } // Verify optional header is 32bit. - const IMAGE_OPTIONAL_HEADER32 *opthdr = &nthdr->OptionalHeader; + const IMAGE_OPTIONAL_HEADER32* opthdr = &nthdr->OptionalHeader; if (opthdr->Magic != IMAGE_NT_OPTIONAL_HDR32_MAGIC) { return 1; } @@ -882,7 +879,7 @@ int xe_xex2_load_pe(xe_xex2_ref xex) { // Quick scan to determine bounds of sections. size_t upper_address = 0; - const IMAGE_SECTION_HEADER *sechdr = IMAGE_FIRST_SECTION(nthdr); + const IMAGE_SECTION_HEADER* sechdr = IMAGE_FIRST_SECTION(nthdr); for (size_t n = 0; n < filehdr->NumberOfSections; n++, sechdr++) { const size_t physical_address = opthdr->ImageBase + sechdr->VirtualAddress; upper_address = @@ -892,7 +889,7 @@ int xe_xex2_load_pe(xe_xex2_ref xex) { // Setup/load sections. sechdr = IMAGE_FIRST_SECTION(nthdr); for (size_t n = 0; n < filehdr->NumberOfSections; n++, sechdr++) { - PESection *section = (PESection *)calloc(1, sizeof(PESection)); + PESection* section = (PESection*)calloc(1, sizeof(PESection)); memcpy(section->name, sechdr->Name, sizeof(sechdr->Name)); section->name[8] = 0; section->raw_address = sechdr->PointerToRawData; @@ -908,8 +905,8 @@ int xe_xex2_load_pe(xe_xex2_ref xex) { return 0; } -const PESection *xe_xex2_get_pe_section(xe_xex2_ref xex, const char *name) { - for (std::vector::iterator it = xex->sections->begin(); +const PESection* xe_xex2_get_pe_section(xe_xex2_ref xex, const char* name) { + for (std::vector::iterator it = xex->sections->begin(); it != xex->sections->end(); ++it) { if (!strcmp((*it)->name, name)) { return *it; @@ -919,7 +916,7 @@ const PESection *xe_xex2_get_pe_section(xe_xex2_ref xex, const char *name) { } int xe_xex2_find_import_infos(xe_xex2_ref xex, - const xe_xex2_import_library_t *library) { + const xe_xex2_import_library_t* library) { auto header = xe_xex2_get_header(xex); // Find library index for verification. @@ -954,8 +951,8 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex, } // Allocate storage. - xe_xex2_import_info_t *infos = (xe_xex2_import_info_t *)calloc( - info_count, sizeof(xe_xex2_import_info_t)); + xe_xex2_import_info_t* infos = + (xe_xex2_import_info_t*)calloc(info_count, sizeof(xe_xex2_import_info_t)); assert_not_null(infos); assert_not_zero(info_count); @@ -972,14 +969,14 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex, switch (type) { case 0x00: { - xe_xex2_import_info_t *info = &infos[i++]; + xe_xex2_import_info_t* info = &infos[i++]; info->ordinal = value & 0xFFFF; info->value_address = record; } break; case 0x01: { // Thunk for previous record. assert_true(i > 0); - xe_xex2_import_info_t *info = &infos[i - 1]; + xe_xex2_import_info_t* info = &infos[i - 1]; assert_true(info->ordinal == (value & 0xFFFF)); info->thunk_address = record; } break; @@ -995,9 +992,9 @@ int xe_xex2_find_import_infos(xe_xex2_ref xex, } int xe_xex2_get_import_infos(xe_xex2_ref xex, - const xe_xex2_import_library_t *library, - xe_xex2_import_info_t **out_import_infos, - size_t *out_import_info_count) { + const xe_xex2_import_library_t* library, + xe_xex2_import_info_t** out_import_infos, + size_t* out_import_info_count) { auto header = xe_xex2_get_header(xex); // Find library index for verification. @@ -1017,7 +1014,7 @@ int xe_xex2_get_import_infos(xe_xex2_ref xex, return 0; } -uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char *name) { +uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char* name) { auto header = xe_xex2_get_header(xex); // no exports :( @@ -1026,24 +1023,23 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char *name) { return 0; } - auto e = reinterpret_cast( + auto e = reinterpret_cast( xex->memory->TranslateVirtual(header->exe_address + header->pe_export_table_offset)); // e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY! - uint32_t *function_table = (uint32_t *)((uint64_t)e + e->AddressOfFunctions); + uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions); // Names relative to directory - uint32_t *name_table = (uint32_t *)((uint64_t)e + e->AddressOfNames); + uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames); // Table of ordinals (by name) - uint16_t *ordinal_table = - (uint16_t *)((uint64_t)e + e->AddressOfNameOrdinals); + uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals); - const char *mod_name = (const char *)((uint64_t)e + e->Name); + const char* mod_name = (const char*)((uint64_t)e + e->Name); for (uint32_t i = 0; i < e->NumberOfNames; i++) { - const char *fn_name = (const char *)((uint64_t)e + name_table[i]); + const char* fn_name = (const char*)((uint64_t)e + name_table[i]); uint16_t ordinal = ordinal_table[i]; uint32_t addr = header->exe_address + function_table[ordinal]; @@ -1062,7 +1058,7 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, uint16_t ordinal) { // XEX-style export table. if (header->loader_info.export_table) { - auto export_table = reinterpret_cast( + auto export_table = reinterpret_cast( xex->memory->TranslateVirtual(header->loader_info.export_table)); uint32_t ordinal_count = xe::byte_swap(export_table->count); uint32_t ordinal_base = xe::byte_swap(export_table->base); @@ -1082,22 +1078,21 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, uint16_t ordinal) { return 0; } - auto e = reinterpret_cast( + auto e = reinterpret_cast( xex->memory->TranslateVirtual(header->exe_address + header->pe_export_table_offset)); // e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY! // Functions relative to base - uint32_t *function_table = (uint32_t *)((uint64_t)e + e->AddressOfFunctions); + uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions); // Names relative to directory - uint32_t *name_table = (uint32_t *)((uint64_t)e + e->AddressOfNames); + uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames); // Table of ordinals (by name) - uint16_t *ordinal_table = - (uint16_t *)((uint64_t)e + e->AddressOfNameOrdinals); + uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals); - const char *mod_name = (const char *)((uint64_t)e + e->Name); + const char* mod_name = (const char*)((uint64_t)e + e->Name); if (ordinal < e->NumberOfFunctions) { return header->exe_address + function_table[ordinal];