From 370523d5bf9b9139fabfeffc77bb727ee53a664e Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 17 Mar 2017 23:25:25 +0000 Subject: [PATCH] Remove sgGMTime, no longer used. (And the implementation was wrong on Windows) --- simgear/timing/lowleveltime.cxx | 21 --------------------- simgear/timing/lowleveltime.h | 7 +------ 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/simgear/timing/lowleveltime.cxx b/simgear/timing/lowleveltime.cxx index fc4fb566..ae994f31 100644 --- a/simgear/timing/lowleveltime.cxx +++ b/simgear/timing/lowleveltime.cxx @@ -1134,24 +1134,3 @@ char *tzstring (const char* string) return strncpy (p, string, needed); } - -time_t sgGMTime() -{ - // this was created to fix: - // https://code.google.com/p/flightgear-bugs/issues/detail?id=1207 - // however applying the code on Unix causes bug: - // https://code.google.com/p/flightgear-bugs/issues/detail?id=1301 - // One solution would be to deinfe our own 'timegm' as suggested here: - // http://linux.die.net/man/3/timegm - // but for the moment we'll assume time(0) on Unix is UTC, and hence we - // return it directly. - - time_t now_sec = time(0); -#if defined(SG_WINDOWS) - struct tm now; - now = *gmtime(&now_sec); - return mktime(&now); -#else - return now_sec; -#endif -} diff --git a/simgear/timing/lowleveltime.h b/simgear/timing/lowleveltime.h index 1be49531..16495404 100644 --- a/simgear/timing/lowleveltime.h +++ b/simgear/timing/lowleveltime.h @@ -41,11 +41,6 @@ void show (const char *zone, time_t t, int v); /* adapted from */ struct tm * fgLocaltime (const time_t *t, const char *tzName); -/* version of time() which returns a value in GMT/UTC, without - any timezone adjustment. Necessary on Windows where calling time() - returns a value in the local time-zone. */ -time_t sgGMTime(); - /* Prototype for the internal function to get information based on TZ. */ extern struct tm *fgtz_convert (const time_t *t, int use_localtime, struct tm *tp, const char *tzName); @@ -130,4 +125,4 @@ extern const unsigned short int mon_yday[2][13]; #define EPOCH_YEAR 1970 #define EPOCH_WDAY TM_THURSDAY -#endif +#endif