summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-05-17 13:02:25 +0200
committerJim Meyering <meyering@redhat.com>2009-05-17 13:59:12 +0200
commit9593a3d8e78ece58deab5a30632021322bbc16d0 (patch)
treea2f3e289371a2d3e78eb2ca3a35c99c0b54c8d4c /src/ls.c
parent65ed4ca07bd18c2038b5863ed1e18d3bfc8e696d (diff)
downloadcoreutils-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/ls.c')
-rw-r--r--src/ls.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ls.c b/src/ls.c
index 795d1edca..838431c96 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -1223,7 +1223,7 @@ main (int argc, char **argv)
SIGXFSZ,
#endif
};
- enum { nsigs = sizeof sig / sizeof sig[0] };
+ enum { nsigs = ARRAY_CARDINALITY (sig) };
#if ! SA_NOCLDSTOP
bool caught_sig[nsigs];
@@ -1238,8 +1238,8 @@ main (int argc, char **argv)
initialize_exit_failure (LS_FAILURE);
atexit (close_stdout);
-#define N_ENTRIES(Array) (sizeof Array / sizeof *(Array))
- assert (N_ENTRIES (color_indicator) + 1 == N_ENTRIES (indicator_name));
+ assert (ARRAY_CARDINALITY (color_indicator) + 1
+ == ARRAY_CARDINALITY (indicator_name));
exit_status = EXIT_SUCCESS;
print_dir_name = true;