[PATCH] sbin/quotacheck cleanup

看板DFBSD_submit作者時間20年前 (2005/04/21 17:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
--nCRcqX7cEx7rr7Pe Content-Type: multipart/mixed; boundary="gJgGjUUWrnN4mpen" Content-Disposition: inline --gJgGjUUWrnN4mpen Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Remove register keywords and WARNS6 cleanups. Peter --gJgGjUUWrnN4mpen Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="quotacheck.patch" Content-Transfer-Encoding: quoted-printable Index: quotacheck.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /ftp/pub/DragonFly/dcvs/src/sbin/quotacheck/quotacheck.c,v retrieving revision 1.7 diff -u -r1.7 quotacheck.c --- quotacheck.c 18 Dec 2004 21:43:40 -0000 1.7 +++ quotacheck.c 21 Apr 2005 08:50:56 -0000 @@ -60,9 +60,9 @@ #include <string.h> #include <unistd.h> =20 -char *qfname =3D QUOTAFILENAME; -char *qfextension[] =3D INITQFNAMES; -char *quotagroup =3D QUOTAGROUP; +const char *qfname =3D QUOTAFILENAME; +const char *qfextension[] =3D INITQFNAMES; +const char *quotagroup =3D QUOTAGROUP; =20 union { struct fs sblk; @@ -70,7 +70,7 @@ } un; #define sblock un.sblk long dev_bsize =3D 1; -long maxino; +ino_t maxino; =20 struct quotaname { long flags; @@ -102,8 +102,8 @@ addid(u_long, int, char *); char *blockcheck(char *); void bread(daddr_t, char *, long); -extern int checkfstab(int, int, int (*)(struct fstab *), - int (*)(char *, char *, long, int)); +extern int checkfstab(int, int, void * (*)(struct fstab *), + int (*)(char *, char *, struct quotaname *)); int chkquota(char *, char *, struct quotaname *); void freeinodebuf(void); struct dinode * @@ -121,9 +121,9 @@ int main(int argc, char **argv) { - register struct fstab *fs; - register struct passwd *pw; - register struct group *gr; + struct fstab *fs; + struct passwd *pw; + struct group *gr; struct quotaname *auxdata; int i, argnum, maxrun, errs; long done =3D 0; @@ -202,9 +202,9 @@ } =20 void * -needchk(register struct fstab *fs) +needchk(struct fstab *fs) { - register struct quotaname *qnp; + struct quotaname *qnp; char *qfnp; =20 if (strcmp(fs->fs_vfstype, "ufs") || @@ -231,10 +231,10 @@ * Scan the specified filesystem to check quota(s) present on it. */ int -chkquota(char *fsname, char *mntpt, register struct quotaname *qnp) +chkquota(char *fsname, char *mntpt, struct quotaname *qnp) { - register struct fileusage *fup; - register struct dinode *dp; + struct fileusage *fup; + struct dinode *dp; int cg, i, mode, errs =3D 0; ino_t ino; =20 @@ -296,12 +296,12 @@ * Update a specified quota file. */ int -update(char *fsname, char *quotafile, register int type) +update(char *fsname, char *quotafile, int type) { - register struct fileusage *fup; - register FILE *qfi, *qfo; - register u_long id, lastid; - register off_t offset; + struct fileusage *fup; + FILE *qfi, *qfo; + u_long id, lastid; + off_t offset; struct dqblk dqbuf; static int warned =3D 0; static struct dqblk zerodqbuf; @@ -393,9 +393,9 @@ * Check to see if target appears in list of size cnt. */ int -oneof(register char *target, register char **list, int cnt) +oneof(char *target, char **list, int cnt) { - register int i; + int i; =20 for (i =3D 0; i < cnt; i++) if (strcmp(target, list[i]) =3D=3D 0) @@ -420,9 +420,9 @@ * Check to see if a particular quota is to be enabled. */ int -hasquota(register struct fstab *fs, int type, char **qfnamep) +hasquota(struct fstab *fs, int type, char **qfnamep) { - register char *opt; + char *opt; char *cp; static char initname, usrname[100], grpname[100]; static char buf[BUFSIZ]; @@ -463,7 +463,7 @@ struct fileusage * lookup(u_long id, int type) { - register struct fileusage *fup; + struct fileusage *fup; =20 for (fup =3D fuhead[type][id & (FUHASH-1)]; fup !=3D 0; fup =3D fup->fu_n= ext) if (fup->fu_id =3D=3D id) --gJgGjUUWrnN4mpen-- --nCRcqX7cEx7rr7Pe Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCZ2pmKjaxugguz8URAljFAJ9RaYin8Ho0sWdRAEwhW3PNBzvgEgCfblJd R0sXQWPcL3Z2hk/4SsPOdfo= =sayu -----END PGP SIGNATURE----- --nCRcqX7cEx7rr7Pe--
文章代碼(AID): #12PslO00 (DFBSD_submit)