Merge pull request #357 from 4jcraft/refactor/expand-auto-var

nuke more winapi types
This commit is contained in:
MatthewBeshay 2026-03-30 16:44:08 +11:00 committed by GitHub
commit b28650976d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
63 changed files with 354 additions and 361 deletions

View file

@ -3459,7 +3459,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) {
// #ifndef _CONTENT_PACKAGE
// if(!(ui.GetMenuDisplayed(iPad)))
// {
// WCHAR wchInput;
// wchar_t wchInput;
// if(InputManager.InputDetected(iPad,&wchInput))
// {
// printf("Input Detected!\n");

View file

@ -204,8 +204,8 @@ LevelChunk* MultiPlayerChunkCache::create(int x, int z) {
#if (defined _WIN64 || defined __LP64__)
if (InterlockedCompareExchangeRelease64(
(LONG64*)&cache[idx], (LONG64)chunk, (LONG64)lastChunk) ==
(LONG64)lastChunk)
(int64_t*)&cache[idx], (int64_t)chunk, (int64_t)lastChunk) ==
(int64_t)lastChunk)
#else
if (InterlockedCompareExchangeRelease((LONG*)&cache[idx], (LONG)chunk,
(LONG)lastChunk) ==

View file

@ -163,8 +163,8 @@ LevelChunk* ServerChunkCache::create(
#if defined(_WIN64) || defined(__LP64__)
if (InterlockedCompareExchangeRelease64(
(LONG64*)&cache[idx], (LONG64)chunk, (LONG64)lastChunk) ==
(LONG64)lastChunk)
(int64_t*)&cache[idx], (int64_t)chunk, (int64_t)lastChunk) ==
(int64_t)lastChunk)
#else
if (InterlockedCompareExchangeRelease((LONG*)&cache[idx], (LONG)chunk,
(LONG)lastChunk) ==

View file

@ -137,17 +137,17 @@ typedef struct {
typedef struct {
eXUID eXuid;
WCHAR wchCape[MAX_CAPENAME_SIZE];
WCHAR wchSkin[MAX_CAPENAME_SIZE];
wchar_t wchCape[MAX_CAPENAME_SIZE];
wchar_t wchSkin[MAX_CAPENAME_SIZE];
} MOJANG_DATA;
typedef struct {
eDLCContentType eDLCType;
ULONGLONG ullOfferID_Full;
ULONGLONG ullOfferID_Trial;
WCHAR wchBanner[MAX_BANNERNAME_SIZE];
WCHAR wchDataFile[MAX_BANNERNAME_SIZE];
uint64_t ullOfferID_Full;
uint64_t ullOfferID_Trial;
wchar_t wchBanner[MAX_BANNERNAME_SIZE];
wchar_t wchDataFile[MAX_BANNERNAME_SIZE];
int iGender;
int iConfig;
unsigned int uiSortIndex;
@ -177,7 +177,7 @@ typedef struct _TMSPPRequest {
// char szFilename[MAX_TMSFILENAME_SIZE];
int (*CallbackFunc)(void*, int, int, C4JStorage::PTMSPP_FILEDATA,
const char* szFilename);
WCHAR wchFilename[MAX_TMSFILENAME_SIZE];
wchar_t wchFilename[MAX_TMSFILENAME_SIZE];
void* lpCallbackParam;
} TMSPPRequest;

View file

@ -57,8 +57,8 @@ public:
virtual void SetIsPlayingEndMusic(bool bVal);
virtual void SetIsPlayingNetherMusic(bool bVal);
static const WCHAR* wchSoundNames[eSoundType_MAX];
static const WCHAR* wchUISoundNames[eSFX_MAX];
static const wchar_t* wchSoundNames[eSoundType_MAX];
static const wchar_t* wchUISoundNames[eSFX_MAX];
public:
void tick();

View file

@ -2,7 +2,7 @@
#include "Consoles_SoundEngine.h"
const WCHAR* ConsoleSoundEngine::wchSoundNames[eSoundType_MAX] = {
const wchar_t* ConsoleSoundEngine::wchSoundNames[eSoundType_MAX] = {
L"mob/chicken/chicken", // eSoundType_MOB_CHICKEN_AMBIENT
L"mob/chicken/chickenhurt", // eSoundType_MOB_CHICKEN_HURT
L"mob/chicken/chickenplop", // eSoundType_MOB_CHICKENPLOP
@ -224,6 +224,6 @@ const WCHAR* ConsoleSoundEngine::wchSoundNames[eSoundType_MAX] = {
L"fire/new_ignite",
};
const WCHAR* ConsoleSoundEngine::wchUISoundNames[eSFX_MAX] = {
const wchar_t* ConsoleSoundEngine::wchUISoundNames[eSFX_MAX] = {
L"back", L"craft", L"craftfail", L"focus", L"press", L"scroll",
};

View file

@ -3473,7 +3473,7 @@ void CMinecraftApp::HandleXuiActions(void) {
uiIDA[1] = IDS_EXIT_GAME;
// pass in the gamertag format std::string
WCHAR wchFormat[40];
wchar_t wchFormat[40];
INetworkPlayer* player =
g_NetworkManager.GetLocalPlayerByUserIndex(i);
@ -4714,7 +4714,7 @@ void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) {
}
#if defined(_WINDOWS64)
int CMinecraftApp::GetTPConfigVal(WCHAR* pwchDataFile) { return -1; }
int CMinecraftApp::GetTPConfigVal(wchar_t* pwchDataFile) { return -1; }
#endif
bool CMinecraftApp::IsFileInTPD(int iConfig) {
bool val = false;
@ -4756,7 +4756,7 @@ void CMinecraftApp::GetTPD(int iConfig, std::uint8_t** ppbData,
// fis.read(ba);
// fis.close();
//
// bRes=StorageManager.WriteTMSFile(iQuadrant,eStorageFacility,(WCHAR
// bRes=StorageManager.WriteTMSFile(iQuadrant,eStorageFacility,(wchar_t
// *)wsFile->c_str(),ba.data, ba.length);
//
// }
@ -5429,13 +5429,13 @@ std::wstring CMinecraftApp::GetIconReplacement(unsigned int uiIcon) {
}
std::unordered_map<PlayerUID, MOJANG_DATA*> CMinecraftApp::MojangData;
std::unordered_map<int, ULONGLONG> CMinecraftApp::DLCTextures_PackID;
std::unordered_map<ULONGLONG, DLC_INFO*> CMinecraftApp::DLCInfo_Trial;
std::unordered_map<ULONGLONG, DLC_INFO*> CMinecraftApp::DLCInfo_Full;
std::unordered_map<std::wstring, ULONGLONG> CMinecraftApp::DLCInfo_SkinName;
std::unordered_map<int, uint64_t> CMinecraftApp::DLCTextures_PackID;
std::unordered_map<uint64_t, DLC_INFO*> CMinecraftApp::DLCInfo_Trial;
std::unordered_map<uint64_t, DLC_INFO*> CMinecraftApp::DLCInfo_Full;
std::unordered_map<std::wstring, uint64_t> CMinecraftApp::DLCInfo_SkinName;
HRESULT CMinecraftApp::RegisterMojangData(WCHAR* pXuidName, PlayerUID xuid,
WCHAR* pSkin, WCHAR* pCape) {
HRESULT CMinecraftApp::RegisterMojangData(wchar_t* pXuidName, PlayerUID xuid,
wchar_t* pSkin, wchar_t* pCape) {
HRESULT hr = S_OK;
eXUID eTempXuid = eXUID_Undefined;
MOJANG_DATA* pMojangData = nullptr;
@ -5469,7 +5469,7 @@ MOJANG_DATA* CMinecraftApp::GetMojangDataForXuid(PlayerUID xuid) {
return MojangData[xuid];
}
HRESULT CMinecraftApp::RegisterConfigValues(WCHAR* pType, int iValue) {
HRESULT CMinecraftApp::RegisterConfigValues(wchar_t* pType, int iValue) {
HRESULT hr = S_OK;
// #ifdef 0
@ -5498,12 +5498,12 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR* pType, int iValue) {
}
#if defined(_WINDOWS64)
HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
HRESULT CMinecraftApp::RegisterDLCData(wchar_t* pType, wchar_t* pBannerName,
int iGender, uint64_t ullOfferID_Full,
uint64_t ullOfferID_Trial,
WCHAR* pFirstSkin,
wchar_t* pFirstSkin,
unsigned int uiSortIndex, int iConfig,
WCHAR* pDataFile) {
wchar_t* pDataFile) {
HRESULT hr = S_OK;
DLC_INFO* pDLCData = new DLC_INFO;
ZeroMemory(pDLCData, sizeof(DLC_INFO));
@ -5548,12 +5548,12 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
return hr;
}
#elif defined(__linux__)
HRESULT CMinecraftApp::RegisterDLCData(WCHAR* pType, WCHAR* pBannerName,
HRESULT CMinecraftApp::RegisterDLCData(wchar_t* pType, wchar_t* pBannerName,
int iGender, uint64_t ullOfferID_Full,
uint64_t ullOfferID_Trial,
WCHAR* pFirstSkin,
wchar_t* pFirstSkin,
unsigned int uiSortIndex, int iConfig,
WCHAR* pDataFile) {
wchar_t* pDataFile) {
fprintf(stderr,
"warning: CMinecraftApp::RegisterDLCData unimplemented for "
"platform `__linux__`\n");
@ -5609,28 +5609,28 @@ HRESULT CMinecraftApp::RegisterDLCData(char* pchDLCName,
#endif
bool CMinecraftApp::GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
ULONGLONG* pullVal) {
uint64_t* pullVal) {
auto it = DLCInfo_SkinName.find(FirstSkin);
if (it == DLCInfo_SkinName.end()) {
return false;
} else {
*pullVal = (ULONGLONG)it->second;
*pullVal = (uint64_t)it->second;
return true;
}
}
bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,
ULONGLONG* pullVal) {
uint64_t* pullVal) {
auto it = DLCTextures_PackID.find(iPackID);
if (it == DLCTextures_PackID.end()) {
*pullVal = (ULONGLONG)0;
*pullVal = (uint64_t)0;
return false;
} else {
*pullVal = (ULONGLONG)it->second;
*pullVal = (uint64_t)it->second;
return true;
}
}
DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) {
// DLC_INFO *pDLCInfo=nullptr;
DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial) {
// DLC_INFO *pDLCInfo=NULL;
if (DLCInfo_Trial.size() > 0) {
auto it = DLCInfo_Trial.find(ullOfferID_Trial);
@ -5645,7 +5645,7 @@ DLC_INFO* CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) {
}
DLC_INFO* CMinecraftApp::GetDLCInfoTrialOffer(int iIndex) {
std::unordered_map<ULONGLONG, DLC_INFO*>::iterator it =
std::unordered_map<uint64_t, DLC_INFO*>::iterator it =
DLCInfo_Trial.begin();
for (int i = 0; i < iIndex; i++) {
@ -5655,7 +5655,7 @@ DLC_INFO* CMinecraftApp::GetDLCInfoTrialOffer(int iIndex) {
return it->second;
}
DLC_INFO* CMinecraftApp::GetDLCInfoFullOffer(int iIndex) {
std::unordered_map<ULONGLONG, DLC_INFO*>::iterator it =
std::unordered_map<uint64_t, DLC_INFO*>::iterator it =
DLCInfo_Full.begin();
for (int i = 0; i < iIndex; i++) {
@ -5664,8 +5664,8 @@ DLC_INFO* CMinecraftApp::GetDLCInfoFullOffer(int iIndex) {
return it->second;
}
ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) {
std::unordered_map<int, ULONGLONG>::iterator it =
uint64_t CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) {
std::unordered_map<int, uint64_t>::iterator it =
DLCTextures_PackID.begin();
for (int i = 0; i < iIndex; i++) {
@ -5676,7 +5676,7 @@ ULONGLONG CMinecraftApp::GetDLCInfoTexturesFullOffer(int iIndex) {
}
DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) {
DLC_INFO* CMinecraftApp::GetDLCInfoForFullOfferID(uint64_t ullOfferID_Full) {
if (DLCInfo_Full.size() > 0) {
auto it = DLCInfo_Full.find(ullOfferID_Full);
@ -5944,8 +5944,8 @@ void CMinecraftApp::AddCreditText(const wchar_t* lpStr) {
pCreditStruct->m_eType = eSmallText;
pCreditStruct->m_iStringID[0] = NO_TRANSLATED_STRING;
pCreditStruct->m_iStringID[1] = NO_TRANSLATED_STRING;
pCreditStruct->m_Text = new WCHAR[wcslen(lpStr) + 1];
wcscpy((WCHAR*)pCreditStruct->m_Text, lpStr);
pCreditStruct->m_Text = new wchar_t[wcslen(lpStr) + 1];
wcscpy((wchar_t*)pCreditStruct->m_Text, lpStr);
vDLCCredits.push_back(pCreditStruct);
}
@ -5961,7 +5961,7 @@ bool CMinecraftApp::AlreadySeenCreditText(const std::wstring& wstemp) {
}
// add this text
m_vCreditText.push_back((WCHAR*)wstemp.c_str());
m_vCreditText.push_back((wchar_t*)wstemp.c_str());
return false;
}
@ -6760,7 +6760,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
// since we might be loading some from the Title Update
// partition
if (pDLC->wchDataFile[0] != 0) {
// WCHAR *cString = pDLC->wchDataFile;
// wchar_t *cString = pDLC->wchDataFile;
// 4J-PB - shouldn't check this here - let the TMS files
// override it, so if they are on TMS, we'll take them
// first
@ -6799,7 +6799,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
C4JStorage::TMS_FILETYPE_BINARY;
memcpy(pTMSPPreq->wchFilename,
pDLC->wchDataFile,
sizeof(WCHAR) * MAX_BANNERNAME_SIZE);
sizeof(wchar_t) * MAX_BANNERNAME_SIZE);
pTMSPPreq->eType = e_DLC_TexturePackData;
pTMSPPreq->eState = e_TMS_ContentState_Queued;
m_bAllTMSContentRetrieved = false;
@ -6829,7 +6829,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
// since we might be loading some from the Title Update
// partition
WCHAR* cString = pDLC->wchBanner;
wchar_t* cString = pDLC->wchBanner;
// 4J-PB - shouldn't check this here - let the TMS files
// override it, so if they are on TMS, we'll take them first
// int iIndex = app.GetLocalTMSFileIndex(cString,true);
@ -6872,7 +6872,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType,
// wcstombs(pTMSPPreq->szFilename,pDLC->wchBanner,MAX_TMSFILENAME_SIZE);
memcpy(pTMSPPreq->wchFilename, pDLC->wchBanner,
sizeof(WCHAR) * MAX_BANNERNAME_SIZE);
sizeof(wchar_t) * MAX_BANNERNAME_SIZE);
pTMSPPreq->eType = eType;
pTMSPPreq->eState = e_TMS_ContentState_Queued;
m_bAllTMSContentRetrieved = false;
@ -7573,11 +7573,11 @@ void CMinecraftApp::getLocale(std::vector<std::wstring>& vecWstrLocales) {
}
}
int CMinecraftApp::get_eMCLang(WCHAR* pwchLocale) {
int CMinecraftApp::get_eMCLang(wchar_t* pwchLocale) {
return m_eMCLangA[pwchLocale];
}
int CMinecraftApp::get_xcLang(WCHAR* pwchLocale) {
int CMinecraftApp::get_xcLang(wchar_t* pwchLocale) {
return m_xcLangA[pwchLocale];
}

View file

@ -439,7 +439,7 @@ public:
bool IsFileInTPD(int iConfig);
void GetTPD(int iConfig, std::uint8_t** ppbData, unsigned int* pByteCount);
int GetTPDSize() { return m_MEM_TPD.size(); }
int GetTPConfigVal(WCHAR* pwchDataFile);
int GetTPConfigVal(wchar_t* pwchDataFile);
bool DefaultCapeExists();
// void InstallDefaultCape(); // attempt to install the default cape once
@ -672,16 +672,16 @@ public:
int* pZ);
std::vector<FEATURE_DATA*> m_vTerrainFeatures;
static HRESULT RegisterMojangData(WCHAR*, PlayerUID, WCHAR*, WCHAR*);
static HRESULT RegisterMojangData(wchar_t*, PlayerUID, wchar_t*, wchar_t*);
MOJANG_DATA* GetMojangDataForXuid(PlayerUID xuid);
static HRESULT RegisterConfigValues(WCHAR* pType, int iValue);
static HRESULT RegisterConfigValues(wchar_t* pType, int iValue);
static HRESULT RegisterDLCData(WCHAR*, WCHAR*, int, uint64_t, uint64_t,
WCHAR*, unsigned int, int, WCHAR* pDataFile);
static HRESULT RegisterDLCData(wchar_t*, wchar_t*, int, uint64_t, uint64_t,
wchar_t*, unsigned int, int, wchar_t* pDataFile);
bool GetDLCFullOfferIDForSkinID(const std::wstring& FirstSkin,
ULONGLONG* pullVal);
DLC_INFO* GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial);
DLC_INFO* GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full);
uint64_t* pullVal);
DLC_INFO* GetDLCInfoForTrialOfferID(uint64_t ullOfferID_Trial);
DLC_INFO* GetDLCInfoForFullOfferID(uint64_t ullOfferID_Full);
unsigned int GetDLCCreditsCount();
SCreditTextItemDef* GetDLCCredits(int iIndex);
@ -707,13 +707,13 @@ private:
std::vector<SCreditTextItemDef*> vDLCCredits;
static std::unordered_map<PlayerUID, MOJANG_DATA*> MojangData;
static std::unordered_map<int, ULONGLONG>
static std::unordered_map<int, uint64_t>
DLCTextures_PackID; // for mash-up packs & texture packs
static std::unordered_map<ULONGLONG, DLC_INFO*>
static std::unordered_map<uint64_t, DLC_INFO*>
DLCInfo_Trial; // full offerid, dlc_info
static std::unordered_map<ULONGLONG, DLC_INFO*>
static std::unordered_map<uint64_t, DLC_INFO*>
DLCInfo_Full; // full offerid, dlc_info
static std::unordered_map<std::wstring, ULONGLONG>
static std::unordered_map<std::wstring, uint64_t>
DLCInfo_SkinName; // skin name, full offer id
// bool m_bRead_TMS_XUIDS_XML; // track whether we have already read the
// TMS xuids.xml file bool m_bRead_TMS_DLCINFO_XML; // track whether
@ -875,8 +875,8 @@ public:
int GetDLCInfoTrialOffersCount();
int GetDLCInfoFullOffersCount();
bool GetDLCFullOfferIDForPackID(const int iPackID, ULONGLONG* pullVal);
ULONGLONG GetDLCInfoTexturesFullOffer(int iIndex);
bool GetDLCFullOfferIDForPackID(const int iPackID, uint64_t* pullVal);
uint64_t GetDLCInfoTexturesFullOffer(int iIndex);
void SetCorruptSaveDeleted(bool bVal) { m_bCorruptSaveDeleted = bVal; }
bool GetCorruptSaveDeleted(void) { return m_bCorruptSaveDeleted; }
@ -913,11 +913,11 @@ public:
unsigned int m_dwDLCFileSize;
std::uint8_t* m_pDLCFileBuffer;
// static int CallbackReadXuidsFileFromTMS(void* lpParam, WCHAR
// static int CallbackReadXuidsFileFromTMS(void* lpParam, wchar_t
// *wchFilename, int iPad, bool bResult, int iAction); static int
// CallbackDLCFileFromTMS(void* lpParam, WCHAR *wchFilename, int iPad, bool
// CallbackDLCFileFromTMS(void* lpParam, wchar_t *wchFilename, int iPad, bool
// bResult, int iAction); static int CallbackBannedListFileFromTMS(void*
// lpParam, WCHAR *wchFilename, int iPad, bool bResult, int iAction);
// lpParam, wchar_t *wchFilename, int iPad, bool bResult, int iAction);
// Storing additional model parts per skin texture
void SetAdditionalSkinBoxes(std::uint32_t dwSkinID, SKIN_BOX* SkinBoxA,
@ -933,11 +933,11 @@ public:
static std::uint32_t getSkinIdFromPath(const std::wstring& skin);
static std::wstring getSkinPathFromId(std::uint32_t skinId);
virtual int LoadLocalTMSFile(WCHAR* wchTMSFile) = 0;
virtual int LoadLocalTMSFile(WCHAR* wchTMSFile,
virtual int LoadLocalTMSFile(wchar_t* wchTMSFile) = 0;
virtual int LoadLocalTMSFile(wchar_t* wchTMSFile,
eFileExtensionType eExt) = 0;
virtual void FreeLocalTMSFiles(eTMSFileType eType) = 0;
virtual int GetLocalTMSFileIndex(WCHAR* wchTMSFile,
virtual int GetLocalTMSFileIndex(wchar_t* wchTMSFile,
bool bFilenameIncludesExtension,
eFileExtensionType eEXT) = 0;
@ -987,8 +987,8 @@ private:
public:
void LocaleAndLanguageInit();
void getLocale(std::vector<std::wstring>& vecWstrLocales);
int get_eMCLang(WCHAR* pwchLocale);
int get_xcLang(WCHAR* pwchLocale);
int get_eMCLang(wchar_t* pwchLocale);
int get_xcLang(wchar_t* pwchLocale);
void SetTickTMSDLCFiles(bool bVal);

View file

@ -80,7 +80,7 @@ std::uint8_t* DLCAudioFile::getData(std::uint32_t& dataBytes) {
return m_pbData;
}
const WCHAR* DLCAudioFile::wchTypeNamesA[] = {
const wchar_t* DLCAudioFile::wchTypeNamesA[] = {
L"CUENAME",
L"CREDIT",
};

View file

@ -23,7 +23,7 @@ public:
e_AudioParamType_Max,
};
static const WCHAR* wchTypeNamesA[e_AudioParamType_Max];
static const wchar_t* wchTypeNamesA[e_AudioParamType_Max];
DLCAudioFile(const std::wstring& path);

View file

@ -17,7 +17,7 @@
static const std::size_t DLC_WCHAR_BIN_SIZE = 2;
#if WCHAR_MAX > 0xFFFF
// than sizeof(WCHAR) != DLC_WCHAR_BIN_SIZE
// than sizeof(wchar_t) != DLC_WCHAR_BIN_SIZE
// e.g. Linux and all Posix/Unix systems with wchar_t beeing 4B/32bit
static_assert(sizeof(wchar_t) == 4,
"wchar_t is not 4bytes but larger than 2bytes ???");
@ -129,7 +129,7 @@ bool readOwnedDlcFile(const std::string& path, std::uint8_t** ppData,
}
} // namespace
const WCHAR* DLCManager::wchTypeNamesA[] = {
const wchar_t* DLCManager::wchTypeNamesA[] = {
L"DISPLAYNAME",
L"THEMENAME",
L"FREE",
@ -362,7 +362,7 @@ unsigned int DLCManager::checkForCorruptDLCAndAlert(
uiIDA[0] = IDS_CONFIRM_OK;
if (corruptDLCCount == 1 && firstCorruptPack != nullptr) {
// pass in the pack format string
WCHAR wchFormat[132];
wchar_t wchFormat[132];
swprintf(wchFormat, 132, L"%ls\n\n%%ls",
firstCorruptPack->getName().c_str());

View file

@ -46,7 +46,7 @@ public:
e_DLCParamType_Max,
};
const static WCHAR* wchTypeNamesA[e_DLCParamType_Max];
const static wchar_t* wchTypeNamesA[e_DLCParamType_Max];
private:
std::vector<DLCPack*> m_packs;

View file

@ -151,7 +151,7 @@ DLCFile* DLCPack::addFile(DLCManager::EDLCType type, const std::wstring& path) {
newFile = new DLCSkinFile(strippedPath);
// check to see if we can get the full offer id using this skin name
ULONGLONG ullVal = 0LL;
uint64_t ullVal = 0LL;
if (app.GetDLCFullOfferIDForSkinID(strippedPath, &ullVal)) {
m_ullFullOfferId = ullVal;

View file

@ -19,7 +19,7 @@ private:
std::uint32_t m_dwLicenseMask;
int m_dlcMountIndex;
XCONTENTDEVICEID m_dlcDeviceID;
ULONGLONG m_ullFullOfferId;
uint64_t m_ullFullOfferId;
bool m_isCorrupt;
std::uint32_t m_packId;
std::uint32_t m_packVersion;
@ -68,7 +68,7 @@ public:
std::wstring getName() { return m_packName; }
void UpdateLanguage();
ULONGLONG getPurchaseOfferId() { return m_ullFullOfferId; }
uint64_t getPurchaseOfferId() { return m_ullFullOfferId; }
DLCFile* addFile(DLCManager::EDLCType type, const std::wstring& path);
DLCFile* getFile(DLCManager::EDLCType type, unsigned int index);

View file

@ -103,7 +103,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
m_cape = value;
break;
case DLCManager::e_DLCParamType_Box: {
WCHAR wchBodyPart[10];
wchar_t wchBodyPart[10];
SKIN_BOX* pSkinBox = new SKIN_BOX;
ZeroMemory(pSkinBox, sizeof(SKIN_BOX));

View file

@ -12,7 +12,7 @@
#include "ConsoleGameRules.h"
#include "GameRuleManager.h"
const WCHAR* GameRuleManager::wchTagNameA[] = {
const wchar_t* GameRuleManager::wchTagNameA[] = {
L"", // eGameRuleType_Root
L"MapOptions", // eGameRuleType_LevelGenerationOptions
L"ApplySchematic", // eGameRuleType_ApplySchematic
@ -33,7 +33,7 @@ const WCHAR* GameRuleManager::wchTagNameA[] = {
L"UpdatePlayer", // eGameRuleType_UpdatePlayerRule
};
const WCHAR* GameRuleManager::wchAttrNameA[] = {
const wchar_t* GameRuleManager::wchAttrNameA[] = {
L"descriptionName", // eGameRuleAttr_descriptionName
L"promptName", // eGameRuleAttr_promptName
L"dataTag", // eGameRuleAttr_dataTag

View file

@ -25,8 +25,8 @@ class WstringLookup;
class GameRuleManager {
public:
static const WCHAR* wchTagNameA[ConsoleGameRules::eGameRuleType_Count];
static const WCHAR* wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count];
static const wchar_t* wchTagNameA[ConsoleGameRules::eGameRuleType_Count];
static const wchar_t* wchAttrNameA[ConsoleGameRules::eGameRuleAttr_Count];
static const short version_number = 2;

View file

@ -512,7 +512,7 @@ int LevelGenerationOptions::packMounted(void* pParam, int iPad, DWORD dwErr,
if (grf.exists()) {
#if defined(_UNICODE)
std::wstring path = grf.getPath();
const WCHAR* pchFilename = path.c_str();
const wchar_t* pchFilename = path.c_str();
HANDLE fileHandle = CreateFile(
pchFilename, // file name
GENERIC_READ, // access mode
@ -570,7 +570,7 @@ int LevelGenerationOptions::packMounted(void* pParam, int iPad, DWORD dwErr,
if (save.exists()) {
#if defined(_UNICODE)
std::wstring path = save.getPath();
const WCHAR* pchFilename = path.c_str();
const wchar_t* pchFilename = path.c_str();
HANDLE fileHandle = CreateFile(
pchFilename, // file name
GENERIC_READ, // access mode
@ -667,7 +667,7 @@ std::wstring LevelGenerationOptions::getDefaultSaveName() {
}
return L"";
}
LPCWSTR LevelGenerationOptions::getWorldName() {
const wchar_t* LevelGenerationOptions::getWorldName() {
switch (getSrc()) {
case eSrc_fromSave:
return getString(info()->getWorldName());
@ -680,7 +680,7 @@ LPCWSTR LevelGenerationOptions::getWorldName() {
}
return L"";
}
LPCWSTR LevelGenerationOptions::getDisplayName() {
const wchar_t* LevelGenerationOptions::getDisplayName() {
switch (getSrc()) {
case eSrc_fromSave:
return getString(info()->getDisplayName());

View file

@ -150,7 +150,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft* minecraft,
if (grf.exists()) {
#if defined(_UNICODE)
std::wstring path = grf.getPath();
const WCHAR* pchFilename = path.c_str();
const wchar_t* pchFilename = path.c_str();
HANDLE fileHandle = CreateFile(
pchFilename, // file name
GENERIC_READ, // access mode

View file

@ -444,7 +444,7 @@ std::wstring CPlatformNetworkManagerStub::GatherRTTStats() {
((NetworkPlayerQNet*)GetPlayerByIndex(i))->GetQNetPlayer();
if (!pQNetPlayer->IsLocal()) {
ZeroMemory(stat, 32 * sizeof(WCHAR));
ZeroMemory(stat, 32 * sizeof(wchar_t));
swprintf(stat, 32, L"%d: %d/", i, pQNetPlayer->GetCurrentRtt());
stats.append(stat);
}

View file

@ -50,7 +50,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete() {
for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) {
bTexturePackAlreadyListed = false;
ULONGLONG ull = app.GetDLCInfoTexturesFullOffer(i);
uint64_t ull = app.GetDLCInfoTexturesFullOffer(i);
pDLCInfo = app.GetDLCInfoForFullOfferID(ull);
for (unsigned int i = 0; i < texturePacksCount; ++i) {
TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i);
@ -79,7 +79,7 @@ void IUIScene_StartGame::HandleDLCMountingComplete() {
for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) {
bTexturePackAlreadyListed = false;
ULONGLONG ull = app.GetDLCInfoTexturesFullOffer(i);
uint64_t ull = app.GetDLCInfoTexturesFullOffer(i);
pDLCInfo = app.GetDLCInfoForFullOfferID(ull);
for (unsigned int i = 0; i < texturePacksCount; ++i) {
TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i);
@ -202,7 +202,7 @@ void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot) {
// upsell the texture pack
// tell sentient about the upsell of the full version of the skin pack
ULONGLONG ullOfferID_Full;
uint64_t ullOfferID_Full;
app.GetDLCFullOfferIDForPackID(ListItem.iData, &ullOfferID_Full);
TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(),

View file

@ -98,7 +98,7 @@ private:
void _SetDescription(UIScene* interactScene, const std::wstring& desc,
const std::wstring& title, bool allowFade,
bool isReminder);
std::wstring _SetIcon(int icon, int iAuxVal, bool isFoil, LPCWSTR desc);
std::wstring _SetIcon(int icon, int iAuxVal, bool isFoil, const wchar_t* desc);
std::wstring _SetImage(std::wstring& desc);
std::wstring ParseDescription(int iPad, std::wstring& text);
void UpdateInteractScenePosition(bool visible);

View file

@ -391,18 +391,18 @@ public:
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC,
DWORD dwPad = XUSER_INDEX_ANY,
int (*Func)(void*, int, const C4JStorage::EMessageResult) = nullptr,
void* lpParam = nullptr, WCHAR* pwchFormatString = nullptr);
void* lpParam = nullptr, wchar_t* pwchFormatString = nullptr);
virtual C4JStorage::EMessageResult RequestErrorMessage(
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC,
DWORD dwPad = XUSER_INDEX_ANY,
int (*Func)(void*, int, const C4JStorage::EMessageResult) = nullptr,
void* lpParam = nullptr, WCHAR* pwchFormatString = nullptr);
void* lpParam = nullptr, wchar_t* pwchFormatString = nullptr);
private:
virtual C4JStorage::EMessageResult RequestMessageBox(
UINT uiTitle, UINT uiText, UINT* uiOptionA, UINT uiOptionC, DWORD dwPad,
int (*Func)(void*, int, const C4JStorage::EMessageResult),
void* lpParam, WCHAR* pwchFormatString, DWORD dwFocusButton,
void* lpParam, wchar_t* pwchFormatString, DWORD dwFocusButton,
bool bIsError);
public:

View file

@ -191,7 +191,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) {
bTexturePackAlreadyListed = false;
ULONGLONG ull = app.GetDLCInfoTexturesFullOffer(i);
uint64_t ull = app.GetDLCInfoTexturesFullOffer(i);
pDLCInfo = app.GetDLCInfoForFullOfferID(ull);
for (unsigned int i = 0; i < texturePacksCount; ++i) {
TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i);
@ -217,7 +217,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void* initData,
for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount();
++i) {
bTexturePackAlreadyListed = false;
ULONGLONG ull = app.GetDLCInfoTexturesFullOffer(i);
uint64_t ull = app.GetDLCInfoTexturesFullOffer(i);
pDLCInfo = app.GetDLCInfoForFullOfferID(ull);
for (unsigned int i = 0; i < texturePacksCount; ++i) {
TexturePack* tp =
@ -390,7 +390,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() {
// upsell the texture pack
// tell sentient about the upsell of the full version of the skin
// pack
ULONGLONG ullOfferID_Full;
uint64_t ullOfferID_Full;
app.GetDLCFullOfferIDForPackID(m_MoreOptionsParams.dwTexturePack,
&ullOfferID_Full);

View file

@ -239,7 +239,7 @@ void UIScene_Credits::tick() {
if (pDef->m_iStringID[0] == NO_TRANSLATED_STRING) {
ZeroMemory(creditsString, 128);
memcpy(creditsString, sanitisedString.c_str(),
sizeof(WCHAR) * sanitisedString.length());
sizeof(wchar_t) * sanitisedString.length());
} else if (pDef->m_iStringID[1] != NO_TRANSLATED_STRING) {
swprintf(creditsString, 128, sanitisedString.c_str(),
app.GetString(pDef->m_iStringID[0]),

View file

@ -31,7 +31,7 @@ UIScene_DebugOverlay::UIScene_DebugOverlay(int iPad, void* initData,
float currentTime =
pMinecraft->level->getLevelData()->getGameTime() % 24000;
swprintf((WCHAR*)TempString, 256, L"Set time (unsafe) (%d)",
swprintf((wchar_t*)TempString, 256, L"Set time (unsafe) (%d)",
(int)currentTime);
m_sliderTime.init(TempString, eControl_Time, 0, 240, currentTime / 100);

View file

@ -245,7 +245,7 @@ void UIScene_InGameSaveManagementMenu::tick() {
// in CHAR's (= bytes), including end-of-string \0
(wchar_t*)u16Message, // destination buffer
MAX_SAVEFILENAME_LENGTH // size of destination buffer, in
// WCHAR's
// wchar_t's
);
#else
uint32_t srcmax, dstmax;

View file

@ -549,7 +549,7 @@ void UIScene_LoadMenu::StartSharedLaunchFlow() {
// upsell the texture pack
// tell sentient about the upsell of the full version of the skin
// pack
ULONGLONG ullOfferID_Full;
uint64_t ullOfferID_Full;
app.GetDLCFullOfferIDForPackID(m_MoreOptionsParams.dwTexturePack,
&ullOfferID_Full);

View file

@ -468,7 +468,7 @@ void UIScene_LoadOrJoinMenu::tick() {
// in CHAR's (= bytes), including end-of-string \0
(wchar_t*)u16Message, // destination buffer
MAX_SAVEFILENAME_LENGTH // size of destination buffer, in
// WCHAR's
// wchar_t's
);
#else
std::uint32_t srcmax, dstmax;
@ -660,7 +660,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() {
}
// 4J-JEV: For debug. Ignore worlds with no name.
LPCWSTR wstr = levelGen->getWorldName();
const wchar_t* wstr = levelGen->getWorldName();
m_buttonListSaves.addItem(wstr);
m_generators.push_back(levelGen);

View file

@ -45,7 +45,7 @@ XMLParser::~XMLParser()
// Name: XMLParser::FillBuffer
// Desc: Reads a block from the current open file
//-------------------------------------------------------------------------------------
VOID XMLParser::FillBuffer()
void XMLParser::FillBuffer()
{
DWORD NChars;
@ -83,7 +83,7 @@ VOID XMLParser::FillBuffer()
// Name: XMLParser::SkipNextAdvance
// Desc: Puts the last character read back on the input stream
//-------------------------------------------------------------------------------------
VOID XMLParser::SkipNextAdvance()
void XMLParser::SkipNextAdvance()
{
m_bSkipNextAdvance = TRUE;
}
@ -119,7 +119,7 @@ HRESULT XMLParser::ConsumeSpace()
HRESULT XMLParser::ConvertEscape()
{
HRESULT hr;
WCHAR wVal = 0;
wchar_t wVal = 0;
if( FAILED( hr = AdvanceCharacter() ) )
return hr;
@ -193,7 +193,7 @@ HRESULT XMLParser::ConvertEscape()
// must be an entity reference
WCHAR *pEntityRefVal = m_pWritePtr;
wchar_t *pEntityRefVal = m_pWritePtr;
UINT EntityRefLen;
SkipNextAdvance();
@ -246,7 +246,7 @@ HRESULT XMLParser::ConvertEscape()
HRESULT XMLParser::AdvanceAttrVal()
{
HRESULT hr;
WCHAR wQuoteChar;
wchar_t wQuoteChar;
if( FAILED( hr = AdvanceCharacter() ) )
return hr;
@ -383,7 +383,7 @@ HRESULT XMLParser::AdvanceCharacter( bool bOkToFail )
}
else // if( m_bUnicode == TRUE )
{
m_Ch = *((WCHAR *)m_pReadPtr);
m_Ch = *((wchar_t *)m_pReadPtr);
if( m_bReverseBytes )
{
@ -494,7 +494,7 @@ HRESULT XMLParser::AdvanceElement()
}
else if( m_Ch == '/' )
{
WCHAR *pEntityRefVal = m_pWritePtr;
wchar_t *pEntityRefVal = m_pWritePtr;
if( FAILED( hr = AdvanceName() ) )
return hr;
@ -532,7 +532,7 @@ HRESULT XMLParser::AdvanceElement()
XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ];
UINT NumAttrs;
WCHAR *pEntityRefVal = m_pWritePtr;
wchar_t *pEntityRefVal = m_pWritePtr;
UINT EntityRefLen;
NumAttrs = 0;
@ -715,7 +715,7 @@ HRESULT XMLParser::AdvanceComment()
// Name: XMLParser::RegisterSAXCallbackInterface
// Desc: Registers callback interface
//-------------------------------------------------------------------------------------
VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback )
void XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback )
{
m_pISAXCallback = pISAXCallback;
}
@ -747,24 +747,24 @@ HRESULT XMLParser::MainParseLoop()
FillBuffer();
if ( *((WCHAR *) m_pReadBuf ) == 0xFEFF )
if ( *((wchar_t *) m_pReadBuf ) == 0xFEFF )
{
m_bUnicode = TRUE;
m_bReverseBytes = FALSE;
m_pReadPtr += 2;
}
else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE )
else if ( *((wchar_t *) m_pReadBuf ) == 0xFFFE )
{
m_bUnicode = TRUE;
m_bReverseBytes = TRUE;
m_pReadPtr += 2;
}
else if ( *((WCHAR *) m_pReadBuf ) == 0x003C )
else if ( *((wchar_t *) m_pReadBuf ) == 0x003C )
{
m_bUnicode = TRUE;
m_bReverseBytes = FALSE;
}
else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 )
else if ( *((wchar_t *) m_pReadBuf ) == 0x3C00 )
{
m_bUnicode = TRUE;
m_bReverseBytes = TRUE;
@ -946,9 +946,9 @@ HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize )
// Logs an error through the callback interface
//-------------------------------------------------------------------------------------
#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation
VOID XMLParser::Error( HRESULT hErr, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... )
void XMLParser::Error( HRESULT hErr, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... )
#else
VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... )
void XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... )
#endif
{
CONST INT MAX_OUTPUT_STR = 160;

View file

@ -39,9 +39,9 @@ CONST UINT XML_WRITE_BUFFER_SIZE = 2048;
//-------------------------------------------------------------------------------------
struct XMLAttribute
{
WCHAR* strName;
wchar_t* strName;
UINT NameLen;
WCHAR* strValue;
wchar_t* strValue;
UINT ValueLen;
};
@ -56,18 +56,18 @@ public:
virtual HRESULT StartDocument() = 0;
virtual HRESULT EndDocument() = 0;
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen,
virtual HRESULT ElementBegin( CONST wchar_t* strName, UINT NameLen,
CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0;
virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) = 0;
virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0;
virtual HRESULT ElementContent( CONST wchar_t *strData, UINT DataLen, bool More ) = 0;
virtual HRESULT ElementEnd( CONST wchar_t *strName, UINT NameLen ) = 0;
virtual HRESULT CDATABegin( ) = 0;
virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ) = 0;
virtual HRESULT CDATAData( CONST wchar_t *strCDATA, UINT CDATALen, bool bMore ) = 0;
virtual HRESULT CDATAEnd( ) = 0;
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
virtual void Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
virtual VOID SetParseProgress( DWORD dwProgress ) { }
virtual void SetParseProgress( DWORD dwProgress ) { }
const CHAR* GetFilename() { return m_strFilename; }
UINT GetLineNumber() { return m_LineNum; }
@ -88,7 +88,7 @@ public:
~XMLParser();
// Register an interface inheiriting from ISAXCallback
VOID RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback );
void RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback );
// Get the registered interface
ISAXCallback* GetSAXCallbackInterface();
@ -102,7 +102,7 @@ public:
HRESULT ParseXMLFile( CONST CHAR *strFilename );
// Parses from a buffer- if you pass a WCHAR buffer (and cast it), it will
// Parses from a buffer- if you pass a wchar_t buffer (and cast it), it will
// correctly detect it and use unicode instead. Return codes are the
// same as for ParseXMLFile
@ -112,7 +112,7 @@ private:
HRESULT MainParseLoop();
HRESULT AdvanceCharacter( bool bOkToFail = FALSE );
VOID SkipNextAdvance();
void SkipNextAdvance();
HRESULT ConsumeSpace();
HRESULT ConvertEscape();
@ -122,12 +122,12 @@ private:
HRESULT AdvanceCDATA();
HRESULT AdvanceComment();
VOID FillBuffer();
void FillBuffer();
#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation
VOID Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... );
void Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... );
#else
VOID Error( HRESULT hRet, CONST CHAR* strFormat, ... );
void Error( HRESULT hRet, CONST CHAR* strFormat, ... );
#endif
ISAXCallback* m_pISAXCallback;
@ -138,17 +138,17 @@ private:
DWORD m_dwCharsTotal;
DWORD m_dwCharsConsumed;
BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing nullptr
WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ];
BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL
wchar_t m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ];
BYTE* m_pReadPtr;
WCHAR* m_pWritePtr; // write pointer within m_pBuf
wchar_t* m_pWritePtr; // write pointer within m_pBuf
bool m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits
bool m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse
bool m_bSkipNextAdvance;
WCHAR m_Ch; // Current character being parsed
wchar_t m_Ch; // Current character being parsed
};
} // namespace ATG

View file

@ -12,13 +12,13 @@ public:
virtual HRESULT StartDocument() { return S_OK; };
virtual HRESULT EndDocument() { return S_OK; };
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes )
virtual HRESULT ElementBegin( CONST wchar_t* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes )
{
WCHAR wTemp[35] = L"";
WCHAR wAttName[32] = L"";
WCHAR wNameXUID[32] = L"";
WCHAR wNameSkin[32] = L"";
WCHAR wNameCloak[32] = L"";
wchar_t wTemp[35] = L"";
wchar_t wAttName[32] = L"";
wchar_t wNameXUID[32] = L"";
wchar_t wNameSkin[32] = L"";
wchar_t wNameCloak[32] = L"";
PlayerUID xuid=0LL;
@ -45,7 +45,7 @@ public:
{
if (pAttributes[i].ValueLen <= 32)
{
ZeroMemory(wTemp,sizeof(WCHAR)*35);
ZeroMemory(wTemp,sizeof(wchar_t)*35);
wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen);
xuid=_wcstoui64(wTemp,nullptr,10);
}
@ -80,17 +80,17 @@ public:
}
};
virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) { return S_OK; };
virtual HRESULT ElementContent( CONST wchar_t *strData, UINT DataLen, bool More ) { return S_OK; };
virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; };
virtual HRESULT ElementEnd( CONST wchar_t *strName, UINT NameLen ){ return S_OK; };
virtual HRESULT CDATABegin( ) { return S_OK; };
virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; };
virtual HRESULT CDATAData( CONST wchar_t *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; };
virtual HRESULT CDATAEnd( ){ return S_OK; };
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); };
virtual void Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); };
};
@ -100,12 +100,12 @@ public:
virtual HRESULT StartDocument() { return S_OK; };
virtual HRESULT EndDocument() { return S_OK; };
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes )
virtual HRESULT ElementBegin( CONST wchar_t* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes )
{
WCHAR wTemp[35] = L"";
WCHAR wType[32] = L"";
WCHAR wAttName[32] = L"";
WCHAR wValue[32] = L"";
wchar_t wTemp[35] = L"";
wchar_t wType[32] = L"";
wchar_t wAttName[32] = L"";
wchar_t wValue[32] = L"";
int iValue=-1;
if (NameLen >31)
@ -161,17 +161,17 @@ public:
}
virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) { return S_OK; };
virtual HRESULT ElementContent( CONST wchar_t *strData, UINT DataLen, bool More ) { return S_OK; };
virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; };
virtual HRESULT ElementEnd( CONST wchar_t *strName, UINT NameLen ){ return S_OK; };
virtual HRESULT CDATABegin( ) { return S_OK; };
virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; };
virtual HRESULT CDATAData( CONST wchar_t *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; };
virtual HRESULT CDATAEnd( ){ return S_OK; };
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); };
virtual void Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing xuids.XML\n"); };
};
@ -181,17 +181,17 @@ public:
virtual HRESULT StartDocument() { return S_OK; };
virtual HRESULT EndDocument() { return S_OK; };
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes )
virtual HRESULT ElementBegin( CONST wchar_t* strName, UINT NameLen, CONST XMLAttribute *pAttributes, UINT NumAttributes )
{
WCHAR wTemp[35] = L"";
WCHAR wAttName[32] = L"";
WCHAR wNameBanner[32] = L"";
WCHAR wDataFile[32] = L"";
WCHAR wType[32] = L"";
WCHAR wFirstSkin[32] = L"";
WCHAR wConfig[32] = L"";
ULONGLONG ullFull=0ll;
ULONGLONG ullTrial=0ll;
wchar_t wTemp[35] = L"";
wchar_t wAttName[32] = L"";
wchar_t wNameBanner[32] = L"";
wchar_t wDataFile[32] = L"";
wchar_t wType[32] = L"";
wchar_t wFirstSkin[32] = L"";
wchar_t wConfig[32] = L"";
uint64_t ullFull=0ll;
uint64_t ullTrial=0ll;
unsigned int uiSortIndex=0L;
int iGender=0;
int iConfig=0;
@ -214,7 +214,7 @@ public:
{
if (pAttributes[i].ValueLen <= 32)
{
ZeroMemory(wTemp,sizeof(WCHAR)*35);
ZeroMemory(wTemp,sizeof(wchar_t)*35);
wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen);
uiSortIndex=wcstoul(wTemp,nullptr,16);
}
@ -230,7 +230,7 @@ public:
{
if (pAttributes[i].ValueLen <= 32)
{
ZeroMemory(wTemp,sizeof(WCHAR)*35);
ZeroMemory(wTemp,sizeof(wchar_t)*35);
wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen);
ullFull=_wcstoui64(wTemp,nullptr,16);
}
@ -239,7 +239,7 @@ public:
{
if (pAttributes[i].ValueLen <= 32)
{
ZeroMemory(wTemp,sizeof(WCHAR)*35);
ZeroMemory(wTemp,sizeof(wchar_t)*35);
wcsncpy_s( wTemp, pAttributes[i].strValue, pAttributes[i].ValueLen);
ullTrial=_wcstoui64(wTemp,nullptr,16);
}
@ -313,17 +313,17 @@ public:
}
};
virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) { return S_OK; };
virtual HRESULT ElementContent( CONST wchar_t *strData, UINT DataLen, bool More ) { return S_OK; };
virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ){ return S_OK; };
virtual HRESULT ElementEnd( CONST wchar_t *strName, UINT NameLen ){ return S_OK; };
virtual HRESULT CDATABegin( ) { return S_OK; };
virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; };
virtual HRESULT CDATAData( CONST wchar_t *strCDATA, UINT CDATALen, bool bMore ){ return S_OK; };
virtual HRESULT CDATAEnd( ){ return S_OK; };
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing DLC.XML\n"); };
virtual void Error( HRESULT hError, CONST CHAR *strMessage ) { app.DebugPrintf("Error when Parsing DLC.XML\n"); };
};

View file

@ -30,7 +30,7 @@ CXuiStringTable StringTable;
ATG::XMLParser::XMLParser() {}
ATG::XMLParser::~XMLParser() {}
HRESULT ATG::XMLParser::ParseXMLBuffer( CONST CHAR* strBuffer, UINT uBufferSize ) { return S_OK; }
VOID ATG::XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) {}
void ATG::XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) {}
#endif
#if !defined(__linux__)
@ -40,8 +40,9 @@ bool CSocialManager::IsTitleAllowedToPostImages() { return false; }
bool CSocialManager::PostLinkToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ) { return false; }
bool CSocialManager::PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect ) { return false; }
CSocialManager *CSocialManager::Instance() { return nullptr; }
void CSocialManager::SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc) {};
void CSocialManager::SetSocialPostText(const wchar_t* Title, const wchar_t* Caption, const wchar_t* Desc) {};
#endif
DWORD XShowPartyUI(DWORD dwUserIndex) { return 0; }
@ -108,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() {}
@ -129,7 +130,7 @@ bool IQNetPlayer::IsHost() { return this == &IQNet::m_player[0]; }
bool IQNetPlayer::IsGuest() { return false; }
bool IQNetPlayer::IsLocal() { return true; }
PlayerUID IQNetPlayer::GetXuid() { return INVALID_XUID; }
LPCWSTR IQNetPlayer::GetGamertag() { static const wchar_t *test = L"stub"; return test; }
const wchar_t* IQNetPlayer::GetGamertag() { static const wchar_t *test = L"stub"; return test; }
int IQNetPlayer::GetSessionIndex() { return 0; }
bool IQNetPlayer::IsTalking() { return false; }
bool IQNetPlayer::IsMutedByLocalUser(DWORD dwUserIndex) { return false; }
@ -176,19 +177,19 @@ DWORD XUserGetSigninInfo(
return 0;
}
LPCWSTR CXuiStringTable::Lookup(LPCWSTR szId) { return szId; }
LPCWSTR CXuiStringTable::Lookup(UINT nIndex) { return L"String"; }
const wchar_t* CXuiStringTable::Lookup(const wchar_t* szId) { return szId; }
const wchar_t* CXuiStringTable::Lookup(UINT nIndex) { return L"String"; }
void CXuiStringTable::Clear() {}
HRESULT CXuiStringTable::Load(LPCWSTR szId) { return S_OK; }
HRESULT CXuiStringTable::Load(const wchar_t* szId) { return S_OK; }
DWORD XUserAreUsersFriends( DWORD dwUserIndex, PPlayerUID pXuids, DWORD dwXuidCount, bool* pfResult, void *pOverlapped) { return 0; }
HRESULT XMemDecompress(
XMEMDECOMPRESSION_CONTEXT Context,
VOID *pDestination,
SIZE_T *pDestSize,
VOID *pSource,
SIZE_T SrcSize
void *pDestination,
size_t *pDestSize,
void *pSource,
size_t SrcSize
)
{
memcpy(pDestination, pSource, SrcSize);
@ -216,10 +217,10 @@ HRESULT XMemDecompress(
HRESULT XMemCompress(
XMEMCOMPRESSION_CONTEXT Context,
VOID *pDestination,
SIZE_T *pDestSize,
VOID *pSource,
SIZE_T SrcSize
void *pDestination,
size_t *pDestSize,
void *pSource,
size_t SrcSize
)
{
memcpy(pDestination, pSource, SrcSize);
@ -247,7 +248,7 @@ HRESULT XMemCompress(
HRESULT XMemCreateCompressionContext(
XMEMCODEC_TYPE CodecType,
CONST VOID *pCodecParams,
CONST void *pCodecParams,
DWORD Flags,
XMEMCOMPRESSION_CONTEXT *pContext
)
@ -268,7 +269,7 @@ HRESULT XMemCreateCompressionContext(
HRESULT XMemCreateDecompressionContext(
XMEMCODEC_TYPE CodecType,
CONST VOID *pCodecParams,
CONST void *pCodecParams,
DWORD Flags,
XMEMDECOMPRESSION_CONTEXT *pContext
)
@ -458,14 +459,14 @@ void C_4JProfile::ShowProfileCard(int iPad, PlayerUID targetUid) {}
#if defined(__linux__)
C4JStorage::C4JStorage() {}
void C4JStorage::Tick() {}
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int pad, int( *Func)(void*,int,const C4JStorage::EMessageResult),void* lpParam, C4JStringTable *pStringTable, WCHAR *pwchFormatString,unsigned int focusButton) { return C4JStorage::EMessage_Undefined; }
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(unsigned int uiTitle, unsigned int uiText, unsigned int *uiOptionA,unsigned int uiOptionC, unsigned int pad, int( *Func)(void*,int,const C4JStorage::EMessageResult),void* lpParam, C4JStringTable *pStringTable, wchar_t *pwchFormatString,unsigned int focusButton) { return C4JStorage::EMessage_Undefined; }
C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult() { return C4JStorage::EMessage_Undefined; }
bool C4JStorage::SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice) { return true; }
void C4JStorage::Init(LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(void*, const ESavingMessage, int),void* lpParam) {}
void C4JStorage::Init(const wchar_t* pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize, int( *Func)(void*, const ESavingMessage, int),void* lpParam) {}
void C4JStorage::ResetSaveData() {}
void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName) {}
void C4JStorage::SetSaveTitle(LPCWSTR pwchDefaultSaveName) {}
LPCWSTR C4JStorage::GetSaveTitle() { return L""; }
void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(const wchar_t* pwchDefaultSaveName) {}
void C4JStorage::SetSaveTitle(const wchar_t* pwchDefaultSaveName) {}
const wchar_t* C4JStorage::GetSaveTitle() { return L""; }
bool C4JStorage::GetSaveUniqueNumber(INT *piVal) { return true; }
bool C4JStorage::GetSaveUniqueFilename(char *pszName) { return true; }
void C4JStorage::SetSaveUniqueFilename(char *szFilename) { }
@ -474,9 +475,9 @@ void C4JStorage::SetSaveDisabled(bool bDisable) {}
bool C4JStorage::GetSaveDisabled(void) { return false; }
unsigned int C4JStorage::GetSaveSize() { return 0; }
void C4JStorage::GetSaveData(void *pvData,unsigned int *pulBytes) {}
PVOID C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; }
void* C4JStorage::AllocateSaveData(unsigned int ulBytes) { return new char[ulBytes]; }
void C4JStorage::SaveSaveData(unsigned int ulBytes,PBYTE pbThumbnail,DWORD cbThumbnail,PBYTE pbTextData, DWORD dwTextLen) {}
void C4JStorage::CopySaveDataToNewSave(std::uint8_t *pbThumbnail,unsigned int cbThumbnail,WCHAR *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam) {}
void C4JStorage::CopySaveDataToNewSave(std::uint8_t *pbThumbnail,unsigned int cbThumbnail,wchar_t *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam) {}
void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {}
bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad) { return true; }
C4JStorage::ELoadGameStatus C4JStorage::DoesSaveExist(bool *pbExists) { return C4JStorage::ELoadGame_Idle; }
@ -498,16 +499,16 @@ unsigned int C4JStorage::CancelGetDLCOffers() { return 0; }
void C4JStorage::ClearDLCOffers() {}
XMARKETPLACE_CONTENTOFFER_INFO& C4JStorage::GetOffer(unsigned int dw) { static XMARKETPLACE_CONTENTOFFER_INFO retval = {0}; return retval; }
int C4JStorage::GetOfferCount() { return 0; }
unsigned int C4JStorage::InstallOffer(int iOfferIDC,ULONGLONG *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial) { return 0; }
unsigned int C4JStorage::InstallOffer(int iOfferIDC,uint64_t *ullOfferIDA,int( *Func)(void*, int, int),void* lpParam, bool bTrial) { return 0; }
unsigned int C4JStorage::GetAvailableDLCCount( int iPad) { return 0; }
XCONTENT_DATA& C4JStorage::GetDLC(unsigned int dw) { static XCONTENT_DATA retval = {0}; return retval; }
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad,int( *Func)(void*, int, int),void* lpParam) { return C4JStorage::EDLC_Idle; }
std::uint32_t C4JStorage::MountInstalledDLC(int iPad,std::uint32_t dwDLC,int( *Func)(void *, int, std::uint32_t, std::uint32_t),void *lpParam,const char* szMountDrive) { return 0; }
unsigned int C4JStorage::UnmountInstalledDLC(const char* szMountDrive) { return 0; }
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, WCHAR *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pBufferSize,int( *Func)(void*, WCHAR *,int, bool, int),void* lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,std::uint8_t *pBuffer,unsigned int bufferSize) { return true; }
bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename) { return true; }
void C4JStorage::StoreTMSPathName(WCHAR *pwchName) {}
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType, wchar_t *pwchFilename,std::uint8_t **ppBuffer,unsigned int *pBufferSize,int( *Func)(void*, wchar_t *,int, bool, int),void* lpParam, int iAction) { return C4JStorage::ETMSStatus_Idle; }
bool C4JStorage::WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename,std::uint8_t *pBuffer,unsigned int bufferSize) { return true; }
bool C4JStorage::DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename) { return true; }
void C4JStorage::StoreTMSPathName(wchar_t *pwchName) {}
unsigned int C4JStorage::CRC(unsigned char *buf, int len) { return 0; }
struct PTMSPP_FILEDATA;

View file

@ -118,15 +118,15 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() {
thread->Run();
}
int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR* wchTMSFile,
int CConsoleMinecraftApp::GetLocalTMSFileIndex(wchar_t* wchTMSFile,
bool bFilenameIncludesExtension,
eFileExtensionType eEXT) {
return -1;
}
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR* wchTMSFile) { return -1; }
int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t* wchTMSFile) { return -1; }
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR* wchTMSFile,
int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t* wchTMSFile,
eFileExtensionType eExt) {
return -1;
}

