diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b07616021..bfb43c639 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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 @@ -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 . diff --git a/CMakeLists.txt b/CMakeLists.txt index ff4992991..760657cd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 @@ -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) @@ -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) diff --git a/build-wasm.sh b/build-wasm.sh index 638906693..ab4c2b703 100755 --- a/build-wasm.sh +++ b/build-wasm.sh @@ -31,7 +31,7 @@ mkdir -p build cd build # Configure Build -emcmake cmake -GNinja "$@" ../../ +emcmake cmake -GNinja -DWERROR=ON "$@" ../../ # Build cmake --build . diff --git a/platforms/android/AppPlatform_android.cpp b/platforms/android/AppPlatform_android.cpp index f2e965dbb..03c9eaee0 100644 --- a/platforms/android/AppPlatform_android.cpp +++ b/platforms/android/AppPlatform_android.cpp @@ -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; @@ -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); -} \ No newline at end of file +} diff --git a/platforms/android/AppPlatform_android.hpp b/platforms/android/AppPlatform_android.hpp index c9515eabd..4d58dd137 100644 --- a/platforms/android/AppPlatform_android.hpp +++ b/platforms/android/AppPlatform_android.hpp @@ -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 getUserInput() override; int getUserInputStatus() override; int getScreenWidth() const override; diff --git a/platforms/ios/CMakeLists.txt b/platforms/ios/CMakeLists.txt index a3917d7ac..b0dc5a142 100644 --- a/platforms/ios/CMakeLists.txt +++ b/platforms/ios/CMakeLists.txt @@ -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 diff --git a/platforms/ios/build.sh b/platforms/ios/build.sh index 74ab47cc0..3f21d3ebb 100755 --- a/platforms/ios/build.sh +++ b/platforms/ios/build.sh @@ -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" diff --git a/platforms/ios/minecraftpeViewController.mm b/platforms/ios/minecraftpeViewController.mm index 8ee4150af..ac84a189c 100644 --- a/platforms/ios/minecraftpeViewController.mm +++ b/platforms/ios/minecraftpeViewController.mm @@ -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(animationFrameInterval)); if (animating) { diff --git a/platforms/sdl/sdl2/CMakeLists.txt b/platforms/sdl/sdl2/CMakeLists.txt index 456831043..ddeac92f5 100644 --- a/platforms/sdl/sdl2/CMakeLists.txt +++ b/platforms/sdl/sdl2/CMakeLists.txt @@ -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 diff --git a/source/client/app/Minecraft.cpp b/source/client/app/Minecraft.cpp index d85d5f309..c071245a4 100644 --- a/source/client/app/Minecraft.cpp +++ b/source/client/app/Minecraft.cpp @@ -467,6 +467,8 @@ void Minecraft::handleBuildAction(const BuildActionIntention& action) } break; } + default: + break; } if (bInteract && action.isInteract() && canInteract) diff --git a/source/client/gui/screens/OptionsScreen.cpp b/source/client/gui/screens/OptionsScreen.cpp index d29a01983..a7cb7c09f 100644 --- a/source/client/gui/screens/OptionsScreen.cpp +++ b/source/client/gui/screens/OptionsScreen.cpp @@ -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) diff --git a/source/client/network/ClientSideNetworkHandler.cpp b/source/client/network/ClientSideNetworkHandler.cpp index e74d348d1..f975ffdd8 100644 --- a/source/client/network/ClientSideNetworkHandler.cpp +++ b/source/client/network/ClientSideNetworkHandler.cpp @@ -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; } } @@ -840,4 +842,4 @@ void ClientSideNetworkHandler::flushAllBufferedUpdates() void ClientSideNetworkHandler::handleBlockUpdate(const BlockUpdate& u) { m_pLevel->setTileAndData(u.pos, Tile::TransformToValidBlockId(u.tile), u.data); -} \ No newline at end of file +} diff --git a/source/client/renderer/entity/EntityRenderDispatcher.cpp b/source/client/renderer/entity/EntityRenderDispatcher.cpp index a57b2a849..acbbb00b5 100644 --- a/source/client/renderer/entity/EntityRenderDispatcher.cpp +++ b/source/client/renderer/entity/EntityRenderDispatcher.cpp @@ -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) diff --git a/source/client/renderer/renderer/RenderMaterialGroup.cpp b/source/client/renderer/renderer/RenderMaterialGroup.cpp index 1afb76212..e653b283a 100644 --- a/source/client/renderer/renderer/RenderMaterialGroup.cpp +++ b/source/client/renderer/renderer/RenderMaterialGroup.cpp @@ -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; } @@ -249,4 +249,4 @@ void RenderMaterialGroup::onAppSuspended() { it->second = RenderMaterial(); } -} \ No newline at end of file +} diff --git a/source/client/sound/SoundData.cpp b/source/client/sound/SoundData.cpp index 991391d66..12efebe2f 100644 --- a/source/client/sound/SoundData.cpp +++ b/source/client/sound/SoundData.cpp @@ -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! @@ -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!"); @@ -125,4 +123,4 @@ void SoundDesc::_unloadAll() // Declare Variables #define SOUND(category, name, number) SoundDesc SA_##name##number; #include "sound_list.h" -#undef SOUND \ No newline at end of file +#undef SOUND diff --git a/source/client/sound/SoundData.hpp b/source/client/sound/SoundData.hpp index b2bc5cd49..e2b458aa4 100644 --- a/source/client/sound/SoundData.hpp +++ b/source/client/sound/SoundData.hpp @@ -35,7 +35,7 @@ struct PCMSoundHeader struct SoundBuffer { - void* m_pData; + int16_t *m_pData; int m_dataSize; }; diff --git a/source/client/sound/SoundStream.cpp b/source/client/sound/SoundStream.cpp index 7b1456263..af011ec44 100644 --- a/source/client/sound/SoundStream.cpp +++ b/source/client/sound/SoundStream.cpp @@ -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; } diff --git a/source/nbt/Tag.hpp b/source/nbt/Tag.hpp index dea1ce99c..43da5b45c 100644 --- a/source/nbt/Tag.hpp +++ b/source/nbt/Tag.hpp @@ -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); } @@ -83,4 +83,4 @@ class TagMemoryChunk unsigned int m_elements; unsigned int m_size; uint8_t* m_buffer; -}; \ No newline at end of file +}; diff --git a/source/renderer/hal/ogl/API_OGL.cpp b/source/renderer/hal/ogl/API_OGL.cpp index e264be64c..5acedfacc 100644 --- a/source/renderer/hal/ogl/API_OGL.cpp +++ b/source/renderer/hal/ogl/API_OGL.cpp @@ -1,3 +1,4 @@ +#include #include #include "API_OGL.hpp" diff --git a/source/renderer/hal/ogl/RenderContextOGL.cpp b/source/renderer/hal/ogl/RenderContextOGL.cpp index 51c8e694c..edfefb105 100644 --- a/source/renderer/hal/ogl/RenderContextOGL.cpp +++ b/source/renderer/hal/ogl/RenderContextOGL.cpp @@ -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) @@ -347,4 +347,4 @@ GLenum mce::getComparisonFunc(ComparisonFunc comparisonFunc) LOG_E("Unknown comparisonFunc: %d", comparisonFunc); throw std::bad_cast(); } -} \ No newline at end of file +} diff --git a/source/server/ServerSideNetworkHandler.cpp b/source/server/ServerSideNetworkHandler.cpp index 2e1ec0775..c732d30c5 100644 --- a/source/server/ServerSideNetworkHandler.cpp +++ b/source/server/ServerSideNetworkHandler.cpp @@ -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); diff --git a/source/world/entity/SynchedEntityData.cpp b/source/world/entity/SynchedEntityData.cpp index cec5ba8d9..ac75c3dd6 100644 --- a/source/world/entity/SynchedEntityData.cpp +++ b/source/world/entity/SynchedEntityData.cpp @@ -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; } @@ -72,7 +72,7 @@ void SynchedEntityData::clear() m_itemsArray.clear(); // Mark as clean - m_minIdxDirty = INT_MAX; + m_minIdxDirty = UINT16_MAX; m_maxIdxDirty = 0; } @@ -91,7 +91,7 @@ SynchedEntityData::ItemsArray SynchedEntityData::packDirty() } // Mark as clean - m_minIdxDirty = INT_MAX; + m_minIdxDirty = UINT16_MAX; return result; } @@ -274,4 +274,4 @@ SynchedEntityData::ItemsArray SynchedEntityData::Unpack(IDataInput& dis) } return result; -} \ No newline at end of file +} diff --git a/source/world/phys/Vec2.cpp b/source/world/phys/Vec2.cpp index a0df85b38..c9ee5a762 100644 --- a/source/world/phys/Vec2.cpp +++ b/source/world/phys/Vec2.cpp @@ -6,14 +6,14 @@ SPDX-License-Identifier: BSD-1-Clause ********************************************************************/ -#include +#include #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) { diff --git a/source/world/phys/Vec3.cpp b/source/world/phys/Vec3.cpp index 50e1426bf..77d64ebd1 100644 --- a/source/world/phys/Vec3.cpp +++ b/source/world/phys/Vec3.cpp @@ -6,7 +6,7 @@ SPDX-License-Identifier: BSD-1-Clause ********************************************************************/ -#include +#include #include "Vec3.hpp" #include "world/level/TilePos.hpp" @@ -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) { diff --git a/source/world/tile/GrassTile.cpp b/source/world/tile/GrassTile.cpp index 0c4c550b4..3fe05e8e4 100644 --- a/source/world/tile/GrassTile.cpp +++ b/source/world/tile/GrassTile.cpp @@ -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()); diff --git a/source/world/tile/SandStoneTile.cpp b/source/world/tile/SandStoneTile.cpp index b387a2c98..df16028a8 100644 --- a/source/world/tile/SandStoneTile.cpp +++ b/source/world/tile/SandStoneTile.cpp @@ -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; } diff --git a/source/world/tile/TntTile.cpp b/source/world/tile/TntTile.cpp index 0955bd748..db244e552 100644 --- a/source/world/tile/TntTile.cpp +++ b/source/world/tile/TntTile.cpp @@ -28,9 +28,9 @@ int TntTile::getTexture(Facing::Name face) const return m_TextureFrame + 2; case Facing::UP: return m_TextureFrame + 1; + default: + return m_TextureFrame; } - - return m_TextureFrame; } void TntTile::destroy(Level* level, const TilePos& pos, TileData data) diff --git a/source/world/tile/TorchTile.cpp b/source/world/tile/TorchTile.cpp index 9338b1cf7..c423097e9 100644 --- a/source/world/tile/TorchTile.cpp +++ b/source/world/tile/TorchTile.cpp @@ -181,6 +181,8 @@ void TorchTile::setPlacedOnFace(Level* level, const TilePos& pos, Facing::Name f if (level->isSolidTile(pos.west())) data = 1; break; + case Facing::DOWN: + break; } level->setData(pos, data); diff --git a/thirdparty/raknet/DynDNS.cpp b/thirdparty/raknet/DynDNS.cpp index 23ccd8eb1..8780fbbe9 100644 --- a/thirdparty/raknet/DynDNS.cpp +++ b/thirdparty/raknet/DynDNS.cpp @@ -219,7 +219,7 @@ void DynDNS::Update(void) existingHost[0]=0; // Resolve DNS we are setting. If equal to current then abort RakNetSocket2::DomainNameToIP(host.C_String(), existingHost); - if (existingHost && strcmp(existingHost, myIPStr)==0) + if (strcmp(existingHost, myIPStr)==0) { // DynDNS considers setting the IP to what it is already set abuse tcp->DeallocatePacket(packet); diff --git a/thirdparty/raknet/HTTPConnection2.cpp b/thirdparty/raknet/HTTPConnection2.cpp index 95325dbb2..d629cb2b4 100644 --- a/thirdparty/raknet/HTTPConnection2.cpp +++ b/thirdparty/raknet/HTTPConnection2.cpp @@ -8,6 +8,8 @@ * */ +#include + #include "NativeFeatureIncludes.h" #if _RAKNET_SUPPORT_HTTPConnection2==1 && _RAKNET_SUPPORT_TCPInterface==1 diff --git a/thirdparty/raknet/PacketLogger.cpp b/thirdparty/raknet/PacketLogger.cpp index 9738e7ed6..4631b0cbb 100644 --- a/thirdparty/raknet/PacketLogger.cpp +++ b/thirdparty/raknet/PacketLogger.cpp @@ -152,7 +152,7 @@ void PacketLogger::OnReliabilityLayerNotification(const char *errorMessage, cons } void PacketLogger::OnAck(unsigned int messageNumber, SystemAddress remoteSystemAddress, RakNet::TimeMS time) { - char str[256]; + char str[512]; char str1[64], str2[62]; SystemAddress localSystemAddress = rakPeerInterface->GetExternalID(remoteSystemAddress); localSystemAddress.ToString(true, str1); @@ -171,7 +171,7 @@ void PacketLogger::OnAck(unsigned int messageNumber, SystemAddress remoteSystemA } void PacketLogger::OnPushBackPacket(const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress) { - char str[256]; + char str[512]; char str1[64], str2[62]; SystemAddress localSystemAddress = rakPeerInterface->GetExternalID(remoteSystemAddress); localSystemAddress.ToString(true, str1); diff --git a/thirdparty/raknet/Rackspace.cpp b/thirdparty/raknet/Rackspace.cpp index b2d68aa7e..16c3907ca 100644 --- a/thirdparty/raknet/Rackspace.cpp +++ b/thirdparty/raknet/Rackspace.cpp @@ -8,6 +8,8 @@ * */ +#include + #include "NativeFeatureIncludes.h" #if _RAKNET_SUPPORT_Rackspace==1 && _RAKNET_SUPPORT_TCPInterface==1 diff --git a/thirdparty/raknet/RakNetSocket2.h b/thirdparty/raknet/RakNetSocket2.h index 91ea1ad4e..817068db7 100644 --- a/thirdparty/raknet/RakNetSocket2.h +++ b/thirdparty/raknet/RakNetSocket2.h @@ -22,7 +22,7 @@ // https://developer.apple.com/library/mac/#documentation/CoreFOundation/Reference/CFSocketRef/Reference/reference.html // Reason: http://sourceforge.net/p/open-dis/discussion/683284/thread/0929d6a0 #if defined(__APPLE__) -#import +#include #include #include #endif diff --git a/thirdparty/raknet/Rand.cpp b/thirdparty/raknet/Rand.cpp index 0d9db67c1..869afbc8f 100644 --- a/thirdparty/raknet/Rand.cpp +++ b/thirdparty/raknet/Rand.cpp @@ -142,8 +142,8 @@ void seedMT( unsigned int seed, unsigned int *state, unsigned int *&next, int &l // so-- that's why the only change I made is to restrict to odd seeds. // - register unsigned int x = ( seed | 1U ) & 0xFFFFFFFFU, *s = state; - register int j; + unsigned int x = ( seed | 1U ) & 0xFFFFFFFFU, *s = state; + int j; for ( left = 0, *s++ = x, j = N; --j; *s++ = ( x *= 69069U ) & 0xFFFFFFFFU )