]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add static keyword where needed [smatch scan]
authorSami Kerola <kerolasa@iki.fi>
Fri, 10 Mar 2017 19:56:16 +0000 (19:56 +0000)
committerSami Kerola <kerolasa@iki.fi>
Fri, 17 Mar 2017 21:22:26 +0000 (21:22 +0000)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
libmount/src/context.c
libmount/src/lock.c
misc-utils/test_uuidd.c
tests/helpers/test_byteswap.c
tests/helpers/test_pathnames.c

index 44282c07bf9e5d9f38fc77f3a280deb51797d9d2..e731749b4200a1647feb940682bed8e001128ca5 100644 (file)
@@ -2414,7 +2414,7 @@ int mnt_context_wait_for_children(struct libmnt_context *cxt,
 
 #ifdef TEST_PROGRAM
 
-struct libmnt_lock *lock;
+static struct libmnt_lock *lock;
 
 static void lock_fallback(void)
 {
index c3cd226f44bd79659633fc1f1421d2fcd93dfafe..06eff1344b9ce67fe3d34eb9a15cd8fd8a36b033 100644 (file)
@@ -560,7 +560,7 @@ void mnt_unlock_file(struct libmnt_lock *ml)
 
 #ifdef TEST_PROGRAM
 
-struct libmnt_lock *lock;
+static struct libmnt_lock *lock;
 
 /*
  * read number from @filename, increment the number and
index d590f9632508126e6ed71b09769b8f6abd71798e..66a9f2d3b5caf24cc64e2385e33bc448ad6afe55 100644 (file)
 
 #define LOG(level,args) if (loglev >= level) { fprintf args; }
 
-size_t nprocesses = 4;
-size_t nthreads = 4;
-size_t nobjects = 4096;
-size_t loglev = 1;
+static size_t nprocesses = 4;
+static size_t nthreads = 4;
+static size_t nobjects = 4096;
+static size_t loglev = 1;
 
 struct processentry {
        pid_t           pid;
index 0b996e09bff8fd903c424c3162bd5f3fdf37406b..1b98f769746f816e0e17d30ad91bba6f3edf798b 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "bitops.h"
 
-uint16_t ary16[] = {
+static uint16_t ary16[] = {
        0x0001, 0x0100,
        0x1234, 0x3412,
        0xff00, 0x00ff,
@@ -28,7 +28,7 @@ uint16_t ary16[] = {
        0x0000, 0x0000
        };
 
-uint32_t ary32[] = {
+static uint32_t ary32[] = {
        0x00000001, 0x01000000,
        0x80000000, 0x00000080,
        0x12345678, 0x78563412,
@@ -38,7 +38,7 @@ uint32_t ary32[] = {
        0x00000000, 0x00000000
        };
 
-uint64_t ary64[] = {
+static uint64_t ary64[] = {
        0x0000000000000001, 0x0100000000000000,
        0x8000000000000000, 0x0000000000000080,
        0x1234567812345678, 0x7856341278563412,
index d5cdad829b40789284d98f40afdfbdc41e7e8b79..2368641f1df563058449862b0789ca255917ef5a 100644 (file)
@@ -29,7 +29,7 @@ struct hlpPath
 
 #define DEF_HLPPATH(_p)                { #_p, _p }
 
-struct hlpPath paths[] =
+static struct hlpPath paths[] =
 {
        DEF_HLPPATH(_PATH_DEFPATH),
        DEF_HLPPATH(_PATH_DEFPATH_ROOT),