summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-04-25 05:25:03 +0200
committerarchshift <admin@archshift.com>2014-04-25 05:25:03 +0200
commit62e5234535d1825b152c882fdaea9d2257194e6d (patch)
treec1fc8bb364b713c81ead55c95d7eee097cda4eae /src
parentOops, fixed that. (diff)
downloadcuberite-62e5234535d1825b152c882fdaea9d2257194e6d.tar
cuberite-62e5234535d1825b152c882fdaea9d2257194e6d.tar.gz
cuberite-62e5234535d1825b152c882fdaea9d2257194e6d.tar.bz2
cuberite-62e5234535d1825b152c882fdaea9d2257194e6d.tar.lz
cuberite-62e5234535d1825b152c882fdaea9d2257194e6d.tar.xz
cuberite-62e5234535d1825b152c882fdaea9d2257194e6d.tar.zst
cuberite-62e5234535d1825b152c882fdaea9d2257194e6d.zip
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;
}
}