summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSCompact.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-05-08 20:16:35 +0200
committerMattes D <github@xoft.cz>2014-05-08 20:16:35 +0200
commitc4ea25e136026004526a63516cbed498e2b6fabe (patch)
tree41545a10b134ea1fc6e58913fc71c4695cdc8297 /src/WorldStorage/WSSCompact.cpp
parentMerge pull request #989 from Howaner/Anvil (diff)
downloadcuberite-c4ea25e136026004526a63516cbed498e2b6fabe.tar
cuberite-c4ea25e136026004526a63516cbed498e2b6fabe.tar.gz
cuberite-c4ea25e136026004526a63516cbed498e2b6fabe.tar.bz2
cuberite-c4ea25e136026004526a63516cbed498e2b6fabe.tar.lz
cuberite-c4ea25e136026004526a63516cbed498e2b6fabe.tar.xz
cuberite-c4ea25e136026004526a63516cbed498e2b6fabe.tar.zst
cuberite-c4ea25e136026004526a63516cbed498e2b6fabe.zip
Diffstat (limited to 'src/WorldStorage/WSSCompact.cpp')
-rw-r--r--src/WorldStorage/WSSCompact.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/WorldStorage/WSSCompact.cpp b/src/WorldStorage/WSSCompact.cpp
index 359bac4a8..6d06b8fe3 100644
--- a/src/WorldStorage/WSSCompact.cpp
+++ b/src/WorldStorage/WSSCompact.cpp
@@ -601,7 +601,7 @@ void cWSSCompact::cPAKFile::UpdateChunk1To2()
// Decompress the data:
AString UncompressedData;
{
- int errorcode = UncompressString(Data.data(), Data.size(), UncompressedData, UncompressedSize);
+ int errorcode = UncompressString(Data.data(), Data.size(), UncompressedData, (size_t)UncompressedSize);
if (errorcode != Z_OK)
{
LOGERROR("Error %d decompressing data for chunk [%d, %d]",
@@ -681,7 +681,7 @@ void cWSSCompact::cPAKFile::UpdateChunk1To2()
// Re-compress data
AString CompressedData;
{
- int errorcode = CompressString(Converted.data(), Converted.size(), CompressedData,m_CompressionFactor);
+ int errorcode = CompressString(Converted.data(), Converted.size(), CompressedData, m_CompressionFactor);
if (errorcode != Z_OK)
{
LOGERROR("Error %d compressing data for chunk [%d, %d]",
@@ -693,9 +693,9 @@ void cWSSCompact::cPAKFile::UpdateChunk1To2()
}
// Save into file's cache
- Header->m_UncompressedSize = Converted.size();
- Header->m_CompressedSize = CompressedData.size();
- NewDataContents.append( CompressedData );
+ Header->m_UncompressedSize = (int)Converted.size();
+ Header->m_CompressedSize = (int)CompressedData.size();
+ NewDataContents.append(CompressedData);
}
// Done converting
@@ -731,7 +731,7 @@ void cWSSCompact::cPAKFile::UpdateChunk2To3()
Offset += Header->m_CompressedSize;
// Crude data integrity check:
- const int ExpectedSize = (16*256*16)*2 + (16*256*16)/2; // For version 2
+ const int ExpectedSize = (16 * 256 * 16) * 2 + (16 * 256 * 16) / 2; // For version 2
if (UncompressedSize < ExpectedSize)
{
LOGWARNING("Chunk [%d, %d] has too short decompressed data (%d bytes out of %d needed), erasing",
@@ -745,7 +745,7 @@ void cWSSCompact::cPAKFile::UpdateChunk2To3()
// Decompress the data:
AString UncompressedData;
{
- int errorcode = UncompressString(Data.data(), Data.size(), UncompressedData, UncompressedSize);
+ int errorcode = UncompressString(Data.data(), Data.size(), UncompressedData, (size_t)UncompressedSize);
if (errorcode != Z_OK)
{
LOGERROR("Error %d decompressing data for chunk [%d, %d]",
@@ -829,9 +829,9 @@ void cWSSCompact::cPAKFile::UpdateChunk2To3()
}
// Save into file's cache
- Header->m_UncompressedSize = Converted.size();
- Header->m_CompressedSize = CompressedData.size();
- NewDataContents.append( CompressedData );
+ Header->m_UncompressedSize = (int)Converted.size();
+ Header->m_CompressedSize = (int)CompressedData.size();
+ NewDataContents.append(CompressedData);
}
// Done converting
@@ -861,7 +861,7 @@ bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int a_Uncompre
// Decompress the data:
AString UncompressedData;
- int errorcode = UncompressString(a_Data.data(), a_Data.size(), UncompressedData, a_UncompressedSize);
+ int errorcode = UncompressString(a_Data.data(), a_Data.size(), UncompressedData, (size_t)a_UncompressedSize);
if (errorcode != Z_OK)
{
LOGERROR("Error %d decompressing data for chunk [%d, %d]",
@@ -873,7 +873,7 @@ bool cWSSCompact::LoadChunkFromData(const cChunkCoords & a_Chunk, int a_Uncompre
if (a_UncompressedSize != (int)UncompressedData.size())
{
- LOGWARNING("Uncompressed data size differs (exp %d bytes, got " SIZE_T_FMT ") for chunk [%d, %d]",
+ LOGWARNING("Uncompressed data size differs (exp %d bytes, got " SIZE_T_FMT ") for chunk [%d, %d]",
a_UncompressedSize, UncompressedData.size(),
a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ
);