summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/MapSerializer.cpp
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-07-29 18:45:36 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-07-29 18:45:36 +0200
commit735d590abf7f804a4504b70c84a289ba86c5f8e3 (patch)
tree13b603c8bbf8177da92ce87f5413fb646d204f3f /src/WorldStorage/MapSerializer.cpp
parentMerge pull request #2376 from mjhanninen/fix-freebsd-build (diff)
parentSilenced and fixed many warning messages across multiple files. (diff)
downloadcuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar
cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.gz
cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.bz2
cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.lz
cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.xz
cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.tar.zst
cuberite-735d590abf7f804a4504b70c84a289ba86c5f8e3.zip
Diffstat (limited to 'src/WorldStorage/MapSerializer.cpp')
-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;