Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1aed621
fix conversion
Un1q32 Dec 22, 2025
48b2b74
add parentesis
Un1q32 Dec 22, 2025
1eb6b3d
explicitly handle STATUS_SUCCESS in switch
Un1q32 Dec 22, 2025
6177e59
explicitly handle all cases in switch
Un1q32 Dec 22, 2025
38deafd
explictly handle all cases in switch
Un1q32 Dec 22, 2025
e3a52ba
explicitly handle all cases in grass tile switch
Un1q32 Dec 22, 2025
303230f
explicitly handle all cases
Un1q32 Dec 22, 2025
04c5e36
cast NSInteger before NSLog
Un1q32 Dec 22, 2025
52004e6
explicitly handle all cases
Un1q32 Dec 22, 2025
9314290
use FLT_{MIN,MAX} instead of INT_{MIN,MAX}
Un1q32 Dec 22, 2025
17b8c6e
cast to correct type
Un1q32 Dec 22, 2025
53f0198
set type of m_pData to short *
Un1q32 Dec 22, 2025
daf109a
change m_pData type from short to int16_t everywhere
Un1q32 Dec 23, 2025
fbb8d34
fix buffer allocation
Un1q32 Dec 23, 2025
1c72e27
remove pointless arg
Un1q32 Dec 23, 2025
168e4aa
fix register warn
Un1q32 Dec 23, 2025
bb2a0f9
disable warns for stb_vorbis
Un1q32 Dec 23, 2025
a13a1cb
always true warn
Un1q32 Dec 23, 2025
6d3b791
fix
Un1q32 Dec 23, 2025
a8106e4
nobody gaf :sob:
Un1q32 Dec 23, 2025
f7b5d24
remove useless define
Un1q32 Dec 23, 2025
6b2cf35
gcc gives a warn in stb_image
Un1q32 Dec 23, 2025
67e0f54
use the dedicated option for adding compiler definitions instead of m…
Un1q32 Dec 23, 2025
4133b43
more cmake nits
Un1q32 Dec 23, 2025
f463812
dont cast
Un1q32 Dec 28, 2025
ebccc5b
can i silence the warn by litterally just increasing the size
Un1q32 Dec 31, 2025
d94f977
increase size again
Un1q32 Dec 31, 2025
9456fb1
Merge remote-tracking branch 'upstream/master' into compiler-wanrs
Un1q32 Dec 31, 2025
a983ccf
dont assign float to int
Un1q32 Dec 31, 2025
b68115d
format args
Un1q32 Dec 31, 2025
6f7b334
remove unused function
Un1q32 Jan 1, 2026
2d82476
build vendored SDL2 with C++11
Un1q32 Jan 1, 2026
d34a702
allow building for macOS with modern GCC
Un1q32 Jan 1, 2026
a0b9f08
disable deprecated declarations warns on macOS too
Un1q32 Jan 1, 2026
388a567
fix
Un1q32 Jan 1, 2026
d219d13
disable compiler C++ extensions and see if anything breaks
Un1q32 Jan 1, 2026
df1cf1c
handle case
Un1q32 Jan 2, 2026
c4505d7
enable -Werror for everything except android
Un1q32 Jan 2, 2026
4eb8818
Merge remote-tracking branch 'upstream/master' into compiler-wanrs
Un1q32 Jan 4, 2026
08d704f
Merge remote-tracking branch 'upstream/master' into compiler-wanrs
Un1q32 Jan 4, 2026
fd420bf
Merge remote-tracking branch 'upstream/master' into compiler-wanrs
Un1q32 Jan 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
mkdir build
cd build
cmake -GNinja ${{ matrix.flags }} ..
cmake -GNinja -DWERROR=ON ${{ matrix.flags }} ..
cmake --build .
wasm:
name: WASM
Expand Down Expand Up @@ -112,6 +112,7 @@ jobs:
RANLIB: llvm-ranlib-21
LLVM_CONFIG: llvm-config-21
REMCPE_NO_IPA: 1
WERROR: ON
android:
strategy:
fail-fast: false
Expand Down Expand Up @@ -172,5 +173,5 @@ jobs:
run: |
mkdir build
cd build
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-w64-toolchain.cmake ${{ matrix.flags }} ..
cmake -GNinja -DWERROR=ON -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-w64-toolchain.cmake ${{ matrix.flags }} ..
cmake --build .
21 changes: 17 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ set(CMAKE_CXX_STANDARD 11)
else()
set(CMAKE_CXX_STANDARD 98)
endif()
set(CXX_EXTENSIONS OFF)

