Browse Source

win32: check: whitespace fixes in time.c

master
goldsimon 8 years ago
parent
commit
d560eda09f
  1. 30
      ports/win32/check/time.c

30
ports/win32/check/time.c

@ -11,8 +11,8 @@
struct timezone struct timezone
{ {
int tz_minuteswest; /* minutes W of Greenwich */ int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */ int tz_dsttime; /* type of dst correction */
}; };
int gettimeofday(struct timeval *tv, struct timezone *tz) int gettimeofday(struct timeval *tv, struct timezone *tz)
@ -21,8 +21,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
unsigned __int64 tmpres = 0; unsigned __int64 tmpres = 0;
static int tzflag; static int tzflag;
if (NULL != tv) if (NULL != tv) {
{
GetSystemTimeAsFileTime(&ft); GetSystemTimeAsFileTime(&ft);
tmpres |= ft.dwHighDateTime; tmpres |= ft.dwHighDateTime;
@ -36,10 +35,8 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
tv->tv_usec = (long)(tmpres % 1000000UL); tv->tv_usec = (long)(tmpres % 1000000UL);
} }
if (NULL != tz) if (NULL != tz) {
{ if (!tzflag) {
if (!tzflag)
{
_tzset(); _tzset();
tzflag++; tzflag++;
} }
@ -53,12 +50,17 @@ int gettimeofday(struct timeval *tv, struct timezone *tz)
struct tm * struct tm *
localtime_r(const time_t *timer, struct tm *result) localtime_r(const time_t *timer, struct tm *result)
{ {
struct tm *local_result; struct tm *local_result;
local_result = localtime (timer);
if (local_result == NULL || result == NULL) if (result == NULL) {
return NULL; return NULL;
}
local_result = localtime (timer);
if (local_result == NULL) {
return NULL;
}
memcpy(result, local_result, sizeof(*result)); memcpy(result, local_result, sizeof(*result));
return result; return result;
} }

Loading…
Cancel
Save