summaryrefslogtreecommitdiffstats
path: root/sbin/dump
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2002-09-25 04:06:37 +0000
committermike <mike@FreeBSD.org>2002-09-25 04:06:37 +0000
commit86a758e51be945d9e690ee0802a21bf9a667b4e8 (patch)
tree2295edf76df9065e84ea0b415c9c13ecf434f1fa /sbin/dump
parentb9155304da025f935d34f191093267f40e40cdd2 (diff)
downloadFreeBSD-src-86a758e51be945d9e690ee0802a21bf9a667b4e8.zip
FreeBSD-src-86a758e51be945d9e690ee0802a21bf9a667b4e8.tar.gz
Use the standardized CHAR_BIT constant instead of NBBY in userland.
Diffstat (limited to 'sbin/dump')
-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
7 files changed, 16 insertions, 7 deletions
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;
OpenPOWER on IntegriCloud