From 28614b922fb77149a54da1a87bebfbc98736f296 Mon Sep 17 00:00:00 2001 From: ModMaker101 <119018978+ModMaker101@users.noreply.github.com> Date: Sun, 8 Mar 2026 19:08:36 -0400 Subject: Modernize project codebase (#906) * Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides * Add safety checks and fix a issue with vector going OOR --- Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp') diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp index 4143c555..c11a8593 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp @@ -74,8 +74,8 @@ int _wcsicmp( const wchar_t * dst, const wchar_t * src ) wchar_t f,l; // validation section - // _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR); - // _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR); + // _VALIDATE_RETURN(dst != nullptr, EINVAL, _NLSCMPERROR); + // _VALIDATE_RETURN(src != nullptr, EINVAL, _NLSCMPERROR); do { f = towlower(*dst); @@ -90,7 +90,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize) { size_t n; -// Note that we do not check if s == NULL, because we do not +// Note that we do not check if s == nullptr, because we do not // return errno_t... for (n = 0; n < maxsize && *wcs; n++, wcs++) @@ -134,7 +134,7 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) lpSystemTime->wMilliseconds = cellRtcGetMicrosecond(&dateTime)/1000; } -HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PS3_STUBBED; return NULL; } +HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PS3_STUBBED; return nullptr; } VOID Sleep(DWORD dwMilliseconds) { C4JThread::Sleep(dwMilliseconds); @@ -267,8 +267,8 @@ BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { return TLSStoragePS3::In LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { int err; - sys_addr_t newAddress = NULL; - if(lpAddress == NULL) + sys_addr_t newAddress = nullptr; + if(lpAddress == nullptr) { // reserve, and possibly commit also int commitSize = 0; @@ -382,7 +382,7 @@ BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHi int fd = (int) hFile; uint64_t pos = 0, bitsToMove = (int64_t) lDistanceToMove; - if (lpDistanceToMoveHigh != NULL) + if (lpDistanceToMoveHigh != nullptr) bitsToMove |= ((uint64_t) (*lpDistanceToMoveHigh)) << 32; int whence = 0; @@ -490,7 +490,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, } else { - err = cellFsOpen(filePath, flags, &fd ,NULL, 0); + err = cellFsOpen(filePath, flags, &fd ,nullptr, 0); iFilesOpen++; //printf("\n\nFiles Open - %d\n\n",iFilesOpen); } @@ -675,7 +675,7 @@ errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_ int _wtoi(const wchar_t *_Str) { - return wcstol(_Str, NULL, 10); + return wcstol(_Str, nullptr, 10); } -- cgit v1.2.3