diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-03-15 14:53:07 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-03-15 14:53:07 +0100 |
commit | 683e2f48405a2bcbf0b839db51379946e096b212 (patch) | |
tree | 43f1df6cdfab7c6c440554438cd087fc3c19096e /src | |
parent | Merge branch 'master' into globals (diff) | |
parent | Debuggers: Added a test for WE selection API. (diff) | |
download | cuberite-683e2f48405a2bcbf0b839db51379946e096b212.tar cuberite-683e2f48405a2bcbf0b839db51379946e096b212.tar.gz cuberite-683e2f48405a2bcbf0b839db51379946e096b212.tar.bz2 cuberite-683e2f48405a2bcbf0b839db51379946e096b212.tar.lz cuberite-683e2f48405a2bcbf0b839db51379946e096b212.tar.xz cuberite-683e2f48405a2bcbf0b839db51379946e096b212.tar.zst cuberite-683e2f48405a2bcbf0b839db51379946e096b212.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/LuaState.h | 2 | ||||
-rw-r--r-- | src/Bindings/PluginManager.cpp | 2 | ||||
-rw-r--r-- | src/Cuboid.cpp | 14 | ||||
-rw-r--r-- | src/Cuboid.h | 1 | ||||
-rw-r--r-- | src/DeadlockDetect.h | 2 | ||||
-rw-r--r-- | src/Globals.h | 11 |
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> |