]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: fix compiler warnings [-Wmissing-prototypes]
authorRuediger Meier <ruediger.meier@ga-group.nl>
Mon, 22 Feb 2016 22:30:17 +0000 (23:30 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 23 Feb 2016 02:18:09 +0000 (03:18 +0100)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
17 files changed:
libblkid/src/dev.c
libblkid/src/tag.c
libfdisk/src/ask.c
libfdisk/src/gpt.c
libfdisk/src/script.c
libfdisk/src/utils.c
libfdisk/src/version.c
libmount/src/cache.c
libmount/src/context.c
libmount/src/lock.c
libmount/src/monitor.c
libmount/src/optstr.c
libmount/src/tab.c
libmount/src/tab_diff.c
libmount/src/utils.c
libmount/src/version.c
libsmartcols/samples/wrap.c

index 9491331abc05911496f33820dcb71c7ff59a5cc0..99b70b682f96c23fe755aaabf5681956fd852c81 100644 (file)
@@ -208,7 +208,7 @@ extern char *optarg;
 extern int optind;
 #endif
 
-void __attribute__((__noreturn__)) usage(char *prog)
+static void __attribute__((__noreturn__)) usage(char *prog)
 {
        fprintf(stderr, "Usage: %s [-f blkid_file] [-m debug_mask]\n", prog);
        fprintf(stderr, "\tList all devices and exit\n");
index c6bc376786172ae8a2267367e74ac355c2ab2aa8..bfc7bb782a09cabf505f962a4230ca7e489068c4 100644 (file)
@@ -397,7 +397,7 @@ extern char *optarg;
 extern int optind;
 #endif
 
-void __attribute__((__noreturn__)) usage(char *prog)
+static void __attribute__((__noreturn__)) usage(char *prog)
 {
        fprintf(stderr, "Usage: %s [-f blkid_file] [-m debug_mask] device "
                "[type value]\n",
index d81ebd76a2ff6665e885d02f6572a0cc72d1cec8..595bfe48a7fa182daab6b0db61b39d905989b66d 100644 (file)
@@ -1002,7 +1002,7 @@ int fdisk_info_new_partition(
 }
 
 #ifdef TEST_PROGRAM
-int test_ranges(struct fdisk_test *ts, int argc, char *argv[])
+static int test_ranges(struct fdisk_test *ts, int argc, char *argv[])
 {
        /*                1  -  3,       6,    8, 9,   11    13 */
        size_t nums[] = { 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1 };
index 6bc0e3f07f2fb72a9a4857b0bb7eb43186d87de2..c461bb511785f7ff2ae5dadd4facb5386278eeea 100644 (file)
@@ -2807,7 +2807,7 @@ struct fdisk_label *fdisk_new_gpt_label(struct fdisk_context *cxt)
 }
 
 #ifdef TEST_PROGRAM
-int test_getattr(struct fdisk_test *ts, int argc, char *argv[])
+static int test_getattr(struct fdisk_test *ts, int argc, char *argv[])
 {
        const char *disk = argv[1];
        size_t part = strtoul(argv[2], NULL, 0) - 1;
@@ -2829,7 +2829,7 @@ int test_getattr(struct fdisk_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_setattr(struct fdisk_test *ts, int argc, char *argv[])
+static int test_setattr(struct fdisk_test *ts, int argc, char *argv[])
 {
        const char *disk = argv[1];
        size_t part = strtoul(argv[2], NULL, 0) - 1;
index 4022ab5654735fe4e6a70b8de609e18ee4976dd8..b80f88e3b6b5889a3df2bfac1e9057df1b14c109 100644 (file)
@@ -1373,7 +1373,7 @@ int fdisk_apply_script(struct fdisk_context *cxt, struct fdisk_script *dp)
 }
 
 #ifdef TEST_PROGRAM
-int test_dump(struct fdisk_test *ts, int argc, char *argv[])
+static int test_dump(struct fdisk_test *ts, int argc, char *argv[])
 {
        char *devname = argv[1];
        struct fdisk_context *cxt;
@@ -1392,7 +1392,7 @@ int test_dump(struct fdisk_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_read(struct fdisk_test *ts, int argc, char *argv[])
+static int test_read(struct fdisk_test *ts, int argc, char *argv[])
 {
        char *filename = argv[1];
        struct fdisk_script *dp;
@@ -1415,7 +1415,7 @@ int test_read(struct fdisk_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_stdin(struct fdisk_test *ts, int argc, char *argv[])
+static int test_stdin(struct fdisk_test *ts, int argc, char *argv[])
 {
        char buf[BUFSIZ];
        struct fdisk_script *dp;
@@ -1450,7 +1450,7 @@ int test_stdin(struct fdisk_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_apply(struct fdisk_test *ts, int argc, char *argv[])
+static int test_apply(struct fdisk_test *ts, int argc, char *argv[])
 {
        char *devname = argv[1], *scriptname = argv[2];
        struct fdisk_context *cxt;
index 5feea53f60eda413a050db91043e22d2aaf05e57..8b4d9ed58e359224350c35efc159bc1927df1dd3 100644 (file)
@@ -167,7 +167,7 @@ char *fdisk_partname(const char *dev, size_t partno)
 struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt) { return NULL; }
 struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt) { return NULL; }
 
-int test_partnames(struct fdisk_test *ts, int argc, char *argv[])
+static int test_partnames(struct fdisk_test *ts, int argc, char *argv[])
 {
        size_t i;
        const char *disk = argv[1];
index bfbd7c5e3e38c27eb61df38d19ea564f01bc3407..9d84b4c96821ead8431391310c6cfe0205d07e00 100644 (file)
@@ -91,7 +91,7 @@ int fdisk_get_library_features(const char ***features)
 }
 
 #ifdef TEST_PROGRAM
-int test_version(struct fdisk_test *ts, int argc, char *argv[])
+static int test_version(struct fdisk_test *ts, int argc, char *argv[])
 {
        const char *ver;
        const char **features;
index b9b607bb00e94c0812ca5040afc4de46ab585ea5..b83706a374684686a18796bc1cf11598e71b5dea 100644 (file)
@@ -720,7 +720,7 @@ char *mnt_resolve_spec(const char *spec, struct libmnt_cache *cache)
 
 #ifdef TEST_PROGRAM
 
-int test_resolve_path(struct libmnt_test *ts, int argc, char *argv[])
+static int test_resolve_path(struct libmnt_test *ts, int argc, char *argv[])
 {
        char line[BUFSIZ];
        struct libmnt_cache *cache;
@@ -743,7 +743,7 @@ int test_resolve_path(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_resolve_spec(struct libmnt_test *ts, int argc, char *argv[])
+static int test_resolve_spec(struct libmnt_test *ts, int argc, char *argv[])
 {
        char line[BUFSIZ];
        struct libmnt_cache *cache;
@@ -766,7 +766,7 @@ int test_resolve_spec(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_read_tags(struct libmnt_test *ts, int argc, char *argv[])
+static int test_read_tags(struct libmnt_test *ts, int argc, char *argv[])
 {
        char line[BUFSIZ];
        struct libmnt_cache *cache;
index 7b965a07f280d3d6f92ab02c44303783ea788df4..e26135fb0a5daf2d72eb5cfe062139daf323b471 100644 (file)
@@ -2412,7 +2412,7 @@ static void lock_fallback(void)
                mnt_unlock_file(lock);
 }
 
-int test_mount(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mount(struct libmnt_test *ts, int argc, char *argv[])
 {
        int idx = 1, rc = 0;
        struct libmnt_context *cxt;
@@ -2462,7 +2462,7 @@ int test_mount(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_umount(struct libmnt_test *ts, int argc, char *argv[])
+static int test_umount(struct libmnt_test *ts, int argc, char *argv[])
 {
        int idx = 1, rc = 0;
        struct libmnt_context *cxt;
@@ -2517,7 +2517,7 @@ err:
        return rc;
 }
 
-int test_flags(struct libmnt_test *ts, int argc, char *argv[])
+static int test_flags(struct libmnt_test *ts, int argc, char *argv[])
 {
        int idx = 1, rc = 0;
        struct libmnt_context *cxt;
@@ -2555,7 +2555,7 @@ int test_flags(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_mountall(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mountall(struct libmnt_test *ts, int argc, char *argv[])
 {
        struct libmnt_context *cxt;
        struct libmnt_iter *itr;
index 0d943295aa6c825da64355505eae4542a0c512f8..4076a23f280e99facc3f1a094ad11589bb5b9b91 100644 (file)
@@ -566,7 +566,7 @@ struct libmnt_lock *lock;
  * read number from @filename, increment the number and
  * write the number back to the file
  */
-void increment_data(const char *filename, int verbose, int loopno)
+static void increment_data(const char *filename, int verbose, int loopno)
 {
        long num;
        FILE *f;
@@ -594,7 +594,7 @@ void increment_data(const char *filename, int verbose, int loopno)
                                filename, num - 1, num, loopno);
 }
 
-void clean_lock(void)
+static void clean_lock(void)
 {
        if (!lock)
                return;
@@ -602,12 +602,12 @@ void clean_lock(void)
        mnt_free_lock(lock);
 }
 
-void __attribute__((__noreturn__)) sig_handler(int sig)
+static void __attribute__((__noreturn__)) sig_handler(int sig)
 {
        errx(EXIT_FAILURE, "\n%d: catch signal: %s\n", getpid(), strsignal(sig));
 }
 
-int test_lock(struct libmnt_test *ts, int argc, char *argv[])
+static int test_lock(struct libmnt_test *ts, int argc, char *argv[])
 {
        time_t synctime = 0;
        unsigned int usecs;
index 9bc7ea32a0faa47134a4cf1c9114c9b8f59d42cc..a71f2f503101d329c9e80983ad66b5ef314298a9 100644 (file)
@@ -863,7 +863,7 @@ err:
 /*
  * create a monitor and add the monitor fd to epoll
  */
-int __test_epoll(struct libmnt_test *ts, int argc, char *argv[], int cleanup)
+static int __test_epoll(struct libmnt_test *ts, int argc, char *argv[], int cleanup)
 {
        int fd, efd = -1, rc = -1;
        struct epoll_event ev;
@@ -927,12 +927,12 @@ done:
 /*
  * create a monitor and add the monitor fd to epoll
  */
-int test_epoll(struct libmnt_test *ts, int argc, char *argv[])
+static int test_epoll(struct libmnt_test *ts, int argc, char *argv[])
 {
        return __test_epoll(ts, argc, argv, 0);
 }
 
-int test_epoll_cleanup(struct libmnt_test *ts, int argc, char *argv[])
+static int test_epoll_cleanup(struct libmnt_test *ts, int argc, char *argv[])
 {
        return __test_epoll(ts, argc, argv, 1);
 }
@@ -940,7 +940,7 @@ int test_epoll_cleanup(struct libmnt_test *ts, int argc, char *argv[])
 /*
  * create a monitor and wait for a change
  */
-int test_wait(struct libmnt_test *ts, int argc, char *argv[])
+static int test_wait(struct libmnt_test *ts, int argc, char *argv[])
 {
        const char *filename;
        struct libmnt_monitor *mn = create_test_monitor(argc, argv);
index 9b21e63b17e3330ede964ba993a53cc30a553b52..b342b5f07e57e9afc11da98be0989070f2fe3fa3 100644 (file)
@@ -1081,7 +1081,7 @@ int mnt_optstr_fix_user(char **optstr)
 
 #ifdef TEST_PROGRAM
 
-int test_append(struct libmnt_test *ts, int argc, char *argv[])
+static int test_append(struct libmnt_test *ts, int argc, char *argv[])
 {
        const char *value = NULL, *name;
        char *optstr;
@@ -1102,7 +1102,7 @@ int test_append(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_prepend(struct libmnt_test *ts, int argc, char *argv[])
+static int test_prepend(struct libmnt_test *ts, int argc, char *argv[])
 {
        const char *value = NULL, *name;
        char *optstr;
@@ -1123,7 +1123,7 @@ int test_prepend(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_split(struct libmnt_test *ts, int argc, char *argv[])
+static int test_split(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr, *user = NULL, *fs = NULL, *vfs = NULL;
        int rc;
@@ -1147,7 +1147,7 @@ int test_split(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_flags(struct libmnt_test *ts, int argc, char *argv[])
+static int test_flags(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr;
        int rc;
@@ -1173,7 +1173,7 @@ int test_flags(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_apply(struct libmnt_test *ts, int argc, char *argv[])
+static int test_apply(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr;
        int rc, map;
@@ -1203,7 +1203,7 @@ int test_apply(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_set(struct libmnt_test *ts, int argc, char *argv[])
+static int test_set(struct libmnt_test *ts, int argc, char *argv[])
 {
        const char *value = NULL, *name;
        char *optstr;
@@ -1224,7 +1224,7 @@ int test_set(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_get(struct libmnt_test *ts, int argc, char *argv[])
+static int test_get(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr;
        const char *name;
@@ -1253,7 +1253,7 @@ int test_get(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_remove(struct libmnt_test *ts, int argc, char *argv[])
+static int test_remove(struct libmnt_test *ts, int argc, char *argv[])
 {
        const char *name;
        char *optstr;
@@ -1271,7 +1271,7 @@ int test_remove(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_dedup(struct libmnt_test *ts, int argc, char *argv[])
+static int test_dedup(struct libmnt_test *ts, int argc, char *argv[])
 {
        const char *name;
        char *optstr;
@@ -1289,7 +1289,7 @@ int test_dedup(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_fix(struct libmnt_test *ts, int argc, char *argv[])
+static int test_fix(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr;
        int rc = 0;
index f9d8b064f89bd5ac33630b768ddd635e516ca6e2..102ed258d553901493793ffbe841debf5c63c7a0 100644 (file)
@@ -1608,7 +1608,7 @@ static int parser_errcb(struct libmnt_table *tb, const char *filename, int line)
        return 1;       /* all errors are recoverable -- this is the default */
 }
 
-struct libmnt_table *create_table(const char *file, int comments)
+static struct libmnt_table *create_table(const char *file, int comments)
 {
        struct libmnt_table *tb;
 
@@ -1630,7 +1630,7 @@ err:
        return NULL;
 }
 
-int test_copy_fs(struct libmnt_test *ts, int argc, char *argv[])
+static int test_copy_fs(struct libmnt_test *ts, int argc, char *argv[])
 {
        struct libmnt_table *tb;
        struct libmnt_fs *fs;
@@ -1660,7 +1660,7 @@ done:
        return rc;
 }
 
-int test_parse(struct libmnt_test *ts, int argc, char *argv[])
+static int test_parse(struct libmnt_test *ts, int argc, char *argv[])
 {
        struct libmnt_table *tb = NULL;
        struct libmnt_iter *itr = NULL;
@@ -1696,7 +1696,7 @@ done:
        return rc;
 }
 
-int test_find(struct libmnt_test *ts, int argc, char *argv[], int dr)
+static int test_find(struct libmnt_test *ts, int argc, char *argv[], int dr)
 {
        struct libmnt_table *tb;
        struct libmnt_fs *fs = NULL;
@@ -1738,17 +1738,17 @@ done:
        return rc;
 }
 
-int test_find_bw(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_bw(struct libmnt_test *ts, int argc, char *argv[])
 {
        return test_find(ts, argc, argv, MNT_ITER_BACKWARD);
 }
 
-int test_find_fw(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_fw(struct libmnt_test *ts, int argc, char *argv[])
 {
        return test_find(ts, argc, argv, MNT_ITER_FORWARD);
 }
 
-int test_find_pair(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_pair(struct libmnt_test *ts, int argc, char *argv[])
 {
        struct libmnt_table *tb;
        struct libmnt_fs *fs;
@@ -1775,7 +1775,7 @@ done:
        return rc;
 }
 
-int test_find_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
 {
        struct libmnt_table *tb;
        struct libmnt_fs *fs;
index 2d178d10f1151183cca73ea8cda91de8e87d306e..7cf9e57ef769c1f5924f511408e67943f19fac2f 100644 (file)
@@ -303,7 +303,7 @@ done:
 
 #ifdef TEST_PROGRAM
 
-int test_diff(struct libmnt_test *ts, int argc, char *argv[])
+static int test_diff(struct libmnt_test *ts, int argc, char *argv[])
 {
        struct libmnt_table *tb_old = NULL, *tb_new = NULL;
        struct libmnt_tabdiff *diff = NULL;
index 50cca0671dca24c1dfa5e571fd20e8417282c4ef..5a62879a49813e857301a06e94a16fc933d6e8bf 100644 (file)
@@ -1096,7 +1096,7 @@ char *mnt_get_kernel_cmdline_option(const char *name)
 }
 
 #ifdef TEST_PROGRAM
-int test_match_fstype(struct libmnt_test *ts, int argc, char *argv[])
+static int test_match_fstype(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *type = argv[1];
        char *pattern = argv[2];
@@ -1105,7 +1105,7 @@ int test_match_fstype(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_match_options(struct libmnt_test *ts, int argc, char *argv[])
+static int test_match_options(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr = argv[1];
        char *pattern = argv[2];
@@ -1114,7 +1114,7 @@ int test_match_options(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_startswith(struct libmnt_test *ts, int argc, char *argv[])
+static int test_startswith(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr = argv[1];
        char *pattern = argv[2];
@@ -1123,7 +1123,7 @@ int test_startswith(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_endswith(struct libmnt_test *ts, int argc, char *argv[])
+static int test_endswith(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *optstr = argv[1];
        char *pattern = argv[2];
@@ -1132,7 +1132,7 @@ int test_endswith(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_appendstr(struct libmnt_test *ts, int argc, char *argv[])
+static int test_appendstr(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *str = strdup(argv[1]);
        const char *ap = argv[2];
@@ -1144,7 +1144,7 @@ int test_appendstr(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *path = canonicalize_path(argv[1]),
             *mnt = path ? mnt_get_mountpoint(path) :  NULL;
@@ -1155,7 +1155,7 @@ int test_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_filesystems(struct libmnt_test *ts, int argc, char *argv[])
+static int test_filesystems(struct libmnt_test *ts, int argc, char *argv[])
 {
        char **filesystems = NULL;
        int rc;
@@ -1170,7 +1170,7 @@ int test_filesystems(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_chdir(struct libmnt_test *ts, int argc, char *argv[])
+static int test_chdir(struct libmnt_test *ts, int argc, char *argv[])
 {
        int rc;
        char *path = canonicalize_path(argv[1]),
@@ -1189,7 +1189,7 @@ int test_chdir(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_kernel_cmdline(struct libmnt_test *ts, int argc, char *argv[])
+static int test_kernel_cmdline(struct libmnt_test *ts, int argc, char *argv[])
 {
        char *name = argv[1];
        char *res;
@@ -1207,7 +1207,7 @@ int test_kernel_cmdline(struct libmnt_test *ts, int argc, char *argv[])
        return 0;
 }
 
-int test_mkdir(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mkdir(struct libmnt_test *ts, int argc, char *argv[])
 {
        int rc;
 
@@ -1219,7 +1219,7 @@ int test_mkdir(struct libmnt_test *ts, int argc, char *argv[])
        return rc;
 }
 
-int test_statfs_type(struct libmnt_test *ts, int argc, char *argv[])
+static int test_statfs_type(struct libmnt_test *ts, int argc, char *argv[])
 {
        struct statfs vfs;
        int rc;
index b9902b9d976af9f2b598d0f474d25ff603eb7b6e..2d30954bbdaddba99ce0b9349f0ef57bfc1c73d5 100644 (file)
@@ -105,7 +105,7 @@ int mnt_get_library_features(const char ***features)
 }
 
 #ifdef TEST_PROGRAM
-int test_version(struct libmnt_test *ts, int argc, char *argv[])
+static int test_version(struct libmnt_test *ts, int argc, char *argv[])
 {
        const char *ver;
        const char **features;
index 2a476fbe9e3f93e3f79445ef125ec37f20884d3e..96cdff31cc635bcd882550d3274b8aebf296f745 100644 (file)
@@ -46,7 +46,7 @@ static char *gen_text(const char *prefix, const char *sub_prefix, char *buf, siz
 {
        int x = snprintf(buf, sz,  "%s-%s-", prefix, sub_prefix);
 
-       for ( ; x < sz - 1; x++)
+       for ( ; (size_t)x < sz - 1; x++)
                buf[x] = *prefix;
 
        buf[x++] = 'x';