summaryrefslogtreecommitdiff
path: root/include/JSystem
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2024-12-29 07:53:54 -0800
committerGitHub <noreply@github.com>2024-12-29 17:53:54 +0200
commit0e281cb97535523a3d1a4f668bc84321bc39fb46 (patch)
tree2f8d939c992c30dcad7a904aa1024041cf3c85fa /include/JSystem
parentc429ce21eb7cf4687da596c51fbc47249fbe4c13 (diff)
various matches / cleanup (#2271)
* cleanup various TUs * checkpoint * d_attention doc
Diffstat (limited to 'include/JSystem')
-rw-r--r--include/JSystem/J3DGraphBase/J3DShape.h2
-rw-r--r--include/JSystem/JGadget/linklist.h45
-rw-r--r--include/JSystem/JUtility/JUTConsole.h9
-rw-r--r--include/JSystem/JUtility/JUTException.h2
4 files changed, 17 insertions, 41 deletions
diff --git a/include/JSystem/J3DGraphBase/J3DShape.h b/include/JSystem/J3DGraphBase/J3DShape.h
index 512a8fe289..91e9b4484a 100644
--- a/include/JSystem/J3DGraphBase/J3DShape.h
+++ b/include/JSystem/J3DGraphBase/J3DShape.h
@@ -127,7 +127,7 @@ public:
GXVtxDescList* getVtxDesc() const { return mVtxDesc; }
J3DMaterial* getMaterial() const { return mMaterial; }
- u32 getIndex() const { return mIndex; }
+ u16 getIndex() const { return mIndex; }
u32 getPipeline() const { return (mFlags >> 2) & 0x07; }
u32 getTexMtxLoadType() const { return mFlags & 0xF000; }
u32 getMtxGroupNum() const { return mMtxGroupNum; }
diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h
index 70a15a1276..4fb6a627df 100644
--- a/include/JSystem/JGadget/linklist.h
+++ b/include/JSystem/JGadget/linklist.h
@@ -22,24 +22,10 @@ struct TNodeLinkList {
struct iterator {
explicit iterator(TLinkListNode* pNode) { node = pNode; }
- iterator& operator++() {
- node = node->getNext();
- return *this;
- }
- iterator& operator--() {
- node = node->getPrev();
- return *this;
- }
- iterator operator++(int) {
- const iterator old(*this);
- (void)++*this;
- return old;
- }
- iterator operator--(int) {
- const iterator old(*this);
- (void)--*this;
- return old;
- }
+ iterator& operator++() { node = node->getNext(); return *this; }
+ iterator& operator--() { node = node->getPrev(); return *this; }
+ iterator operator++(int) { const iterator old(*this); (void)++*this; return old; }
+ iterator operator--(int) { const iterator old(*this); (void)--*this; return old; }
friend bool operator==(iterator a, iterator b) { return a.node == b.node; }
friend bool operator!=(iterator a, iterator b) { return !(a == b); }
@@ -52,27 +38,12 @@ struct TNodeLinkList {
struct const_iterator {
explicit const_iterator(TLinkListNode* pNode) { node = pNode; }
- const_iterator(const const_iterator& iter) { *this = iter; }
explicit const_iterator(iterator it) { node = it.node; }
- const_iterator& operator++() {
- node = node->getNext();
- return *this;
- }
- const_iterator& operator--() {
- node = node->getPrev();
- return *this;
- }
- const_iterator operator++(int) {
- const const_iterator old(*this);
- (void)++*this;
- return old;
- }
- const_iterator operator--(int) {
- const const_iterator old(*this);
- (void)--*this;
- return old;
- }
+ const_iterator& operator++() { node = node->getNext(); return *this; }
+ const_iterator& operator--() { node = node->getPrev(); return *this; }
+ const_iterator operator++(int) { const const_iterator old(*this); (void)++*this; return old; }
+ const_iterator operator--(int) { const const_iterator old(*this); (void)--*this; return old; }
friend bool operator==(const_iterator a, const_iterator b) { return a.node == b.node; }
friend bool operator!=(const_iterator a, const_iterator b) { return !(a == b); }
diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h
index d454a2b14d..233469b652 100644
--- a/include/JSystem/JUtility/JUTConsole.h
+++ b/include/JSystem/JUtility/JUTConsole.h
@@ -93,7 +93,7 @@ public:
void scrollToFirstLine() { scroll(-mMaxLines); }
/* 0x18 */ JGadget::TLinkListNode mListNode;
- /* 0x20 */ u32 field_0x20;
+ /* 0x20 */ unsigned int field_0x20;
/* 0x24 */ int mMaxLines;
/* 0x28 */ u8* mBuf;
/* 0x2C */ bool field_0x2c;
@@ -133,11 +133,16 @@ public:
JUTConsole* getDirectConsole() const { return mDirectConsole; }
- static JUTConsoleManager* getManager() { return sManager; }
+ static JUTConsoleManager* const getManager() { return sManager; }
static JUTConsoleManager* sManager;
+#ifdef __MWERKS__
typedef JGadget::TLinkList<JUTConsole, -offsetof(JUTConsole, mListNode)> ConsoleList;
+#else
+ // clangd does not support offsetof in template arguments.
+ typedef JGadget::TLinkList<JUTConsole, -sizeof(JKRDisposer)> ConsoleList;
+#endif
private:
/* 0x00 */ ConsoleList soLink_;
diff --git a/include/JSystem/JUtility/JUTException.h b/include/JSystem/JUtility/JUTException.h
index b9b6829ae2..3f568afd77 100644
--- a/include/JSystem/JUtility/JUTException.h
+++ b/include/JSystem/JUtility/JUTException.h
@@ -118,7 +118,7 @@ private:
static OSMessageQueue sMessageQueue;
static const char* sCpuExpName[17];
static JSUList<JUTException::JUTExMapFile> sMapFileList;
- static OSMessage sMessageBuffer[1 + 1 /* padding */];
+ static OSMessage sMessageBuffer[1];
static JUTException* sErrorManager;
static OSErrorHandler sPreUserCallback;
static OSErrorHandler sPostUserCallback;