style(9): mostly avoiding line wrap by not indenting cases. No obj change.

This commit is contained in:
Max Laier 2008-11-04 19:17:32 +00:00
parent 0caf1ab15a
commit 40850176c9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184654

View File

@ -85,7 +85,7 @@ main(int argc, char *argv[])
{
FTS *fts;
FTSENT *p;
off_t savednumber = 0;
off_t savednumber;
long blocksize;
int ftsoptions;
int listall;
@ -102,75 +102,77 @@ main(int argc, char *argv[])
save = argv;
ftsoptions = 0;
savednumber = 0;
depth = INT_MAX;
SLIST_INIT(&ignores);
while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
break;
case 'I':
ignoreadd(optarg);
break;
case 'L':
if (Pflag)
usage();
Lflag = 1;
break;
case 'P':
if (Lflag)
usage();
Pflag = 1;
break;
case 'a':
aflag = 1;
break;
case 's':
sflag = 1;
break;
case 'd':
dflag = 1;
errno = 0;
depth = atoi(optarg);
if (errno == ERANGE || depth < 0) {
warnx("invalid argument to option d: %s", optarg);
usage();
}
break;
case 'c':
cflag = 1;
break;
case 'h':
if (setenv("BLOCKSIZE", "512", 1) == -1)
warn(
"setenv: cannot set BLOCKSIZE=512");
hflag = 1;
break;
case 'k':
hflag = 0;
if (setenv("BLOCKSIZE", "1024", 1) == -1)
warn("setenv: cannot set BLOCKSIZE=1024");
break;
case 'l':
lflag = 1;
break;
case 'm':
hflag = 0;
if (setenv("BLOCKSIZE", "1048576", 1) == -1)
warn("setenv: cannot set BLOCKSIZE=1048576");
break;
case 'n':
nodumpflag = 1;
break;
case 'r': /* Compatibility. */
break;
case 'x':
ftsoptions |= FTS_XDEV;
break;
case '?':
default:
case 'H':
Hflag = 1;
break;
case 'I':
ignoreadd(optarg);
break;
case 'L':
if (Pflag)
usage();
Lflag = 1;
break;
case 'P':
if (Lflag)
usage();
Pflag = 1;
break;
case 'a':
aflag = 1;
break;
case 's':
sflag = 1;
break;
case 'd':
dflag = 1;
errno = 0;
depth = atoi(optarg);
if (errno == ERANGE || depth < 0) {
warnx("invalid argument to option d: %s",
optarg);
usage();
}
break;
case 'c':
cflag = 1;
break;
case 'h':
if (setenv("BLOCKSIZE", "512", 1) == -1)
warn("setenv: cannot set BLOCKSIZE=512");
hflag = 1;
break;
case 'k':
hflag = 0;
if (setenv("BLOCKSIZE", "1024", 1) == -1)
warn("setenv: cannot set BLOCKSIZE=1024");
break;
case 'l':
lflag = 1;
break;
case 'm':
hflag = 0;
if (setenv("BLOCKSIZE", "1048576", 1) == -1)
warn("setenv: cannot set BLOCKSIZE=1048576");
break;
case 'n':
nodumpflag = 1;
break;
case 'r': /* Compatibility. */
break;
case 'x':
ftsoptions |= FTS_XDEV;
break;
case '?':
default:
usage();
/* NOTREACHED */
}
argc -= optind;
@ -222,7 +224,7 @@ main(int argc, char *argv[])
argv[1] = NULL;
}
(void) getbsize(&notused, &blocksize);
(void)getbsize(&notused, &blocksize);
blocksize /= 512;
rval = 0;
@ -232,57 +234,60 @@ main(int argc, char *argv[])
while ((p = fts_read(fts)) != NULL) {
switch (p->fts_info) {
case FTS_D: /* Ignore. */
if (ignorep(p))
fts_set(fts, p, FTS_SKIP);
case FTS_D: /* Ignore. */
if (ignorep(p))
fts_set(fts, p, FTS_SKIP);
break;
case FTS_DP:
if (ignorep(p))
break;
case FTS_DP:
if (ignorep(p))
break;
p->fts_parent->fts_bignum +=
p->fts_bignum += p->fts_statp->st_blocks;
p->fts_parent->fts_bignum += p->fts_bignum +=
p->fts_statp->st_blocks;
if (p->fts_level <= depth) {
if (hflag) {
(void) prthumanval(howmany(p->fts_bignum, blocksize));
(void) printf("\t%s\n", p->fts_path);
} else {
(void) printf("%jd\t%s\n",
(intmax_t)howmany(p->fts_bignum, blocksize),
p->fts_path);
}
if (p->fts_level <= depth) {
if (hflag) {
prthumanval(howmany(p->fts_bignum,
blocksize));
(void)printf("\t%s\n", p->fts_path);
} else {
(void)printf("%jd\t%s\n",
(intmax_t)howmany(p->fts_bignum,
blocksize), p->fts_path);
}
}
break;
case FTS_DC: /* Ignore. */
break;
case FTS_DNR: /* Warn, continue. */
case FTS_ERR:
case FTS_NS:
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
default:
if (ignorep(p))
break;
case FTS_DC: /* Ignore. */
break;
case FTS_DNR: /* Warn, continue. */
case FTS_ERR:
case FTS_NS:
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
default:
if (ignorep(p))
break;
if (lflag == 0 &&
p->fts_statp->st_nlink > 1 && linkchk(p))
break;
if (lflag == 0 && p->fts_statp->st_nlink > 1 &&
linkchk(p))
break;
if (listall || p->fts_level == 0) {
if (hflag) {
(void) prthumanval(howmany(p->fts_statp->st_blocks,
blocksize));
(void) printf("\t%s\n", p->fts_path);
} else {
(void) printf("%jd\t%s\n",
(intmax_t)howmany(p->fts_statp->st_blocks, blocksize),
p->fts_path);
}
if (listall || p->fts_level == 0) {
if (hflag) {
prthumanval(howmany(
p->fts_statp->st_blocks,
blocksize));
(void)printf("\t%s\n", p->fts_path);
} else {
(void)printf("%jd\t%s\n",
(intmax_t)howmany(
p->fts_statp->st_blocks,
blocksize), p->fts_path);
}
}
p->fts_parent->fts_bignum += p->fts_statp->st_blocks;
p->fts_parent->fts_bignum += p->fts_statp->st_blocks;
}
savednumber = p->fts_parent->fts_bignum;
}
@ -292,10 +297,11 @@ main(int argc, char *argv[])
if (cflag) {
if (hflag) {
(void) prthumanval(howmany(savednumber, blocksize));
(void) printf("\ttotal\n");
prthumanval(howmany(savednumber, blocksize));
(void)printf("\ttotal\n");
} else {
(void) printf("%jd\ttotal\n", (intmax_t)howmany(savednumber, blocksize));
(void)printf("%jd\ttotal\n", (intmax_t)howmany(
savednumber, blocksize));
}
}
@ -348,7 +354,8 @@ linkchk(FTSENT *p)
free_list = le->next;
free(le);
}
new_buckets = malloc(new_size * sizeof(new_buckets[0]));
new_buckets = malloc(new_size *
sizeof(new_buckets[0]));
}
if (new_buckets == NULL) {