diff options
author | Jim Meyering <meyering@redhat.com> | 2009-05-17 13:02:25 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-05-17 13:59:12 +0200 |
commit | 9593a3d8e78ece58deab5a30632021322bbc16d0 (patch) | |
tree | a2f3e289371a2d3e78eb2ca3a35c99c0b54c8d4c /src/od.c | |
parent | 65ed4ca07bd18c2038b5863ed1e18d3bfc8e696d (diff) | |
download | coreutils-9593a3d8e78ece58deab5a30632021322bbc16d0.tar.xz |
maint: use ARRAY_CARDINALITY more
* src/sort.c (main): Use ARRAY_CARDINALITY, rather than open-coding it.
* src/factor.c (WHEEL_END): Likewise.
* src/csplit.c (main): Likewise.
* src/od.c: Likewise,
* src/ls.c (main): Likewise.
(N_ENTRIES): Remove definition. Use ARRAY_CARDINALITY instead.
* src/dircolors.c: Likewise.
(array_len): Remove definition.
Diffstat (limited to 'src/od.c')
-rw-r--r-- | src/od.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1,5 +1,5 @@ /* od -- dump files in octal and other formats - Copyright (C) 92, 1995-2008 Free Software Foundation, Inc. + Copyright (C) 92, 1995-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -148,8 +148,7 @@ static unsigned int const bytes_to_hex_digits[] = /* It'll be a while before we see integral types wider than 16 bytes, but if/when it happens, this check will catch it. Without this check, a wider type would provoke a buffer overrun. */ -verify (MAX_INTEGRAL_TYPE_SIZE - < sizeof bytes_to_hex_digits / sizeof *bytes_to_hex_digits); +verify (MAX_INTEGRAL_TYPE_SIZE < ARRAY_CARDINALITY (bytes_to_hex_digits)); /* Make sure the other arrays have the same length. */ verify (sizeof bytes_to_oct_digits == sizeof bytes_to_signed_dec_digits); @@ -172,7 +171,7 @@ static const int width_bytes[] = /* Ensure that for each member of `enum size_spec' there is an initializer in the width_bytes array. */ -verify (sizeof width_bytes / sizeof width_bytes[0] == N_SIZE_SPECS); +verify (ARRAY_CARDINALITY (width_bytes) == N_SIZE_SPECS); /* Names for some non-printing characters. */ static char const charname[33][4] = |