Re: [PATCH v2 1/4] progress: make display_progress() return void
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 2, 2019, 05:42 UTC
- Message-ID
- <CAPig+cSF8A0-rSM3q1AvpE7xjkFcrMEBdsGTe+qkd2rU_uxcEg@mail.gmail.com>
- In-Reply-To
- <20190401115217.3423-2-szeder.dev@gmail.com>
On Mon, Apr 1, 2019 at 7:52 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 13 quoted lines
> [...]
> Let's make display_progress() return void, too.
>
> Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
> ---
> diff --git a/progress.c b/progress.c
> @@ -78,12 +78,12 @@ static int is_foreground_fd(int fd)
> -static int display(struct progress *progress, uint64_t n, const char *done)
> +static void display(struct progress *progress, uint64_t n, const char *done)
> {
> if (progress->delay && (!progress_update || --progress->delay))
> - return 0;
> + return;This 'return' needs to stay, but...
Show 15 quoted lines
> @@ -100,7 +100,7 @@ static int display(struct progress *progress, uint64_t n, const char *done)
> progress_update = 0;
> - return 1;
> + return;
> }
> } else if (progress_update) {
> @@ -109,10 +109,10 @@ static int display(struct progress *progress, uint64_t n, const char *done)
> progress_update = 0;
> - return 1;
> + return;
> }
>
> - return 0;
> + return;
> }... these three 'returns' can all go away. (In fact, the first two mysteriously disappear in patch 2/4.)