From 043b1e5d997d9b582a5aee37bd56e2e4f29be6e4 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 6 Sep 2009 12:47:55 +0200 Subject: more C standard compat fixes from Dan Fandrich function old new delta docolon 207 204 -3 Signed-off-by: Denys Vlasenko --- coreutils/cut.c | 5 ++++- coreutils/dd.c | 2 +- coreutils/expr.c | 2 +- coreutils/head.c | 2 +- coreutils/od_bloaty.c | 4 ++-- coreutils/sleep.c | 2 +- coreutils/split.c | 2 +- coreutils/stty.c | 2 +- coreutils/tail.c | 2 +- coreutils/uname.c | 3 ++- 10 files changed, 15 insertions(+), 11 deletions(-) (limited to 'coreutils') diff --git a/coreutils/cut.c b/coreutils/cut.c index 9cc22be16..240ce4bb9 100644 --- a/coreutils/cut.c +++ b/coreutils/cut.c @@ -111,7 +111,10 @@ static void cut_file(FILE *file, char delim, const struct cut_list *cut_lists, u int ndelim = -1; /* zero-based / one-based problem */ int nfields_printed = 0; char *field = NULL; - const char delimiter[2] = { delim, 0 }; + char delimiter[2]; + + delimiter[0] = delim; + delimiter[1] = 0; /* does this line contain any delimiters? */ if (strchr(line, delim) == NULL) { diff --git a/coreutils/dd.c b/coreutils/dd.c index 5281d8118..3fdfc236a 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -29,7 +29,7 @@ static const struct suffix_mult dd_suffixes[] = { { "M", 1048576 }, { "GD", 1000000000 }, { "G", 1073741824 }, - { } + { "", 0 } }; struct globals { diff --git a/coreutils/expr.c b/coreutils/expr.c index 54c2ee165..f5701a460 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -214,9 +214,9 @@ static arith_t arithmetic_common(VALUE *l, VALUE *r, int op) static VALUE *docolon(VALUE *sv, VALUE *pv) { + enum { NMATCH = 2 }; VALUE *v; regex_t re_buffer; - const int NMATCH = 2; regmatch_t re_regs[NMATCH]; tostring(sv); diff --git a/coreutils/head.c b/coreutils/head.c index ac476d091..0fab8a8ae 100644 --- a/coreutils/head.c +++ b/coreutils/head.c @@ -25,7 +25,7 @@ static const struct suffix_mult head_suffixes[] = { { "b", 512 }, { "k", 1024 }, { "m", 1024*1024 }, - { } + { "", 0 } }; #endif diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 00efec51c..1d5769bd8 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c @@ -963,7 +963,7 @@ parse_old_offset(const char *s, off_t *offset) static const struct suffix_mult Bb[] = { { "B", 1024 }, { "b", 512 }, - { } + { "", 0 } }; char *p; int radix; @@ -1178,7 +1178,7 @@ int od_main(int argc, char **argv) { "b", 512 }, { "k", 1024 }, { "m", 1024*1024 }, - { } + { "", 0 } }; enum { OPT_A = 1 << 0, diff --git a/coreutils/sleep.c b/coreutils/sleep.c index b16d03c2b..399a38dd4 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -29,7 +29,7 @@ static const struct suffix_mult sfx[] = { { "m", 60 }, { "h", 60*60 }, { "d", 24*60*60 }, - { } + { "", 0 } }; #endif diff --git a/coreutils/split.c b/coreutils/split.c index f1ec64be0..2191f30ea 100644 --- a/coreutils/split.c +++ b/coreutils/split.c @@ -20,7 +20,7 @@ static const struct suffix_mult split_suffices[] = { #if ENABLE_FEATURE_SPLIT_FANCY { "g", 1024*1024*1024 }, #endif - { } + { "", 0 } }; /* Increment the suffix part of the filename. diff --git a/coreutils/stty.c b/coreutils/stty.c index e02fe7c72..baa1ec2da 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c @@ -774,7 +774,7 @@ static const struct suffix_mult stty_suffixes[] = { { "b", 512 }, { "k", 1024 }, { "B", 1024 }, - { } + { "", 0 } }; static const struct mode_info *find_mode(const char *name) diff --git a/coreutils/tail.c b/coreutils/tail.c index 05dadcd9b..0be166315 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c @@ -30,7 +30,7 @@ static const struct suffix_mult tail_suffixes[] = { { "b", 512 }, { "k", 1024 }, { "m", 1024*1024 }, - { } + { "", 0 } }; struct globals { diff --git a/coreutils/uname.c b/coreutils/uname.c index 8453bcc01..9822e49bd 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -48,8 +48,9 @@ * Fix handling of -a to not print "unknown", add -o and -i support. */ -#include #include "libbb.h" +/* After libbb.h, since it needs sys/types.h on some systems */ +#include typedef struct { struct utsname name; -- cgit v1.2.3