From 3357683933d2df86657b018d0176ce42e4148d55 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Nov 2024 09:40:36 -0700 Subject: [PATCH] Prefer other types to int in checkpoint.c * src/checkpoint.c (checkpoint_state): Now enum, not int. (tty_cleanup): Now bool, not int. --- src/checkpoint.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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++; -- 2.47.3