diff --git a/src/init.c b/src/init.c index a94f19f5..935584a0 100644 --- a/src/init.c +++ b/src/init.c @@ -1372,13 +1372,13 @@ cmd_bytes_sum (const char *com, const char *val, void *place) double byte_value; if (!parse_bytes_helper (val, &byte_value) - || byte_value < LONG_MIN || byte_value > LONG_MAX) + || byte_value < WGINT_MIN || byte_value > WGINT_MAX) { fprintf (stderr, _("%s: %s: Invalid byte value %s\n"), exec_name, com, quote (val)); return false; } - *(SUM_SIZE_INT *) place = (SUM_SIZE_INT) byte_value; + *(wgint *) place = (wgint) byte_value; return true; } diff --git a/src/options.h b/src/options.h index 6d4c17c5..a0e9c60d 100644 --- a/src/options.h +++ b/src/options.h @@ -171,7 +171,7 @@ struct options wgint limit_rate; /* Limit the download rate to this many bps. */ - SUM_SIZE_INT quota; /* Maximum file size to download and + wgint quota; /* Maximum file size to download and store. */ bool server_response; /* Do we print server response? */ diff --git a/src/retr.c b/src/retr.c index 1efd6a63..2e18eae1 100644 --- a/src/retr.c +++ b/src/retr.c @@ -62,7 +62,7 @@ as that of the covered work. */ #include "hsts.h" /* Total size of downloaded files. Used to enforce quota. */ -SUM_SIZE_INT total_downloaded_bytes; +wgint total_downloaded_bytes; /* Total download time in seconds. */ double total_download_time; diff --git a/src/retr.h b/src/retr.h index 4121096e..60ef5ffe 100644 --- a/src/retr.h +++ b/src/retr.h @@ -37,7 +37,7 @@ extern int numurls; /* These global vars should be made static to retr.c and exported via functions! */ -extern SUM_SIZE_INT total_downloaded_bytes; +extern wgint total_downloaded_bytes; extern double total_download_time; extern FILE *output_stream; extern bool output_stream_regular; diff --git a/src/utils.h b/src/utils.h index 1dbbf86c..51062eff 100644 --- a/src/utils.h +++ b/src/utils.h @@ -121,8 +121,7 @@ void free_keys_and_values (struct hash_table *); const char *with_thousand_seps (wgint); -/* human_readable must be able to accept wgint and SUM_SIZE_INT - arguments. */ +/* human_readable must be able to accept wgint arguments. */ char *human_readable (wgint, const int, const int); diff --git a/src/wget.h b/src/wget.h index 6f20eab5..cbac4678 100644 --- a/src/wget.h +++ b/src/wget.h @@ -141,8 +141,8 @@ as that of the covered work. */ #include typedef int64_t wgint; +#define WGINT_MIN INT64_MIN #define WGINT_MAX INT64_MAX -typedef wgint SUM_SIZE_INT; #define str_to_wgint strtol