From: Michihiro NAKAJIMA Date: Wed, 22 Feb 2012 06:49:22 +0000 (+0900) Subject: Fix build failure on MSYS: rename a variable name 'time' to 't' since X-Git-Tag: v3.0.4~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a111a314b8ea99658d5e0b0020bf76ad63e86930;p=thirdparty%2Flibarchive.git Fix build failure on MSYS: rename a variable name 'time' to 't' since that 'time' shadows a global declaration. --- diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c index 15bdeb90e..89b753f3c 100644 --- a/libarchive/archive_windows.c +++ b/libarchive/archive_windows.c @@ -425,7 +425,7 @@ __la_read(int fd, void *buf, size_t nbytes) /* Convert Windows FILETIME to UTC */ __inline static void -fileTimeToUTC(const FILETIME *filetime, time_t *time, long *ns) +fileTimeToUTC(const FILETIME *filetime, time_t *t, long *ns) { ULARGE_INTEGER utc; @@ -433,10 +433,10 @@ fileTimeToUTC(const FILETIME *filetime, time_t *time, long *ns) utc.LowPart = filetime->dwLowDateTime; if (utc.QuadPart >= EPOC_TIME) { utc.QuadPart -= EPOC_TIME; - *time = (time_t)(utc.QuadPart / 10000000); /* milli seconds base */ + *t = (time_t)(utc.QuadPart / 10000000); /* milli seconds base */ *ns = (long)(utc.QuadPart % 10000000) * 100;/* nano seconds base */ } else { - *time = 0; + *t = 0; *ns = 0; } } @@ -459,7 +459,7 @@ __hstat(HANDLE handle, struct ustat *st) ULARGE_INTEGER ino64; DWORD ftype; mode_t mode; - time_t time; + time_t t; long ns; switch (ftype = GetFileType(handle)) { @@ -516,14 +516,14 @@ __hstat(HANDLE handle, struct ustat *st) mode |= S_IFREG; st->st_mode = mode; - fileTimeToUTC(&info.ftLastAccessTime, &time, &ns); - st->st_atime = time; + fileTimeToUTC(&info.ftLastAccessTime, &t, &ns); + st->st_atime = t; st->st_atime_nsec = ns; - fileTimeToUTC(&info.ftLastWriteTime, &time, &ns); - st->st_mtime = time; + fileTimeToUTC(&info.ftLastWriteTime, &t, &ns); + st->st_mtime = t; st->st_mtime_nsec = ns; - fileTimeToUTC(&info.ftCreationTime, &time, &ns); - st->st_ctime = time; + fileTimeToUTC(&info.ftCreationTime, &t, &ns); + st->st_ctime = t; st->st_ctime_nsec = ns; st->st_size = ((int64_t)(info.nFileSizeHigh) * ((int64_t)MAXDWORD + 1))