From 987eb2b7615104f3f70e56e51f1dd3df5b2a41eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Sat, 1 Apr 2017 14:48:16 +0200 Subject: Clang-format: trivial fix on some headers (#5495) Fix some headers style and remove them from whitelist --- src/gettime.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/gettime.h') diff --git a/src/gettime.h b/src/gettime.h index 44c159026..6e70b8533 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -45,8 +45,8 @@ extern u32 getTime(TimePrecision prec); Timestamp stuff */ -#include #include +#include inline std::string getTimestamp() { @@ -54,10 +54,9 @@ inline std::string getTimestamp() // This is not really thread-safe but it won't break anything // except its own output, so just go with it. struct tm *tm = localtime(&t); - char cs[20]; //YYYY-MM-DD HH:MM:SS + '\0' + char cs[20]; // YYYY-MM-DD HH:MM:SS + '\0' strftime(cs, 20, "%Y-%m-%d %H:%M:%S", tm); return cs; } - #endif -- cgit v1.2.3 From 3a90b78a037df3eb9098d4fddb1289ed8ee21329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Thu, 6 Apr 2017 16:03:29 +0200 Subject: LINT: Switch whitelist check from egrep to awk Bonus: make CI happy with the last rules fix --- src/gettime.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gettime.h') diff --git a/src/gettime.h b/src/gettime.h index 6e70b8533..b2f09a7bb 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -31,7 +31,8 @@ with this program; if not, write to the Free Software Foundation, Inc., Normal build: main.cpp Server build: servermain.cpp */ -enum TimePrecision { +enum TimePrecision +{ PRECISION_SECONDS = 0, PRECISION_MILLI, PRECISION_MICRO, -- cgit v1.2.3 From b662a4577d692329b9ca83525e6039f2ddcd1ac1 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Sun, 6 Mar 2016 14:31:16 -0500 Subject: Clean up getTime helpers This increases size of the getTime return values to 64 bits. It also removes the TimeGetter classes since the getTime functions are now very precise. --- src/gettime.h | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'src/gettime.h') diff --git a/src/gettime.h b/src/gettime.h index b2f09a7bb..a93eee387 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -21,33 +21,18 @@ with this program; if not, write to the Free Software Foundation, Inc., #define GETTIME_HEADER #include "irrlichttypes.h" +#include +#include -/* - Get a millisecond counter value. - Precision depends on implementation. - Overflows at any value above 10000000. - Implementation of this is done in: - Normal build: main.cpp - Server build: servermain.cpp -*/ enum TimePrecision { - PRECISION_SECONDS = 0, + PRECISION_SECONDS, PRECISION_MILLI, PRECISION_MICRO, PRECISION_NANO }; -extern u32 getTimeMs(); -extern u32 getTime(TimePrecision prec); - -/* - Timestamp stuff -*/ - -#include -#include inline std::string getTimestamp() { -- cgit v1.2.3 From ecf08255b0b6b9d15b86f614942ac8f53f41302a Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Sat, 29 Apr 2017 09:47:22 +0200 Subject: Fix Lint broken by b662a4577d692329b9ca83525e6039f2ddcd1ac1 --- src/gettime.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/gettime.h') diff --git a/src/gettime.h b/src/gettime.h index a93eee387..4d5a02e1e 100644 --- a/src/gettime.h +++ b/src/gettime.h @@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include - enum TimePrecision { PRECISION_SECONDS, @@ -33,7 +32,6 @@ enum TimePrecision PRECISION_NANO }; - inline std::string getTimestamp() { time_t t = time(NULL); -- cgit v1.2.3