mirror of
https://github.com/curl/curl.git
synced 2026-08-25 11:43:36 +03:00
parent
9672cc640c
commit
835682661c
10 changed files with 17 additions and 182 deletions
|
|
@ -116,8 +116,8 @@ static void fly(struct ProgressData *bar, bool moved)
|
|||
|
||||
#define MAX_BARLENGTH 256
|
||||
|
||||
#if (SIZEOF_CURL_OFF_T == 4)
|
||||
# define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFF)
|
||||
#if (SIZEOF_CURL_OFF_T < 8)
|
||||
#error "too small curl_off_t"
|
||||
#else
|
||||
/* assume SIZEOF_CURL_OFF_T == 8 */
|
||||
# define CURL_OFF_T_MAX CURL_OFF_T_C(0x7FFFFFFFFFFFFFFF)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ curl_off_t getfiletime(const char *filename, struct GlobalConfig *global)
|
|||
/* Windows stat() may attempt to adjust the unix GMT file time by a daylight
|
||||
saving time offset and since it's GMT that is bad behavior. When we have
|
||||
access to a 64-bit type we can bypass stat and get the times directly. */
|
||||
#if defined(WIN32) && (SIZEOF_CURL_OFF_T >= 8)
|
||||
#if defined(WIN32)
|
||||
HANDLE hfile;
|
||||
TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename);
|
||||
|
||||
|
|
@ -85,8 +85,7 @@ curl_off_t getfiletime(const char *filename, struct GlobalConfig *global)
|
|||
return result;
|
||||
}
|
||||
|
||||
#if defined(HAVE_UTIME) || defined(HAVE_UTIMES) || \
|
||||
(defined(WIN32) && (SIZEOF_CURL_OFF_T >= 8))
|
||||
#if defined(HAVE_UTIME) || defined(HAVE_UTIMES) || defined(WIN32)
|
||||
void setfiletime(curl_off_t filetime, const char *filename,
|
||||
struct GlobalConfig *global)
|
||||
{
|
||||
|
|
@ -94,7 +93,7 @@ void setfiletime(curl_off_t filetime, const char *filename,
|
|||
/* Windows utime() may attempt to adjust the unix GMT file time by a daylight
|
||||
saving time offset and since it's GMT that is bad behavior. When we have
|
||||
access to a 64-bit type we can bypass utime and set the times directly. */
|
||||
#if defined(WIN32) && (SIZEOF_CURL_OFF_T >= 8)
|
||||
#if defined(WIN32)
|
||||
HANDLE hfile;
|
||||
TCHAR *tchar_filename = curlx_convert_UTF8_to_tchar((char *)filename);
|
||||
|
||||
|
|
@ -151,5 +150,5 @@ void setfiletime(curl_off_t filetime, const char *filename,
|
|||
#endif
|
||||
}
|
||||
}
|
||||
#endif /* defined(HAVE_UTIME) || defined(HAVE_UTIMES) || \
|
||||
(defined(WIN32) && (SIZEOF_CURL_OFF_T >= 8)) */
|
||||
#endif /* defined(HAVE_UTIME) || defined(HAVE_UTIMES) || \
|
||||
defined(WIN32) */
|
||||
|
|
|
|||
|
|
@ -53,8 +53,6 @@ static char *max5data(curl_off_t bytes, char *max5)
|
|||
CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE,
|
||||
(bytes%ONE_MEGABYTE) / (ONE_MEGABYTE/CURL_OFF_T_C(10)) );
|
||||
|
||||
#if (SIZEOF_CURL_OFF_T > 4)
|
||||
|
||||
else if(bytes < CURL_OFF_T_C(10000) * ONE_MEGABYTE)
|
||||
/* 'XXXXM' is good until we're at 10000MB or above */
|
||||
msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE);
|
||||
|
|
@ -77,16 +75,8 @@ static char *max5data(curl_off_t bytes, char *max5)
|
|||
/* up to 10000PB, display without decimal: XXXXP */
|
||||
msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "P", bytes/ONE_PETABYTE);
|
||||
|
||||
/* 16384 petabytes (16 exabytes) is the maximum a 64 bit unsigned number
|
||||
can hold, but our data type is signed so 8192PB will be the maximum. */
|
||||
|
||||
#else
|
||||
|
||||
else
|
||||
msnprintf(max5, 6, "%4" CURL_FORMAT_CURL_OFF_T "M", bytes/ONE_MEGABYTE);
|
||||
|
||||
#endif
|
||||
|
||||
/* 16384 petabytes (16 exabytes) is the maximum a 64 bit unsigned number can
|
||||
hold, but our data type is signed so 8192PB will be the maximum. */
|
||||
return max5;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue