diff options
author | Mat <mail@mathias.is> | 2020-05-07 21:14:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 21:14:00 +0200 |
commit | c710f6a4ea2231051a9e6406128d6e06af86e58e (patch) | |
tree | d86451d18434a1e02d8753ee2486d11068f69494 /src/WorldStorage | |
parent | Remove coverity_scan branch reference (diff) | |
download | cuberite-c710f6a4ea2231051a9e6406128d6e06af86e58e.tar cuberite-c710f6a4ea2231051a9e6406128d6e06af86e58e.tar.gz cuberite-c710f6a4ea2231051a9e6406128d6e06af86e58e.tar.bz2 cuberite-c710f6a4ea2231051a9e6406128d6e06af86e58e.tar.lz cuberite-c710f6a4ea2231051a9e6406128d6e06af86e58e.tar.xz cuberite-c710f6a4ea2231051a9e6406128d6e06af86e58e.tar.zst cuberite-c710f6a4ea2231051a9e6406128d6e06af86e58e.zip |
Diffstat (limited to 'src/WorldStorage')
-rw-r--r-- | src/WorldStorage/MapSerializer.cpp | 12 | ||||
-rw-r--r-- | src/WorldStorage/ScoreboardSerializer.cpp | 6 | ||||
-rw-r--r-- | src/WorldStorage/StatSerializer.cpp | 8 | ||||
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/WorldStorage/MapSerializer.cpp b/src/WorldStorage/MapSerializer.cpp index 381ef19fa..d030b5a32 100644 --- a/src/WorldStorage/MapSerializer.cpp +++ b/src/WorldStorage/MapSerializer.cpp @@ -23,7 +23,7 @@ cMapSerializer::cMapSerializer(const AString & a_WorldName, cMap * a_Map): Printf(m_Path, "%s%cmap_%i.dat", DataPath.c_str(), cFile::PathSeparator(), a_Map->GetID()); - cFile::CreateFolder(FILE_IO_PREFIX + DataPath); + cFile::CreateFolder(DataPath); } @@ -32,7 +32,7 @@ cMapSerializer::cMapSerializer(const AString & a_WorldName, cMap * a_Map): bool cMapSerializer::Load(void) { - AString Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_Path); + AString Data = cFile::ReadWholeFile(m_Path); if (Data.empty()) { return false; @@ -75,7 +75,7 @@ bool cMapSerializer::Save(void) #endif // _DEBUG cFile File; - if (!File.Open(FILE_IO_PREFIX + m_Path, cFile::fmWrite)) + if (!File.Open(m_Path, cFile::fmWrite)) { return false; } @@ -207,7 +207,7 @@ cIDCountSerializer::cIDCountSerializer(const AString & a_WorldName) : m_MapCount Printf(m_Path, "%s%cidcounts.dat", DataPath.c_str(), cFile::PathSeparator()); - cFile::CreateFolder(FILE_IO_PREFIX + DataPath); + cFile::CreateFolder(DataPath); } @@ -216,7 +216,7 @@ cIDCountSerializer::cIDCountSerializer(const AString & a_WorldName) : m_MapCount bool cIDCountSerializer::Load(void) { - AString Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_Path); + AString Data = cFile::ReadWholeFile(m_Path); if (Data.empty()) { return false; @@ -266,7 +266,7 @@ bool cIDCountSerializer::Save(void) #endif // _DEBUG cFile File; - if (!File.Open(FILE_IO_PREFIX + m_Path, cFile::fmWrite)) + if (!File.Open(m_Path, cFile::fmWrite)) { return false; } diff --git a/src/WorldStorage/ScoreboardSerializer.cpp b/src/WorldStorage/ScoreboardSerializer.cpp index 367b88c0d..7b41f92b1 100644 --- a/src/WorldStorage/ScoreboardSerializer.cpp +++ b/src/WorldStorage/ScoreboardSerializer.cpp @@ -22,7 +22,7 @@ cScoreboardSerializer::cScoreboardSerializer(const AString & a_WorldName, cScore m_Path = DataPath + cFile::PathSeparator() + "scoreboard.dat"; - cFile::CreateFolder(FILE_IO_PREFIX + DataPath); + cFile::CreateFolder(DataPath); } @@ -31,7 +31,7 @@ cScoreboardSerializer::cScoreboardSerializer(const AString & a_WorldName, cScore bool cScoreboardSerializer::Load(void) { - AString Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_Path); + AString Data = cFile::ReadWholeFile(m_Path); if (Data.empty()) { return false; @@ -74,7 +74,7 @@ bool cScoreboardSerializer::Save(void) #endif // _DEBUG cFile File; - if (!File.Open(FILE_IO_PREFIX + m_Path, cFile::fmWrite)) + if (!File.Open(m_Path, cFile::fmWrite)) { return false; } diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp index ecedd87ce..2bc4b783f 100644 --- a/src/WorldStorage/StatSerializer.cpp +++ b/src/WorldStorage/StatSerializer.cpp @@ -24,7 +24,7 @@ cStatSerializer::cStatSerializer(const AString & a_WorldName, const AString & a_ m_Path = StatsPath + "/" + a_FileName + ".json"; // Ensure that the directory exists. - cFile::CreateFolder(FILE_IO_PREFIX + StatsPath); + cFile::CreateFolder(StatsPath); } @@ -33,10 +33,10 @@ cStatSerializer::cStatSerializer(const AString & a_WorldName, const AString & a_ bool cStatSerializer::Load(void) { - AString Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_Path); + AString Data = cFile::ReadWholeFile(m_Path); if (Data.empty()) { - Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_LegacyPath); + Data = cFile::ReadWholeFile(m_LegacyPath); if (Data.empty()) { return false; @@ -64,7 +64,7 @@ bool cStatSerializer::Save(void) SaveStatToJSON(Root); cFile File; - if (!File.Open(FILE_IO_PREFIX + m_Path, cFile::fmWrite)) + if (!File.Open(m_Path, cFile::fmWrite)) { return false; } diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index e7cd6e544..22564248a 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -112,7 +112,7 @@ cWSSAnvil::cWSSAnvil(cWorld * a_World, int a_CompressionFactor) : Writer.EndCompound(); Writer.Finish(); - gzFile gz = gzopen((FILE_IO_PREFIX + fnam).c_str(), "wb"); + gzFile gz = gzopen((fnam).c_str(), "wb"); if (gz != nullptr) { gzwrite(gz, Writer.GetResult().data(), static_cast<unsigned>(Writer.GetResult().size())); @@ -181,7 +181,7 @@ void cWSSAnvil::ChunkLoadFailed(int a_ChunkX, int a_ChunkZ, const AString & a_Re // Construct the filename for offloading: AString OffloadFileName; Printf(OffloadFileName, "%s%cregion%cbadchunks", m_World->GetDataPath().c_str(), cFile::PathSeparator(), cFile::PathSeparator()); - cFile::CreateFolder(FILE_IO_PREFIX + OffloadFileName); + cFile::CreateFolder(OffloadFileName); auto t = time(nullptr); struct tm stm; #ifdef _MSC_VER @@ -287,7 +287,7 @@ cWSSAnvil::cMCAFile * cWSSAnvil::LoadMCAFile(const cChunkCoords & a_Chunk) // Load it anew: AString FileName; Printf(FileName, "%s%cregion", m_World->GetDataPath().c_str(), cFile::PathSeparator()); - cFile::CreateFolder(FILE_IO_PREFIX + FileName); + cFile::CreateFolder(FileName); AppendPrintf(FileName, "/r.%d.%d.mca", RegionX, RegionZ); cMCAFile * f = new cMCAFile(*this, FileName, RegionX, RegionZ); if (f == nullptr) |