summaryrefslogtreecommitdiff
path: root/src/od.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-12-03 17:49:57 +0100
committerJim Meyering <meyering@redhat.com>2011-12-04 10:31:03 +0100
commit63098ee58235f5a1877220e8c073f6f23b09264f (patch)
treebd2fe30d768fc5cdb499657722e5cdea40664902 /src/od.c
parentbea7b10489afcc845db00b03da6ccea71de6cb1d (diff)
downloadcoreutils-63098ee58235f5a1877220e8c073f6f23b09264f.tar.xz
od,test: address warnings from gcc's -Wjump-misses-init
* src/test.c (unary_operator): gcc reported that initializations in two case statements were skipped. Enclose in braces. * src/od.c (decode_one_format): Likewise.
Diffstat (limited to 'src/od.c')
-rw-r--r--src/od.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/od.c b/src/od.c
index 2f3593e95..6a6eb8067 100644
--- a/src/od.c
+++ b/src/od.c
@@ -771,32 +771,34 @@ this system doesn't provide a %lu-byte floating point type"),
}
size_spec = fp_type_size[size];
- struct lconv const *locale = localeconv ();
- size_t decimal_point_len =
- (locale->decimal_point[0] ? strlen (locale->decimal_point) : 1);
-
- switch (size_spec)
- {
- case FLOAT_SINGLE:
- print_function = print_float;
- field_width = FLT_STRLEN_BOUND_L (decimal_point_len);
- break;
+ {
+ struct lconv const *locale = localeconv ();
+ size_t decimal_point_len =
+ (locale->decimal_point[0] ? strlen (locale->decimal_point) : 1);
+
+ switch (size_spec)
+ {
+ case FLOAT_SINGLE:
+ print_function = print_float;
+ field_width = FLT_STRLEN_BOUND_L (decimal_point_len);
+ break;
- case FLOAT_DOUBLE:
- print_function = print_double;
- field_width = DBL_STRLEN_BOUND_L (decimal_point_len);
- break;
+ case FLOAT_DOUBLE:
+ print_function = print_double;
+ field_width = DBL_STRLEN_BOUND_L (decimal_point_len);
+ break;
- case FLOAT_LONG_DOUBLE:
- print_function = print_long_double;
- field_width = LDBL_STRLEN_BOUND_L (decimal_point_len);
- break;
+ case FLOAT_LONG_DOUBLE:
+ print_function = print_long_double;
+ field_width = LDBL_STRLEN_BOUND_L (decimal_point_len);
+ break;
- default:
- abort ();
- }
+ default:
+ abort ();
+ }
- break;
+ break;
+ }
case 'a':
++s;