]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
checkpoint_total_format is now const
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 1 Nov 2024 02:53:25 +0000 (19:53 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Nov 2024 06:47:23 +0000 (23:47 -0700)
* src/checkpoint.c (checkpoint_total_format):
Now const, and local to format_checkpoint_string.

src/checkpoint.c

index 573eff8d67c05e8afa5f3b41bf16c36ac0d7cd59..c6200c696cef9024c64c7b2e12f7de8f9cc022ff 100644 (file)
@@ -168,12 +168,6 @@ checkpoint_finish_compile (void)
     }
 }
 
-static const char *checkpoint_total_format[] = {
-  "R",
-  "W",
-  "D"
-};
-
 static intmax_t
 getwidth (FILE *fp)
 {
@@ -289,7 +283,9 @@ format_checkpoint_string (FILE *fp, idx_t len,
 
            case 'T':
              {
-               const char **fmt = checkpoint_total_format, *fmtbuf[3];
+               static char const *const checkpoint_total_format[]
+                 = { "R", "W", "D" };
+               char const *const *fmt = checkpoint_total_format, *fmtbuf[3];
                struct wordsplit ws;
                compute_duration_ns ();