# Warnings
if(WERROR)
add_compile_options(-Werror)
endif()

# WASM
if(EMSCRIPTEN)
Expand All @@ -28,7 +34,10 @@ check_symbol_exists("_WIN32" "" MCPE_WIN32)

# Clang
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wno-inconsistent-missing-override -Wno-enum-compare-switch -Wno-register)
add_compile_options(-Wno-inconsistent-missing-override)
endif()
if(APPLE)
add_compile_options(-Wno-deprecated-declarations)
endif()

# Windows Linking
Expand All @@ -53,7 +62,7 @@ else()
endif()

# Disable thread local storage (needed for C++98 & iOS)
add_compile_options(-DRAPIDJSON_NO_THREAD_LOCAL -DSTBI_NO_THREAD_LOCALS)
add_compile_definitions(RAPIDJSON_NO_THREAD_LOCAL STBI_NO_THREAD_LOCALS)

# Android Logging
if(ANDROID)
Expand All @@ -76,7 +85,11 @@ else()
file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/game/assets" "${CMAKE_CURRENT_BINARY_DIR}/assets" SYMBOLIC)
endif()

#VBO Emulation
# VBO Emulation
if(USE_GL_VBO_EMULATION)
add_compile_options(-DUSE_GL_VBO_EMULATION)
add_compile_definitions(USE_GL_VBO_EMULATION)
endif()

# Disable warnings on third party libraries
target_compile_options(stb_vorbis PRIVATE -w)
target_compile_options(stb_image PRIVATE -w)
2 changes: 1 addition & 1 deletion build-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mkdir -p build
cd build

# Configure Build
emcmake cmake -GNinja "$@" ../../
emcmake cmake -GNinja -DWERROR=ON "$@" ../../

# Build
cmake --build .
Expand Down
20 changes: 1 addition & 19 deletions platforms/android/AppPlatform_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,6 @@ int AppPlatform_android::getUserInputStatus()
return m_UserInputStatus;
}

void AppPlatform_android::createUserInput()
{
m_UserInput.clear();
m_UserInputStatus = -1;

switch (m_DialogType)
{
case DLG_CREATE_WORLD:
{
// some placeholder for now
m_UserInput.push_back("New World");
m_UserInput.push_back("123456");
m_UserInputStatus = 1;
break;
}
}
}

void AppPlatform_android::showDialog(eDialogType type)
{
m_DialogType = type;
Expand Down Expand Up @@ -297,4 +279,4 @@ AssetFile AppPlatform_android::readAssetFile(const std::string& str, bool quiet)
AAsset_read(asset, (void*)buffer, cnt);
AAsset_close(asset);
return AssetFile(ssize_t(cnt), buffer);
}
}
1 change: 0 additions & 1 deletion platforms/android/AppPlatform_android.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class AppPlatform_android : public AppPlatform
void buyGame() override;
void saveScreenshot(const std::string& fileName, int width, int height) override;
int checkLicense() override;
void createUserInput() override;
std::vector<std::string> getUserInput() override;
int getUserInputStatus() override;
int getScreenWidth() const override;
Expand Down
1 change: 0 additions & 1 deletion platforms/ios/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.16.0)
project(reminecraftpe-ios)

target_compile_definitions(reminecraftpe-core PUBLIC HANDLE_CHARS_SEPARATELY USE_GLES)
target_compile_definitions(stb_image PUBLIC STBI_NO_THREAD_LOCALS)

