diff options
author | mike <mike@FreeBSD.org> | 2002-09-25 04:06:37 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-09-25 04:06:37 +0000 |
commit | 86a758e51be945d9e690ee0802a21bf9a667b4e8 (patch) | |
tree | 2295edf76df9065e84ea0b415c9c13ecf434f1fa /sbin/newfs | |
parent | b9155304da025f935d34f191093267f40e40cdd2 (diff) | |
download | FreeBSD-src-86a758e51be945d9e690ee0802a21bf9a667b4e8.zip FreeBSD-src-86a758e51be945d9e690ee0802a21bf9a667b4e8.tar.gz |
Use the standardized CHAR_BIT constant instead of NBBY in userland.
Diffstat (limited to 'sbin/newfs')
-rw-r--r-- | sbin/newfs/mkfs.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 39575ef..90561ef 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -52,6 +52,7 @@ static const char rcsid[] = #endif /* not lint */ #include <err.h> +#include <limits.h> #include <signal.h> #include <stdlib.h> #include <string.h> @@ -544,8 +545,8 @@ initcg(int cylno, time_t utime) acg.cg_iusedoff = acg.cg_old_boff + sblock.fs_old_cpg * sizeof(u_int16_t); } - acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, NBBY); - acg.cg_nextfreeoff = acg.cg_freeoff + howmany(sblock.fs_fpg, NBBY); + acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, CHAR_BIT); + acg.cg_nextfreeoff = acg.cg_freeoff + howmany(sblock.fs_fpg, CHAR_BIT); if (sblock.fs_contigsumsize > 0) { acg.cg_clustersumoff = roundup(acg.cg_nextfreeoff, sizeof(u_int32_t)); @@ -553,7 +554,7 @@ initcg(int cylno, time_t utime) acg.cg_clusteroff = acg.cg_clustersumoff + (sblock.fs_contigsumsize + 1) * sizeof(u_int32_t); acg.cg_nextfreeoff = acg.cg_clusteroff + - howmany(fragstoblks(&sblock, sblock.fs_fpg), NBBY); + howmany(fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT); } if (acg.cg_nextfreeoff > sblock.fs_cgsize) { printf("Panic: cylinder group too big\n"); @@ -616,7 +617,7 @@ initcg(int cylno, time_t utime) sump[run]++; run = 0; } - if ((i & (NBBY - 1)) != NBBY - 1) + if ((i & (CHAR_BIT - 1)) != CHAR_BIT - 1) bit <<= 1; else { map = *mapp++; @@ -1024,7 +1025,7 @@ ilog2(int val) { u_int n; - for (n = 0; n < sizeof(n) * NBBY; n++) + for (n = 0; n < sizeof(n) * CHAR_BIT; n++) if (1 << n == val) return (n); errx(1, "ilog2: %d is not a power of 2\n", val); |