Skip to content

Commit

Permalink
Fix more clangd errors
Browse files Browse the repository at this point in the history
This also seems to fix the problem where clangd failed to index most header files, which was due to the typo in JGeometry.h.
  • Loading branch information
LagoLunatic committed Nov 23, 2024
1 parent 12c8373 commit c46adeb
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
},
"clangd.arguments": [
"--function-arg-placeholders=0",
// "--log=verbose",
],
}
2 changes: 1 addition & 1 deletion include/JSystem/JGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ struct TVec2 {
template <class T>
struct TBox {
TBox() : i(), f() {}
TBox(const TBox& other) : i(other.f), f(other.y) {}
TBox(const TBox& other) : i(other.i), f(other.f) {}

T i, f;
};
Expand Down
2 changes: 1 addition & 1 deletion include/dolphin/os/OSTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OSTime OSGetTime(void);
OSTick OSGetTick(void);
OSTime __OSGetSystemTime(void);
OSTime __OSTimeToSystemTime(OSTime time);
void GetDates(s32 days, OSCalendarTime* ct);
static void GetDates(s32 days, OSCalendarTime* ct);
void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* ct);

extern u32 __OSBusClock AT_ADDRESS(0x800000F8);
Expand Down
4 changes: 2 additions & 2 deletions src/JSystem/JKernel/JKRThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ JKRThread::JKRThread(u32 stack_size, int message_count, int param_3) : mThreadLi
mThreadRecord = (OSThread*)JKRAllocFromHeap(mHeap, sizeof(OSThread), 0x20);

void* stackBase = (void*)((int)mStackMemory + mStackSize);
OSCreateThread(mThreadRecord, start, this, stackBase, mStackSize, param_3, 1);
OSCreateThread(mThreadRecord, (void*)start, this, stackBase, mStackSize, param_3, 1);

mMessageCount = message_count;
mMessages = (OSMessage*)JKRAllocFromHeap(mHeap, mMessageCount * sizeof(OSMessage), 0);
Expand Down Expand Up @@ -135,4 +135,4 @@ void JKRThreadSwitch::callback(OSThread* current, OSThread* next) {
static void dummy() {
OSReport("Cannot create JKRTask Manager.");
OSReport("sManager != 0");
}
}
2 changes: 2 additions & 0 deletions src/dolphin/os/OSReset.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ inline BOOL __OSCallResetFunctions(u32 arg0) {
return 1;
}

#ifdef __MWERKS__
static asm void Reset(register s32 param_0) {
// clang-format off
nofralloc
Expand Down Expand Up @@ -107,6 +108,7 @@ static asm void Reset(register s32 param_0) {
b lbl_8033F790
// clang-format on
}
#endif

inline static void KillThreads(void) {
OSThread* thread;
Expand Down
4 changes: 4 additions & 0 deletions src/dolphin/os/OSTime.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#define OS_TIME_WEEK_DAY_MAX 7
#define OS_TIME_YEAR_DAY_MAX 365

#ifdef __MWERKS__
asm OSTime OSGetTime(void) {
// clang-format off
nofralloc
Expand All @@ -19,7 +20,9 @@ asm OSTime OSGetTime(void) {
blr
// clang-format on
}
#endif

#ifdef __MWERKS__
asm OSTick OSGetTick(void) {
// clang-format off
nofralloc
Expand All @@ -28,6 +31,7 @@ asm OSTick OSGetTick(void) {
blr
// clang-format on
}
#endif

#define OS_SYSTEMTIME_BASE 0x30D8

Expand Down
2 changes: 1 addition & 1 deletion src/f_pc/f_pc_deletor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ s32 fpcDt_deleteMethod(base_process_class* i_proc) {

/* 8003D314-8003D34C .text fpcDt_Handler__Fv */
void fpcDt_Handler(void) {
cLsIt_Method(&g_fpcDtTg_Queue, (cNdIt_MethodFunc)fpcDtTg_Do, fpcDt_deleteMethod);
cLsIt_Method(&g_fpcDtTg_Queue, (cNdIt_MethodFunc)fpcDtTg_Do, (void*)fpcDt_deleteMethod);
}

/* 8003D34C-8003D3C8 .text fpcDt_ToQueue__FP18base_process_class */
Expand Down
2 changes: 1 addition & 1 deletion src/m_Do/m_Do_DVDError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void mDoDvdErr_ThdInit() {
OSThread* curThread = OSGetCurrentThread();
s32 priority = OSGetThreadPriority(curThread);

OSCreateThread(&DvdErr_thread, mDoDvdErr_Watch, NULL, DvdErr_stack + sizeof(DvdErr_stack),
OSCreateThread(&DvdErr_thread, (void*)mDoDvdErr_Watch, NULL, DvdErr_stack + sizeof(DvdErr_stack),
sizeof(DvdErr_stack), priority - 3, 1);
OSResumeThread(&DvdErr_thread);
OSCreateAlarm(&Alarm);
Expand Down

0 comments on commit c46adeb

Please sign in to comment.