From f137c9c1002da8b30b6d95bcf6ca3d4d41c14d65 Mon Sep 17 00:00:00 2001 From: David Malone Date: Wed, 23 Jun 2004 08:26:31 +0000 Subject: [PATCH] Fix some style bugs I introduced pointed out by bde. Also add a blank line after the empty variable declarations. Reviewed by: md5 --- bin/ls/cmp.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/bin/ls/cmp.c b/bin/ls/cmp.c index 17c856e53c29..41f5b8da1f76 100644 --- a/bin/ls/cmp.c +++ b/bin/ls/cmp.c @@ -51,83 +51,91 @@ __FBSDID("$FreeBSD$"); int namecmp(const FTSENT *a, const FTSENT *b) { + return (strcoll(a->fts_name, b->fts_name)); } int revnamecmp(const FTSENT *a, const FTSENT *b) { + return (strcoll(b->fts_name, a->fts_name)); } int modcmp(const FTSENT *a, const FTSENT *b) { + if (b->fts_statp->st_mtimespec.tv_sec > a->fts_statp->st_mtimespec.tv_sec) - return 1; + return (1); if (b->fts_statp->st_mtimespec.tv_sec < a->fts_statp->st_mtimespec.tv_sec) - return -1; + return (-1); if (b->fts_statp->st_mtimespec.tv_nsec > a->fts_statp->st_mtimespec.tv_nsec) - return 1; + return (1); if (b->fts_statp->st_mtimespec.tv_nsec < a->fts_statp->st_mtimespec.tv_nsec) - return -1; + return (-1); return (strcoll(a->fts_name, b->fts_name)); } int revmodcmp(const FTSENT *a, const FTSENT *b) { - return (modcmp(b,a)); + + return (modcmp(b, a)); } int acccmp(const FTSENT *a, const FTSENT *b) { + if (b->fts_statp->st_atimespec.tv_sec > a->fts_statp->st_atimespec.tv_sec) - return 1; + return (1); if (b->fts_statp->st_atimespec.tv_sec < a->fts_statp->st_atimespec.tv_sec) - return -1; + return (-1); if (b->fts_statp->st_atimespec.tv_nsec > a->fts_statp->st_atimespec.tv_nsec) - return 1; + return (1); if (b->fts_statp->st_atimespec.tv_nsec < a->fts_statp->st_atimespec.tv_nsec) - return -1; + return (-1); return (strcoll(a->fts_name, b->fts_name)); } int revacccmp(const FTSENT *a, const FTSENT *b) { - return (acccmp(b,a)); + + return (acccmp(b, a)); } int statcmp(const FTSENT *a, const FTSENT *b) { + if (b->fts_statp->st_ctimespec.tv_sec > a->fts_statp->st_ctimespec.tv_sec) - return 1; + return (1); if (b->fts_statp->st_ctimespec.tv_sec < a->fts_statp->st_ctimespec.tv_sec) - return -1; + return (-1); if (b->fts_statp->st_ctimespec.tv_nsec > a->fts_statp->st_ctimespec.tv_nsec) - return 1; + return (1); if (b->fts_statp->st_ctimespec.tv_nsec < a->fts_statp->st_ctimespec.tv_nsec) - return -1; + return (-1); return (strcoll(a->fts_name, b->fts_name)); } int revstatcmp(const FTSENT *a, const FTSENT *b) { - return (statcmp(b,a)); + + return (statcmp(b, a)); }