summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorPeter Bell <peterbell10@live.co.uk>2020-05-09 17:51:54 +0200
committerpeterbell10 <peterbell10@live.co.uk>2020-05-09 21:37:16 +0200
commit1123c95cf2efdcb23ff557b956d58538ca24aefe (patch)
treee8f39c2519ad06afc4f52d8fbc1d8fb334aeea42 /src/Globals.h
parentUpdate submodules (#4727) (diff)
downloadcuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.gz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.bz2
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.lz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.xz
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.tar.zst
cuberite-1123c95cf2efdcb23ff557b956d58538ca24aefe.zip
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 02b007e09..e6fde373e 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -390,6 +390,13 @@ using cTickTimeLong = std::chrono::duration<Int64, cTickTime::period>;
#error TOLUA_EXPOSITION should never actually be defined
#endif
+template <typename T>
+auto ToUnsigned(T a_Val)
+{
+ ASSERT(a_Val >= 0);
+ return static_cast<std::make_unsigned_t<T>>(a_Val);
+}
+