# Build
add_executable(reminecraftpe
Expand Down
1 change: 1 addition & 0 deletions platforms/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ for target in $targets; do
-DCMAKE_C_COMPILER="$target-cc" \
-DCMAKE_CXX_COMPILER="$target-c++" \
-DCMAKE_FIND_ROOT_PATH="$sdk/usr" \
-DWERROR="${WERROR:-OFF}" \
$lto
make -j"$ncpus"
mv "$bin" "$workdir/$bin-$target"
Expand Down
2 changes: 1 addition & 1 deletion platforms/ios/minecraftpeViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ - (void)setAnimationFrameInterval:(NSInteger)frameInterval
if (frameInterval >= 1)
{
animationFrameInterval = frameInterval;
NSLog(@"Set animationFrameInterval to %d\n", animationFrameInterval);
NSLog(@"Set animationFrameInterval to %ld\n", static_cast<long>(animationFrameInterval));

if (animating)
{
Expand Down
1 change: 1 addition & 0 deletions platforms/sdl/sdl2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ add_library(SDL INTERFACE)
if(ANDROID OR MCPE_WIN32)
# Use Vendored SDL2 (Only For Android)
add_subdirectory(../../../thirdparty/SDL2/src SDL EXCLUDE_FROM_ALL)
set_target_properties(SDL2 PROPERTIES CXX_STANDARD 11)
target_link_libraries(SDL INTERFACE SDL2::SDL2)
elseif(EMSCRIPTEN)
# Use Emscripten's SDL2
Expand Down
2 changes: 2 additions & 0 deletions source/client/app/Minecraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ void Minecraft::handleBuildAction(const BuildActionIntention& action)
}
break;
}
default:
break;
}

if (bInteract && action.isInteract() && canInteract)
Expand Down
2 changes: 1 addition & 1 deletion source/client/gui/screens/OptionsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void OptionsScreen::init()
tabButtons[i]->m_width = buttonWidth;
tabButtons[i]->m_height = buttonHeight;
tabButtons[i]->m_xPos = startX + (buttonWidth + buttonSpacing) * i;
tabButtons[i]->m_yPos = 4.3;
tabButtons[i]->m_yPos = 4;
}

for (int i = 0; i < NUM_CATEGORY_BUTTONS; ++i)
Expand Down
4 changes: 3 additions & 1 deletion source/client/network/ClientSideNetworkHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& rakGuid, LoginSt
case LoginStatusPacket::STATUS_SERVER_OUTDATED:
m_pMinecraft->setScreen(new DisconnectionScreen("Could not connect: Outdated server!"));
break;
case LoginStatusPacket::STATUS_SUCCESS:
break;
}
}

Expand Down Expand Up @@ -840,4 +842,4 @@ void ClientSideNetworkHandler::flushAllBufferedUpdates()
void ClientSideNetworkHandler::handleBlockUpdate(const BlockUpdate& u)
{
m_pLevel->setTileAndData(u.pos, Tile::TransformToValidBlockId(u.tile), u.data);
}
}
4 changes: 2 additions & 2 deletions source/client/renderer/entity/EntityRenderDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ EntityRenderer* EntityRenderDispatcher::getRenderer(Entity::RenderType renderTyp
case Entity::RENDER_FALLING_TILE:
return &m_FallingTileRenderer;
#endif
default:
return nullptr;
}

return nullptr;
}

EntityRenderer* EntityRenderDispatcher::getRenderer(const Entity& entity)
Expand Down
4 changes: 2 additions & 2 deletions source/client/renderer/renderer/RenderMaterialGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void RenderMaterialGroup::_loadList()
rapidjson::ParseResult ok = doc.Parse(fileContents.c_str());
if (!ok)
{
LOG_E("Error parsing \"%s\", offset %u: %s", path.c_str(), ok.Offset(), rapidjson::GetParseError_En(ok.Code()));
LOG_E("Error parsing \"%s\", offset %zu: %s", path.c_str(), ok.Offset(), rapidjson::GetParseError_En(ok.Code()));
continue;
}

Expand Down Expand Up @@ -249,4 +249,4 @@ void RenderMaterialGroup::onAppSuspended()
{
it->second = RenderMaterial();
}
}
}
8 changes: 3 additions & 5 deletions source/client/sound/SoundData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ bool SoundDesc::_loadPcm(const AppPlatform* platform, const char *name)
m_codecType = AudioCodec::PCM;
m_fileData = m_file.data;
m_header = *(PCMSoundHeader *) m_fileData;
m_buffer.m_pData = (void *) (m_fileData + sizeof(PCMSoundHeader));
m_buffer.m_pData = (int16_t *) (m_fileData + sizeof(PCMSoundHeader));
m_buffer.m_dataSize = m_header.m_channels * m_header.m_length * m_header.m_bytes_per_sample;

