diff options
author | Linquize <linquize@yahoo.com.hk> | 2013-05-15 20:26:55 +0800 |
---|---|---|
committer | Linquize <linquize@yahoo.com.hk> | 2013-05-15 20:26:55 +0800 |
commit | 0cb16fe924fb5c4e58866c28b06ace876e2dcbd3 (patch) | |
tree | f1c4e33497c216c333dc0133d8a15fcd137c358b /src/win32 | |
parent | bc2020d64869aa19a88b71aee33a24b54c178dab (diff) | |
download | libgit2-0cb16fe924fb5c4e58866c28b06ace876e2dcbd3.tar.gz |
Unify whitespaces to tabs
Diffstat (limited to 'src/win32')
-rw-r--r-- | src/win32/posix_w32.c | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c index 52eb4638a..b9115836e 100644 --- a/src/win32/posix_w32.c +++ b/src/win32/posix_w32.c @@ -479,29 +479,29 @@ int p_send(GIT_SOCKET socket, const void *buffer, size_t length, int flags) * Borrowed from http://old.nabble.com/Porting-localtime_r-and-gmtime_r-td15282276.html * On Win32, `gmtime_r` doesn't exist but `gmtime` is threadsafe, so we can use that */ -struct tm * -p_localtime_r (const time_t *timer, struct tm *result) -{ - struct tm *local_result; - local_result = localtime (timer); - - if (local_result == NULL || result == NULL) - return NULL; - - memcpy (result, local_result, sizeof (struct tm)); - return result; -} -struct tm * -p_gmtime_r (const time_t *timer, struct tm *result) -{ - struct tm *local_result; - local_result = gmtime (timer); - - if (local_result == NULL || result == NULL) - return NULL; - - memcpy (result, local_result, sizeof (struct tm)); - return result; +struct tm * +p_localtime_r (const time_t *timer, struct tm *result) +{ + struct tm *local_result; + local_result = localtime (timer); + + if (local_result == NULL || result == NULL) + return NULL; + + memcpy (result, local_result, sizeof (struct tm)); + return result; +} +struct tm * +p_gmtime_r (const time_t *timer, struct tm *result) +{ + struct tm *local_result; + local_result = gmtime (timer); + + if (local_result == NULL || result == NULL) + return NULL; + + memcpy (result, local_result, sizeof (struct tm)); + return result; } #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) @@ -514,44 +514,44 @@ p_gmtime_r (const time_t *timer, struct tm *result) #define _TIMEZONE_DEFINED struct timezone { - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ }; #endif - + int p_gettimeofday(struct timeval *tv, struct timezone *tz) { - FILETIME ft; - unsigned __int64 tmpres = 0; - static int tzflag; - - if (NULL != tv) - { - GetSystemTimeAsFileTime(&ft); - - tmpres |= ft.dwHighDateTime; - tmpres <<= 32; - tmpres |= ft.dwLowDateTime; - - /*converting file time to unix epoch*/ - tmpres /= 10; /*convert into microseconds*/ - tmpres -= DELTA_EPOCH_IN_MICROSECS; - tv->tv_sec = (long)(tmpres / 1000000UL); - tv->tv_usec = (long)(tmpres % 1000000UL); - } - - if (NULL != tz) - { - if (!tzflag) - { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - - return 0; + FILETIME ft; + unsigned __int64 tmpres = 0; + static int tzflag; + + if (NULL != tv) + { + GetSystemTimeAsFileTime(&ft); + + tmpres |= ft.dwHighDateTime; + tmpres <<= 32; + tmpres |= ft.dwLowDateTime; + + /*converting file time to unix epoch*/ + tmpres /= 10; /*convert into microseconds*/ + tmpres -= DELTA_EPOCH_IN_MICROSECS; + tv->tv_sec = (long)(tmpres / 1000000UL); + tv->tv_usec = (long)(tmpres % 1000000UL); + } + + if (NULL != tz) + { + if (!tzflag) + { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + + return 0; } int p_inet_pton(int af, const char* src, void* dst) |