fix: clear all build warnings and clean up review nits

This commit is contained in:
MatthewBeshay 2026-04-09 09:55:13 +10:00
parent b2a4620f25
commit 0da697cbd4
30 changed files with 88 additions and 98 deletions

View file

@ -110,7 +110,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
SKIN_BOX* pSkinBox = new SKIN_BOX; SKIN_BOX* pSkinBox = new SKIN_BOX;
memset(pSkinBox, 0, sizeof(SKIN_BOX)); memset(pSkinBox, 0, sizeof(SKIN_BOX));
sscanf(value.c_str(), "%9ls%f%f%f%f%f%f%f%f", wchBodyPart, 10, sscanf(value.c_str(), "%9s%f%f%f%f%f%f%f%f", wchBodyPart,
&pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW, &pSkinBox->fX, &pSkinBox->fY, &pSkinBox->fZ, &pSkinBox->fW,
&pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV); &pSkinBox->fH, &pSkinBox->fD, &pSkinBox->fU, &pSkinBox->fV);
@ -132,8 +132,7 @@ void DLCSkinFile::addParameter(DLCManager::EDLCParameterType type,
m_AdditionalBoxes.push_back(pSkinBox); m_AdditionalBoxes.push_back(pSkinBox);
} break; } break;
case DLCManager::e_DLCParamType_Anim: { case DLCManager::e_DLCParamType_Anim: {
sscanf(value.c_str(), "%X", &m_uiAnimOverrideBitmask, sscanf(value.c_str(), "%X", &m_uiAnimOverrideBitmask);
sizeof(unsigned int));
uint32_t skinId = app.getSkinIdFromPath(m_path); uint32_t skinId = app.getSkinIdFromPath(m_path);
app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask); app.SetAnimOverrideBitmask(skinId, m_uiAnimOverrideBitmask);
break; break;

View file

@ -15,7 +15,7 @@ LeaderboardInterface::LeaderboardInterface(IPlatformLeaderboard* man) {
m_startIndex = 0; m_startIndex = 0;
m_readCount = 0; m_readCount = 0;
m_manager->OpenSession(); (void)m_manager->OpenSession();
} }
LeaderboardInterface::~LeaderboardInterface() { LeaderboardInterface::~LeaderboardInterface() {

View file

@ -717,7 +717,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void* pParam,
// If the player was signed in before selecting play, we'll not // If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get // have read the profile yet, so query the sign-in status to get
// this to happen // this to happen
PlatformProfile.QuerySigninStatus(); (void)PlatformProfile.QuerySigninStatus();
// 4J-PB - clear any previous connection errors // 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed(); Minecraft::GetInstance()->clearConnectionFailed();
@ -1377,7 +1377,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus(
// If the player was signed in before selecting play, we'll not // If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get // have read the profile yet, so query the sign-in status to get
// this to happen // this to happen
PlatformProfile.QuerySigninStatus(); (void)PlatformProfile.QuerySigninStatus();
// 4J-PB - clear any previous connection errors // 4J-PB - clear any previous connection errors
Minecraft::GetInstance()->clearConnectionFailed(); Minecraft::GetInstance()->clearConnectionFailed();

View file

@ -875,7 +875,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable() {
app.DebugPrintf("Need more H slots - "); app.DebugPrintf("Need more H slots - ");
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
fprintf( fprintf(
stderr, stderr, "%s",
app.GetString(pTempItemInst->getDescriptionId())); app.GetString(pTempItemInst->getDescriptionId()));
#endif #endif
app.DebugPrintf("\n"); app.DebugPrintf("\n");

View file

@ -302,7 +302,7 @@ void UIScene_LoadMenu::tick() {
if (szSeed[0] != 0) { if (szSeed[0] != 0) {
char TempString[256]; char TempString[256];
snprintf(TempString, 256, "%s: %hs", app.GetString(IDS_SEED), snprintf(TempString, 256, "%s: %s", app.GetString(IDS_SEED),
szSeed); szSeed);
m_labelSeed.setLabel(TempString); m_labelSeed.setLabel(TempString);
} else { } else {

View file

@ -787,7 +787,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad) {
// If the player was signed in before selecting play, we'll not have // If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to // read the profile yet, so query the sign-in status to get this to
// happen // happen
PlatformProfile.QuerySigninStatus(); (void)PlatformProfile.QuerySigninStatus();
// 4J-PB - Need to check for installed DLC // 4J-PB - Need to check for installed DLC
if (!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(iPad); if (!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(iPad);
@ -896,7 +896,7 @@ void UIScene_MainMenu::RunLeaderboards(int iPad) {
// If the player was signed in before selecting play, we'll not have // If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to // read the profile yet, so query the sign-in status to get this to
// happen // happen
PlatformProfile.QuerySigninStatus(); (void)PlatformProfile.QuerySigninStatus();
proceedToScene(iPad, eUIScene_LeaderboardsMenu); proceedToScene(iPad, eUIScene_LeaderboardsMenu);
} }
@ -916,7 +916,7 @@ void UIScene_MainMenu::RunUnlockOrDLC(int iPad) {
// If the player was signed in before selecting play, we'll not // If the player was signed in before selecting play, we'll not
// have read the profile yet, so query the sign-in status to get // have read the profile yet, so query the sign-in status to get
// this to happen // this to happen
PlatformProfile.QuerySigninStatus(); (void)PlatformProfile.QuerySigninStatus();
{ {
bool bContentRestricted = false; bool bContentRestricted = false;
@ -1015,7 +1015,7 @@ void UIScene_MainMenu::RunHelpAndOptions(int iPad) {
// If the player was signed in before selecting play, we'll not have // If the player was signed in before selecting play, we'll not have
// read the profile yet, so query the sign-in status to get this to // read the profile yet, so query the sign-in status to get this to
// happen // happen
PlatformProfile.QuerySigninStatus(); (void)PlatformProfile.QuerySigninStatus();
#if TO_BE_IMPLEMENTED #if TO_BE_IMPLEMENTED
// 4J-PB - You can be offline and still can go into help and options // 4J-PB - You can be offline and still can go into help and options

View file

@ -885,6 +885,8 @@ TEXTURE_NAME UIScene_SkinSelectMenu::getTextureId(int skinIndex) {
case EDefaultSkins::Skin7: case EDefaultSkins::Skin7:
texture = TN_MOB_CHAR7; texture = TN_MOB_CHAR7;
break; break;
case EDefaultSkins::Count:
break;
}; };
return texture; return texture;

View file

@ -586,7 +586,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion* region,
} }
m_cachedSlotDraw.clear(); m_cachedSlotDraw.clear();
if (useCommandBuffers) PlatformRenderer.CBuffCall(list); if (useCommandBuffers) (void)PlatformRenderer.CBuffCall(list);
// Finish GDraw and anything else that needs to be finalised // Finish GDraw and anything else that needs to be finalised
ui.endCustomDraw(region); ui.endCustomDraw(region);

View file

@ -6,7 +6,7 @@ public:
virtual void init() override; virtual void init() override;
protected: protected:
virtual void keyPressed(char eventCharacter, int eventKey); virtual void keyPressed(char eventCharacter, int eventKey) override;
virtual void buttonClicked(Button* button) override; virtual void buttonClicked(Button* button) override;
public: public:

View file

@ -188,8 +188,8 @@ void Font::draw(const std::string& str, bool dropShadow) {
// 4jcraft: this is a check for §. This was easy in UTF-16, since a // 4jcraft: this is a check for §. This was easy in UTF-16, since a
// single widechar can fit §, but it's encoded as 0xA7 0xC2 in UTF-8, so // single widechar can fit §, but it's encoded as 0xA7 0xC2 in UTF-8, so
// we need to check both characters. // we need to check both characters.
if (i + 2 < cleanStr.length() && c == '\xC2' && if (i + 2 < cleanStr.length() && c == 0xC2u &&
(unsigned char)cleanStr[i + 1] == '\xA7') { (unsigned char)cleanStr[i + 1] == 0xA7u) {
// 4J - following block was: // 4J - following block was:
// int colorN = // int colorN =
// "0123456789abcdefk".indexOf(str.toLowerCase().charAt(i + 1)); // "0123456789abcdefk".indexOf(str.toLowerCase().charAt(i + 1));

View file

@ -13,7 +13,7 @@ public:
protected: protected:
using Screen::keyPressed; using Screen::keyPressed;
virtual void keyPressed(char eventCharacter, int eventKey); virtual void keyPressed(char eventCharacter, int eventKey) override;
public: public:
virtual void init() override; virtual void init() override;

View file

@ -49,7 +49,7 @@ public:
protected: protected:
virtual void buttonClicked(Button* button) override; virtual void buttonClicked(Button* button) override;
virtual void keyPressed(char eventCharacter, int eventKey); virtual void keyPressed(char eventCharacter, int eventKey) override;
public: public:
virtual void render(int mouseX, int mouseY, float a) override; virtual void render(int mouseX, int mouseY, float a) override;

View file

@ -2375,7 +2375,7 @@ void ClientConnection::handleTextureChange(
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Skin for remote player %s has changed to %s (%d)\n", printf("Skin for remote player %s has changed to %s (%d)\n",
player->name.c_str(), player->customTextureUrl.c_str(), player->name.c_str(), player->customTextureUrl.c_str(),
player->getPlayerDefaultSkin()); static_cast<int>(player->getPlayerDefaultSkin()));
#endif #endif
break; break;
case TextureChangePacket::e_TextureChange_Cape: case TextureChangePacket::e_TextureChange_Cape:
@ -2431,7 +2431,7 @@ void ClientConnection::handleTextureAndGeometryChange(
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Skin for remote player %s has changed to %s (%d)\n", printf("Skin for remote player %s has changed to %s (%d)\n",
player->name.c_str(), player->customTextureUrl.c_str(), player->name.c_str(), player->customTextureUrl.c_str(),
player->getPlayerDefaultSkin()); static_cast<int>(player->getPlayerDefaultSkin()));
#endif #endif
if (!packet->path.empty() && if (!packet->path.empty() &&

View file

@ -16,7 +16,7 @@ public:
virtual void tick() override; virtual void tick() override;
protected: protected:
virtual void keyPressed(char eventCharacter, int eventKey); virtual void keyPressed(char eventCharacter, int eventKey) override;
public: public:
virtual void init() override; virtual void init() override;

View file

@ -15,7 +15,7 @@ public:
protected: protected:
using Screen::keyPressed; using Screen::keyPressed;
virtual void keyPressed(char eventCharacter, int eventKey); virtual void keyPressed(char eventCharacter, int eventKey) override;
public: public:
virtual void init() override; virtual void init() override;

View file

@ -373,7 +373,8 @@ void MultiplayerLocalPlayer::setAndBroadcastCustomSkin(std::uint32_t skinId) {
LocalPlayer::setCustomSkin(skinId); LocalPlayer::setCustomSkin(skinId);
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Skin for local player %s has changed to %s (%d)\n", printf("Skin for local player %s has changed to %s (%d)\n",
name.c_str(), customTextureUrl.c_str(), getPlayerDefaultSkin()); name.c_str(), customTextureUrl.c_str(),
static_cast<int>(getPlayerDefaultSkin()));
#endif #endif
if (getCustomSkin() != oldSkinIndex) if (getCustomSkin() != oldSkinIndex)
connection->send(std::shared_ptr<TextureAndGeometryChangePacket>( connection->send(std::shared_ptr<TextureAndGeometryChangePacket>(

View file

@ -13,7 +13,7 @@ public:
protected: protected:
using Screen::keyPressed; using Screen::keyPressed;
virtual void keyPressed(char eventCharacter, int eventKey); virtual void keyPressed(char eventCharacter, int eventKey) override;
public: public:
virtual void init() override; virtual void init() override;

View file

@ -3,6 +3,7 @@
#include "AbstractTexturePack.h" #include "AbstractTexturePack.h"
#include <cinttypes>
#include <wchar.h> #include <wchar.h>
#include <vector> #include <vector>
@ -222,7 +223,7 @@ std::string AbstractTexturePack::getXuiRootPath() {
256; // Use this to allocate space to hold a ResourceLocator string 256; // Use this to allocate space to hold a ResourceLocator string
char szResourceLocator[LOCATOR_SIZE]; char szResourceLocator[LOCATOR_SIZE];
snprintf(szResourceLocator, LOCATOR_SIZE, "section://%X,%s#%s", snprintf(szResourceLocator, LOCATOR_SIZE, "section://%" PRIxPTR ",%s#%s",
c_ModuleHandle, "media", "media/"); c_ModuleHandle, "media", "media/");
return szResourceLocator; return szResourceLocator;
} }

View file

@ -2,6 +2,7 @@
#include "minecraft/util/Log.h" #include "minecraft/util/Log.h"
#include "DLCTexturePack.h" #include "DLCTexturePack.h"
#include <cinttypes>
#include <cstdint> #include <cstdint>
#include <cwchar> #include <cwchar>
#include <limits> #include <limits>
@ -451,8 +452,9 @@ std::string DLCTexturePack::getXuiRootPath() {
constexpr int LOCATOR_SIZE = constexpr int LOCATOR_SIZE =
256; // Use this to allocate space to hold a ResourceLocator string 256; // Use this to allocate space to hold a ResourceLocator string
char szResourceLocator[LOCATOR_SIZE]; char szResourceLocator[LOCATOR_SIZE];
snprintf(szResourceLocator, LOCATOR_SIZE, "memory://%08X,%04X#", snprintf(szResourceLocator, LOCATOR_SIZE,
pbData, dwSize); "memory://%08" PRIxPTR ",%04X#",
reinterpret_cast<std::uintptr_t>(pbData), dwSize);
path = szResourceLocator; path = szResourceLocator;
} }
return path; return path;

View file

@ -969,7 +969,7 @@ void PlayerConnection::handleTextureChange(
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Skin for server player %s has changed to %s (%d)\n", printf("Skin for server player %s has changed to %s (%d)\n",
player->name.c_str(), player->customTextureUrl.c_str(), player->name.c_str(), player->customTextureUrl.c_str(),
player->getPlayerDefaultSkin()); static_cast<int>(player->getPlayerDefaultSkin()));
#endif #endif
break; break;
case TextureChangePacket::e_TextureChange_Cape: case TextureChangePacket::e_TextureChange_Cape:
@ -1013,7 +1013,7 @@ void PlayerConnection::handleTextureAndGeometryChange(
"PlayerConnection::handleTextureAndGeometryChange - Skin for server " "PlayerConnection::handleTextureAndGeometryChange - Skin for server "
"player %s has changed to %s (%d)\n", "player %s has changed to %s (%d)\n",
player->name.c_str(), player->customTextureUrl.c_str(), player->name.c_str(), player->customTextureUrl.c_str(),
player->getPlayerDefaultSkin()); static_cast<int>(player->getPlayerDefaultSkin()));
#endif #endif
if (!packet->path.empty() && if (!packet->path.empty() &&
@ -1423,7 +1423,7 @@ void PlayerConnection::handlePlayerInfo(
gameType) { gameType) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("Setting %s to game mode %d\n", printf("Setting %s to game mode %d\n",
serverPlayer->name.c_str(), gameType); serverPlayer->name.c_str(), gameType->getId());
#endif #endif
serverPlayer->setPlayerGamePrivilege( serverPlayer->setPlayerGamePrivilege(
Player::ePlayerGamePrivilege_CreativeMode, Player::ePlayerGamePrivilege_CreativeMode,
@ -1438,7 +1438,7 @@ void PlayerConnection::handlePlayerInfo(
} else { } else {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
printf("%s already has game mode %d\n", printf("%s already has game mode %d\n",
serverPlayer->name.c_str(), gameType); serverPlayer->name.c_str(), gameType->getId());
#endif #endif
} }
if (cheats) { if (cheats) {

View file

@ -2570,7 +2570,7 @@ std::string Level::gatherStats() {
char buf[64]; char buf[64];
{ {
std::lock_guard<std::recursive_mutex> lock(m_entitiesCS); std::lock_guard<std::recursive_mutex> lock(m_entitiesCS);
snprintf(buf, 64, "All:%d", entities.size()); snprintf(buf, 64, "All:%zu", entities.size());
} }
return std::string(buf); return std::string(buf);
} }

View file

@ -422,15 +422,12 @@ void SparseDataStorage::addNewPlane(int y) {
newDataAndCount |= ((int64_t)linesUsed) << 48; newDataAndCount |= ((int64_t)linesUsed) << 48;
// Attempt to update the data & count atomically. This command will Only // Attempt to update the data & count atomically. CAS only
// succeed if the data stored at dataAndCount is equal to // succeeds if dataAndCount currently equals lastDataAndCount.
// lastDataAndCount, and will return the value present just before the int64_t expected = lastDataAndCount;
// write took place if (std::atomic_ref<int64_t>(dataAndCount)
int64_t lastDataAndCount2 = lastDataAndCount; .compare_exchange_strong(expected, newDataAndCount,
std::atomic_ref<int64_t>(dataAndCount).compare_exchange_strong( std::memory_order_release)) {
lastDataAndCount2, newDataAndCount, std::memory_order_release);
if (lastDataAndCount2 == lastDataAndCount) {
success = true; success = true;
// Queue old data to be deleted // Queue old data to be deleted
queueForDelete(lastDataPointer); queueForDelete(lastDataPointer);
@ -497,15 +494,12 @@ void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount) {
unsigned char* lastDataPointer = unsigned char* lastDataPointer =
(unsigned char*)(lastDataAndCount & 0x0000ffffffffffff); (unsigned char*)(lastDataAndCount & 0x0000ffffffffffff);
// Attempt to update the data & count atomically. This command will Only // Attempt to update the data & count atomically. CAS only
// succeed if the data stored at dataAndCount is equal to // succeeds if dataAndCount currently equals lastDataAndCount.
// lastDataAndCount, and will return the value present just before the int64_t expected = lastDataAndCount;
// write took place if (std::atomic_ref<int64_t>(dataAndCount)
int64_t lastDataAndCount2 = lastDataAndCount; .compare_exchange_strong(expected, newDataAndCount,
std::atomic_ref<int64_t>(dataAndCount).compare_exchange_strong( std::memory_order_release)) {
lastDataAndCount2, newDataAndCount, std::memory_order_release);
if (lastDataAndCount2 == lastDataAndCount) {
success = true; success = true;
// Queue old data to be deleted // Queue old data to be deleted
// printf("Marking for delete 0x%x (full // printf("Marking for delete 0x%x (full
@ -573,15 +567,12 @@ int SparseDataStorage::compress() {
newDataAndCount |= ((int64_t)planesToAlloc) << 48; newDataAndCount |= ((int64_t)planesToAlloc) << 48;
// Attempt to update the data & count atomically. This command will Only // Attempt to update the data & count atomically. CAS only
// succeed if the data stored at dataAndCount is equal to // succeeds if dataAndCount currently equals lastDataAndCount.
// lastDataAndCount, and will return the value present just before the int64_t expected = lastDataAndCount;
// write took place if (!std::atomic_ref<int64_t>(dataAndCount)
int64_t lastDataAndCount2 = lastDataAndCount; .compare_exchange_strong(expected, newDataAndCount,
std::atomic_ref<int64_t>(dataAndCount).compare_exchange_strong( std::memory_order_release)) {
lastDataAndCount2, newDataAndCount, std::memory_order_release);
if (lastDataAndCount2 != lastDataAndCount) {
// Failed to write. Don't bother trying again... being very // Failed to write. Don't bother trying again... being very
// conservative here. // conservative here.
// printf("Marking for delete 0x%x (compress // printf("Marking for delete 0x%x (compress

View file

@ -426,15 +426,12 @@ void SparseLightStorage::addNewPlane(int y) {
newDataAndCount |= ((int64_t)linesUsed) << 48; newDataAndCount |= ((int64_t)linesUsed) << 48;
// Attempt to update the data & count atomically. This command will Only // Attempt to update the data & count atomically. CAS only
// succeed if the data stored at dataAndCount is equal to // succeeds if dataAndCount currently equals lastDataAndCount.
// lastDataAndCount, and will return the value present just before the int64_t expected = lastDataAndCount;
// write took place if (std::atomic_ref<int64_t>(dataAndCount)
int64_t lastDataAndCount2 = lastDataAndCount; .compare_exchange_strong(expected, newDataAndCount,
std::atomic_ref<int64_t>(dataAndCount).compare_exchange_strong( std::memory_order_release)) {
lastDataAndCount2, newDataAndCount, std::memory_order_release);
if (lastDataAndCount2 == lastDataAndCount) {
success = true; success = true;
// Queue old data to be deleted // Queue old data to be deleted
queueForDelete(lastDataPointer); queueForDelete(lastDataPointer);
@ -501,15 +498,12 @@ void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount) {
unsigned char* lastDataPointer = unsigned char* lastDataPointer =
(unsigned char*)(lastDataAndCount & 0x0000ffffffffffff); (unsigned char*)(lastDataAndCount & 0x0000ffffffffffff);
// Attempt to update the data & count atomically. This command will Only // Attempt to update the data & count atomically. CAS only
// succeed if the data stored at dataAndCount is equal to // succeeds if dataAndCount currently equals lastDataAndCount.
// lastDataAndCount, and will return the value present just before the int64_t expected = lastDataAndCount;
// write took place if (std::atomic_ref<int64_t>(dataAndCount)
int64_t lastDataAndCount2 = lastDataAndCount; .compare_exchange_strong(expected, newDataAndCount,
std::atomic_ref<int64_t>(dataAndCount).compare_exchange_strong( std::memory_order_release)) {
lastDataAndCount2, newDataAndCount, std::memory_order_release);
if (lastDataAndCount2 == lastDataAndCount) {
success = true; success = true;
// Queue old data to be deleted // Queue old data to be deleted
// printf("Marking for delete 0x%x (full // printf("Marking for delete 0x%x (full
@ -584,15 +578,12 @@ int SparseLightStorage::compress() {
newDataAndCount |= ((int64_t)planesToAlloc) << 48; newDataAndCount |= ((int64_t)planesToAlloc) << 48;
// Attempt to update the data & count atomically. This command will Only // Attempt to update the data & count atomically. CAS only
// succeed if the data stored at dataAndCount is equal to // succeeds if dataAndCount currently equals lastDataAndCount.
// lastDataAndCount, and will return the value present just before the int64_t expected = lastDataAndCount;
// write took place if (!std::atomic_ref<int64_t>(dataAndCount)
int64_t lastDataAndCount2 = lastDataAndCount; .compare_exchange_strong(expected, newDataAndCount,
std::atomic_ref<int64_t>(dataAndCount).compare_exchange_strong( std::memory_order_release)) {
lastDataAndCount2, newDataAndCount, std::memory_order_release);
if (lastDataAndCount2 != lastDataAndCount) {
// Failed to write. Don't bother trying again... being very // Failed to write. Don't bother trying again... being very
// conservative here. // conservative here.
// printf("Marking for delete 0x%x (compress // printf("Marking for delete 0x%x (compress

View file

@ -44,8 +44,7 @@ void SignTileEntity::save(CompoundTag* tag) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
fprintf(stderr, "### - Saving a sign with text - \n"); fprintf(stderr, "### - Saving a sign with text - \n");
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
fprintf(stderr, m_wsmessages[i].c_str()); fprintf(stderr, "%s\n", m_wsmessages[i].c_str());
fprintf(stderr, "\n");
} }
#endif #endif
} }
@ -63,8 +62,7 @@ void SignTileEntity::load(CompoundTag* tag) {
#if !defined(_CONTENT_PACKAGE) #if !defined(_CONTENT_PACKAGE)
fprintf(stderr, "### - Loaded a sign with text - \n"); fprintf(stderr, "### - Loaded a sign with text - \n");
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
fprintf(stderr, m_wsmessages[i].c_str()); fprintf(stderr, "%s\n", m_wsmessages[i].c_str());
fprintf(stderr, "\n");
} }
#endif #endif

View file

@ -32,7 +32,7 @@ public:
std::string toString() { std::string toString() {
static char buf[32]; static char buf[32];
snprintf(buf, 32, "[%d bytes]", data.size()); snprintf(buf, 32, "[%zu bytes]", data.size());
return std::string(buf); return std::string(buf);
} }

View file

@ -36,7 +36,7 @@ public:
std::string toString() { std::string toString() {
static char buf[32]; static char buf[32];
snprintf(buf, 32, "[%d bytes]", data.size()); snprintf(buf, 32, "[%zu bytes]", data.size());
return std::string(buf); return std::string(buf);
} }

View file

@ -15,7 +15,7 @@ public:
uint8_t getId() { return TAG_Long; } uint8_t getId() { return TAG_Long; }
std::string toString() { std::string toString() {
static char buf[32]; static char buf[32];
snprintf(buf, 32, "%I64d", data); snprintf(buf, 32, "%lld", static_cast<long long>(data));
return std::string(buf); return std::string(buf);
} }

View file

@ -14,7 +14,7 @@ struct ImageFileBuffer {
ImageFileBuffer(EImageType type, std::size_t size) ImageFileBuffer(EImageType type, std::size_t size)
: m_type(type), : m_type(type),
m_pBuffer(size > 0 ? std::make_unique<std::byte[]>(size) : nullptr), m_pBuffer(size > 0 ? std::make_unique<std::byte[]>(size) : nullptr),
m_bufferSize(static_cast<int>(size)) {} m_bufferSize(size) {}
// move-only // move-only
ImageFileBuffer(ImageFileBuffer&&) noexcept = default; ImageFileBuffer(ImageFileBuffer&&) noexcept = default;
@ -24,7 +24,7 @@ struct ImageFileBuffer {
[[nodiscard]] EImageType GetType() const { return m_type; } [[nodiscard]] EImageType GetType() const { return m_type; }
[[nodiscard]] std::byte* GetBufferPointer() const { return m_pBuffer.get(); } [[nodiscard]] std::byte* GetBufferPointer() const { return m_pBuffer.get(); }
[[nodiscard]] int GetBufferSize() const { return m_bufferSize; } [[nodiscard]] std::size_t GetBufferSize() const { return m_bufferSize; }
[[nodiscard]] bool Allocated() const { return m_pBuffer != nullptr; } [[nodiscard]] bool Allocated() const { return m_pBuffer != nullptr; }
void Release() { void Release() {
m_pBuffer.reset(); m_pBuffer.reset();
@ -33,7 +33,7 @@ struct ImageFileBuffer {
EImageType m_type{e_typePNG}; EImageType m_type{e_typePNG};
std::unique_ptr<std::byte[]> m_pBuffer; std::unique_ptr<std::byte[]> m_pBuffer;
int m_bufferSize = 0; std::size_t m_bufferSize = 0;
}; };
struct D3DXIMAGE_INFO { struct D3DXIMAGE_INFO {

View file

@ -1563,7 +1563,8 @@ void glCallLists_4J(IntBuffer* lists) {
if (!lists) return; if (!lists) return;
int count = lists->limit() - lists->position(); int count = lists->limit() - lists->position();
int* ids = getIntPtr(lists); int* ids = getIntPtr(lists);
for (int i = 0; i < count; i++) PlatformRenderer.CBuffCall(ids[i], false); for (int i = 0; i < count; i++)
(void)PlatformRenderer.CBuffCall(ids[i], false);
} }
void glReadPixels_4J(int x, int y, int w, int h, int f, int t, ByteBuffer* p) { void glReadPixels_4J(int x, int y, int w, int h, int f, int t, ByteBuffer* p) {

View file

@ -264,7 +264,11 @@
#undef glEndList #undef glEndList
#define glEndList() PlatformRenderer.CBuffEnd() #define glEndList() PlatformRenderer.CBuffEnd()
#undef glCallList #undef glCallList
#define glCallList(_list) PlatformRenderer.CBuffCall(_list) // CBuffCall is [[nodiscard]] because it can fail (chunk not ready), but
// legacy display list call sites treat it as fire-and-forget rendering -
// a missed call just means nothing draws this frame, which is what the
// old GL display list semantics already gave them.
#define glCallList(_list) ((void)PlatformRenderer.CBuffCall(_list))
// glGenLists / glDeleteLists, lists are not supported in core!!!!! // glGenLists / glDeleteLists, lists are not supported in core!!!!!
#undef glGenLists #undef glGenLists