Reformat with indent; update translation string line numbers.

This commit is contained in:
Andrew Wood
2025-01-26 20:08:17 +00:00
parent 6ef23916f0
commit 8664521f08
13 changed files with 97 additions and 98 deletions
+1 -2
View File
@@ -27,8 +27,7 @@ pvdisplay_bytecount_t pv_formatter_average_rate(pvformatter_args_t args)
if (args->state->control.numeric) {
/* numeric - raw value without suffix. */
(void) pv_snprintf(content, sizeof(content),
"%.4Lf",
((args->state->control.bits ? 8.0 : 1.0) * args->state->calc.average_rate));
"%.4Lf", ((args->state->control.bits ? 8.0 : 1.0) * args->state->calc.average_rate));
} else if (args->state->control.bits && !args->state->control.linemode) {
/* bits per second */
pv_describe_amount(content, sizeof(content),
+2 -1
View File
@@ -30,7 +30,8 @@ pvdisplay_bytecount_t pv_formatter_bytes(pvformatter_args_t args)
/* Numeric mode - raw values only, no suffix. */
(void) pv_snprintf(content, sizeof(content),
"%lld",
(long long) ((args->state->control.bits ? 8 : 1) * args->state->transfer.transferred));
(long long) ((args->state->control.bits ? 8 : 1) *
args->state->transfer.transferred));
} else if (args->state->control.bits && !args->state->control.linemode) {
pv_describe_amount(content, sizeof(content), "%s",
(long double) (args->state->transfer.transferred * 8), "", _("b"),
+1 -1
View File
@@ -396,7 +396,7 @@ pvdisplay_bytecount_t pv_formatter_progress_amount_only(pvformatter_args_t args)
if (args->state->control.numeric) {
/* Numeric mode - percentage as a rounded integer with no suffix. */
(void) pv_snprintf(content, sizeof(content), "%.0f", args->state->calc.percentage);
bytes = strlen(content); /* flawfinder: ignore */
bytes = strlen(content); /* flawfinder: ignore */
/* flawfinder: always \0-terminated by pv_snprintf() and the earlier memset(). */
} else if (args->state->control.size > 0 || args->state->control.rate_gauge) {
/* Known size or rate gauge - percentage or rate. */
+1 -2
View File
@@ -39,8 +39,7 @@ pvdisplay_bytecount_t pv_formatter_timer(pvformatter_args_t args)
if (args->state->control.numeric) {
/* Numeric mode - show the number of seconds, unformatted. */
(void) pv_snprintf(content, sizeof(content), "%.4Lf",
args->state->transfer.elapsed_seconds);
(void) pv_snprintf(content, sizeof(content), "%.4Lf", args->state->transfer.elapsed_seconds);
} else if (args->state->transfer.elapsed_seconds > (long double) 86400.0L) {
/*
* If the elapsed time is more than a day, include a day count as
+1 -1
View File
@@ -282,7 +282,7 @@ void pv_state_set_format(pvstate_t state, bool progress, bool timer, bool eta, b
PV_ADDFORMAT(fineta, "%I");
if (lastwritten > 0) {
char buf[16]; /* flawfinder: ignore */
char buf[16]; /* flawfinder: ignore */
memset(buf, 0, sizeof(buf));
(void) pv_snprintf(buf, sizeof(buf), "%%%uA", (unsigned int) lastwritten);
PV_ADDFORMAT(lastwritten > 0, buf);