From 5187e87901f5d9c407cbf7b15fddf156a969ca06 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 9 Nov 1998 09:21:25 +0000 Subject: [PATCH] "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. --- sys/fs/umapfs/umap_subr.c | 21 ++++++++++----------- 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 fc4d5eb4575a..14ecefb90e88 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 @@ -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 fc4d5eb4575a..14ecefb90e88 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 @@ -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;