summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-03-15 14:47:56 +0100
committerTycho <work.tycho+git@gmail.com>2014-03-15 14:47:56 +0100
commitfbd4d53dacdf93f51eccc53df22831aec6a5b40a (patch)
tree8187e7749f2c8331d2c096b755bf859cd6ee8c21 /src
parentPatched tolua to emit range checks for enums (diff)
parentDebuggers: Added a test for WE selection API. (diff)
downloadcuberite-fbd4d53dacdf93f51eccc53df22831aec6a5b40a.tar
cuberite-fbd4d53dacdf93f51eccc53df22831aec6a5b40a.tar.gz
cuberite-fbd4d53dacdf93f51eccc53df22831aec6a5b40a.tar.bz2
cuberite-fbd4d53dacdf93f51eccc53df22831aec6a5b40a.tar.lz
cuberite-fbd4d53dacdf93f51eccc53df22831aec6a5b40a.tar.xz
cuberite-fbd4d53dacdf93f51eccc53df22831aec6a5b40a.tar.zst
cuberite-fbd4d53dacdf93f51eccc53df22831aec6a5b40a.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/LuaState.h2
-rw-r--r--src/Bindings/PluginManager.cpp2
-rw-r--r--src/Cuboid.cpp14
-rw-r--r--src/Cuboid.h1
-rw-r--r--src/DeadlockDetect.h2
-rw-r--r--src/Globals.h11
6 files changed, 29 insertions, 3 deletions
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index 73f9629cb..f5cb8379d 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -200,7 +200,7 @@ public:
void Push(const HTTPTemplateRequest * a_Request);
void Push(cTNTEntity * a_TNTEntity);
void Push(Vector3i * a_Vector);
- void Push(void * a_Ptr);
+ NORETURNDEBUG void Push(void * a_Ptr);
void Push(cHopperEntity * a_Hopper);
void Push(cBlockEntity * a_BlockEntity);
diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp
index c7df6357e..b9cf160c4 100644
--- a/src/Bindings/PluginManager.cpp
+++ b/src/Bindings/PluginManager.cpp
@@ -248,7 +248,7 @@ bool cPluginManager::CallHookChat(cPlayer * a_Player, AString & a_Message)
{
AStringVector Split(StringSplit(a_Message, " "));
ASSERT(!Split.empty()); // This should not happen - we know there's at least one char in the message so the split needs to be at least one item long
- a_Player->SendMessageInfo(Printf("Unknown command: \"%s\"", Split[0].c_str()));
+ a_Player->SendMessageInfo(Printf("Unknown command: \"%s\"", a_Message.c_str()));
LOGINFO("Player %s issued an unknown command: \"%s\"", a_Player->GetName().c_str(), a_Message.c_str());
return true; // Cancel sending
}
diff --git a/src/Cuboid.cpp b/src/Cuboid.cpp
index 2400c64f3..3e5240248 100644
--- a/src/Cuboid.cpp
+++ b/src/Cuboid.cpp
@@ -38,6 +38,20 @@ void cCuboid::Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2)
+void cCuboid::Assign(const cCuboid & a_SrcCuboid)
+{
+ p1.x = a_SrcCuboid.p1.x;
+ p1.y = a_SrcCuboid.p1.y;
+ p1.z = a_SrcCuboid.p1.z;
+ p2.x = a_SrcCuboid.p2.x;
+ p2.y = a_SrcCuboid.p2.y;
+ p2.z = a_SrcCuboid.p2.z;
+}
+
+
+
+
+
void cCuboid::Sort(void)
{
if (p1.x > p2.x)
diff --git a/src/Cuboid.h b/src/Cuboid.h
index b90a09e05..3239c54fc 100644
--- a/src/Cuboid.h
+++ b/src/Cuboid.h
@@ -21,6 +21,7 @@ public:
cCuboid(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2) : p1(a_X1, a_Y1, a_Z1), p2(a_X2, a_Y2, a_Z2) {}
void Assign(int a_X1, int a_Y1, int a_Z1, int a_X2, int a_Y2, int a_Z2);
+ void Assign(const cCuboid & a_SrcCuboid);
void Sort(void);
diff --git a/src/DeadlockDetect.h b/src/DeadlockDetect.h
index cb2309169..6aa98acbb 100644
--- a/src/DeadlockDetect.h
+++ b/src/DeadlockDetect.h
@@ -60,7 +60,7 @@ protected:
void CheckWorldAge(const AString & a_WorldName, Int64 a_Age);
/// Called when a deadlock is detected. Aborts the server.
- void DeadlockDetected(void);
+ NORETURN void DeadlockDetected(void);
} ;
diff --git a/src/Globals.h b/src/Globals.h
index c2542f0d8..3e62832b7 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -45,6 +45,8 @@
#define SIZE_T_FMT "%Iu"
#define SIZE_T_FMT_PRECISION(x) "%" #x "Iu"
#define SIZE_T_FMT_HEX "%Ix"
+
+ #define NORETURN __declspec(noreturn)
#elif defined(__GNUC__)
@@ -69,6 +71,8 @@
#define SIZE_T_FMT "%zu"
#define SIZE_T_FMT_PRECISION(x) "%" #x "zu"
#define SIZE_T_FMT_HEX "%zx"
+
+ #define NORETURN __attribute((__noreturn__))
#else
@@ -94,6 +98,13 @@
#endif
+#ifdef _DEBUG
+ #define NORETURNDEBUG NORETURN
+#else
+ #define NORETURNDEBUG
+#endif
+
+
#include <stddef.h>