View file

@ -17,12 +17,12 @@ public:
virtual void GetScreenshot(int iPad, std::uint8_t** screenshotData,
unsigned int* screenshotSize);
virtual int LoadLocalTMSFile(WCHAR* wchTMSFile);
virtual int LoadLocalTMSFile(WCHAR* wchTMSFile, eFileExtensionType eExt);
virtual int LoadLocalTMSFile(wchar_t* wchTMSFile);
virtual int LoadLocalTMSFile(wchar_t* wchTMSFile, eFileExtensionType eExt);
virtual void FreeLocalTMSFiles(eTMSFileType eType);
virtual int GetLocalTMSFileIndex(
WCHAR* wchTMSFile, bool bFilenameIncludesExtension,
wchar_t* wchTMSFile, bool bFilenameIncludesExtension,
eFileExtensionType eEXT = eFileExtensionType_PNG);
// BANNED LEVEL LIST

View file

@ -1008,7 +1008,7 @@ std::string wstring_to_utf8(const std::wstring& str) {
}
uint8_t* mallocAndCreateUTF8ArrayFromString(int iID) {
LPCWSTR wchString = app.GetString(iID);
const wchar_t* wchString = app.GetString(iID);
std::wstring srcString = wchString;
std::string dstString = wstring_to_utf8(srcString);
@ -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);
@ -1100,7 +1100,7 @@ void operator delete(void* p) {
XALLOC_MEMPROTECT_READWRITE, FALSE, XALLOC_MEMTYPE_HEAP));
}
void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) {
void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) {
bool special = false;
if (dwAllocAttributes == 0) {
dwAllocAttributes = MAKE_XALLOC_ATTRIBUTES(
@ -1132,7 +1132,7 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) {
LeaveCriticalSection(&memCS);
}
SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
size_t WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
if (trackStarted) {
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
} else {

View file

@ -26,7 +26,7 @@ public:
bool PostLinkToSocialNetwork(ESocialNetwork, DWORD, bool) { return false; }
bool PostImageToSocialNetwork(ESocialNetwork, DWORD, bool) { return false; }
void SetSocialPostText(const WCHAR*, const WCHAR*, const WCHAR*) {}
void SetSocialPostText(const wchar_t*, const wchar_t*, const wchar_t*) {}
private:
CSocialManager() {}

View file

@ -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) \

View file

@ -18,25 +18,17 @@
#define S_OK 0
typedef unsigned int DWORD;
typedef wchar_t WCHAR;
typedef unsigned char BYTE;
typedef BYTE* PBYTE;
typedef const wchar_t* LPCWSTR;
typedef unsigned long long ULONGLONG;
typedef int HRESULT;
typedef unsigned int UINT;
typedef void* HANDLE;
typedef int INT;
typedef long* PLONG;
typedef unsigned int* LPDWORD;
typedef const void* LPCVOID;
typedef char CHAR;
typedef void* PVOID;
typedef uintptr_t ULONG_PTR;
typedef long LONG;
typedef long LONG64, *PLONG64;
typedef void VOID;
typedef ULONGLONG PlayerUID;
typedef unsigned long long PlayerUID;
typedef DWORD WORD;
typedef DWORD* PDWORD;
@ -53,8 +45,7 @@ typedef struct {
} ULARGE_INTEGER;
typedef long long LONGLONG;
typedef size_t SIZE_T;
typedef WCHAR *LPWSTR, *PWSTR;
typedef wchar_t *LPWSTR, *PWSTR;
typedef unsigned char boolean; // java brainrot
#define __debugbreak()
#define CONST const
@ -175,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 {
@ -214,8 +205,8 @@ typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS;
typedef VOID* XMEMCOMPRESSION_CONTEXT;
typedef VOID* XMEMDECOMPRESSION_CONTEXT;
typedef void* XMEMCOMPRESSION_CONTEXT;
typedef void* XMEMDECOMPRESSION_CONTEXT;
// internal search state for FindFirstFile/FindNextFile
typedef struct _LINUXSTUBS_FIND_HANDLE {
@ -299,23 +290,23 @@ static inline ULONG TryEnterCriticalSection(
}
// https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-globalmemorystatus
static inline VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) {
static inline void GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) {
// TODO: Parse /proc/meminfo and set lpBuffer based on that. Probably will
// also need another different codepath for macOS too.
}
static inline DWORD GetLastError(VOID) { return errno; }
static inline DWORD GetLastError(void) { return errno; }
#ifdef __LP64__
static inline LONG64 InterlockedCompareExchangeRelease64(
LONG64 volatile* Destination, LONG64 Exchange, LONG64 Comperand) {
LONG64 expected = Comperand;
static inline int64_t InterlockedCompareExchangeRelease64(
int64_t volatile* Destination, int64_t Exchange, int64_t Comperand) {
int64_t expected = Comperand;
__atomic_compare_exchange_n(Destination, &expected, Exchange, false,
__ATOMIC_RELEASE, __ATOMIC_RELAXED);
return expected;
}
#else
static inline LONG64 InterlockedCompareExchangeRelease(
static inline int64_t InterlockedCompareExchangeRelease(
LONG volatile* Destination, LONG Exchange, LONG Comperand) {
LONG expected = Comperand;
__atomic_compare_exchange_n(Destination, &expected, Exchange, false,
@ -327,8 +318,8 @@ static inline LONG64 InterlockedCompareExchangeRelease(
// internal helper: convert time_t to FILETIME (100ns intervals since
// 1601-01-01)
static inline FILETIME _TimeToFileTime(time_t t) {
const ULONGLONG EPOCH_DIFF = 11644473600ULL;
ULONGLONG val = ((ULONGLONG)t + EPOCH_DIFF) * 10000000ULL;
const uint64_t EPOCH_DIFF = 11644473600ULL;
uint64_t val = ((uint64_t)t + EPOCH_DIFF) * 10000000ULL;
FILETIME ft;
ft.dwLowDateTime = (DWORD)(val & 0xFFFFFFFF);
ft.dwHighDateTime = (DWORD)(val >> 32);
@ -651,8 +642,8 @@ static inline bool FindClose(HANDLE hFindFile) {
// internal helper: convert FILETIME (100ns since 1601) to time_t (seconds since
// 1970)
static inline time_t _FileTimeToTimeT(const FILETIME& ft) {
ULONGLONG val = ((ULONGLONG)ft.dwHighDateTime << 32) | ft.dwLowDateTime;
const ULONGLONG EPOCH_DIFF =
uint64_t val = ((uint64_t)ft.dwHighDateTime << 32) | ft.dwLowDateTime;
const uint64_t EPOCH_DIFF =
116444736000000000ULL; // 100ns intervals between 1601-01-01 and
// 1970-01-01
return (time_t)((val - EPOCH_DIFF) / 10000000ULL);
@ -684,7 +675,7 @@ static inline void _FillSystemTime(const struct tm* tm, long tv_nsec,
}
// https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getsystemtime
static inline VOID GetSystemTime(LPSYSTEMTIME lpSystemTime) {
static inline void GetSystemTime(LPSYSTEMTIME lpSystemTime) {
struct timespec ts;
_CurrentTimeSpec(&ts);
struct tm tm;
@ -693,7 +684,7 @@ static inline VOID GetSystemTime(LPSYSTEMTIME lpSystemTime) {
}
// https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getlocaltime
static inline VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) {
static inline void GetLocalTime(LPSYSTEMTIME lpSystemTime) {
struct timespec ts;
_CurrentTimeSpec(&ts);
struct tm tm;
@ -715,7 +706,7 @@ static inline bool SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime,
time_t t = timegm(&tm);
if (t == (time_t)-1) return FALSE;
ULONGLONG ft = ((ULONGLONG)t + 11644473600ULL) * 10000000ULL;
uint64_t ft = ((uint64_t)t + 11644473600ULL) * 10000000ULL;
ft += lpSystemTime->wMilliseconds * 10000ULL;
lpFileTime->dwLowDateTime = (DWORD)(ft & 0xFFFFFFFF);
lpFileTime->dwHighDateTime = (DWORD)(ft >> 32);
@ -725,7 +716,7 @@ static inline bool SystemTimeToFileTime(const SYSTEMTIME* lpSystemTime,
// https://learn.microsoft.com/en-us/windows/win32/api/timezoneapi/nf-timezoneapi-filetimetosystemtime
static inline bool FileTimeToSystemTime(const FILETIME* lpFileTime,
LPSYSTEMTIME lpSystemTime) {
ULONGLONG ft = ((ULONGLONG)lpFileTime->dwHighDateTime << 32) |
uint64_t ft = ((uint64_t)lpFileTime->dwHighDateTime << 32) |
lpFileTime->dwLowDateTime;
time_t t = _FileTimeToTimeT(*lpFileTime);
long remainder_ns = (long)((ft % 10000000ULL) * 100);
@ -761,18 +752,18 @@ static inline bool QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount) {
}
// https://learn.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringa
static inline VOID OutputDebugStringA(const char* lpOutputString) {
static inline void OutputDebugStringA(const char* lpOutputString) {
if (!lpOutputString) return;
fputs(lpOutputString, stderr);
}
// https://learn.microsoft.com/en-us/windows/win32/api/debugapi/nf-debugapi-outputdebugstringw
static inline VOID OutputDebugStringW(LPCWSTR lpOutputString) {
static inline void OutputDebugStringW(const wchar_t* lpOutputString) {
if (!lpOutputString) return;
fprintf(stderr, "%ls", lpOutputString);
}
static inline VOID OutputDebugString(const char* lpOutputString) {
static inline void OutputDebugString(const char* lpOutputString) {
return OutputDebugStringA(lpOutputString);
}
@ -965,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) {
@ -1057,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;
@ -1078,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

View file

@ -10,7 +10,7 @@
void Display::update() {}
int CMinecraftApp::GetTPConfigVal(WCHAR* pwchDataFile) { return 0; }
int CMinecraftApp::GetTPConfigVal(wchar_t* pwchDataFile) { return 0; }
#include "../../Minecraft.World/Platform/x64headers/extraX64.h"

View file

@ -107,8 +107,8 @@ public:
void SetMenuDisplayed(int iPad, bool bVal);
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(void*,const bool),void* lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
// EKeyboardResult RequestKeyboard(UINT uiTitle, LPCWSTR pwchDefault, UINT uiDesc, DWORD dwPad, WCHAR *pwchResult, UINT uiResultSize,int( *Func)(void*,const bool),void* lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
// EKeyboardResult RequestKeyboard(UINT uiTitle, UINT uiText, UINT uiDesc, DWORD dwPad, wchar_t *pwchResult, UINT uiResultSize,int( *Func)(void*,const bool),void* lpParam,EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
// EKeyboardResult RequestKeyboard(UINT uiTitle, const wchar_t* pwchDefault, UINT uiDesc, DWORD dwPad, wchar_t *pwchResult, UINT uiResultSize,int( *Func)(void*,const bool),void* lpParam, EKeyboardMode eMode,C4JStringTable *pStringTable=nullptr);
EKeyboardResult RequestKeyboard(const wchar_t *Title, const wchar_t *Text, int iPad, unsigned int uiMaxChars, int( *Func)(void *,const bool), void *lpParam, C_4JInput::EKeyboardMode eMode);
void GetText(uint16_t *UTF16String);
@ -130,7 +130,7 @@ public:
void CancelQueuedVerifyStrings(int( *Func)(void *,STRING_VERIFY_RESPONSE *),void *lpParam);
void CancelAllVerifyInProgress(void);
//bool InputDetected(DWORD dwUserIndex,WCHAR *pwchInput);
//bool InputDetected(DWORD dwUserIndex,wchar_t *pwchInput);
};
// Singleton

View file

@ -195,7 +195,7 @@ public:
void StateSetForceLOD(int LOD);
// Event tracking
void BeginEvent(LPCWSTR eventName);
void BeginEvent(const wchar_t* eventName);
void EndEvent();
// PLM event handling

View file

@ -47,23 +47,23 @@ public:
{
unsigned int uiFileSize;
DWORD dwType;
DWORD dwWchCount; // count of WCHAR in next array
WCHAR wchFile[1];
DWORD dwWchCount; // count of wchar_t in next array
wchar_t wchFile[1];
}
DLC_FILE_DETAILS, *PDLC_FILE_DETAILS;
typedef struct
{
DWORD dwType;
DWORD dwWchCount; // count of WCHAR in next array;
WCHAR wchData[1]; // will be an array of size dwBytes
DWORD dwWchCount; // count of wchar_t in next array;
wchar_t wchData[1]; // will be an array of size dwBytes
}
DLC_FILE_PARAM, *PDLC_FILE_PARAM;
// End of DLC_Creator structs
typedef struct
{
WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
wchar_t wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH];
CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH];
DWORD dwImageOffset;
DWORD dwImageBytes;
@ -239,7 +239,7 @@ public:
// Messages
C4JStorage::EMessageResult RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA,UINT uiOptionC, DWORD dwPad=XUSER_INDEX_ANY,
int( *Func)(void*,int,const C4JStorage::EMessageResult)=nullptr,void* lpParam=nullptr, C4JStringTable *pStringTable=nullptr, WCHAR *pwchFormatString=nullptr,DWORD dwFocusButton=0);
int( *Func)(void*,int,const C4JStorage::EMessageResult)=nullptr,void* lpParam=nullptr, C4JStringTable *pStringTable=nullptr, wchar_t *pwchFormatString=nullptr,DWORD dwFocusButton=0);
C4JStorage::EMessageResult GetMessageBoxResult();
@ -248,10 +248,10 @@ public:
bool SetSaveDevice(int( *Func)(void*,const bool),void* lpParam, bool bForceResetOfSaveDevice=false);
// savegame
void Init(unsigned int uiSaveVersion,LPCWSTR pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(void*, const ESavingMessage, int),void* lpParam,const char* szGroupID);
void Init(unsigned int uiSaveVersion,const wchar_t* pwchDefaultSaveName,char *pszSavePackName,int iMinimumSaveSize,int( *Func)(void*, const ESavingMessage, int),void* lpParam,const char* szGroupID);
void ResetSaveData(); // Call before a new save to clear out stored save file name
void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName);
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
void SetDefaultSaveNameForKeyboardDisplay(const wchar_t* pwchDefaultSaveName);
void SetSaveTitle(const wchar_t* pwchDefaultSaveName);
bool GetSaveUniqueNumber(INT *piVal);
bool GetSaveUniqueFilename(char *pszName);
void SetSaveUniqueFilename(char *szFilename);
@ -260,10 +260,10 @@ public:
bool GetSaveDisabled(void);
unsigned int GetSaveSize();
void GetSaveData(void *pvData,unsigned int *puiBytes);
PVOID AllocateSaveData(unsigned int uiBytes);
void* AllocateSaveData(unsigned int uiBytes);
void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(void* ,const bool),void* lpParam);
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam);
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,wchar_t *wchNewName,int ( *Func)(void* lpParam, bool), void* lpParam);
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
bool GetSaveDeviceSelected(unsigned int iPad);
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists);
@ -303,10 +303,11 @@ public:
// Global title storage
C4JStorage::ETMSStatus ReadTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,C4JStorage::eTMS_FileType eFileType,
WCHAR *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(void*, WCHAR *,int, bool, int)=nullptr,void* lpParam=nullptr, int iAction=0);
bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize);
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,WCHAR *pwchFilename);
void StoreTMSPathName(WCHAR *pwchName=nullptr);
wchar_t *pwchFilename,BYTE **ppBuffer,DWORD *pdwBufferSize,int( *Func)(void*, wchar_t *,int, bool, int)=nullptr,void* lpParam=nullptr, int iAction=0);
bool WriteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename,BYTE *pBuffer,DWORD dwBufferSize);
bool DeleteTMSFile(int iQuadrant,eGlobalStorage eStorageFacility,wchar_t *pwchFilename);
void StoreTMSPathName(wchar_t *pwchName=NULL);
// TMS++

View file

@ -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);

View file

@ -114,7 +114,7 @@ public:
// Post a test image to social network.
bool PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DWORD dwUserIndex, bool bUsingKinect );
void SetSocialPostText(LPCWSTR Title, LPCWSTR Caption, LPCWSTR Desc);
void SetSocialPostText(const wchar_t* Title, const wchar_t* Caption, const wchar_t* Desc);
// WESTY : Not sure if we even need to get social access key!
/*
@ -123,9 +123,9 @@ public:
*/
private:
WCHAR m_wchTitleA[MAX_SOCIALPOST_CAPTION+1];
WCHAR m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1];
WCHAR m_wchDescA[MAX_SOCIALPOST_DESC+1];
wchar_t m_wchTitleA[MAX_SOCIALPOST_CAPTION+1];
wchar_t m_wchCaptionA[MAX_SOCIALPOST_CAPTION+1];
wchar_t m_wchDescA[MAX_SOCIALPOST_DESC+1];
};

