mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 10:42:45 +00:00
"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.
This commit is contained in:
parent
96fca41fcf
commit
5187e87901
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=41031
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user