// Success!
Expand All @@ -76,9 +76,7 @@ bool SoundDesc::_loadOgg(const AppPlatform* platform, const char* category, cons
m_codecType = AudioCodec::OGG;
m_fileData = m_file.data;
m_header.m_bytes_per_sample = 2; // Always 2 (16-bit)
// Casting to a short** here might cause problems. Let's find out...
// Seems like it doesn't. Cool.
m_header.m_length = stb_vorbis_decode_memory(m_file.data, (int) m_file.size, &m_header.m_channels, &m_header.m_sample_rate, (short **) &m_buffer.m_pData);
m_header.m_length = stb_vorbis_decode_memory(m_file.data, (int) m_file.size, &m_header.m_channels, &m_header.m_sample_rate, &m_buffer.m_pData);
if (m_header.m_length == -1)
{
LOG_E("An error occurred while trying to decode a sound!");
Expand Down Expand Up @@ -125,4 +123,4 @@ void SoundDesc::_unloadAll()
// Declare Variables
#define SOUND(category, name, number) SoundDesc SA_##name##number;
#include "sound_list.h"
#undef SOUND
#undef SOUND
2 changes: 1 addition & 1 deletion source/client/sound/SoundData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct PCMSoundHeader

struct SoundBuffer
{
void* m_pData;
int16_t *m_pData;
int m_dataSize;
};

Expand Down
2 changes: 1 addition & 1 deletion source/client/sound/SoundStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool SoundStream::_stream(int bufferId)

while (size < m_tempPcmBuffer.m_dataSize)
{
result = stb_vorbis_get_samples_short_interleaved(m_decoder, m_info.channels, (short*)m_tempPcmBuffer.m_pData + size, m_tempPcmBuffer.m_dataSize - size);
result = stb_vorbis_get_samples_short_interleaved(m_decoder, m_info.channels, (int16_t *)m_tempPcmBuffer.m_pData + size, m_tempPcmBuffer.m_dataSize - size);
if (result > 0) size += result * m_info.channels;
else break;
}
Expand Down
4 changes: 2 additions & 2 deletions source/nbt/Tag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class TagMemoryChunk
m_size = size;
if (size > 0)
{
m_buffer = new uint8_t(size);
m_buffer = new uint8_t[size];
if (m_buffer)
memset(m_buffer, 0, size);
}
Expand All @@ -83,4 +83,4 @@ class TagMemoryChunk
unsigned int m_elements;
unsigned int m_size;
uint8_t* m_buffer;
};
};
1 change: 1 addition & 0 deletions source/renderer/hal/ogl/API_OGL.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <cstdlib>
#include <cstring>

#include "API_OGL.hpp"
Expand Down
4 changes: 2 additions & 2 deletions source/renderer/hal/ogl/RenderContextOGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void RenderContextOGL::drawIndexed(PrimitiveMode primitiveMode, unsigned int cou

void RenderContextOGL::drawIndexed(PrimitiveMode primitiveMode, unsigned int count, unsigned int startOffset, uint8_t indexSize)
{
glDrawElements(modeMap[primitiveMode], count, indexType[indexSize], (const GLvoid*)(startOffset * indexSize));
glDrawElements(modeMap[primitiveMode], count, indexType[indexSize], (const GLvoid*)((uintptr_t)startOffset * indexSize));
}

void RenderContextOGL::setDepthRange(float nearVal, float farVal)
Expand Down Expand Up @@ -347,4 +347,4 @@ GLenum mce::getComparisonFunc(ComparisonFunc comparisonFunc)
LOG_E("Unknown comparisonFunc: %d", comparisonFunc);
throw std::bad_cast();
}
}
}
2 changes: 1 addition & 1 deletion source/server/ServerSideNetworkHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void ServerSideNetworkHandler::onDisconnect(const RakNet::RakNetGUID& guid)
// remove it from our world
m_pLevel->removeEntity(pPlayer);
}
else if (pPlayer = getPendingPlayerByGUID(guid))
else if ((pPlayer = getPendingPlayerByGUID(guid)))
{
// Player was still loading
m_pendingPlayers.erase(guid);
Expand Down
8 changes: 4 additions & 4 deletions source/world/entity/SynchedEntityData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MAP(Vec3, TYPE_VEC3, Vec3())
SynchedEntityData::SynchedEntityData()
{
m_itemsArray = ItemsArray();
m_minIdxDirty = INT_MAX;
m_minIdxDirty = UINT16_MAX;
m_maxIdxDirty = 0;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ void SynchedEntityData::clear()

m_itemsArray.clear();
// Mark as clean
m_minIdxDirty = INT_MAX;
m_minIdxDirty = UINT16_MAX;
m_maxIdxDirty = 0;
}

Expand All @@ -91,7 +91,7 @@ SynchedEntityData::ItemsArray SynchedEntityData::packDirty()
}

