diff options
author | Sami Kerola | 2013-04-08 21:32:49 +0200 |
---|---|---|
committer | Karel Zak | 2013-04-09 12:17:20 +0200 |
commit | 3acc206d39de38f7d78008950cd030fceb125ff0 (patch) | |
tree | c66b0823e6c132d4b80f9f90133fa4e63f3f146c /text-utils | |
parent | bash-completion: swapon: add options and fix argument (diff) | |
download | kernel-qcow2-util-linux-3acc206d39de38f7d78008950cd030fceb125ff0.tar.gz kernel-qcow2-util-linux-3acc206d39de38f7d78008950cd030fceb125ff0.tar.xz kernel-qcow2-util-linux-3acc206d39de38f7d78008950cd030fceb125ff0.zip |
various: fix variable and function declarations [smatch scan]
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code
fdisks/sfdisk.c:982:5: warning: mixing declarations and code
fdisks/sfdisk.c:1254:5: warning: mixing declarations and code
fdisks/sfdisk.c:1564:5: warning: mixing declarations and code
lib/mbsalign.c:279:7: warning: mixing declarations and code
libblkid/src/devname.c:378:17: warning: mixing declarations and code
libfdisk/src/alignment.c:219:9: warning: mixing declarations and code
term-utils/wall.c:111:9: warning: mixing declarations and code
text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks'
text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line'
text-utils/rev.c:105:9: warning: mixing declarations and code
text-utils/tailf.c:245:9: warning: mixing declarations and code
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils')
-rw-r--r-- | text-utils/col.c | 4 | ||||
-rw-r--r-- | text-utils/rev.c | 12 | ||||
-rw-r--r-- | text-utils/tailf.c | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/text-utils/col.c b/text-utils/col.c index c2b10dc51..474b33fca 100644 --- a/text-utils/col.c +++ b/text-utils/col.c @@ -415,7 +415,7 @@ void flush_lines(int nflush) * is the number of half line feeds, otherwise it is the number of whole line * feeds. */ -void flush_blanks() +void flush_blanks(void) { int half, i, nb; @@ -550,7 +550,7 @@ void flush_line(LINE *l) static LINE *line_freelist; LINE * -alloc_line() +alloc_line(void) { LINE *l; int i; diff --git a/text-utils/rev.c b/text-utils/rev.c index 00d519695..95545064a 100644 --- a/text-utils/rev.c +++ b/text-utils/rev.c @@ -94,6 +94,12 @@ int main(int argc, char *argv[]) FILE *fp = stdin; int ch, rval = EXIT_SUCCESS; + static const struct option longopts[] = { + { "version", no_argument, 0, 'V' }, + { "help", no_argument, 0, 'h' }, + { NULL, 0, 0, 0 } + }; + setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); @@ -102,12 +108,6 @@ int main(int argc, char *argv[]) signal(SIGINT, sig_handler); signal(SIGTERM, sig_handler); - static const struct option longopts[] = { - { "version", no_argument, 0, 'V' }, - { "help", no_argument, 0, 'h' }, - { NULL, 0, 0, 0 } - }; - while ((ch = getopt_long(argc, argv, "Vh", longopts, NULL)) != -1) switch(ch) { case 'V': diff --git a/text-utils/tailf.c b/text-utils/tailf.c index a8630fb6c..2f611a4cb 100644 --- a/text-utils/tailf.c +++ b/text-utils/tailf.c @@ -237,11 +237,6 @@ int main(int argc, char **argv) struct stat st; off_t size = 0; - setlocale(LC_ALL, ""); - bindtextdomain(PACKAGE, LOCALEDIR); - textdomain(PACKAGE); - atexit(close_stdout); - static const struct option longopts[] = { { "lines", required_argument, 0, 'n' }, { "version", no_argument, 0, 'V' }, @@ -249,6 +244,11 @@ int main(int argc, char **argv) { NULL, 0, 0, 0 } }; + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + atexit(close_stdout); + lines = old_style_option(&argc, argv); if (lines < 0) lines = DEFAULT_LINES; |