View file

@ -116,17 +116,17 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
thread->Run();
}
int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)
int CConsoleMinecraftApp::GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT)
{
return -1;
}
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile)
int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile)
{
return -1;
}
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt)
int CConsoleMinecraftApp::LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt)
{
return -1;
}

View file

@ -16,11 +16,11 @@ public:
virtual void ReleaseSaveThumbnail();
virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize);
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile);
virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt);
virtual int LoadLocalTMSFile(wchar_t *wchTMSFile);
virtual int LoadLocalTMSFile(wchar_t *wchTMSFile, eFileExtensionType eExt);
virtual void FreeLocalTMSFiles(eTMSFileType eType);
virtual int GetLocalTMSFileIndex(WCHAR *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG);
virtual int GetLocalTMSFileIndex(wchar_t *wchTMSFile,bool bFilenameIncludesExtension,eFileExtensionType eEXT=eFileExtensionType_PNG);
// BANNED LEVEL LIST
virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false) {}

View file

@ -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);
@ -986,7 +986,7 @@ void operator delete(void* p) {
XALLOC_MEMPROTECT_READWRITE, FALSE, XALLOC_MEMTYPE_HEAP));
}
void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) {
void WINAPI XMemFree(void* pAddress, DWORD dwAllocAttributes) {
bool special = false;
if (dwAllocAttributes == 0) {
dwAllocAttributes = MAKE_XALLOC_ATTRIBUTES(
@ -1018,7 +1018,7 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes) {
LeaveCriticalSection(&memCS);
}
SIZE_T WINAPI XMemSize(PVOID pAddress, DWORD dwAllocAttributes) {
size_t WINAPI XMemSize(void* pAddress, DWORD dwAllocAttributes) {
if (trackStarted) {
return XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
} else {

View file

@ -39,9 +39,9 @@ CONST UINT XML_WRITE_BUFFER_SIZE = 2048;
//-------------------------------------------------------------------------------------
struct XMLAttribute
{
WCHAR* strName;
wchar_t* strName;
UINT NameLen;
WCHAR* strValue;
wchar_t* strValue;
UINT ValueLen;
};
@ -56,18 +56,18 @@ public:
virtual HRESULT StartDocument() = 0;
virtual HRESULT EndDocument() = 0;
virtual HRESULT ElementBegin( CONST WCHAR* strName, UINT NameLen,
virtual HRESULT ElementBegin( CONST wchar_t* strName, UINT NameLen,
CONST XMLAttribute *pAttributes, UINT NumAttributes ) = 0;
virtual HRESULT ElementContent( CONST WCHAR *strData, UINT DataLen, bool More ) = 0;
virtual HRESULT ElementEnd( CONST WCHAR *strName, UINT NameLen ) = 0;
virtual HRESULT ElementContent( CONST wchar_t *strData, UINT DataLen, bool More ) = 0;
virtual HRESULT ElementEnd( CONST wchar_t *strName, UINT NameLen ) = 0;
virtual HRESULT CDATABegin( ) = 0;
virtual HRESULT CDATAData( CONST WCHAR *strCDATA, UINT CDATALen, bool bMore ) = 0;
virtual HRESULT CDATAData( CONST wchar_t *strCDATA, UINT CDATALen, bool bMore ) = 0;
virtual HRESULT CDATAEnd( ) = 0;
virtual VOID Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
virtual void Error( HRESULT hError, CONST CHAR *strMessage ) = 0;
virtual VOID SetParseProgress( DWORD dwProgress ) { }
virtual void SetParseProgress( DWORD dwProgress ) { }
const CHAR* GetFilename() { return m_strFilename; }
UINT GetLineNumber() { return m_LineNum; }
@ -88,7 +88,7 @@ public:
~XMLParser();
// Register an interface inheiriting from ISAXCallback
VOID RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback );
void RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback );
// Get the registered interface
ISAXCallback* GetSAXCallbackInterface();
@ -102,7 +102,7 @@ public:
HRESULT ParseXMLFile( CONST CHAR *strFilename );
// Parses from a buffer- if you pass a WCHAR buffer (and cast it), it will
// Parses from a buffer- if you pass a wchar_t buffer (and cast it), it will
// correctly detect it and use unicode instead. Return codes are the
// same as for ParseXMLFile
@ -112,7 +112,7 @@ private:
HRESULT MainParseLoop();
HRESULT AdvanceCharacter( bool bOkToFail = FALSE );
VOID SkipNextAdvance();
void SkipNextAdvance();
HRESULT ConsumeSpace();
HRESULT ConvertEscape();
@ -122,12 +122,12 @@ private:
HRESULT AdvanceCDATA();
HRESULT AdvanceComment();
VOID FillBuffer();
void FillBuffer();
#ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation
VOID Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... );
void Error( HRESULT hRet, _In_z_ _Printf_format_string_ CONST CHAR* strFormat, ... );
#else
VOID Error( HRESULT hRet, CONST CHAR* strFormat, ... );
void Error( HRESULT hRet, CONST CHAR* strFormat, ... );
#endif
ISAXCallback* m_pISAXCallback;
@ -138,17 +138,18 @@ private:
DWORD m_dwCharsTotal;
DWORD m_dwCharsConsumed;
BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing nullptr
WCHAR m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ];
BYTE m_pReadBuf[ XML_READ_BUFFER_SIZE + 2 ]; // room for a trailing NULL
wchar_t m_pWriteBuf[ XML_WRITE_BUFFER_SIZE ];
BYTE* m_pReadPtr;
WCHAR* m_pWritePtr; // write pointer within m_pBuf
wchar_t* m_pWritePtr; // write pointer within m_pBuf
bool m_bUnicode; // TRUE = 16-bits, FALSE = 8-bits
bool m_bReverseBytes; // TRUE = reverse bytes, FALSE = don't reverse
bool m_bSkipNextAdvance;
WCHAR m_Ch; // Current character being parsed
wchar_t m_Ch; // Current character being parsed
};
} // namespace ATG

View file

@ -504,7 +504,7 @@ void LivingEntityRenderer::renderNameTag(std::shared_ptr<LivingEntity> mob,
int offs = 0;
std::wstring playerName;
WCHAR wchName[2];
wchar_t wchName[2];
if (mob->instanceof(eTYPE_PLAYER)) {
std::shared_ptr<Player> player = std::dynamic_pointer_cast<Player>(mob);

View file

@ -214,7 +214,7 @@ std::wstring AbstractTexturePack::getXuiRootPath() {
// Load new skin
constexpr int LOCATOR_SIZE =
256; // Use this to allocate space to hold a ResourceLocator string
WCHAR szResourceLocator[LOCATOR_SIZE];
wchar_t szResourceLocator[LOCATOR_SIZE];
swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",
c_ModuleHandle, L"media", L"media/");

View file

@ -434,7 +434,7 @@ std::wstring DLCTexturePack::getXuiRootPath() {
constexpr int LOCATOR_SIZE =
256; // Use this to allocate space to hold a ResourceLocator string
WCHAR szResourceLocator[LOCATOR_SIZE];
wchar_t szResourceLocator[LOCATOR_SIZE];
swprintf(szResourceLocator, LOCATOR_SIZE, L"memory://%08X,%04X#",
pbData, dwSize);
path = szResourceLocator;

View file

@ -60,7 +60,7 @@ public:
const wchar_t* getString(const std::wstring& id);
const wchar_t* getString(int id);
// static LPCWSTR m_wchLocaleCode[LOCALE_COUNT];
// static const wchar_t* m_wchLocaleCode[LOCALE_COUNT];
private:
// std::wstring getLangId(DWORD dwLanguage=0);

View file

@ -112,20 +112,20 @@ void SignTileEntity::setChanged() {
if(!g_NetworkManager.IsLocalGame() && !m_bVerified)
//if (pMinecraft->level->isClientSide)
{
WCHAR *wcMessages[MAX_SIGN_LINES];
wchar_t *wcMessages[MAX_SIGN_LINES];
for (int i = 0; i < MAX_SIGN_LINES; ++i)
{
wcMessages[i]=new WCHAR [MAX_LINE_LENGTH+1];
ZeroMemory(wcMessages[i],sizeof(WCHAR)*(MAX_LINE_LENGTH+1));
wcMessages[i]=new wchar_t [MAX_LINE_LENGTH+1];
ZeroMemory(wcMessages[i],sizeof(wchar_t)*(MAX_LINE_LENGTH+1));
if(m_wsmessages[i].length()>0)
{
memcpy(wcMessages[i],m_wsmessages[i].c_str(),m_wsmessages[i].length()*sizeof(WCHAR));
memcpy(wcMessages[i],m_wsmessages[i].c_str(),m_wsmessages[i].length()*sizeof(wchar_t));
}
}
// at this point, we can ask the online string verifier if our sign
text is ok #if 0 m_bVerified=true; #else
if(!InputManager.VerifyStrings((WCHAR**)&wcMessages,MAX_SIGN_LINES,&SignTileEntity::StringVerifyCallback,(void*)this))
if(!InputManager.VerifyStrings((wchar_t**)&wcMessages,MAX_SIGN_LINES,&SignTileEntity::StringVerifyCallback,(void*)this))
{
// Nothing to verify
m_bVerified=true;

View file

@ -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

View file

@ -1475,12 +1475,12 @@ Item* Item::setDescriptionId(unsigned int id) {
return this;
}
LPCWSTR Item::getDescription() {
const wchar_t* Item::getDescription() {
return app.GetString(getDescriptionId());
// return I18n::get(getDescriptionId());
}
LPCWSTR Item::getDescription(std::shared_ptr<ItemInstance> instance) {
const wchar_t* Item::getDescription(std::shared_ptr<ItemInstance> instance) {
return app.GetString(getDescriptionId(instance));
// return I18n::get(getDescriptionId(instance));
}

View file

@ -720,8 +720,8 @@ public:
virtual bool isHandEquipped();
virtual bool isMirroredArt();
Item* setDescriptionId(unsigned int id);
LPCWSTR getDescription();
LPCWSTR getDescription(std::shared_ptr<ItemInstance> instance);
const wchar_t* getDescription();
const wchar_t* getDescription(std::shared_ptr<ItemInstance> instance);
virtual unsigned int getDescriptionId(int iData = -1);
virtual unsigned int getDescriptionId(
std::shared_ptr<ItemInstance> instance);

View file

@ -415,7 +415,7 @@ void SparseDataStorage::addNewPlane(int y) {
// lastDataAndCount, and will return the value present just before the
// write took place
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64(
(LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount);
(int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount);
if (lastDataAndCount2 == lastDataAndCount) {
success = true;
@ -489,7 +489,7 @@ void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount) {
// lastDataAndCount, and will return the value present just before the
// write took place
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64(
(LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount);
(int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount);
if (lastDataAndCount2 == lastDataAndCount) {
success = true;
@ -564,7 +564,7 @@ int SparseDataStorage::compress() {
// lastDataAndCount, and will return the value present just before the
// write took place
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64(
(LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount);
(int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount);
if (lastDataAndCount2 != lastDataAndCount) {
// Failed to write. Don't bother trying again... being very

View file

@ -418,7 +418,7 @@ void SparseLightStorage::addNewPlane(int y) {
// lastDataAndCount, and will return the value present just before the
// write took place
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64(
(LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount);
(int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount);
if (lastDataAndCount2 == lastDataAndCount) {
success = true;
@ -492,7 +492,7 @@ void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount) {
// lastDataAndCount, and will return the value present just before the
// write took place
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64(
(LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount);
(int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount);
if (lastDataAndCount2 == lastDataAndCount) {
success = true;
@ -574,7 +574,7 @@ int SparseLightStorage::compress() {
// lastDataAndCount, and will return the value present just before the
// write took place
int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64(
(LONG64*)&dataAndCount, newDataAndCount, lastDataAndCount);
(int64_t*)&dataAndCount, newDataAndCount, lastDataAndCount);
if (lastDataAndCount2 != lastDataAndCount) {
// Failed to write. Don't bother trying again... being very

View file

@ -177,7 +177,7 @@ void System::ReverseULONGLONG(int64_t* pullVal) {
pchVal1[7] = pchVal2[0];
}
void System::ReverseWCHARA(WCHAR* pwch, int iLen) {
void System::ReverseWCHARA(wchar_t* pwch, int iLen) {
for (int i = 0; i < iLen; i++) {
ReverseUSHORT((unsigned short*)&pwch[i]);
}

View file

@ -36,7 +36,7 @@ public:
static void ReverseULONG(unsigned int* pulVal);
static void ReverseINT(int* piVal);
static void ReverseULONGLONG(int64_t* pullVal);
static void ReverseWCHARA(WCHAR* pwch, int iLen);
static void ReverseWCHARA(wchar_t* pwch, int iLen);
};
#define MAKE_FOURCC(ch0, ch1, ch2, ch3) \

View file

@ -14,14 +14,13 @@
#define MULTITHREAD_ENABLE
typedef unsigned char byte;
constexpr int MINECRAFT_NET_MAX_PLAYERS = 8;
static_assert(
MINECRAFT_NET_MAX_PLAYERS <= std::numeric_limits<std::uint8_t>::max(),
"MINECRAFT_NET_MAX_PLAYERS must fit in the 8-bit network protocol");
typedef ULONGLONG SessionID;
typedef uint64_t SessionID;
typedef PlayerUID GameSessionUID;
class INVITE_INFO;
@ -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;
@ -128,7 +127,7 @@ public:
bool IsGuest();
bool IsLocal();
PlayerUID GetXuid();
LPCWSTR GetGamertag();
const wchar_t* GetGamertag();
int GetSessionIndex();
bool IsTalking();
bool IsMutedByLocalUser(DWORD dwUserIndex);
@ -265,32 +264,32 @@ DWORD XUserGetSigninInfo(DWORD dwUserIndex, DWORD dwFlags,
class CXuiStringTable {
public:
LPCWSTR Lookup(LPCWSTR szId);
LPCWSTR Lookup(UINT nIndex);
const wchar_t* Lookup(const wchar_t* szId);
const wchar_t* Lookup(UINT nIndex);
void Clear();
HRESULT Load(LPCWSTR szId);
HRESULT Load(const wchar_t* szId);
};
typedef VOID* XMEMDECOMPRESSION_CONTEXT;
typedef VOID* XMEMCOMPRESSION_CONTEXT;
typedef void* XMEMDECOMPRESSION_CONTEXT;
typedef void* XMEMCOMPRESSION_CONTEXT;
typedef enum _XMEMCODEC_TYPE {
XMEMCODEC_DEFAULT = 0,
XMEMCODEC_LZX = 1
} XMEMCODEC_TYPE;
HRESULT XMemDecompress(XMEMDECOMPRESSION_CONTEXT Context, VOID* pDestination,
SIZE_T* pDestSize, VOID* pSource, SIZE_T SrcSize);
HRESULT XMemDecompress(XMEMDECOMPRESSION_CONTEXT Context, void* pDestination,
size_t* pDestSize, void* pSource, size_t SrcSize);
HRESULT XMemCompress(XMEMCOMPRESSION_CONTEXT Context, VOID* pDestination,
SIZE_T* pDestSize, VOID* pSource, SIZE_T SrcSize);
HRESULT XMemCompress(XMEMCOMPRESSION_CONTEXT Context, void* pDestination,
size_t* pDestSize, void* pSource, size_t SrcSize);
HRESULT XMemCreateCompressionContext(XMEMCODEC_TYPE CodecType,
const VOID* pCodecParams, DWORD Flags,
const void* pCodecParams, DWORD Flags,
XMEMCOMPRESSION_CONTEXT* pContext);
HRESULT XMemCreateDecompressionContext(XMEMCODEC_TYPE CodecType,
const VOID* pCodecParams, DWORD Flags,
const void* pCodecParams, DWORD Flags,
XMEMDECOMPRESSION_CONTEXT* pContext);
typedef struct _XMEMCODEC_PARAMETERS_LZX {

View file

@ -321,10 +321,10 @@ public:
static LPCGUID getPlayerSession();
static void setMultiplayerCorrelationId(Platform::String ^ mpcId);
static LPCWSTR getMultiplayerCorrelationId();
static const wchar_t* getMultiplayerCorrelationId();
static LPCWSTR getUserId(std::shared_ptr<LocalPlayer> plr);
static LPCWSTR getUserId(int iPad);
static const wchar_t* getUserId(std::shared_ptr<LocalPlayer> plr);
static const wchar_t* getUserId(int iPad);
static void playerSessionStart(PlayerUID, std::shared_ptr<Player>);
static void playerSessionStart(int iPad);