diff options
author | Daniel Stenberg <daniel@haxx.se> | 2023-02-24 00:45:16 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2023-02-24 17:05:33 +0100 |
commit | 835682661c7a36b0e860c978204e8cd9b033be45 (patch) | |
tree | 606e64e9bc9d563abafe4b20f47d63ed23b6f5ea /lib | |
parent | 9672cc640ce7e38b5abcd69a5b80bd972bc0aff3 (diff) | |
download | curl-835682661c7a36b0e860c978204e8cd9b033be45.tar.gz |
misc: remove support for curl_off_t < 8 bytes
Closes #10597
Diffstat (limited to 'lib')
-rw-r--r-- | lib/curl_setup.h | 4 | ||||
-rw-r--r-- | lib/progress.c | 13 | ||||
-rw-r--r-- | lib/smb.c | 3 | ||||
-rw-r--r-- | lib/version.c | 3 |
4 files changed, 6 insertions, 17 deletions
diff --git a/lib/curl_setup.h b/lib/curl_setup.h index a8cc71503..76fccb81d 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -441,8 +441,8 @@ # endif #endif -#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) diff --git a/lib/progress.c b/lib/progress.c index a2228888e..6092b782c 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -87,8 +87,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); @@ -111,15 +109,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; } @@ -25,8 +25,7 @@ #include "curl_setup.h" -#if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) && \ - (SIZEOF_CURL_OFF_T > 4) +#if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) #define BUILDING_CURL_SMB_C diff --git a/lib/version.c b/lib/version.c index a69e2ca57..eaf9e4684 100644 --- a/lib/version.c +++ b/lib/version.c @@ -357,8 +357,7 @@ static const char * const protocols[] = { #ifdef USE_SSH "sftp", #endif -#if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) && \ - (SIZEOF_CURL_OFF_T > 4) +#if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) "smb", # ifdef USE_SSL "smbs", |