summaryrefslogtreecommitdiff
path: root/src/porting.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-08-19 14:25:35 +0200
committerGitHub <noreply@github.com>2017-08-19 14:25:35 +0200
commit7528986e4449febead9b18b6118f0b096f7cf800 (patch)
tree8e526c1403ba8d0689ab40a24165fc19d8a07e27 /src/porting.h
parent1992db1395d9c068327a7c08bac7a24ef7112274 (diff)
downloadminetest-7528986e4449febead9b18b6118f0b096f7cf800.tar.gz
minetest-7528986e4449febead9b18b6118f0b096f7cf800.tar.bz2
minetest-7528986e4449febead9b18b6118f0b096f7cf800.zip
Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Spelling: vertice -> vertex
Diffstat (limited to 'src/porting.h')
-rw-r--r--src/porting.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/porting.h b/src/porting.h
index 4e663390a..304e4aff0 100644
--- a/src/porting.h
+++ b/src/porting.h
@@ -56,7 +56,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define sleep_ms(x) Sleep(x)
#else
#include <unistd.h>
- #include <stdint.h> //for uintptr_t
+ #include <cstdint> //for uintptr_t
// Use standard Posix macro for Linux
#if (defined(linux) || defined(__linux)) && !defined(__linux__)
@@ -112,8 +112,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef _WIN32 // Posix
#include <sys/time.h>
- #include <time.h>
- #if defined(__MACH__) && defined(__APPLE__)
+ #include <ctime>
+
+#if defined(__MACH__) && defined(__APPLE__)
#include <mach/clock.h>
#include <mach/mach.h>
#endif
@@ -273,9 +274,9 @@ inline u64 getDeltaMs(u64 old_time_ms, u64 new_time_ms)
{
if (new_time_ms >= old_time_ms) {
return (new_time_ms - old_time_ms);
- } else {
- return (old_time_ms - new_time_ms);
}
+
+ return (old_time_ms - new_time_ms);
}
inline const char *getPlatformName()