summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/net/res_init.c5
-rw-r--r--lib/libstand/printf.c3
-rw-r--r--libexec/ftpd/ftpcmd.y16
-rw-r--r--libexec/ftpd/ftpd.c4
-rw-r--r--sbin/dump/dump.h9
-rw-r--r--sbin/dump/dumprmt.c1
-rw-r--r--sbin/dump/itime.c1
-rw-r--r--sbin/dump/main.c7
-rw-r--r--sbin/dump/optr.c1
-rw-r--r--sbin/dump/tape.c1
-rw-r--r--sbin/dump/traverse.c3
-rw-r--r--sbin/fsck_ffs/pass1.c7
-rw-r--r--sbin/fsck_ffs/pass5.c13
-rw-r--r--sbin/fsck_ffs/setup.c3
-rw-r--r--sbin/growfs/debug.c5
-rw-r--r--sbin/growfs/growfs.c9
-rw-r--r--sbin/newfs/mkfs.c11
-rw-r--r--sbin/restore/dirs.c1
-rw-r--r--sbin/restore/interactive.c1
-rw-r--r--sbin/restore/main.c1
-rw-r--r--sbin/restore/restore.c1
-rw-r--r--sbin/restore/restore.h6
-rw-r--r--sbin/restore/symtab.c1
-rw-r--r--sbin/restore/tape.c1
-rw-r--r--sbin/restore/utilities.c1
-rw-r--r--usr.sbin/mountd/mountd.c5
26 files changed, 72 insertions, 45 deletions
diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c
index e855ccb..9bb8452 100644
--- a/lib/libc/net/res_init.c
+++ b/lib/libc/net/res_init.c
@@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <ctype.h>
+#include <limits.h>
#include <resolv.h>
#include <stdio.h>
#include <stdlib.h>
@@ -414,7 +415,7 @@ res_init()
}
/*FALLTHROUGH*/
default:
- m = sizeof(struct in6_addr) * NBBY;
+ m = sizeof(struct in6_addr) * CHAR_BIT;
break;
}
if (m >= 0) {
@@ -422,7 +423,7 @@ res_init()
if (m <= 0) {
*u = 0;
} else {
- m -= NBBY;
+ m -= CHAR_BIT;
*u = (u_char)~0;
if (m < 0)
*u <<= -m;
diff --git a/lib/libstand/printf.c b/lib/libstand/printf.c
index 6afcbfd..5f1bedc 100644
--- a/lib/libstand/printf.c
+++ b/lib/libstand/printf.c
@@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
*/
#include <sys/types.h>
+#include <limits.h>
#include <string.h>
#include "stand.h"
@@ -109,7 +110,7 @@ ksprintn(ul, base, lenp)
u_long ul;
int base, *lenp;
{ /* A long in base 8, plus NULL. */
- static char buf[sizeof(long) * NBBY / 3 + 2];
+ static char buf[sizeof(long) * CHAR_BIT / 3 + 2];
char *p;
p = buf;
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index ec11dcd..22ae19a 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -393,16 +393,16 @@ cmd
break;
case TYPE_L:
-#if NBBY == 8
+#if CHAR_BIT == 8
if (cmd_bytesz == 8) {
reply(200,
"Type set to L (byte size 8).");
type = cmd_type;
} else
reply(504, "Byte size must be 8.");
-#else /* NBBY == 8 */
- UNIMPLEMENTED for NBBY != 8
-#endif /* NBBY == 8 */
+#else /* CHAR_BIT == 8 */
+ UNIMPLEMENTED for CHAR_BIT != 8
+#endif /* CHAR_BIT == 8 */
}
}
}
@@ -692,12 +692,12 @@ cmd
#ifdef unix
#ifdef BSD
reply(215, "UNIX Type: L%d Version: BSD-%d",
- NBBY, BSD);
+ CHAR_BIT, BSD);
#else /* BSD */
- reply(215, "UNIX Type: L%d", NBBY);
+ reply(215, "UNIX Type: L%d", CHAR_BIT);
#endif /* BSD */
#else /* unix */
- reply(215, "UNKNOWN Type: L%d", NBBY);
+ reply(215, "UNKNOWN Type: L%d", CHAR_BIT);
#endif /* unix */
}
@@ -916,7 +916,7 @@ type_code
| L
{
cmd_type = TYPE_L;
- cmd_bytesz = NBBY;
+ cmd_bytesz = CHAR_BIT;
}
| L SP byte_size
{
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 9a22f88..180f0c1 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -2148,8 +2148,8 @@ statcmd(void)
if (type == TYPE_A || type == TYPE_E)
printf(", FORM: %s", formnames[form]);
if (type == TYPE_L)
-#if NBBY == 8
- printf(" %d", NBBY);
+#if CHAR_BIT == 8
+ printf(" %d", CHAR_BIT);
#else
printf(" %d", bytesize); /* need definition! */
#endif
diff --git a/sbin/dump/dump.h b/sbin/dump/dump.h
index e200347..a148c6b 100644
--- a/sbin/dump/dump.h
+++ b/sbin/dump/dump.h
@@ -46,11 +46,14 @@ char *dumpinomap; /* map of files to be dumped */
* Map manipulation macros.
*/
#define SETINO(ino, map) \
- map[(u_int)((ino) - 1) / NBBY] |= 1 << ((u_int)((ino) - 1) % NBBY)
+ map[(u_int)((ino) - 1) / CHAR_BIT] |= \
+ 1 << ((u_int)((ino) - 1) % CHAR_BIT)
#define CLRINO(ino, map) \
- map[(u_int)((ino) - 1) / NBBY] &= ~(1 << ((u_int)((ino) - 1) % NBBY))
+ map[(u_int)((ino) - 1) / CHAR_BIT] &= \
+ ~(1 << ((u_int)((ino) - 1) % CHAR_BIT))
#define TSTINO(ino, map) \
- (map[(u_int)((ino) - 1) / NBBY] & (1 << ((u_int)((ino) - 1) % NBBY)))
+ (map[(u_int)((ino) - 1) / CHAR_BIT] & \
+ (1 << ((u_int)((ino) - 1) % CHAR_BIT)))
/*
* All calculations done in 0.1" units!
diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c
index 11531fb..1e37d06 100644
--- a/sbin/dump/dumprmt.c
+++ b/sbin/dump/dumprmt.c
@@ -57,6 +57,7 @@ static const char rcsid[] =
#include <netdb.h>
#include <pwd.h>
#include <stdio.h>
+#include <limits.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c
index dd273ea..55af65c 100644
--- a/sbin/dump/itime.c
+++ b/sbin/dump/itime.c
@@ -49,6 +49,7 @@ static const char rcsid[] =
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index cc4f80d..de6ecf7 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -60,6 +60,7 @@ static const char rcsid[] =
#include <fcntl.h>
#include <fstab.h>
#include <inttypes.h>
+#include <limits.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -365,7 +366,7 @@ main(int argc, char *argv[])
if (TP_BSIZE != (1 << tp_bshift))
quit("TP_BSIZE (%d) is not a power of 2", TP_BSIZE);
maxino = sblock->fs_ipg * sblock->fs_ncg;
- mapsize = roundup(howmany(maxino, NBBY), TP_BSIZE);
+ mapsize = roundup(howmany(maxino, CHAR_BIT), TP_BSIZE);
usedinomap = (char *)calloc((unsigned) mapsize, sizeof(char));
dumpdirmap = (char *)calloc((unsigned) mapsize, sizeof(char));
dumpinomap = (char *)calloc((unsigned) mapsize, sizeof(char));
@@ -454,7 +455,7 @@ main(int argc, char *argv[])
msg("dumping (Pass III) [directories]\n");
dirty = 0; /* XXX just to get gcc to shut up */
for (map = dumpdirmap, ino = 1; ino < maxino; ino++) {
- if (((ino - 1) % NBBY) == 0) /* map is offset by 1 */
+ if (((ino - 1) % CHAR_BIT) == 0) /* map is offset by 1 */
dirty = *map++;
else
dirty >>= 1;
@@ -473,7 +474,7 @@ main(int argc, char *argv[])
setproctitle("%s: pass 4: regular files", disk);
msg("dumping (Pass IV) [regular files]\n");
for (map = dumpinomap, ino = 1; ino < maxino; ino++) {
- if (((ino - 1) % NBBY) == 0) /* map is offset by 1 */
+ if (((ino - 1) % CHAR_BIT) == 0) /* map is offset by 1 */
dirty = *map++;
else
dirty >>= 1;
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index a28d522..09333c8 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -49,6 +49,7 @@ static const char rcsid[] =
#include <errno.h>
#include <fstab.h>
#include <grp.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c
index 4a3b810..00bb5c3 100644
--- a/sbin/dump/tape.c
+++ b/sbin/dump/tape.c
@@ -52,6 +52,7 @@ static const char rcsid[] =
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 9baec88..612f970 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -51,6 +51,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -203,7 +204,7 @@ mapdirs(ino_t maxino, long *tapesize)
isdir = 0; /* XXX just to get gcc to shut up */
for (map = dumpdirmap, ino = 1; ino < maxino; ino++) {
- if (((ino - 1) % NBBY) == 0) /* map is offset by 1 */
+ if (((ino - 1) % CHAR_BIT) == 0) /* map is offset by 1 */
isdir = *map++;
else
isdir >>= 1;
diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c
index 87cc464..5a18abd 100644
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
@@ -48,6 +48,7 @@ static const char rcsid[] =
#include <ufs/ffs/fs.h>
#include <err.h>
+#include <limits.h>
#include <stdint.h>
#include <string.h>
@@ -116,11 +117,11 @@ pass1(void)
if (preen && usedsoftdep) {
if (!cg_chkmagic(&cgrp))
pfatal("CG %d: BAD MAGIC NUMBER\n", c);
- cp = &cg_inosused(&cgrp)[(inosused - 1) / NBBY];
- for ( ; inosused > 0; inosused -= NBBY, cp--) {
+ cp = &cg_inosused(&cgrp)[(inosused - 1) / CHAR_BIT];
+ for ( ; inosused > 0; inosused -= CHAR_BIT, cp--) {
if (*cp == 0)
continue;
- for (i = 1 << (NBBY - 1); i > 0; i >>= 1) {
+ for (i = 1 << (CHAR_BIT - 1); i > 0; i >>= 1) {
if (*cp & i)
break;
inosused--;
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 6685e39..c3f6c3d 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
#include <ufs/ffs/fs.h>
#include <err.h>
+#include <limits.h>
#include <string.h>
#include "fsck.h"
@@ -127,9 +128,9 @@ pass5(void)
fs->fs_old_cpg * fs->fs_old_nrpos * sizeof(u_int16_t);
memset(&newcg->cg_space[0], 0, newcg->cg_iusedoff - basesize);
}
- inomapsize = howmany(fs->fs_ipg, NBBY);
+ inomapsize = howmany(fs->fs_ipg, CHAR_BIT);
newcg->cg_freeoff = newcg->cg_iusedoff + inomapsize;
- blkmapsize = howmany(fs->fs_fpg, NBBY);
+ blkmapsize = howmany(fs->fs_fpg, CHAR_BIT);
newcg->cg_nextfreeoff = newcg->cg_freeoff + blkmapsize;
if (fs->fs_contigsumsize > 0) {
newcg->cg_clustersumoff = newcg->cg_nextfreeoff -
@@ -139,7 +140,7 @@ pass5(void)
newcg->cg_clusteroff = newcg->cg_clustersumoff +
(fs->fs_contigsumsize + 1) * sizeof(u_int32_t);
newcg->cg_nextfreeoff = newcg->cg_clusteroff +
- howmany(fragstoblks(fs, fs->fs_fpg), NBBY);
+ howmany(fragstoblks(fs, fs->fs_fpg), CHAR_BIT);
}
newcg->cg_magic = CG_MAGIC;
mapsize = newcg->cg_nextfreeoff - newcg->cg_iusedoff;
@@ -273,7 +274,7 @@ pass5(void)
sump[run]++;
run = 0;
}
- if ((i & (NBBY - 1)) != (NBBY - 1)) {
+ if ((i & (CHAR_BIT - 1)) != (CHAR_BIT - 1)) {
bit <<= 1;
} else {
map = *mapp++;
@@ -370,10 +371,10 @@ check_maps(
k = *map2++;
if (j == k)
continue;
- for (m = 0, l = 1; m < NBBY; m++, l <<= 1) {
+ for (m = 0, l = 1; m < CHAR_BIT; m++, l <<= 1) {
if ((j & l) == (k & l))
continue;
- n = startvalue + i * NBBY + m;
+ n = startvalue + i * CHAR_BIT + m;
if ((j & l) != 0) {
if (astart == -1) {
astart = aend = n;
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c
index 5bfae4d..db3fc3f 100644
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
@@ -52,6 +52,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <limits.h>
#include <stdint.h>
#include <string.h>
@@ -243,7 +244,7 @@ setup(char *dev)
/*
* allocate and initialize the necessary maps
*/
- bmapsize = roundup(howmany(maxfsblock, NBBY), sizeof(short));
+ bmapsize = roundup(howmany(maxfsblock, CHAR_BIT), sizeof(short));
blockmap = calloc((unsigned)bmapsize, sizeof (char));
if (blockmap == NULL) {
printf("cannot alloc %u bytes for blockmap\n",
diff --git a/sbin/growfs/debug.c b/sbin/growfs/debug.c
index 3fe263f..5b62bdd 100644
--- a/sbin/growfs/debug.c
+++ b/sbin/growfs/debug.c
@@ -47,6 +47,7 @@ static const char rcsid[] =
/* ********************************************************** INCLUDES ***** */
#include <sys/param.h>
+#include <limits.h>
#include <stdio.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
@@ -456,7 +457,7 @@ dbg_dump_frmap(struct fs *sb, const char *comment, struct cg *cgr)
indent++;
cp=(unsigned char *)cg_blksfree(cgr);
- e=howmany((sb->fs_cpg * sb->fs_spc / NSPF(sb)), NBBY);
+ e=howmany((sb->fs_cpg * sb->fs_spc / NSPF(sb)), CHAR_BIT);
for(j=0; j<e; j+=32) {
fprintf(dbg_log, "%08x: ", j);
for(k=0; k<32; k+=8) {
@@ -500,7 +501,7 @@ dbg_dump_clmap(struct fs *sb, const char *comment, struct cg *cgr)
indent++;
cp=(unsigned char *)cg_clustersfree(cgr);
- e=howmany(sb->fs_cpg * sb->fs_spc / NSPB(sb), NBBY);
+ e=howmany(sb->fs_cpg * sb->fs_spc / NSPB(sb), CHAR_BIT);
for(j=0; j<e; j+=32) {
fprintf(dbg_log, "%08x: ", j);
for(k=0; k<32; k+=8) {
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index 2db3430..368fa99 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -62,6 +62,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -410,8 +411,8 @@ initcg(int cylno, time_t utime, int fso, unsigned int Nflag)
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));
@@ -419,7 +420,7 @@ initcg(int cylno, time_t utime, int fso, unsigned int Nflag)
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) {
/*
@@ -504,7 +505,7 @@ initcg(int cylno, time_t utime, int fso, unsigned int Nflag)
sump[run]++;
run = 0;
}
- if ((i & (NBBY - 1)) != NBBY - 1)
+ if ((i & (CHAR_BIT - 1)) != CHAR_BIT - 1)
bit <<= 1;
else {
map = *mapp++;
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);
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index dba5738..313b87b 100644
--- a/sbin/restore/dirs.c
+++ b/sbin/restore/dirs.c
@@ -55,6 +55,7 @@ static const char rcsid[] =
#include <err.h>
#include <errno.h>
+#include <limits.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c
index 5bfe821..ec49c36 100644
--- a/sbin/restore/interactive.c
+++ b/sbin/restore/interactive.c
@@ -48,6 +48,7 @@ static const char rcsid[] =
#include <setjmp.h>
#include <glob.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sbin/restore/main.c b/sbin/restore/main.c
index 2d316c0..e612436 100644
--- a/sbin/restore/main.c
+++ b/sbin/restore/main.c
@@ -52,6 +52,7 @@ static const char rcsid[] =
#include <protocols/dumprestore.h>
#include <err.h>
+#include <limits.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c
index 8b463a7..a9eb31e 100644
--- a/sbin/restore/restore.c
+++ b/sbin/restore/restore.c
@@ -41,6 +41,7 @@ static const char rcsid[] =
#include <sys/types.h>
+#include <limits.h>
#include <stdio.h>
#include <string.h>
diff --git a/sbin/restore/restore.h b/sbin/restore/restore.h
index 8d7206d..d00c3b3 100644
--- a/sbin/restore/restore.h
+++ b/sbin/restore/restore.h
@@ -139,9 +139,11 @@ typedef struct rstdirdesc RST_DIR;
* Useful macros
*/
#define TSTINO(ino, map) \
- (map[(u_int)((ino) - 1) / NBBY] & (1 << ((u_int)((ino) - 1) % NBBY)))
+ (map[(u_int)((ino) - 1) / CHAR_BIT] & \
+ (1 << ((u_int)((ino) - 1) % CHAR_BIT)))
#define SETINO(ino, map) \
- map[(u_int)((ino) - 1) / NBBY] |= 1 << ((u_int)((ino) - 1) % NBBY)
+ map[(u_int)((ino) - 1) / CHAR_BIT] |= \
+ 1 << ((u_int)((ino) - 1) % CHAR_BIT)
#define dprintf if (dflag) fprintf
#define vprintf if (vflag) fprintf
diff --git a/sbin/restore/symtab.c b/sbin/restore/symtab.c
index 3dd55f8..ffda3fc 100644
--- a/sbin/restore/symtab.c
+++ b/sbin/restore/symtab.c
@@ -55,6 +55,7 @@ static const char rcsid[] =
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 1392f59..70ff44a 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -54,6 +54,7 @@ static const char rcsid[] =
#include <protocols/dumprestore.h>
#include <errno.h>
+#include <limits.h>
#include <paths.h>
#include <setjmp.h>
#include <stdio.h>
diff --git a/sbin/restore/utilities.c b/sbin/restore/utilities.c
index 3901ad3..e42465d 100644
--- a/sbin/restore/utilities.c
+++ b/sbin/restore/utilities.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
#include <ufs/ufs/dir.h>
#include <errno.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 49d5454..e3868b9 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -75,6 +75,7 @@ static const char rcsid[] =
#include <err.h>
#include <errno.h>
#include <grp.h>
+#include <limits.h>
#include <netdb.h>
#include <pwd.h>
#include <signal.h>
@@ -2362,11 +2363,11 @@ makemask(struct sockaddr_storage *ssp, int bitlen)
if ((p = sa_rawaddr((struct sockaddr *)ssp, &len)) == NULL)
return (-1);
- if (bitlen > len * NBBY)
+ if (bitlen > len * CHAR_BIT)
return (-1);
for (i = 0; i < len; i++) {
- bits = (bitlen > NBBY) ? NBBY : bitlen;
+ bits = (bitlen > CHAR_BIT) ? CHAR_BIT : bitlen;
*p++ = (1 << bits) - 1;
bitlen -= bits;
}
OpenPOWER on IntegriCloud