diff options
author | madmaxoft <github@xoft.cz> | 2014-05-01 22:16:29 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-05-01 22:16:29 +0200 |
commit | 4a952717904436cc92a31505149d1729e2994b68 (patch) | |
tree | d21b857cce4dbac162a597400ab27331a69f1263 | |
parent | Added a missing return statement. (diff) | |
parent | Merge pull request #973 from mc-server/ItemNoCopyConstructor (diff) | |
download | cuberite-4a952717904436cc92a31505149d1729e2994b68.tar cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.gz cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.bz2 cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.lz cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.xz cuberite-4a952717904436cc92a31505149d1729e2994b68.tar.zst cuberite-4a952717904436cc92a31505149d1729e2994b68.zip |
-rw-r--r-- | .gitmodules | 2 | ||||
m--------- | lib/polarssl | 0 | ||||
-rw-r--r-- | src/Globals.h | 2 | ||||
-rw-r--r-- | src/Item.h | 6 | ||||
-rw-r--r-- | src/WorldStorage/WSSAnvil.cpp | 5 |
5 files changed, 13 insertions, 2 deletions
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 diff --git a/lib/polarssl b/lib/polarssl -Subproject 2cb1a0c4009ecf368ecc74eb428394e10f9e6d0 +Subproject 1ed82759c68f92c4acc7e3f33b850cf9f01c8ab 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<UInt16, 2>; #if (defined(_MSC_VER) && (_MSC_VER < 1600)) // MSVC before 2010 doesn't have std::shared_ptr, but has std::tr1::shared_ptr, defined in <memory> included earlier #define SharedPtr std::tr1::shared_ptr -#elif (__cplusplus >= 201103L) +#elif (defined(_MSC_VER) || (__cplusplus >= 201103L)) // C++11 has std::shared_ptr in <memory>, included earlier #define SharedPtr std::shared_ptr #else 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) { 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); |