Standardize include guards, clang-format headers

Former-commit-id: 261ee48bba
This commit is contained in:
Luke Street
2022-10-09 01:13:17 -04:00
parent 68d30b954d
commit 7f83e1fa03
341 changed files with 1373 additions and 1256 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
{
"recommendations": [
"ms-vscode.cpptools",
"xaver.clang-format"
"xaver.clang-format",
"akiramiyakoda.cppincludeguard"
]
}
+21
View File
@@ -14,4 +14,25 @@
"files.autoSave": "onFocusChange",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"C/C++ Include Guard.Macro Type": "Filename",
"C/C++ Include Guard.Prefix": "_",
"C/C++ Include Guard.Suffix": "",
"C/C++ Include Guard.Comment Style": "Line",
"C/C++ Include Guard.Subfolder Prefixes": [
{
"folderPath": "include/dolphin",
"prefix": "DOLPHIN_"
},
{
"folderPath": "include/musyx",
"prefix": "MUSYX_"
},
{
"folderPath": "include/rstl",
"prefix": "RSTL_"
}
],
"C/C++ Include Guard.Auto Update Path Allowlist": [
"include"
],
}
+4 -4
View File
@@ -1,5 +1,5 @@
#ifndef _CCOLLIDABLEAABOX_HPP
#define _CCOLLIDABLEAABOX_HPP
#ifndef _CCOLLIDABLEAABOX
#define _CCOLLIDABLEAABOX
#include "types.h"
@@ -16,7 +16,7 @@ public:
CAABox CalculateAABox(const CTransform4f&) const override;
CAABox CalculateLocalAABox() const override;
FourCC GetPrimType() const override;
~CCollidableAABox() override {};
~CCollidableAABox() override{};
CRayCastResult CastRayInternal(const CInternalRayCastStructure&) const;
private:
@@ -24,4 +24,4 @@ private:
};
CHECK_SIZEOF(CCollidableAABox, 0x28)
#endif
#endif // _CCOLLIDABLEAABOX
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CCOLLIDABLESPHERE_HPP
#define _CCOLLIDABLESPHERE_HPP
#ifndef _CCOLLIDABLESPHERE
#define _CCOLLIDABLESPHERE
#include "types.h"
@@ -24,4 +24,4 @@ private:
};
CHECK_SIZEOF(CCollidableSphere, 0x20)
#endif
#endif // _CCOLLIDABLESPHERE
+10 -10
View File
@@ -1,5 +1,5 @@
#ifndef _CCOLLISIONINFO_HPP
#define _CCOLLISIONINFO_HPP
#ifndef _CCOLLISIONINFO
#define _CCOLLISIONINFO
#include "types.h"
@@ -15,16 +15,16 @@ public:
kI_Invalid,
kI_Valid,
};
enum ESwapMaterials {
kSM_Swap
};
enum ESwapMaterials { kSM_Swap };
CCollisionInfo(EInvalid valid = kI_Invalid);
CCollisionInfo(const CVector3f& point, const CMaterialList& leftMat, const CMaterialList& rightMat, const CVector3f& normal);
CCollisionInfo(const CVector3f& point, const CMaterialList& leftMat, const CMaterialList& rightMat, const CVector3f& leftNormal,
const CVector3f& rightNormal);
CCollisionInfo(const CAABox& aabox, const CMaterialList& leftMat, const CMaterialList& rightMat, const CVector3f& leftNormal,
CCollisionInfo(const CVector3f& point, const CMaterialList& leftMat,
const CMaterialList& rightMat, const CVector3f& normal);
CCollisionInfo(const CVector3f& point, const CMaterialList& leftMat,
const CMaterialList& rightMat, const CVector3f& leftNormal,
const CVector3f& rightNormal);
CCollisionInfo(const CAABox& aabox, const CMaterialList& leftMat, const CMaterialList& rightMat,
const CVector3f& leftNormal, const CVector3f& rightNormal);
CCollisionInfo(const CCollisionInfo& other, ESwapMaterials swap)
: x0_point(other.x0_point)
, xc_extentX(other.xc_extentX)
@@ -61,4 +61,4 @@ private:
};
CHECK_SIZEOF(CCollisionInfo, 0x60)
#endif
#endif // _CCOLLISIONINFO
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CCOLLISIONPRIMITIVE_HPP
#define _CCOLLISIONPRIMITIVE_HPP
#ifndef _CCOLLISIONPRIMITIVE
#define _CCOLLISIONPRIMITIVE
#include "types.h"
@@ -33,4 +33,4 @@ CHECK_SIZEOF(CCollisionPrimitive, 0x10)
inline CCollisionPrimitive::~CCollisionPrimitive() {}
#endif
#endif // _CCOLLISIONPRIMITIVE
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef __CMRAY_HPP__
#define __CMRAY_HPP__
#ifndef _CMRAY
#define _CMRAY
#include "Kyoto/Math/CVector3f.hpp"
@@ -19,4 +19,4 @@ private:
CVector3f mDir;
};
#endif // __CMRAY_HPP__
#endif // _CMRAY
+4 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CMATERIALFILTER_HPP
#define _CMATERIALFILTER_HPP
#ifndef _CMATERIALFILTER
#define _CMATERIALFILTER
#include "types.h"
@@ -7,6 +7,7 @@
class CMaterialFilter {
static const CMaterialFilter skPassEverything;
public:
enum EFilterType {
kFT_Always,
@@ -39,4 +40,4 @@ private:
};
CHECK_SIZEOF(CMaterialFilter, 0x18)
#endif
#endif // _CMATERIALFILTER
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CMATERIALLIST_HPP
#define _CMATERIALLIST_HPP
#ifndef _CMATERIALLIST
#define _CMATERIALLIST
#include "types.h"
@@ -129,4 +129,4 @@ private:
};
CHECK_SIZEOF(CMaterialList, 0x8)
#endif
#endif // _CMATERIALLIST
+4 -3
View File
@@ -1,5 +1,5 @@
#ifndef __COBBOX_HPP__
#define __COBBOX_HPP__
#ifndef _COBBOX
#define _COBBOX
#include "Kyoto/Math/CAABox.hpp"
#include "Kyoto/Math/CTransform4f.hpp"
@@ -19,9 +19,10 @@ public:
bool LineIntersectsBox(const CMRay& ray, float& penetration) const;
bool AABoxIntersectsBox(const CAABox& box) const;
bool OBBIntersectsBox(const COBBox& box) const;
private:
CTransform4f mTransform;
CVector3f mExtents;
};
#endif // __COBBOX_HPP__
#endif // _COBBOX
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CRAYCASTRESULT_HPP
#define _CRAYCASTRESULT_HPP
#ifndef _CRAYCASTRESULT
#define _CRAYCASTRESULT
#include "types.h"
@@ -33,4 +33,4 @@ private:
};
CHECK_SIZEOF(CRayCastResult, 0x30)
#endif
#endif // _CRAYCASTRESULT
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CGUISYS_HPP
#define _CGUISYS_HPP
#ifndef _CGUISYS
#define _CGUISYS
#include "types.h"
@@ -31,4 +31,4 @@ private:
static CGuiSys* spGuiSys;
};
#endif
#endif // _CGUISYS
+3 -4
View File
@@ -1,8 +1,7 @@
#ifndef __ALLOCATORCOMMON_HPP__
#define __ALLOCATORCOMMON_HPP__
#ifndef _ALLOCATORCOMMON
#define _ALLOCATORCOMMON
static const int kPointerSize = sizeof(void*);
static const int kPointerBits = kPointerSize * 8;
#endif // __ALLOCATORCOMMON_HPP__
#endif // _ALLOCATORCOMMON
+4 -3
View File
@@ -1,5 +1,5 @@
#ifndef __CCALLSTACK_HPP__
#define __CCALLSTACK_HPP__
#ifndef _CCALLSTACK
#define _CCALLSTACK
class CCallStack {
public:
@@ -7,9 +7,10 @@ public:
const char* GetFileAndLineText() const;
const char* GetTypeText() const;
private:
const char* x0_line;
const char* x4_type;
};
#endif // __CCALLSTACK_HPP__
#endif // _CCALLSTACK
+4 -3
View File
@@ -1,5 +1,5 @@
#ifndef __CCIRCULARBUFFER_HPP__
#define __CCIRCULARBUFFER_HPP__
#ifndef _CCIRCULARBUFFER
#define _CCIRCULARBUFFER
#include <types.h>
@@ -21,4 +21,5 @@ private:
s32 x10_nextFreeAddr;
s32 x14_;
};
#endif // __CCIRCULARBUFFER_HPP__
#endif // _CCIRCULARBUFFER
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef __CGAMEALLOCATOR_HPP__
#define __CGAMEALLOCATOR_HPP__
#ifndef _CGAMEALLOCATOR
#define _CGAMEALLOCATOR
#include <Kyoto/Alloc/CMediumAllocPool.hpp>
#include <Kyoto/Alloc/IAllocator.hpp>
@@ -133,4 +133,4 @@ private:
uint xbc_;
};
#endif // __CGAMEALLOCATOR_HPP__
#endif // _CGAMEALLOCATOR
+24 -24
View File
@@ -1,34 +1,34 @@
#ifndef __CMEDIUMALLOCPOOL_HPP__
#define __CMEDIUMALLOCPOOL_HPP__
#ifndef _CMEDIUMALLOCPOOL
#define _CMEDIUMALLOCPOOL
#include <rstl/list.hpp>
class CMediumAllocPool {
public:
struct SMediumAllocPuddle {
u8 unk;
void* x4_mainData;
void* x8_bookKeeping;
void* xc_cachedBookKeepingOffset;
int x10_;
int x14_numBlocks;
int x18_numAllocs;
int x1c_numEntries;
};
struct SMediumAllocPuddle {
u8 unk;
void* x4_mainData;
void* x8_bookKeeping;
void* xc_cachedBookKeepingOffset;
int x10_;
int x14_numBlocks;
int x18_numAllocs;
int x1c_numEntries;
};
rstl::list<SMediumAllocPuddle> x0_list;
/*rstl::list_node<SMediumAllocPuddle>* x18_lastNodePrev; */
void* x18_lastNodePrev;
void* Alloc(uint size);
bool HasPuddles() const;
void AddPuddle(uint, void*, int);
void ClearPuddles();
rstl::list< SMediumAllocPuddle > x0_list;
/*rstl::list_node<SMediumAllocPuddle>* x18_lastNodePrev; */
void* x18_lastNodePrev;
void* Alloc(uint size);
bool HasPuddles() const;
void AddPuddle(uint, void*, int);
void ClearPuddles();
s32 Free(const void* ptr);
s32 Free(const void* ptr);
uint GetTotalEntries();
uint GetNumBlocksAvailable();
uint GetNumAllocs();
uint GetTotalEntries();
uint GetNumBlocksAvailable();
uint GetNumAllocs();
};
#endif // __CMEDIUMALLOCPOOL_HPP__
#endif // _CMEDIUMALLOCPOOL
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _CMEMORY_HPP
#define _CMEMORY_HPP
#ifndef _CMEMORY
#define _CMEMORY
#include "types.h"
@@ -18,4 +18,4 @@ inline void* operator new(size_t n, void* ptr) { return ptr; };
inline void operator delete(void* ptr) { CMemory::Free(ptr); }
inline void operator delete[](void* ptr) { CMemory::Free(ptr); }
#endif
#endif // _CMEMORY
+12 -7
View File
@@ -1,5 +1,5 @@
#ifndef __CSMALLALLOCPOOL_HPP__
#define __CSMALLALLOCPOOL_HPP__
#ifndef _CSMALLALLOCPOOL
#define _CSMALLALLOCPOOL
#include <types.h>
@@ -13,12 +13,17 @@ public:
bool Free(const void* ptr);
bool PtrWithinPool(const void* ptr) const {
return u32((reinterpret_cast< const u8* >(ptr) - reinterpret_cast< u8* >(x0_mainData)) / 4) < x8_numBlocks;
return u32((reinterpret_cast< const u8* >(ptr) - reinterpret_cast< u8* >(x0_mainData)) / 4) <
x8_numBlocks;
}
uint GetIndexFromPtr(const void* ptr) const { return ((const u8*)ptr - x0_mainData) / kPointerSize; }
uint GetIndexFromPtr(const void* ptr) const {
return ((const u8*)ptr - x0_mainData) / kPointerSize;
}
long GetEntryValue(uint idx) const { return (long)*((u8*)x4_bookKeeping + idx); }
u8* GetPtrFromIndex(unsigned int idx) const { return static_cast< u8* >(x0_mainData) + (idx << 3); }
u8* GetPtrFromIndex(unsigned int idx) const {
return static_cast< u8* >(x0_mainData) + (idx << 3);
}
uint GetNumBlocksAvailable() const { return x18_numBlocksAvailable; }
uint GetTotalEntries() const { return x8_numBlocks; }
@@ -26,7 +31,6 @@ public:
uint GetNumAllocs() const { return x1c_numAllocs; }
private:
void* x0_mainData;
void* x4_bookKeeping;
int x8_numBlocks;
@@ -36,4 +40,5 @@ private:
uint x18_numBlocksAvailable;
uint x1c_numAllocs;
};
#endif // __CSMALLALLOCPOOL_HPP__
#endif // _CSMALLALLOCPOOL
+3 -3
View File
@@ -1,5 +1,5 @@
#ifndef _IALLOCATOR_HPP
#define _IALLOCATOR_HPP
#ifndef _IALLOCATOR
#define _IALLOCATOR
#include "Kyoto/Alloc/CMemory.hpp"
#include "types.h"
@@ -95,4 +95,4 @@ public:
virtual SMetrics GetMetrics() const = 0;
};
#endif
#endif // _IALLOCATOR

Some files were not shown because too many files have changed in this diff Show More