don't use the return result of wxLocaltime_r, we receive the output in second parameter anyhow (simplifies the code and also suppresses warning about tm being not used if WX_GMTOFF_IN_TM is not defined)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-04-18 22:28:02 +00:00
parent c0989defa0
commit 3d561414e5

View File

@@ -337,17 +337,16 @@ static int GetTimeZone()
// just call wxLocaltime_r() instead of figuring out whether this
// system supports tzset(), _tzset() or something else
time_t t = 0;
struct tm *tm;
struct tm tmstruct;
struct tm tm;
tm = wxLocaltime_r(&t, &tmstruct);
wxLocaltime_r(&t, &tm);
s_timezoneSet = true;
#ifdef WX_GMTOFF_IN_TM
// note that GMT offset is the opposite of time zone and so to return
// consistent results in both WX_GMTOFF_IN_TM and !WX_GMTOFF_IN_TM
// cases we have to negate it
gmtoffset = -tm->tm_gmtoff;
gmtoffset = -tm.tm_gmtoff;
#else // !WX_GMTOFF_IN_TM
gmtoffset = WX_TIMEZONE;
#endif // WX_GMTOFF_IN_TM/!WX_GMTOFF_IN_TM