diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index 164d11785a9b..1a0222184f4a 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1498,7 +1498,7 @@ cd9660_free_structure(cd9660node *root) * instead of having the TAILQ_ENTRY as part of the cd9660node, * just create a temporary structure */ -struct ptq_entry +static struct ptq_entry { TAILQ_ENTRY(ptq_entry) ptq; cd9660node *node; diff --git a/usr.sbin/makefs/ffs/buf.c b/usr.sbin/makefs/ffs/buf.c index 325d59b4a337..7b08d537d4b9 100644 --- a/usr.sbin/makefs/ffs/buf.c +++ b/usr.sbin/makefs/ffs/buf.c @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include "makefs.h" #include "buf.h" -TAILQ_HEAD(buftailhead,buf) buftail; +static TAILQ_HEAD(buftailhead,buf) buftail; int bread(struct vnode *vp, daddr_t blkno, int size, struct ucred *u1 __unused, diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c index 905a89d76ffb..931007fb4f06 100644 --- a/usr.sbin/makefs/ffs/mkfs.c +++ b/usr.sbin/makefs/ffs/mkfs.c @@ -67,7 +67,7 @@ __FBSDID("$FreeBSD$"); #define BBSIZE 8192 /* size of boot area, with label */ #endif -static void initcg(int, time_t, const fsinfo_t *); +static void initcg(uint32_t, time_t, const fsinfo_t *); static int ilog2(int); static int count_digits(int); @@ -78,23 +78,22 @@ static int count_digits(int); #define UMASK 0755 #define POWEROF2(num) (((num) & ((num) - 1)) == 0) -union { +static union { struct fs fs; char pad[SBLOCKSIZE]; } fsun; #define sblock fsun.fs -struct csum *fscs; -union { +static union { struct cg cg; char pad[FFS_MAXBSIZE]; } cgun; #define acg cgun.cg -char *iobuf; -int iobufsize; +static char *iobuf; +static int iobufsize; -char writebuf[FFS_MAXBSIZE]; +static char writebuf[FFS_MAXBSIZE]; static int Oflag; /* format as an 4.3BSD file system */ static int64_t fssize; /* file system size */ @@ -117,7 +116,8 @@ struct fs * ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) { int fragsperinode, optimalfpg, origdensity, minfpg, lastminfpg; - int32_t cylno, i, csfrags; + int32_t csfrags; + uint32_t i, cylno; long long sizepb; void *space; int size; @@ -537,7 +537,8 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp) void ffs_write_superblock(struct fs *fs, const fsinfo_t *fsopts) { - int cylno, size, blks, i, saveflag; + int size, blks, i, saveflag; + uint32_t cylno; void *space; char *wrbuf; @@ -579,10 +580,11 @@ ffs_write_superblock(struct fs *fs, const fsinfo_t *fsopts) * Initialize a cylinder group. */ static void -initcg(int cylno, time_t utime, const fsinfo_t *fsopts) +initcg(uint32_t cylno, time_t utime, const fsinfo_t *fsopts) { daddr_t cbase, dmax; - int32_t i, j, d, dlower, dupper, blkno; + int32_t blkno; + uint32_t i, j, d, dlower, dupper; struct ufs1_dinode *dp1; struct ufs2_dinode *dp2; int start; @@ -643,7 +645,7 @@ initcg(int cylno, time_t utime, const fsinfo_t *fsopts) acg.cg_nextfreeoff = acg.cg_clusteroff + howmany(fragstoblks(&sblock, sblock.fs_fpg), CHAR_BIT); } - if (acg.cg_nextfreeoff > sblock.fs_cgsize) { + if (acg.cg_nextfreeoff > (uint32_t)sblock.fs_cgsize) { printf("Panic: cylinder group too big\n"); exit(37); } diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c index 3c53c2ba1dd8..5e8268e04411 100644 --- a/usr.sbin/makefs/makefs.c +++ b/usr.sbin/makefs/makefs.c @@ -95,8 +95,8 @@ main(int argc, char *argv[]) fsinfo_t fsoptions; fsnode *root; int ch, i, len; - char *subtree; - char *specfile; + const char *subtree; + const char *specfile; setprogname(argv[0]);