]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
cat: declare static variables and fix several compiler warnings 702/head
authorMartin Matuska <martin@matuska.org>
Wed, 11 May 2016 09:26:47 +0000 (11:26 +0200)
committerMartin Matuska <martin@matuska.org>
Wed, 11 May 2016 21:44:33 +0000 (23:44 +0200)
cat/bsdcat.c
cat/bsdcat.h

index af140e0001c7058e6b2f133d2659b79ea8492d4e..9ef75a6b476f96f94f33a6e90f29cff228e889bc 100644 (file)
@@ -42,10 +42,10 @@ __FBSDID("$FreeBSD$");
 
 #define        BYTES_PER_BLOCK (20*512)
 
-struct archive *a;
-struct archive_entry *ae;
-char *bsdcat_current_path;
-int exit_status = 0;
+static struct archive *a;
+static struct archive_entry *ae;
+static const char *bsdcat_current_path;
+static int exit_status = 0;
 
 
 void
@@ -68,7 +68,7 @@ version(void)
 }
 
 void
-bsdcat_next()
+bsdcat_next(void)
 {
        a = archive_read_new();
        archive_read_support_filter_all(a);
@@ -85,7 +85,7 @@ bsdcat_print_error(void)
 }
 
 void
-bsdcat_read_to_stdout(char* filename)
+bsdcat_read_to_stdout(const char* filename)
 {
        int r;
 
index ca603d3d6f890d8598b8f7501032f2d80d14a8f1..2e055e7c187c8d3e9af4b8499250d8ec9613c7d9 100644 (file)
@@ -53,4 +53,4 @@ int bsdcat_getopt(struct bsdcat *);
 void usage(FILE *stream, int eval);
 void bsdcat_next(void);
 void bsdcat_print_error(void);
-void bsdcat_read_to_stdout(char* filename);
+void bsdcat_read_to_stdout(const char* filename);