summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ByteBuffer.cpp2
-rw-r--r--src/ByteBuffer.h2
-rw-r--r--src/MCLogger.cpp4
-rw-r--r--src/MCLogger.h1
-rw-r--r--src/World.cpp9
-rw-r--r--src/WorldStorage/NBTChunkSerializer.cpp8
6 files changed, 12 insertions, 14 deletions
diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp
index 1893d89a8..c634dc308 100644
--- a/src/ByteBuffer.cpp
+++ b/src/ByteBuffer.cpp
@@ -143,7 +143,7 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cByteBuffer:
-cByteBuffer::cByteBuffer(int a_BufferSize) :
+cByteBuffer::cByteBuffer(size_t a_BufferSize) :
m_Buffer(new char[a_BufferSize + 1]),
m_BufferSize(a_BufferSize + 1),
#ifdef _DEBUG
diff --git a/src/ByteBuffer.h b/src/ByteBuffer.h
index 1915467f3..44f43e17f 100644
--- a/src/ByteBuffer.h
+++ b/src/ByteBuffer.h
@@ -27,7 +27,7 @@ their own synchronization.
class cByteBuffer
{
public:
- cByteBuffer(int a_BufferSize);
+ cByteBuffer(size_t a_BufferSize);
~cByteBuffer();
/// Writes the bytes specified to the ringbuffer. Returns true if successful, false if not
diff --git a/src/MCLogger.cpp b/src/MCLogger.cpp
index 80fa7b173..ca47b29db 100644
--- a/src/MCLogger.cpp
+++ b/src/MCLogger.cpp
@@ -9,7 +9,6 @@
cMCLogger * cMCLogger::s_MCLogger = NULL;
-bool g_ShouldColorOutput = false;
#ifdef _WIN32
#include <io.h> // Needed for _isatty(), not available on Linux
@@ -33,7 +32,8 @@ cMCLogger * cMCLogger::GetInstance(void)
-cMCLogger::cMCLogger(void)
+cMCLogger::cMCLogger(void):
+ g_ShouldColorOutput(false)
{
AString FileName;
Printf(FileName, "LOG_%d.txt", (int)time(NULL));
diff --git a/src/MCLogger.h b/src/MCLogger.h
index c0150c124..34955ea16 100644
--- a/src/MCLogger.h
+++ b/src/MCLogger.h
@@ -52,6 +52,7 @@ private:
cCriticalSection m_CriticalSection;
cLog * m_Log;
static cMCLogger * s_MCLogger;
+ bool g_ShouldColorOutput;
/// Sets the specified color scheme in the terminal (TODO: if coloring available)
diff --git a/src/World.cpp b/src/World.cpp
index 25ac9b021..21cabe434 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -316,12 +316,9 @@ int cWorld::GetDefaultWeatherInterval(eWeather a_Weather)
{
return 2400 + (m_TickRand.randInt() % 4800); // 2 - 6 minutes
}
- default:
- {
- LOGWARNING("%s: Missing default weather interval for weather %d.", __FUNCTION__, a_Weather);
- return -1;
- }
- } // switch (Weather)
+ }
+ LOGWARNING("%s: Missing default weather interval for weather %d.", __FUNCTION__, a_Weather);
+ return -1;
}
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index b6c14db9c..27631eded 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -621,10 +621,10 @@ void cNBTChunkSerializer::AddHangingEntity(cHangingEntity * a_Hanging)
m_Writer.AddInt("TileZ", a_Hanging->GetTileZ());
switch (a_Hanging->GetDirection())
{
- case 0: m_Writer.AddByte("Dir", (unsigned char)2); break;
- case 1: m_Writer.AddByte("Dir", (unsigned char)1); break;
- case 2: m_Writer.AddByte("Dir", (unsigned char)0); break;
- case 3: m_Writer.AddByte("Dir", (unsigned char)3); break;
+ case BLOCK_FACE_YM: m_Writer.AddByte("Dir", (unsigned char)2); break;
+ case BLOCK_FACE_YP: m_Writer.AddByte("Dir", (unsigned char)1); break;
+ case BLOCK_FACE_ZM: m_Writer.AddByte("Dir", (unsigned char)0); break;
+ case BLOCK_FACE_ZP: m_Writer.AddByte("Dir", (unsigned char)3); break;
}
}