summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/MapSerializer.cpp
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2015-07-29 17:04:03 +0200
committerSamuel Barney <samjbarney@gmail.com>2015-07-29 17:49:30 +0200
commit804805d35a87c2acc9425d1762ad26b1ba2ec9ac (patch)
tree13b603c8bbf8177da92ce87f5413fb646d204f3f /src/WorldStorage/MapSerializer.cpp
parentMerge pull request #2376 from mjhanninen/fix-freebsd-build (diff)
downloadcuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar
cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.gz
cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.bz2
cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.lz
cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.xz
cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.tar.zst
cuberite-804805d35a87c2acc9425d1762ad26b1ba2ec9ac.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/MapSerializer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp
index d4925dcab..8acfa4696 100644
--- a/src/WorldStorage/MapSerializer.cpp
+++ b/src/WorldStorage/MapSerializer.cpp
@@ -112,7 +112,7 @@ void cMapSerializer::SaveMapToNBT(cFastNBTWriter & a_Writer)
a_Writer.AddInt("zCenter", m_Map->GetCenterZ());
const cMap::cColorList & Data = m_Map->GetData();
- a_Writer.AddByteArray("colors", (char *)Data.data(), Data.size());
+ a_Writer.AddByteArray("colors", reinterpret_cast<const char *>(Data.data()), Data.size());
a_Writer.EndCompound();
}
@@ -132,14 +132,14 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
int CurrLine = a_NBT.FindChildByName(Data, "scale");
if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Byte))
{
- unsigned int Scale = (unsigned int)a_NBT.GetByte(CurrLine);
+ unsigned int Scale = static_cast<unsigned int>(a_NBT.GetByte(CurrLine));
m_Map->SetScale(Scale);
}
CurrLine = a_NBT.FindChildByName(Data, "dimension");
if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Byte))
{
- eDimension Dimension = (eDimension) a_NBT.GetByte(CurrLine);
+ eDimension Dimension = static_cast<eDimension>(a_NBT.GetByte(CurrLine));
if (Dimension != m_Map->m_World->GetDimension())
{
@@ -151,7 +151,7 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
CurrLine = a_NBT.FindChildByName(Data, "width");
if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Short))
{
- unsigned int Width = (unsigned int)a_NBT.GetShort(CurrLine);
+ unsigned int Width = static_cast<unsigned int>(a_NBT.GetShort(CurrLine));
if (Width != 128)
{
return false;
@@ -162,7 +162,7 @@ bool cMapSerializer::LoadMapFromNBT(const cParsedNBT & a_NBT)
CurrLine = a_NBT.FindChildByName(Data, "height");
if ((CurrLine >= 0) && (a_NBT.GetType(CurrLine) == TAG_Short))
{
- unsigned int Height = (unsigned int)a_NBT.GetShort(CurrLine);
+ unsigned int Height = static_cast<unsigned int>(a_NBT.GetShort(CurrLine));
if (Height >= 256)
{
return false;