mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-22 11:32:57 +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 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 *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); }
|
||||
|
||||
D3DXVECTOR3::D3DXVECTOR3() {}
|
||||
|
|
@ -187,9 +187,9 @@ DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCo
|
|||
HRESULT XMemDecompress(
|
||||
XMEMDECOMPRESSION_CONTEXT Context,
|
||||
void *pDestination,
|
||||
SIZE_T *pDestSize,
|
||||
size_t *pDestSize,
|
||||
void *pSource,
|
||||
SIZE_T SrcSize
|
||||
size_t SrcSize
|
||||
)
|
||||
{
|
||||
memcpy(pDestination, pSource, SrcSize);
|
||||
|
|
@ -218,9 +218,9 @@ HRESULT XMemDecompress(
|
|||
HRESULT XMemCompress(
|
||||
XMEMCOMPRESSION_CONTEXT Context,
|
||||
void *pDestination,
|
||||
SIZE_T *pDestSize,
|
||||
size_t *pDestSize,
|
||||
void *pSource,
|
||||
SIZE_T SrcSize
|
||||
size_t SrcSize
|
||||
)
|
||||
{
|
||||
memcpy(pDestination, pSource, SrcSize);
|
||||
|
|
|
|||
|
|
@ -1049,7 +1049,7 @@ volatile int sectCheck = 48;
|
|||
CRITICAL_SECTION memCS;
|
||||
DWORD tlsIdx;
|
||||
|
||||
void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
||||
void* XMemAlloc(size_t dwSize, DWORD dwAllocAttributes) {
|
||||
if (!trackStarted) {
|
||||
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
||||
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
||||
|
|
@ -1132,7 +1132,7 @@ void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) {
|
|||
LeaveCriticalSection(&memCS);
|
||||
}
|
||||
|
||||
SIZE_T WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
||||
size_t WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
||||
if (trackStarted) {
|
||||
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
|
||||
} 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
|
||||
#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 );
|
||||
#define _Post_cap_(size) _SAL1_1_Source_(_Post_cap_, (size), _Post1_impl_(__cap_impl(size)))
|
||||
#define _Post_bytecap_(size) \
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ typedef unsigned int* LPDWORD;
|
|||
typedef char CHAR;
|
||||
typedef uintptr_t ULONG_PTR;
|
||||
typedef long LONG;
|
||||
typedef uint64_t PlayerUID;
|
||||
typedef unsigned long long PlayerUID;
|
||||
typedef DWORD WORD;
|
||||
typedef DWORD* PDWORD;
|
||||
|
||||
|
|
@ -45,7 +45,6 @@ typedef struct {
|
|||
} ULARGE_INTEGER;
|
||||
|
||||
typedef long long LONGLONG;
|
||||
typedef size_t SIZE_T;
|
||||
typedef wchar_t *LPWSTR, *PWSTR;
|
||||
typedef unsigned char boolean; // java brainrot
|
||||
#define __debugbreak()
|
||||
|
|
@ -167,12 +166,12 @@ typedef struct _FILETIME {
|
|||
typedef struct _MEMORYSTATUS {
|
||||
DWORD dwLength;
|
||||
DWORD dwMemoryLoad;
|
||||
SIZE_T dwTotalPhys;
|
||||
SIZE_T dwAvailPhys;
|
||||
SIZE_T dwTotalPageFile;
|
||||
SIZE_T dwAvailPageFile;
|
||||
SIZE_T dwTotalVirtual;
|
||||
SIZE_T dwAvailVirtual;
|
||||
size_t dwTotalPhys;
|
||||
size_t dwAvailPhys;
|
||||
size_t dwTotalPageFile;
|
||||
size_t dwAvailPageFile;
|
||||
size_t dwTotalVirtual;
|
||||
size_t dwAvailVirtual;
|
||||
} MEMORYSTATUS, *LPMEMORYSTATUS;
|
||||
|
||||
typedef struct _WIN32_FIND_DATAA {
|
||||
|
|
@ -957,7 +956,7 @@ static inline DWORD _WaitForThread(struct LinuxThread* lt,
|
|||
|
||||
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,
|
||||
void* lpParameter, DWORD dwCreationFlags,
|
||||
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 void* VirtualAlloc(void* lpAddress, SIZE_T dwSize,
|
||||
static inline void* VirtualAlloc(void* lpAddress, size_t dwSize,
|
||||
DWORD flAllocationType, DWORD flProtect) {
|
||||
// MEM_COMMIT | MEM_RESERVE → mmap anonymous
|
||||
int prot = 0;
|
||||
|
|
@ -1070,7 +1069,7 @@ static inline void* VirtualAlloc(void* lpAddress, SIZE_T dwSize,
|
|||
return p;
|
||||
}
|
||||
|
||||
static inline bool VirtualFree(void* lpAddress, SIZE_T dwSize,
|
||||
static inline bool VirtualFree(void* lpAddress, size_t dwSize,
|
||||
DWORD dwFreeType) {
|
||||
if (lpAddress == nullptr) return FALSE;
|
||||
// MEM_RELEASE (0x8000) frees the whole region
|
||||
|
|
|
|||
|
|
@ -2703,7 +2703,7 @@ __stdcall
|
|||
XMemSet(
|
||||
PVOID pDest,
|
||||
INT c,
|
||||
SIZE_T count
|
||||
size_t count
|
||||
);
|
||||
|
||||
PVOID
|
||||
|
|
@ -2711,7 +2711,7 @@ __stdcall
|
|||
XMemCpy(
|
||||
PVOID pDest,
|
||||
const void* pSrc,
|
||||
SIZE_T count
|
||||
size_t count
|
||||
);
|
||||
|
||||
char * __cdecl strcpy( char *_Dest, const char * _Source);
|
||||
|
|
|
|||
|
|
@ -935,7 +935,7 @@ volatile int sectCheck = 48;
|
|||
CRITICAL_SECTION memCS;
|
||||
DWORD tlsIdx;
|
||||
|
||||
void* XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes) {
|
||||
void* XMemAlloc(size_t dwSize, DWORD dwAllocAttributes) {
|
||||
if (!trackStarted) {
|
||||
void* p = XMemAllocDefault(dwSize, dwAllocAttributes);
|
||||
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
|
||||
|
|
@ -1018,7 +1018,7 @@ void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) {
|
|||
LeaveCriticalSection(&memCS);
|
||||
}
|
||||
|
||||
SIZE_T WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
||||
size_t WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
|
||||
if (trackStarted) {
|
||||
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
|
||||
} 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
|
||||
// PS3 a stubbed non-compressing version of this
|
||||
#if defined(_WIN64) || defined(__linux__)
|
||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
||||
size_t destSize = (size_t)(*pDestSize);
|
||||
int res = ::compress((Bytef*)pDestination, (uLongf*)&destSize,
|
||||
(Bytef*)pSource, SrcSize);
|
||||
*pDestSize = (unsigned int)destSize;
|
||||
return ((res == Z_OK) ? S_OK : -1);
|
||||
#else
|
||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
||||
size_t destSize = (size_t)(*pDestSize);
|
||||
HRESULT res = XMemCompress(compressionContext, pDestination, &destSize,
|
||||
pSource, SrcSize);
|
||||
*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
|
||||
// PS3 a stubbed non-compressing version of this
|
||||
#if defined(_WIN64) || defined(__linux__)
|
||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
||||
size_t destSize = (size_t)(*pDestSize);
|
||||
int res = ::uncompress((Bytef*)pDestination, (uLongf*)&destSize,
|
||||
(Bytef*)pSource, SrcSize);
|
||||
*pDestSize = (unsigned int)destSize;
|
||||
return ((res == Z_OK) ? S_OK : -1);
|
||||
#else
|
||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
||||
size_t destSize = (size_t)(*pDestSize);
|
||||
HRESULT res = XMemDecompress(decompressionContext, pDestination,
|
||||
(SIZE_T*)&destSize, pSource, SrcSize);
|
||||
(size_t*)&destSize, pSource, SrcSize);
|
||||
*pDestSize = (unsigned int)destSize;
|
||||
return res;
|
||||
#endif
|
||||
|
|
@ -293,7 +293,7 @@ HRESULT Compression::Decompress(void* pDestination, unsigned int* pDestSize,
|
|||
// platforms (so no virtual mem stuff)
|
||||
void Compression::VitaVirtualDecompress(
|
||||
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;
|
||||
int Offset = 0;
|
||||
|
|
@ -333,9 +333,9 @@ HRESULT Compression::DecompressWithType(void* pDestination,
|
|||
return S_OK;
|
||||
case eCompressionType_LZXRLE: {
|
||||
#if defined(_WIN64)
|
||||
SIZE_T destSize = (SIZE_T)(*pDestSize);
|
||||
size_t destSize = (size_t)(*pDestSize);
|
||||
HRESULT res = XMemDecompress(decompressionContext, pDestination,
|
||||
(SIZE_T*)&destSize, pSource, SrcSize);
|
||||
(size_t*)&destSize, pSource, SrcSize);
|
||||
*pDestSize = (unsigned int)destSize;
|
||||
return res;
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
#define MULTITHREAD_ENABLE
|
||||
|
||||
typedef unsigned char byte;
|
||||
constexpr int MINECRAFT_NET_MAX_PLAYERS = 8;
|
||||
|
||||
static_assert(
|
||||
|
|
@ -60,7 +59,7 @@ public:
|
|||
void XMemCpy(void* a, const void* b, size_t s);
|
||||
void XMemSet(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);
|
||||
|
||||
class DLCManager;
|
||||
|
|
@ -280,10 +279,10 @@ typedef enum _XMEMCODEC_TYPE {
|
|||
} XMEMCODEC_TYPE;
|
||||
|
||||
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,
|
||||
SIZE_T* pDestSize, void* pSource, SIZE_T SrcSize);
|
||||
size_t* pDestSize, void* pSource, size_t SrcSize);
|
||||
|
||||
HRESULT XMemCreateCompressionContext(XMEMCODEC_TYPE CodecType,
|
||||
const void* pCodecParams, DWORD Flags,
|
||||
|
|
|
|||
Loading…
Reference in a new issue