mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
SIZE_T -> size_t
This commit is contained in:
parent
f03c7163f4
commit
cba5a56ee7
|
|
@ -109,7 +109,7 @@ bool IsEqualXUID(PlayerUID a, PlayerUID b)
|
||||||
void XMemCpy(void *a, const void *b, size_t s) { memcpy(a, b, s); }
|
void XMemCpy(void *a, const void *b, size_t s) { memcpy(a, b, s); }
|
||||||
void XMemSet(void *a, int t, size_t s) { memset(a, t, s); }
|
void XMemSet(void *a, int t, size_t s) { memset(a, t, s); }
|
||||||
void XMemSet128(void *a, int t, size_t s) { memset(a, t, s); }
|
void XMemSet128(void *a, int t, size_t s) { memset(a, t, s); }
|
||||||
void *XPhysicalAlloc(SIZE_T a, ULONG_PTR b, ULONG_PTR c, DWORD d) { return malloc(a); }
|
void *XPhysicalAlloc(size_t a, ULONG_PTR b, ULONG_PTR c, DWORD d) { return malloc(a); }
|
||||||
void XPhysicalFree(void *a) { free(a); }
|
void XPhysicalFree(void *a) { free(a); }
|
||||||
|
|
||||||
D3DXVECTOR3::D3DXVECTOR3() {}
|
D3DXVECTOR3::D3DXVECTOR3() {}
|
||||||
|
|
@ -187,9 +187,9 @@ DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCo
|
||||||
HRESULT XMemDecompress(
|
HRESULT XMemDecompress(
|
||||||
XMEMDECOMPRESSION_CONTEXT Context,
|
XMEMDECOMPRESSION_CONTEXT Context,
|
||||||
void *pDestination,
|
void *pDestination,
|
||||||
SIZE_T *pDestSize,
|
size_t *pDestSize,
|
||||||
void *pSource,
|
void *pSource,
|
||||||
SIZE_T SrcSize
|
size_t SrcSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
memcpy(pDestination, pSource, SrcSize);
|
memcpy(pDestination, pSource, SrcSize);
|
||||||
|
|
@ -218,9 +218,9 @@ HRESULT XMemDecompress(
|
||||||
HRESULT XMemCompress(
|
HRESULT XMemCompress(
|
||||||
XMEMCOMPRESSION_CONTEXT Context,
|
XMEMCOMPRESSION_CONTEXT Context,
|
||||||
void *pDestination,
|
void *pDestination,
|
||||||
SIZE_T *pDestSize,
|
size_t *pDestSize,
|
||||||
void *pSource,
|
void *pSource,
|
||||||
SIZE_T SrcSize
|
size_t SrcSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
memcpy(pDestination, pSource, SrcSize);
|
memcpy(pDestination, pSource, SrcSize);
|
||||||
|
|
|
||||||
|
|
@ -1049,7 +1049,7 @@ volatile int sectCheck = 48;
|
||||||
CRITICAL_SECTION memCS;
|
CRITICAL_SECTION memCS;
|
||||||
DWORD tlsIdx;
|
DWORD tlsIdx;
|
||||||
|
|
||||||
void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
void* XMemAlloc(size_t dwSize, DWORD dwAllocAttributes) {
|
||||||
if (!trackStarted) {
|
if (!trackStarted) {
|
||||||
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
||||||
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
||||||
|
|
@ -1132,7 +1132,7 @@ void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) {
|
||||||
LeaveCriticalSection(&memCS);
|
LeaveCriticalSection(&memCS);
|
||||||
}
|
}
|
||||||
|
|
||||||
SIZE_T WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
size_t WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
||||||
if (trackStarted) {
|
if (trackStarted) {
|
||||||
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
|
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -2323,7 +2323,7 @@ enum __SAL_YesNo { _SAL_notpresent, _SAL_no, _SAL_maybe, _SAL_yes, _SAL_default
|
||||||
// size_t _Count) buffer maybe zero-terminated after the call
|
// size_t _Count) buffer maybe zero-terminated after the call
|
||||||
#define _Post_maybez_ _SAL1_1_Source_(_Post_maybez_, (), _Post1_impl_(__maybezterm_impl))
|
#define _Post_maybez_ _SAL1_1_Source_(_Post_maybez_, (), _Post1_impl_(__maybezterm_impl))
|
||||||
|
|
||||||
// e.g. SIZE_T HeapSize( _In_ HANDLE hHeap, DWORD dwFlags, _Pre_notnull_ _Post_bytecap_(return)
|
// e.g. size_t HeapSize( _In_ HANDLE hHeap, DWORD dwFlags, _Pre_notnull_ _Post_bytecap_(return)
|
||||||
// LPCVOID lpMem );
|
// LPCVOID lpMem );
|
||||||
#define _Post_cap_(size) _SAL1_1_Source_(_Post_cap_, (size), _Post1_impl_(__cap_impl(size)))
|
#define _Post_cap_(size) _SAL1_1_Source_(_Post_cap_, (size), _Post1_impl_(__cap_impl(size)))
|
||||||
#define _Post_bytecap_(size) \
|
#define _Post_bytecap_(size) \
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ typedef unsigned int* LPDWORD;
|
||||||
typedef char CHAR;
|
typedef char CHAR;
|
||||||
typedef uintptr_t ULONG_PTR;
|
typedef uintptr_t ULONG_PTR;
|
||||||
typedef long LONG;
|
typedef long LONG;
|
||||||
typedef uint64_t PlayerUID;
|
typedef unsigned long long PlayerUID;
|
||||||
typedef DWORD WORD;
|
typedef DWORD WORD;
|
||||||
typedef DWORD* PDWORD;
|
typedef DWORD* PDWORD;
|
||||||
|
|
||||||
|
|
@ -45,7 +45,6 @@ typedef struct {
|
||||||
} ULARGE_INTEGER;
|
} ULARGE_INTEGER;
|
||||||
|
|
||||||
typedef long long LONGLONG;
|
typedef long long LONGLONG;
|
||||||
typedef size_t SIZE_T;
|
|
||||||
typedef wchar_t *LPWSTR, *PWSTR;
|
typedef wchar_t *LPWSTR, *PWSTR;
|
||||||
typedef unsigned char boolean; // java brainrot
|
typedef unsigned char boolean; // java brainrot
|
||||||
#define __debugbreak()
|
#define __debugbreak()
|
||||||
|
|
@ -167,12 +166,12 @@ typedef struct _FILETIME {
|
||||||
typedef struct _MEMORYSTATUS {
|
typedef struct _MEMORYSTATUS {
|
||||||
DWORD dwLength;
|
DWORD dwLength;
|
||||||
DWORD dwMemoryLoad;
|
DWORD dwMemoryLoad;
|
||||||
SIZE_T dwTotalPhys;
|
size_t dwTotalPhys;
|
||||||
SIZE_T dwAvailPhys;
|
size_t dwAvailPhys;
|
||||||
SIZE_T dwTotalPageFile;
|
size_t dwTotalPageFile;
|
||||||
SIZE_T dwAvailPageFile;
|
size_t dwAvailPageFile;
|
||||||
SIZE_T dwTotalVirtual;
|
size_t dwTotalVirtual;
|
||||||
SIZE_T dwAvailVirtual;
|
size_t dwAvailVirtual;
|
||||||
} MEMORYSTATUS, *LPMEMORYSTATUS;
|
} MEMORYSTATUS, *LPMEMORYSTATUS;
|
||||||
|
|
||||||
typedef struct _WIN32_FIND_DATAA {
|
typedef struct _WIN32_FIND_DATAA {
|
||||||
|
|
@ -957,7 +956,7 @@ static inline DWORD _WaitForThread(struct LinuxThread* lt,
|
||||||
|
|
||||||
static DWORD g_nextThreadId = 1000;
|
static DWORD g_nextThreadId = 1000;
|
||||||
|
|
||||||
static inline HANDLE CreateThread(void*, SIZE_T stackSize,
|
static inline HANDLE CreateThread(void*, size_t stackSize,
|
||||||
LPTHREAD_START_ROUTINE lpStartAddress,
|
LPTHREAD_START_ROUTINE lpStartAddress,
|
||||||
void* lpParameter, DWORD dwCreationFlags,
|
void* lpParameter, DWORD dwCreationFlags,
|
||||||
DWORD* lpThreadId) {
|
DWORD* lpThreadId) {
|
||||||
|
|
@ -1049,7 +1048,7 @@ static inline int swprintf_s(wchar_t* buf, size_t sz, const wchar_t* fmt, ...) {
|
||||||
|
|
||||||
static inline HMODULE GetModuleHandle(const char* lpModuleName) { return 0; }
|
static inline HMODULE GetModuleHandle(const char* lpModuleName) { return 0; }
|
||||||
|
|
||||||
static inline void* VirtualAlloc(void* lpAddress, SIZE_T dwSize,
|
static inline void* VirtualAlloc(void* lpAddress, size_t dwSize,
|
||||||
DWORD flAllocationType, DWORD flProtect) {
|
DWORD flAllocationType, DWORD flProtect) {
|
||||||
// MEM_COMMIT | MEM_RESERVE → mmap anonymous
|
// MEM_COMMIT | MEM_RESERVE → mmap anonymous
|
||||||
int prot = 0;
|
int prot = 0;
|
||||||
|
|
@ -1070,7 +1069,7 @@ static inline void* VirtualAlloc(void* lpAddress, SIZE_T dwSize,
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool VirtualFree(void* lpAddress, SIZE_T dwSize,
|
static inline bool VirtualFree(void* lpAddress, size_t dwSize,
|
||||||
DWORD dwFreeType) {
|
DWORD dwFreeType) {
|
||||||
if (lpAddress == nullptr) return FALSE;
|
if (lpAddress == nullptr) return FALSE;
|
||||||
// MEM_RELEASE (0x8000) frees the whole region
|
// MEM_RELEASE (0x8000) frees the whole region
|
||||||
|
|
|
||||||
|
|
@ -2703,7 +2703,7 @@ __stdcall
|
||||||
XMemSet(
|
XMemSet(
|
||||||
PVOID pDest,
|
PVOID pDest,
|
||||||
INT c,
|
INT c,
|
||||||
SIZE_T count
|
size_t count
|
||||||
);
|
);
|
||||||
|
|
||||||
PVOID
|
PVOID
|
||||||
|
|
@ -2711,7 +2711,7 @@ __stdcall
|
||||||
XMemCpy(
|
XMemCpy(
|
||||||
PVOID pDest,
|
PVOID pDest,
|
||||||
const void* pSrc,
|
const void* pSrc,
|
||||||
SIZE_T count
|
size_t count
|
||||||
);
|
);
|
||||||
|
|
||||||
char * __cdecl strcpy( char *_Dest, const char * _Source);
|
char * __cdecl strcpy( char *_Dest, const char * _Source);
|
||||||
|
|
|
||||||
|
|
@ -935,7 +935,7 @@ volatile int sectCheck = 48;
|
||||||
CRITICAL_SECTION memCS;
|
CRITICAL_SECTION memCS;
|
||||||
DWORD tlsIdx;
|
DWORD tlsIdx;
|
||||||
|
|
||||||
void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
void* XMemAlloc(size_t dwSize, DWORD dwAllocAttributes) {
|
||||||
if (!trackStarted) {
|
if (!trackStarted) {
|
||||||
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
||||||
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
||||||
|
|
@ -1018,7 +1018,7 @@ void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) {
|
||||||
LeaveCriticalSection(&memCS);
|
LeaveCriticalSection(&memCS);
|
||||||
}
|
}
|
||||||
|
|
||||||
SIZE_T WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
size_t WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
||||||
if (trackStarted) {
|
if (trackStarted) {
|
||||||
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
|
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -247,13 +247,13 @@ HRESULT Compression::Compress(void* pDestination, unsigned int* pDestSize,
|
||||||
// Using zlib for x64 compression - 360 is using native 360 compression and
|
// Using zlib for x64 compression - 360 is using native 360 compression and
|
||||||
// PS3 a stubbed non-compressing version of this
|
// PS3 a stubbed non-compressing version of this
|
||||||
#if defined(_WIN64) || defined(__linux__)
|
#if defined(_WIN64) || defined(__linux__)
|
||||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
size_t destSize = (size_t)(*pDestSize);
|
||||||
int res = ::compress((Bytef*)pDestination, (uLongf*)&destSize,
|
int res = ::compress((Bytef*)pDestination, (uLongf*)&destSize,
|
||||||
(Bytef*)pSource, SrcSize);
|
(Bytef*)pSource, SrcSize);
|
||||||
*pDestSize = (unsigned int)destSize;
|
*pDestSize = (unsigned int)destSize;
|
||||||
return ((res == Z_OK) ? S_OK : -1);
|
return ((res == Z_OK) ? S_OK : -1);
|
||||||
#else
|
#else
|
||||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
size_t destSize = (size_t)(*pDestSize);
|
||||||
HRESULT res = XMemCompress(compressionContext, pDestination, &destSize,
|
HRESULT res = XMemCompress(compressionContext, pDestination, &destSize,
|
||||||
pSource, SrcSize);
|
pSource, SrcSize);
|
||||||
*pDestSize = (unsigned int)destSize;
|
*pDestSize = (unsigned int)destSize;
|
||||||
|
|
@ -275,15 +275,15 @@ HRESULT Compression::Decompress(void* pDestination, unsigned int* pDestSize,
|
||||||
// Using zlib for x64 compression - 360 is using native 360 compression and
|
// Using zlib for x64 compression - 360 is using native 360 compression and
|
||||||
// PS3 a stubbed non-compressing version of this
|
// PS3 a stubbed non-compressing version of this
|
||||||
#if defined(_WIN64) || defined(__linux__)
|
#if defined(_WIN64) || defined(__linux__)
|
||||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
size_t destSize = (size_t)(*pDestSize);
|
||||||
int res = ::uncompress((Bytef*)pDestination, (uLongf*)&destSize,
|
int res = ::uncompress((Bytef*)pDestination, (uLongf*)&destSize,
|
||||||
(Bytef*)pSource, SrcSize);
|
(Bytef*)pSource, SrcSize);
|
||||||
*pDestSize = (unsigned int)destSize;
|
*pDestSize = (unsigned int)destSize;
|
||||||
return ((res == Z_OK) ? S_OK : -1);
|
return ((res == Z_OK) ? S_OK : -1);
|
||||||
#else
|
#else
|
||||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
size_t destSize = (size_t)(*pDestSize);
|
||||||
HRESULT res = XMemDecompress(decompressionContext, pDestination,
|
HRESULT res = XMemDecompress(decompressionContext, pDestination,
|
||||||
(SIZE_T*)&destSize, pSource, SrcSize);
|
(size_t*)&destSize, pSource, SrcSize);
|
||||||
*pDestSize = (unsigned int)destSize;
|
*pDestSize = (unsigned int)destSize;
|
||||||
return res;
|
return res;
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -293,7 +293,7 @@ HRESULT Compression::Decompress(void* pDestination, unsigned int* pDestSize,
|
||||||
// platforms (so no virtual mem stuff)
|
// platforms (so no virtual mem stuff)
|
||||||
void Compression::VitaVirtualDecompress(
|
void Compression::VitaVirtualDecompress(
|
||||||
void* pDestination, unsigned int* pDestSize, void* pSource,
|
void* pDestination, unsigned int* pDestSize, void* pSource,
|
||||||
unsigned int SrcSize) // (void* buf, SIZE_T dwSize, void* dst)
|
unsigned int SrcSize) // (void* buf, size_t dwSize, void* dst)
|
||||||
{
|
{
|
||||||
std::uint8_t* pSrc = (std::uint8_t*)pSource;
|
std::uint8_t* pSrc = (std::uint8_t*)pSource;
|
||||||
int Offset = 0;
|
int Offset = 0;
|
||||||
|
|
@ -333,9 +333,9 @@ HRESULT Compression::DecompressWithType(void* pDestination,
|
||||||
return S_OK;
|
return S_OK;
|
||||||
case eCompressionType_LZXRLE: {
|
case eCompressionType_LZXRLE: {
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
size_t destSize = (size_t)(*pDestSize);
|
||||||
HRESULT res = XMemDecompress(decompressionContext, pDestination,
|
HRESULT res = XMemDecompress(decompressionContext, pDestination,
|
||||||
(SIZE_T*)&destSize, pSource, SrcSize);
|
(size_t*)&destSize, pSource, SrcSize);
|
||||||
*pDestSize = (unsigned int)destSize;
|
*pDestSize = (unsigned int)destSize;
|
||||||
return res;
|
return res;
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
#define MULTITHREAD_ENABLE
|
#define MULTITHREAD_ENABLE
|
||||||
|
|
||||||
typedef unsigned char byte;
|
|
||||||
constexpr int MINECRAFT_NET_MAX_PLAYERS = 8;
|
constexpr int MINECRAFT_NET_MAX_PLAYERS = 8;
|
||||||
|
|
||||||
static_assert(
|
static_assert(
|
||||||
|
|
@ -60,7 +59,7 @@ public:
|
||||||
void XMemCpy(void* a, const void* b, size_t s);
|
void XMemCpy(void* a, const void* b, size_t s);
|
||||||
void XMemSet(void* a, int t, size_t s);
|
void XMemSet(void* a, int t, size_t s);
|
||||||
void XMemSet128(void* a, int t, size_t s);
|
void XMemSet128(void* a, int t, size_t s);
|
||||||
void* XPhysicalAlloc(SIZE_T a, ULONG_PTR b, ULONG_PTR c, DWORD d);
|
void* XPhysicalAlloc(size_t a, ULONG_PTR b, ULONG_PTR c, DWORD d);
|
||||||
void XPhysicalFree(void* a);
|
void XPhysicalFree(void* a);
|
||||||
|
|
||||||
class DLCManager;
|
class DLCManager;
|
||||||
|
|
@ -280,10 +279,10 @@ typedef enum _XMEMCODEC_TYPE {
|
||||||
} XMEMCODEC_TYPE;
|
} XMEMCODEC_TYPE;
|
||||||
|
|
||||||
HRESULT XMemDecompress(XMEMDECOMPRESSION_CONTEXT Context, void* pDestination,
|
HRESULT XMemDecompress(XMEMDECOMPRESSION_CONTEXT Context, void* pDestination,
|
||||||
SIZE_T* pDestSize, void* pSource, SIZE_T SrcSize);
|
size_t* pDestSize, void* pSource, size_t SrcSize);
|
||||||
|
|
||||||
HRESULT XMemCompress(XMEMCOMPRESSION_CONTEXT Context, void* pDestination,
|
HRESULT XMemCompress(XMEMCOMPRESSION_CONTEXT Context, void* pDestination,
|
||||||
SIZE_T* pDestSize, void* pSource, SIZE_T SrcSize);
|
size_t* pDestSize, void* pSource, size_t SrcSize);
|
||||||
|
|
||||||
HRESULT XMemCreateCompressionContext(XMEMCODEC_TYPE CodecType,
|
HRESULT XMemCreateCompressionContext(XMEMCODEC_TYPE CodecType,
|
||||||
const void* pCodecParams, DWORD Flags,
|
const void* pCodecParams, DWORD Flags,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue