summaryrefslogtreecommitdiff
path: root/src/JSystem/JUtility
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2025-09-04 07:56:59 -0700
committerGitHub <noreply@github.com>2025-09-04 17:56:59 +0300
commitb45a089e15d79821b07be020db628e01a49b1fd2 (patch)
tree948057548cc19b19d644bd4f300ca6434e6bff11 /src/JSystem/JUtility
parentee8b843996f4d888903f8c125b95ec1af376877e (diff)
some J3D/misc cleanup (#2628)
* some j3d cleanup * begin using uintptr_t * j3dgraphbase cleanup * j3dgraphanimator cleanup
Diffstat (limited to 'src/JSystem/JUtility')
-rw-r--r--src/JSystem/JUtility/JUTDirectFile.cpp3
-rw-r--r--src/JSystem/JUtility/JUTDirectPrint.cpp2
-rw-r--r--src/JSystem/JUtility/JUTException.cpp13
-rw-r--r--src/JSystem/JUtility/JUTProcBar.cpp3
4 files changed, 12 insertions, 9 deletions
diff --git a/src/JSystem/JUtility/JUTDirectFile.cpp b/src/JSystem/JUtility/JUTDirectFile.cpp
index 8b9c31e747..8a670475c5 100644
--- a/src/JSystem/JUtility/JUTDirectFile.cpp
+++ b/src/JSystem/JUtility/JUTDirectFile.cpp
@@ -6,6 +6,7 @@
#include "JSystem/JUtility/JUTDirectFile.h"
#include <dolphin/os.h>
#include "global.h"
+#include <stdint.h>
//
// Forward References:
@@ -47,7 +48,7 @@ JUTDirectFile::JUTDirectFile() {
mLength = 0;
mPos = 0;
mToRead = 0;
- mSectorStart = (u8*)ALIGN_NEXT((u32)mBuffer, DVD_MIN_TRANSFER_SIZE);
+ mSectorStart = (u8*)ALIGN_NEXT((uintptr_t)mBuffer, DVD_MIN_TRANSFER_SIZE);
mIsOpen = false;
}
diff --git a/src/JSystem/JUtility/JUTDirectPrint.cpp b/src/JSystem/JUtility/JUTDirectPrint.cpp
index a020ee2936..2f708f3043 100644
--- a/src/JSystem/JUtility/JUTDirectPrint.cpp
+++ b/src/JSystem/JUtility/JUTDirectPrint.cpp
@@ -190,7 +190,7 @@ void JUTDirectPrint::printSub(u16 position_x, u16 position_y, char const* format
return;
}
- int buffer_length = vsnprintf(buffer, ARRAY_SIZE(buffer), format, args);
+ int buffer_length = vsnprintf(buffer, ARRAY_SIZEU(buffer), format, args);
u16 x = position_x;
if (buffer_length > 0) {
if (clear) {
diff --git a/src/JSystem/JUtility/JUTException.cpp b/src/JSystem/JUtility/JUTException.cpp
index 7ea4a54e22..754b8277c4 100644
--- a/src/JSystem/JUtility/JUTException.cpp
+++ b/src/JSystem/JUtility/JUTException.cpp
@@ -11,6 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <dolphin.h>
+#include <stdint.h>
/* 803CC620-803CC640 029740 0020+00 3/3 0/0 0/0 .data sMessageQueue__12JUTException */
OSMessageQueue JUTException::sMessageQueue = {0};
@@ -191,7 +192,7 @@ void JUTException::panic_f_va(char const* file, int line, char const* format, va
OSContext* current_context = OSGetCurrentContext();
memcpy(&context, current_context, sizeof(OSContext));
- sErrorManager->mStackPointer = (u32)OSGetStackPointer();
+ sErrorManager->mStackPointer = (uintptr_t)OSGetStackPointer();
exCallbackObject.callback = sPreUserCallback;
exCallbackObject.error = 0xFF;
@@ -468,10 +469,10 @@ bool JUTException::showMapInfo_subroutine(u32 address, bool begin_with_newline)
if (result == true) {
result =
queryMapAddress((char*)name_part, section_offset, section_id, &out_addr, &out_size,
- out_line, ARRAY_SIZE(out_line), true, begin_with_newline);
+ out_line, ARRAY_SIZEU(out_line), true, begin_with_newline);
} else {
result = queryMapAddress(NULL, address, -1, &out_addr, &out_size, out_line,
- ARRAY_SIZE(out_line), true, begin_with_newline);
+ ARRAY_SIZEU(out_line), true, begin_with_newline);
}
if (result == true) {
@@ -826,7 +827,7 @@ void JUTException::createFB() {
u32 pixel_count = width * height;
u32 size = pixel_count * 2;
- void* begin = (void*)ALIGN_PREV((u32)end - size, 32);
+ void* begin = (void*)ALIGN_PREV((uintptr_t)end - size, 32);
void* object = (void*)ALIGN_PREV((s32)begin - sizeof(JUTExternalFB), 32);
new (object) JUTExternalFB(renderMode, GX_GM_1_7, begin, size);
@@ -934,7 +935,7 @@ bool JUTException::queryMapAddress_single(char* mapPath, u32 address, s32 sectio
char* src;
char* dst;
- if (file.fgets(buffer, ARRAY_SIZE(buffer)) < 0)
+ if (file.fgets(buffer, ARRAY_SIZEU(buffer)) < 0)
break;
if (buffer[0] != '.')
continue;
@@ -968,7 +969,7 @@ bool JUTException::queryMapAddress_single(char* mapPath, u32 address, s32 sectio
int length;
while (true) {
- if ((length = file.fgets(buffer, ARRAY_SIZE(buffer))) <= 4)
+ if ((length = file.fgets(buffer, ARRAY_SIZEU(buffer))) <= 4)
break;
if ((length < 28))
continue;
diff --git a/src/JSystem/JUtility/JUTProcBar.cpp b/src/JSystem/JUtility/JUTProcBar.cpp
index a276be2321..fc72d7a276 100644
--- a/src/JSystem/JUtility/JUTProcBar.cpp
+++ b/src/JSystem/JUtility/JUTProcBar.cpp
@@ -2,6 +2,7 @@
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTVideo.h"
+#include <stdint.h>
/* 802E5888-802E599C 2E01C8 0114+00 1/1 0/0 0/0 .text __ct__10JUTProcBarFv */
JUTProcBar::JUTProcBar() {
@@ -263,7 +264,7 @@ void JUTProcBar::drawProcessBar() {
/* 802E6D3C-802E6DA4 2E167C 0068+00 2/2 0/0 0/0 .text addrToXPos__FPvi */
static int addrToXPos(void* param_0, int param_1) {
- return param_1 * (((u32)param_0 - 0x80000000) / (float)JKRHeap::mMemorySize);
+ return param_1 * (((uintptr_t)param_0 - 0x80000000) / (float)JKRHeap::mMemorySize);
}
/* 802E6DA4-802E6E0C 2E16E4 0068+00 2/2 0/0 0/0 .text byteToXLen__Fii */