diff options
author | peter <peter@FreeBSD.org> | 1998-11-09 09:21:25 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1998-11-09 09:21:25 +0000 |
commit | c30cd27fafd573e1fda4a6c5323b85679037eca4 (patch) | |
tree | 06ae90bbf5ca3c6fd5f1fb7b95a6173e8b90362d /sys | |
parent | 23c0eb258d846823c8add99017f7aa812f6e9b35 (diff) | |
download | FreeBSD-src-c30cd27fafd573e1fda4a6c5323b85679037eca4.zip FreeBSD-src-c30cd27fafd573e1fda4a6c5323b85679037eca4.tar.gz |
"fix" a warning that has been bugging me for ages. Eliminate a couple
of temporary variables since they are only used once and their types
were the cause of the warnings.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/umapfs/umap_subr.c | 21 | ||||
-rw-r--r-- | sys/miscfs/umapfs/umap_subr.c | 21 |
2 files changed, 20 insertions, 22 deletions
diff --git a/sys/fs/umapfs/umap_subr.c b/sys/fs/umapfs/umap_subr.c index fc4d5eb..14ecefb 100644 --- a/sys/fs/umapfs/umap_subr.c +++ b/sys/fs/umapfs/umap_subr.c @@ -35,7 +35,7 @@ * * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95 * - * $Id: umap_subr.c,v 1.13 1998/02/09 06:09:48 eivind Exp $ + * $Id: umap_subr.c,v 1.14 1998/08/16 01:21:51 bde Exp $ */ #include <sys/param.h> @@ -352,22 +352,18 @@ umap_mapids(v_mount, credp) struct mount *v_mount; struct ucred *credp; { - int i, unentries, gnentries; - u_long *groupmap, *usermap; + int i; uid_t uid; gid_t gid; if (credp == NOCRED) return; - unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries; - usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]); - gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries; - groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]); - /* Find uid entry in map */ - uid = (uid_t) umap_findid(credp->cr_uid, usermap, unentries); + uid = (uid_t) umap_findid(credp->cr_uid, + MOUNTTOUMAPMOUNT(v_mount)->info_mapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_nentries); if (uid != -1) credp->cr_uid = uid; @@ -379,7 +375,9 @@ umap_mapids(v_mount, credp) /* Find gid entry in map */ - gid = (gid_t) umap_findid(credp->cr_gid, groupmap, gnentries); + gid = (gid_t) umap_findid(credp->cr_gid, + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_gid = gid; @@ -393,7 +391,8 @@ umap_mapids(v_mount, credp) i = 0; while (credp->cr_groups[i] != 0) { gid = (gid_t) umap_findid(credp->cr_groups[i], - groupmap, gnentries); + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_groups[i++] = gid; diff --git a/sys/miscfs/umapfs/umap_subr.c b/sys/miscfs/umapfs/umap_subr.c index fc4d5eb..14ecefb 100644 --- a/sys/miscfs/umapfs/umap_subr.c +++ b/sys/miscfs/umapfs/umap_subr.c @@ -35,7 +35,7 @@ * * @(#)umap_subr.c 8.9 (Berkeley) 5/14/95 * - * $Id: umap_subr.c,v 1.13 1998/02/09 06:09:48 eivind Exp $ + * $Id: umap_subr.c,v 1.14 1998/08/16 01:21:51 bde Exp $ */ #include <sys/param.h> @@ -352,22 +352,18 @@ umap_mapids(v_mount, credp) struct mount *v_mount; struct ucred *credp; { - int i, unentries, gnentries; - u_long *groupmap, *usermap; + int i; uid_t uid; gid_t gid; if (credp == NOCRED) return; - unentries = MOUNTTOUMAPMOUNT(v_mount)->info_nentries; - usermap = &(MOUNTTOUMAPMOUNT(v_mount)->info_mapdata[0][0]); - gnentries = MOUNTTOUMAPMOUNT(v_mount)->info_gnentries; - groupmap = &(MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata[0][0]); - /* Find uid entry in map */ - uid = (uid_t) umap_findid(credp->cr_uid, usermap, unentries); + uid = (uid_t) umap_findid(credp->cr_uid, + MOUNTTOUMAPMOUNT(v_mount)->info_mapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_nentries); if (uid != -1) credp->cr_uid = uid; @@ -379,7 +375,9 @@ umap_mapids(v_mount, credp) /* Find gid entry in map */ - gid = (gid_t) umap_findid(credp->cr_gid, groupmap, gnentries); + gid = (gid_t) umap_findid(credp->cr_gid, + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_gid = gid; @@ -393,7 +391,8 @@ umap_mapids(v_mount, credp) i = 0; while (credp->cr_groups[i] != 0) { gid = (gid_t) umap_findid(credp->cr_groups[i], - groupmap, gnentries); + MOUNTTOUMAPMOUNT(v_mount)->info_gmapdata, + MOUNTTOUMAPMOUNT(v_mount)->info_gnentries); if (gid != -1) credp->cr_groups[i++] = gid; |