From 23fec8875b3a6af0eaf63d009383ec52d7e897b8 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Thu, 1 Oct 2026 00:44:05 +0100 Subject: [PATCH] Fix const qualifier warnings --- append.c | 8 +++----- ar.c | 2 +- delete.c | 4 ++-- extract.c | 4 ++-- replace.c | 4 ++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/append.c b/append.c index e27d5d8..a52adee 100644 --- a/append.c +++ b/append.c @@ -11,13 +11,11 @@ void append (FILE *ofp, const char *fname) { - FILE *tfp; - struct ar_header header; - char temp[17]; + FILE *tfp; - const char *name = fname; - char *p, *contents; + const char *name = fname, *p; + char *contents, temp[17]; int need_newline = 0; long bytes, len, read; diff --git a/ar.c b/ar.c index ad5e1a1..37bf4af 100644 --- a/ar.c +++ b/ar.c @@ -39,7 +39,7 @@ int main (int argc, char **argv) { if (argc && *argv) { - char *p; + const char *p; program_name = *argv; if ((p = strrchr (program_name, '/')) || (p = strrchr (program_name, '\\'))) { diff --git a/delete.c b/delete.c index acbaab3..47da7eb 100644 --- a/delete.c +++ b/delete.c @@ -13,8 +13,8 @@ void delete (FILE *arfp, const char *fname) { long bytes, len, read; - const char *name; - char temp[17], *p, *contents; + const char *name, *p; + char *contents, temp[17]; FILE *tfp; diff --git a/extract.c b/extract.c index bf0d79b..b21036d 100644 --- a/extract.c +++ b/extract.c @@ -14,8 +14,8 @@ void extract (FILE *arfp, const char *fname) { FILE *ofp; long bytes, len, read; - const char *name; - char temp[17], *p, *contents; + const char *name, *p; + char *contents, temp[17]; name = fname; diff --git a/replace.c b/replace.c index d0e9ad7..6a2be76 100644 --- a/replace.c +++ b/replace.c @@ -13,8 +13,8 @@ void replace (FILE *arfp, const char *fname) { long bytes, len, read; - const char *name; - char temp[17], *p, *contents; + const char *name, *p; + char *contents, temp[17]; FILE *tfp; -- 2.34.1