From: Paul Eggert Date: Fri, 1 Nov 2024 16:40:36 +0000 (-0700) Subject: Prefer other types to int in checkpoint.c X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3357683933d2df86657b018d0176ce42e4148d55;p=thirdparty%2Ftar.git Prefer other types to int in checkpoint.c * src/checkpoint.c (checkpoint_state): Now enum, not int. (tty_cleanup): Now bool, not int. --- diff --git a/src/checkpoint.c b/src/checkpoint.c index 57c7b5a1..9866dfb4 100644 --- a/src/checkpoint.c +++ b/src/checkpoint.c @@ -62,12 +62,11 @@ static struct checkpoint_action *checkpoint_action, **checkpoint_action_tail = &checkpoint_action; /* State of the checkpoint system */ -enum { +static enum { CHKP_INIT, /* Needs initialization */ CHKP_COMPILE, /* Actions are being compiled */ CHKP_RUN /* Actions are being run */ -}; -static int checkpoint_state; +} checkpoint_state; /* Blocked signals */ static sigset_t sigs; @@ -199,7 +198,7 @@ getarg (char const *input, char const **endp, char **argbuf, idx_t *arglen) return NULL; } -static int tty_cleanup; +static bool tty_cleanup; static const char *def_format = "%{%Y-%m-%d %H:%M:%S}t: %ds, %{read,wrote}T%*\r"; @@ -343,7 +342,7 @@ format_checkpoint_string (FILE *fp, idx_t len, if (*ip == '\r') { len = 0; - tty_cleanup = 1; + tty_cleanup = true; } else len++;