From a55a3b50e8b1674a670ba9986d9651df172c1b6a Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Tue, 28 Aug 2018 10:21:36 +0500 Subject: [PATCH] src/Mayaqua/Unix: remove unused code, improve readability of "ifdef" refactoring was discussed in PR#672 --- src/Mayaqua/Unix.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Mayaqua/Unix.c b/src/Mayaqua/Unix.c index 185abed9..c082f143 100755 --- a/src/Mayaqua/Unix.c +++ b/src/Mayaqua/Unix.c @@ -2060,12 +2060,6 @@ UINT64 UnixGetTick64() struct timespec t; UINT64 ret; - static bool akirame = false; - - if (akirame) - { - return TickRealtimeManual(); - } Zero(&t, sizeof(t)); @@ -2073,20 +2067,17 @@ UINT64 UnixGetTick64() // Be careful. The Implementation is depend on the system. #ifdef CLOCK_HIGHRES clock_gettime(CLOCK_HIGHRES, &t); -#else // CLOCK_HIGHRES -#ifdef CLOCK_MONOTONIC +#elif CLOCK_MONOTONIC clock_gettime(CLOCK_MONOTONIC, &t); -#else // CLOCK_MONOTONIC +#else clock_gettime(CLOCK_REALTIME, &t); -#endif // CLOCK_MONOTONIC -#endif // CLOCK_HIGHRES +#endif ret = ((UINT64)((UINT32)t.tv_sec)) * 1000LL + (UINT64)t.tv_nsec / 1000000LL; - if (akirame == false && ret == 0) + if (ret == 0) { ret = TickRealtimeManual(); - akirame = true; } return ret;