summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-03-19 17:20:02 +0000
committeriedowse <iedowse@FreeBSD.org>2002-03-19 17:20:02 +0000
commitce097e5509c17c3c87f878d82f08c9d54857fbe4 (patch)
tree658d80c60878e975c461b0b1f1413344f60875ec
parent7204dd55d6b506ad5f1def6e39d80b2057f33ef0 (diff)
downloadFreeBSD-src-ce097e5509c17c3c87f878d82f08c9d54857fbe4.zip
FreeBSD-src-ce097e5509c17c3c87f878d82f08c9d54857fbe4.tar.gz
Complete the ANSIfication of newfs by converting function declarations
to C89 style.
-rw-r--r--sbin/newfs/mkfs.c57
-rw-r--r--sbin/newfs/newfs.c34
2 files changed, 17 insertions, 74 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index 9bced71..0d702c4 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -140,10 +140,7 @@ void wtfs (daddr_t, int, char *);
void wtfsflush (void);
void
-mkfs(pp, fsys, fi, fo)
- struct partition *pp;
- char *fsys;
- int fi, fo;
+mkfs(struct partition *pp, char *fsys, int fi, int fo)
{
long i, mincpc, mincpg, inospercg;
long cylno, rpos, blk, j, warn = 0;
@@ -666,9 +663,7 @@ next:
* Initialize a cylinder group.
*/
void
-initcg(cylno, utime)
- int cylno;
- time_t utime;
+initcg(int cylno, time_t utime)
{
daddr_t cbase, d, dlower, dupper, dmax, blkno;
struct csum *cs;
@@ -863,8 +858,7 @@ struct odirect olost_found_dir[] = {
char buf[MAXBSIZE];
void
-fsinit(utime)
- time_t utime;
+fsinit(time_t utime)
{
#ifdef LOSTDIR
int i;
@@ -919,9 +913,7 @@ fsinit(utime)
* return size of directory.
*/
int
-makedir(protodir, entries)
- struct direct *protodir;
- int entries;
+makedir(struct direct *protodir, int entries)
{
char *cp;
int i, spcleft;
@@ -942,9 +934,7 @@ makedir(protodir, entries)
* allocate a block or frag
*/
daddr_t
-alloc(size, mode)
- int size;
- int mode;
+alloc(int size, int mode)
{
int i, frag;
daddr_t d, blkno;
@@ -997,10 +987,7 @@ goth:
* Calculate number of inodes per group.
*/
long
-calcipg(cpg, bpcg, usedbp)
- long cpg;
- long bpcg;
- off_t *usedbp;
+calcipg(long cpg, long bpcg, off_t *usedbp)
{
int i;
long ipg, new_ipg, ncg, ncyl;
@@ -1034,9 +1021,7 @@ calcipg(cpg, bpcg, usedbp)
* Allocate an inode on the disk
*/
void
-iput(ip, ino)
- struct dinode *ip;
- ino_t ino;
+iput(struct dinode *ip, ino_t ino)
{
struct dinode buf[MAXINOPB];
daddr_t d;
@@ -1070,10 +1055,7 @@ iput(ip, ino)
* read a block from the file system
*/
void
-rdfs(bno, size, bf)
- daddr_t bno;
- int size;
- char *bf;
+rdfs(daddr_t bno, int size, char *bf)
{
int n;
@@ -1119,13 +1101,9 @@ wtfsflush()
* write a block to the file system
*/
void
-wtfs(bno, size, bf)
- daddr_t bno;
- int size;
- char *bf;
+wtfs(daddr_t bno, int size, char *bf)
{
- int n;
- int done;
+ int done, n;
if (Nflag)
return;
@@ -1164,10 +1142,7 @@ wtfs(bno, size, bf)
* check if a block is available
*/
int
-isblock(fs, cp, h)
- struct fs *fs;
- unsigned char *cp;
- int h;
+isblock(struct fs *fs, unsigned char *cp, int h)
{
unsigned char mask;
@@ -1193,10 +1168,7 @@ isblock(fs, cp, h)
* take a block out of the map
*/
void
-clrblock(fs, cp, h)
- struct fs *fs;
- unsigned char *cp;
- int h;
+clrblock(struct fs *fs, unsigned char *cp, int h)
{
switch ((fs)->fs_frag) {
case 8:
@@ -1221,10 +1193,7 @@ clrblock(fs, cp, h)
* put a block into the map
*/
void
-setblock(fs, cp, h)
- struct fs *fs;
- unsigned char *cp;
- int h;
+setblock(struct fs *fs, unsigned char *cp, int h)
{
switch (fs->fs_frag) {
case 8:
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index 02f8f96..7aee58d 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -69,17 +69,9 @@ static const char rcsid[] =
#include <syslog.h>
#include <unistd.h>
-#if __STDC__
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#if __STDC__
void fatal(const char *fmt, ...) __printflike(1, 2);
-#else
-void fatal();
-#endif
#define COMPAT /* allow non-labeled disks */
@@ -198,19 +190,16 @@ static void rewritelabel (char *s, int fd, register struct disklabel *lp);
static void usage (void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
- int ch;
struct partition *pp;
struct disklabel *lp;
struct disklabel *getdisklabel();
struct partition oldpartition;
struct stat st;
struct statfs *mp;
- int fsi, fso, len, n, vflag;
char *cp, *s1, *s2, *special, *opstring;
+ int ch, fsi, fso, len, n, vflag;
vflag = 0;
if ((progname = strrchr(*argv, '/')))
@@ -536,9 +525,7 @@ const char lmsg[] = "%s: can't read disk label";
#endif
struct disklabel *
-getdisklabel(s, fd)
- char *s;
- int fd;
+getdisklabel(char *s, int fd)
{
static struct disklabel lab;
@@ -561,10 +548,7 @@ getdisklabel(s, fd)
}
void
-rewritelabel(s, fd, lp)
- char *s;
- int fd;
- struct disklabel *lp;
+rewritelabel(char *s, int fd, struct disklabel *lp)
{
#ifdef COMPAT
if (unlabeled)
@@ -580,21 +564,11 @@ rewritelabel(s, fd, lp)
/*VARARGS*/
void
-#if __STDC__
fatal(const char *fmt, ...)
-#else
-fatal(fmt, va_alist)
- char *fmt;
- va_dcl
-#endif
{
va_list ap;
-#if __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
if (fcntl(STDERR_FILENO, F_GETFL) < 0) {
openlog(progname, LOG_CONS, LOG_DAEMON);
vsyslog(LOG_ERR, fmt, ap);
OpenPOWER on IntegriCloud