// Mark as clean
m_minIdxDirty = INT_MAX;
m_minIdxDirty = UINT16_MAX;
return result;
}

Expand Down Expand Up @@ -274,4 +274,4 @@ SynchedEntityData::ItemsArray SynchedEntityData::Unpack(IDataInput& dis)
}

return result;
}
}
4 changes: 2 additions & 2 deletions source/world/phys/Vec2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/

#include <climits>
#include <cfloat>

#include "Vec2.hpp"

const Vec2 Vec2::ZERO = Vec2(0, 0), Vec2::ONE = Vec2(1, 1);
const Vec2 Vec2::UNIT_X = Vec2(1, 0), Vec2::NEG_UNIT_X = Vec2(-1, 0);
const Vec2 Vec2::UNIT_Y = Vec2(0, 1), Vec2::NEG_UNIT_Y = Vec2(0, -1);
const Vec2 Vec2::MIN = Vec2(INT_MIN, INT_MIN), Vec2::MAX = Vec2(INT_MAX, INT_MAX);
const Vec2 Vec2::MIN = Vec2(FLT_MIN, FLT_MIN), Vec2::MAX = Vec2(FLT_MAX, FLT_MAX);

void Vec2::_init(float x, float y)
{
Expand Down
4 changes: 2 additions & 2 deletions source/world/phys/Vec3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/

#include <climits>
#include <cfloat>

#include "Vec3.hpp"
#include "world/level/TilePos.hpp"
Expand All @@ -15,7 +15,7 @@ const Vec3 Vec3::ZERO = Vec3(0, 0, 0), Vec3::ONE = Vec3(1, 1, 1);
const Vec3 Vec3::UNIT_X = Vec3(1, 0, 0), Vec3::NEG_UNIT_X = Vec3(-1, 0, 0);
const Vec3 Vec3::UNIT_Y = Vec3(0, 1, 0), Vec3::NEG_UNIT_Y = Vec3(0, -1, 0);
const Vec3 Vec3::UNIT_Z = Vec3(0, 0, 1), Vec3::NEG_UNIT_Z = Vec3(0, 0, -1);
const Vec3 Vec3::MIN = Vec3(INT_MIN, INT_MIN, INT_MIN), Vec3::MAX = Vec3(INT_MAX, INT_MAX, INT_MAX);
const Vec3 Vec3::MIN = Vec3(FLT_MIN, FLT_MIN, FLT_MIN), Vec3::MAX = Vec3(FLT_MAX, FLT_MAX, FLT_MAX);

void Vec3::_init(float x, float y, float z)
{
Expand Down
2 changes: 2 additions & 0 deletions source/world/tile/GrassTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ int GrassTile::getTexture(const LevelSource* level, const TilePos& pos, Facing::
return TEXTURE_GRASS_TOP;
case Facing::DOWN:
return TEXTURE_DIRT;
default:
break;
}

Material* pMat = level->getMaterial(pos.above());
Expand Down
4 changes: 2 additions & 2 deletions source/world/tile/SandStoneTile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int SandStoneTile::getTexture(Facing::Name face) const
return TEXTURE_SANDSTONE_BOTTOM;
case Facing::UP:
return TEXTURE_SANDSTONE_TOP;
default:
return m_TextureFrame;
}

return m_TextureFrame;
}
Loading