From ef730dda06db0b7b867e2ec23fdb2672676b38ac Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 12 Apr 2026 17:42:16 +0100 Subject: [PATCH] Minor corrections to the comments. --- src/pv/calc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pv/calc.c b/src/pv/calc.c index c9b7b65..a03200b 100644 --- a/src/pv/calc.c +++ b/src/pv/calc.c @@ -14,8 +14,10 @@ /* * Update the current average rate, using a ring buffer of past transfer * positions - if this is the first entry, use the provided instantaneous - * rate, otherwise calulate the average rate from the difference between the - * current position + elapsed time pair, and the oldest pair in the buffer. + * rate, otherwise calculate the average rate from the difference between + * the current position + elapsed time pair, and the oldest pair in the + * buffer. The current elapsed time and amount transferred (both from + * "transfer") are added to the buffer. */ static void pv__update_average_rate_history(pvtransfercalc_t calc, readonly_pvtransferstate_t transfer, unsigned int history_interval, long double rate) @@ -38,7 +40,7 @@ static void pv__update_average_rate_history(pvtransfercalc_t calc, readonly_pvtr return; /* - * If this is not the first call, add a new entry to the circular + * If this is not the first call, add a new entry to the ring * buffer. */ if (last_elapsed > 0.0) { @@ -136,7 +138,7 @@ void pv_calculate_transfer_rate(pvtransfercalc_t calc, readonly_pvtransferstate_ average_rate = calc->current_avg_rate; /* - * If this is the final update at the end of the transfer, we + * If this is the final update at the end of the transfer, * recalculate the rate - and the average rate - across the whole * period of the transfer. */