]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
Prefer other types to int in checkpoint.c
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Nov 2024 16:40:36 +0000 (09:40 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Nov 2024 06:47:23 +0000 (23:47 -0700)
* src/checkpoint.c (checkpoint_state): Now enum, not int.
(tty_cleanup): Now bool, not int.

src/checkpoint.c

index 57c7b5a12b9c43c2d123e1f4ee405262deaff1dc..9866dfb43fc8c6bed1da03a75b2dbfc84989b46d 100644 (file)
@@ -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++;