From 772b57ca04b2dbe4ec163a8c2856f8af7bc5c2a5 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 18:00:10 +0200 Subject: Anvil saver pads data to 4K boundaries. Fixes #524. --- src/WorldStorage/WSSAnvil.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 33f34728e..f33178173 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -2672,6 +2672,11 @@ bool cWSSAnvil::cMCAFile::SetChunkData(const cChunkCoords & a_Chunk, const AStri return false; } + // Add padding to 4K boundary: + size_t BytesWritten = a_Data.size() + MCA_CHUNK_HEADER_LENGTH; + static const char Padding[4095] = {0}; + m_File.Write(Padding, 4096 - (BytesWritten % 4096)); + // Store the header: ChunkSize = (a_Data.size() + MCA_CHUNK_HEADER_LENGTH + 4095) / 4096; // Round data size *up* to nearest 4KB sector, make it a sector number ASSERT(ChunkSize < 256); -- cgit v1.2.3 From ed071538d56826a9c46ccc486f2bd9c5d30d3054 Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 1 May 2014 09:47:22 -0700 Subject: Changed polarssl repo to point to cloned copy of polarssl --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 2c7ec209b..2aaee3624 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,4 +9,4 @@ url = https://github.com/bearbin/transapi.git [submodule "lib/polarssl"] path = lib/polarssl - url = https://github.com/polarssl/polarssl + url = https://github.com/mc-server/polarssl -- cgit v1.2.3 From 9928698d6d602813eb2db5b9d494a1b5e5bb0f7f Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 1 May 2014 09:53:43 -0700 Subject: Merged change to enable testing to be disabled This is confirmed upstream but is unlikely to get into the repository for several weeks --- lib/polarssl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/polarssl b/lib/polarssl index 2cb1a0c40..1ed82759c 160000 --- a/lib/polarssl +++ b/lib/polarssl @@ -1 +1 @@ -Subproject commit 2cb1a0c4009ecf368ecc74eb428394e10f9e6d00 +Subproject commit 1ed82759c68f92c4acc7e3f33b850cf9f01c8aba -- cgit v1.2.3 From a2cffb0363e42f12019712297e764a269b6a7d9a Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 1 May 2014 20:21:54 +0200 Subject: Fixed MSVC2013 compilation. --- src/Globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Globals.h b/src/Globals.h index a09819ce9..71e9191e4 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -272,7 +272,7 @@ template class SizeChecker; #if (defined(_MSC_VER) && (_MSC_VER < 1600)) // MSVC before 2010 doesn't have std::shared_ptr, but has std::tr1::shared_ptr, defined in included earlier #define SharedPtr std::tr1::shared_ptr -#elif (__cplusplus >= 201103L) +#elif (defined(_MSC_VER) || (__cplusplus >= 201103L)) // C++11 has std::shared_ptr in , included earlier #define SharedPtr std::shared_ptr #else -- cgit v1.2.3 From b0056cdcf8a36efbed4b97414ebf5741b56a5895 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 22:02:25 +0200 Subject: Removed the explicit copy constructor for cItem. The compiler generates an implicit one with the same contents and warns about it. The function left in for ToLua to generate the binding for it. --- src/Item.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Item.h b/src/Item.h index 641c681db..8eb0a1f4e 100644 --- a/src/Item.h +++ b/src/Item.h @@ -73,6 +73,10 @@ public: } + // The constructor is disabled in code, because the compiler generates it anyway, + // but it needs to stay because ToLua needs to generate the binding for it + #if 0 + /** Creates an exact copy of the item */ cItem(const cItem & a_CopyFrom) : m_ItemType (a_CopyFrom.m_ItemType), @@ -85,6 +89,8 @@ public: { } + #endif + void Empty(void) { -- cgit v1.2.3