mountd: Add static qualifier to missing variable declarations.
authorRosen Penev <rosenp@gmail.com>
Sat, 17 Dec 2016 23:41:05 +0000 (15:41 -0800)
committerJohn Crispin <john@phrozen.org>
Mon, 19 Dec 2016 07:32:44 +0000 (08:32 +0100)
-Wmissing-variable-declarations is missing in gcc but available in clang.

Signed-off by: Rosen Penev <rosenp@gmail.com>

autofs.c
fs.c
led.c
mount.c
signal.c
timer.c

index 4ad782d6adc0da54cc3bb7fcd94f4ece29175eb5..8c69cbea5c763fe68e6f18364fc4a7e43aac2d6b 100644 (file)
--- a/autofs.c
+++ b/autofs.c
 #include "include/ucix.h"
 #include "include/autofs.h"
 
-int fdin = 0; /* data coming out of the kernel */
-int fdout = 0;/* data going into the kernel */
-dev_t dev;
+static int fdin = 0; /* data coming out of the kernel */
+static int fdout = 0;/* data going into the kernel */
+static dev_t dev;
 
-time_t uci_timeout;
+static time_t uci_timeout;
 char uci_path[32];
 
 static void umount_autofs(void)
diff --git a/fs.c b/fs.c
index ca77a76875cf5b723a1601408c84137c4f8c8b9c..d9bcc63cb9891d157df30cd58c641a7d7c3f56e4 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -191,7 +191,7 @@ out:
        return ret;
 }
 
-dfunc funcs[] = {
+static dfunc funcs[] = {
        detect_ext23,
        detect_exfat,
        detect_fat,
diff --git a/led.c b/led.c
index 62554e6705197552bd4f6cf41e183cf44d10bc3c..d373de0dad3bdb6ba2c136904fef4224bd7fa620 100644 (file)
--- a/led.c
+++ b/led.c
@@ -14,7 +14,7 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  *
  *   Provided by fon.com
- *   Copyright (C) 2009 John Crispin <blogic@openwrt.org> 
+ *   Copyright (C) 2009 John Crispin <blogic@openwrt.org>
  */
 
 
@@ -27,7 +27,7 @@
 #include "include/timer.h"
 #include "include/led.h"
 
-char usbled[16];
+static char usbled[16];
 
 void led_ping(void)
 {
diff --git a/mount.c b/mount.c
index 9a291d7b47dce6bdd649c23e1a8c26a309fbc754..a7f1862f2747919090da85c2c4fcc140ae282463 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -31,7 +31,7 @@
 
 int mount_new(char *path, char *dev);
 
-struct list_head mounts;
+static struct list_head mounts;
 
 struct mount {
        struct list_head list;
@@ -48,7 +48,7 @@ struct mount {
        int fs;
 };
 
-char *fs_names[] = {
+static char *fs_names[] = {
        "",
        "",
        "mbr",
@@ -67,8 +67,8 @@ char *fs_names[] = {
 #define MAX_MOUNTED            32
 #define MAX_MOUNT_NAME 32
 
-char mounted[MAX_MOUNTED][3][MAX_MOUNT_NAME];
-int mounted_count = 0;
+static char mounted[MAX_MOUNTED][3][MAX_MOUNT_NAME];
+static int mounted_count = 0;
 extern char uci_path[32];
 
 static void mount_dump_uci_state(void)
@@ -663,8 +663,8 @@ static int dir_filter2(const struct dirent *a)
        return 0;
 }
 #define MAX_BLOCK      64
-char block[MAX_BLOCK][MAX_BLOCK];
-int blk_cnt = 0;
+static char block[MAX_BLOCK][MAX_BLOCK];
+static int blk_cnt = 0;
 
 static int check_block(char *b)
 {
index 4a4450c91c88dbe189ef2d667efe4767abd67d99..6ab77da499765e449c5fbb2c405f82912b9c7697 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -7,7 +7,7 @@
 #include "include/led.h"
 #include "include/signal.h"
 
-void (*crtlc_cb)(void) = 0;
+static void (*crtlc_cb)(void) = 0;
 
 static void handlerINT(int s)
 {
diff --git a/timer.c b/timer.c
index b3adff4b50b53ad68130caad36d633a5d449d9e2..f634af505f4bd43a6fad534e7d989b8025c286af 100644 (file)
--- a/timer.c
+++ b/timer.c
@@ -9,7 +9,7 @@
 
 /* when using this file, alarm() is used */
 
-struct list_head timers;
+static struct list_head timers;
 
 struct timer {
        struct list_head list;