Fix some style bugs I introduced pointed out by bde. Also add a blank
line after the empty variable declarations. Reviewed by: md5
This commit is contained in:
parent
887f7ef50a
commit
f137c9c100
38
bin/ls/cmp.c
38
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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user