[LINT] Linted files + Added lint job to CI

This commit is contained in:
Gliniak
2024-03-12 08:59:10 +01:00
committed by Radosław Gliński
parent e8afad8f8a
commit b9061e6292
117 changed files with 1177 additions and 883 deletions

View File

@@ -2,8 +2,8 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2023 Xenia Canary. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
* Copyright 2023 Xenia Canary. All rights reserved. * Released under the BSD
*license - see LICENSE in the root for more details. *
******************************************************************************
*/
@@ -95,9 +95,10 @@ bool GrowHandleTable(uint32_t table_ptr, PPCContext* context) {
/*
copy old bucket list contents to new, larger bucket list
*/
memcpy(context->TranslateVirtual(new_dynamic_buckets),
context->TranslateVirtual(table->table_dynamic_buckets),
sizeof(uint32_t) * (new_bucket_handle_base / SIZE_PER_HANDLE_BUCKET));
memcpy(
context->TranslateVirtual(new_dynamic_buckets),
context->TranslateVirtual(table->table_dynamic_buckets),
sizeof(uint32_t) * (new_bucket_handle_base / SIZE_PER_HANDLE_BUCKET));
if (context->TranslateVirtualBE<uint32_t>(table->table_dynamic_buckets) !=
&table->table_static_buckets[0]) {

View File

@@ -2,8 +2,8 @@
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2023 Xenia Canary. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
* Copyright 2023 Xenia Canary. All rights reserved. * Released under the BSD
*license - see LICENSE in the root for more details. *
******************************************************************************
*/
@@ -26,7 +26,7 @@ struct X_HANDLE_TABLE {
xe::be<uint32_t> table_dynamic_buckets;
xe::be<uint32_t> table_static_buckets[8];
X_KSPINLOCK table_lock;
//used as unknown arg 3 to pool allocations
// used as unknown arg 3 to pool allocations
uint8_t unk_pool_arg_34;
uint8_t handle_high_byte;
uint8_t unk_36;

View File

@@ -25,5 +25,5 @@ struct X_OBJECT_CREATE_INFORMATION;
namespace xe::kernel::util {
class NativeList;
class ObjectTable;
}
} // namespace xe::kernel::util
#endif

View File

@@ -168,8 +168,8 @@ static void XeInsertHeadList(uint32_t list_head, X_LIST_ENTRY* entry,
template <typename VirtualTranslator>
static void XeInsertHeadList(X_LIST_ENTRY* list_head, X_LIST_ENTRY* entry,
VirtualTranslator context) {
XeInsertHeadList(list_head, XeGuestList(list_head, context),
entry, XeGuestList(entry, context), context);
XeInsertHeadList(list_head, XeGuestList(list_head, context), entry,
XeGuestList(entry, context), context);
}
template <typename TObject, size_t EntryListOffset>
@@ -216,7 +216,7 @@ struct X_TYPED_LIST : public X_LIST_ENTRY {
uint32_t end() { return vt->HostToGuestVirtual(thiz); }
};
template<typename VirtualTranslator>
template <typename VirtualTranslator>
ForwardIteratorBegin<VirtualTranslator> IterateForward(VirtualTranslator vt) {
return ForwardIteratorBegin<VirtualTranslator>{vt, this};
}
@@ -227,13 +227,14 @@ struct X_TYPED_LIST : public X_LIST_ENTRY {
}
template <typename VirtualTranslator>
void InsertHead(TObject* entry, VirtualTranslator translator) {
XeInsertHeadList(static_cast<X_LIST_ENTRY*>(this), ObjectListEntry(entry), translator);
XeInsertHeadList(static_cast<X_LIST_ENTRY*>(this), ObjectListEntry(entry),
translator);
}
template <typename VirtualTranslator>
void InsertTail(TObject* entry, VirtualTranslator translator) {
XeInsertTailList(this, ObjectListEntry(entry), translator);
}
template<typename VirtualTranslator>
template <typename VirtualTranslator>
bool empty(VirtualTranslator vt) const {
return vt->TranslateVirtual<X_LIST_ENTRY*>(flink_ptr) == this;
}

View File

@@ -111,8 +111,8 @@ class ObjectTable {
// Generic lookup
template <>
object_ref<XObject> ObjectTable::LookupObject<XObject>(
X_HANDLE handle, bool already_locked);
object_ref<XObject> ObjectTable::LookupObject<XObject>(X_HANDLE handle,
bool already_locked);
} // namespace util
} // namespace kernel

View File

@@ -35,8 +35,7 @@ using PPCContext = xe::cpu::ppc::PPCContext;
library_name, ordinals::export_name, \
(xe::cpu::xe_kernel_export_shim_fn)export_name##_entry);
#define SHIM_MEM_ADDR(a) \
((a) ? ppc_context->TranslateVirtual(a) : nullptr)
#define SHIM_MEM_ADDR(a) ((a) ? ppc_context->TranslateVirtual(a) : nullptr)
#define SHIM_MEM_8(a) xe::load_and_swap<uint8_t>(SHIM_MEM_ADDR(a))
#define SHIM_MEM_16(a) xe::load_and_swap<uint16_t>(SHIM_MEM_ADDR(a))
@@ -158,9 +157,8 @@ class Param {
} else {
uint32_t stack_ptr =
uint32_t(init.ppc_context->r[1]) + 0x54 + (ordinal_ - 8) * 8;
*out_value = xe::load_and_swap<V>(
init.ppc_context->TranslateVirtual(
stack_ptr));
*out_value =
xe::load_and_swap<V>(init.ppc_context->TranslateVirtual(stack_ptr));
}
}
@@ -216,6 +214,7 @@ class ContextParam : public Param {
X_KPCR* GetPCR() const { return TranslateGPR<X_KPCR*>(13); }
XThread* CurrentXThread() const;
protected:
PPCContext* XE_RESTRICT ctx_;
};
@@ -223,10 +222,7 @@ class ContextParam : public Param {
class PointerParam : public ParamBase<uint32_t> {
public:
PointerParam(Init& init) : ParamBase(init) {
host_ptr_ =
value_
? init.ppc_context->TranslateVirtual(value_)
: nullptr;
host_ptr_ = value_ ? init.ppc_context->TranslateVirtual(value_) : nullptr;
}
PointerParam(void* host_ptr) : ParamBase(), host_ptr_(host_ptr) {}
PointerParam& operator=(void*& other) {
@@ -296,10 +292,7 @@ class StringPointerParam : public ParamBase<uint32_t> {
public:
StringPointerParam(Init& init) : ParamBase(init) {
host_ptr_ =
value_
? init.ppc_context->TranslateVirtual<CHAR*>(
value_)
: nullptr;
value_ ? init.ppc_context->TranslateVirtual<CHAR*>(value_) : nullptr;
}
StringPointerParam(CHAR* host_ptr) : ParamBase(), host_ptr_(host_ptr) {}
StringPointerParam& operator=(const CHAR*& other) {
@@ -323,9 +316,7 @@ class TypedPointerParam : public ParamBase<uint32_t> {
public:
TypedPointerParam(Init& init) : ParamBase(init) {
host_ptr_ =
value_ ? init.ppc_context->TranslateVirtual<T*>(
value_)
: nullptr;
value_ ? init.ppc_context->TranslateVirtual<T*>(value_) : nullptr;
}
TypedPointerParam(T* host_ptr) : ParamBase(), host_ptr_(host_ptr) {}
TypedPointerParam& operator=(const T*& other) {

View File

@@ -216,7 +216,7 @@ std::vector<XdbfViewTable> XdbfWrapper::GetStatsView() const {
}
const uint8_t* XdbfWrapper::ReadXLast(uint32_t& compressed_size,
uint32_t& decompressed_size) const {
uint32_t& decompressed_size) const {
auto xlast_table = GetEntry(XdbfSection::kMetadata, kXdbfIdXsrc);
if (!xlast_table) {
return nullptr;

View File

@@ -187,8 +187,7 @@ class XdbfWrapper {
XdbfPropertyTableEntry GetProperty(const uint32_t id) const;
XdbfContextTableEntry GetContext(const uint32_t id) const;
std::vector<XdbfViewTable> GetStatsView() const;
XdbfSharedView GetSharedView(const uint8_t* ptr,
uint32_t& byte_count) const;
XdbfSharedView GetSharedView(const uint8_t* ptr, uint32_t& byte_count) const;
void GetPropertyBagMetadata(const uint8_t* ptr, uint32_t& byte_count,
std::vector<xe::be<uint32_t>>& contexts,
@@ -196,7 +195,8 @@ class XdbfWrapper {
XdbfPropertyBag GetMatchCollection() const;
const uint8_t* ReadXLast(uint32_t& compressed_size, uint32_t& decompressed_size) const;
const uint8_t* ReadXLast(uint32_t& compressed_size,
uint32_t& decompressed_size) const;
private:
const uint8_t* data_ = nullptr;