Module Name: src
Committed By: lukem
Date: Sat Apr 18 13:02:36 UTC 2009
Modified Files:
src/usr.sbin/rpc.pcnfsd: extern.h pcnfsd.x pcnfsd_print.c pcnfsd_v2.c
Log Message:
Fix -Wshadow and -Wcast-qual issues
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/rpc.pcnfsd/extern.h
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/rpc.pcnfsd/pcnfsd.x
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/rpc.pcnfsd/pcnfsd_v2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/rpc.pcnfsd/extern.h
diff -u src/usr.sbin/rpc.pcnfsd/extern.h:1.1 src/usr.sbin/rpc.pcnfsd/extern.h:1.2
--- src/usr.sbin/rpc.pcnfsd/extern.h:1.1 Sat Oct 25 13:45:55 1997
+++ src/usr.sbin/rpc.pcnfsd/extern.h Sat Apr 18 13:02:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.1 1997/10/25 13:45:55 lukem Exp $ */
+/* $NetBSD: extern.h,v 1.2 2009/04/18 13:02:36 lukem Exp $ */
extern int interrupted;
extern pr_list printers;
@@ -13,7 +13,7 @@
void free_mapreq_results __P((mapreq_res));
void fillin_extra_groups __P((char *, u_int, int *, u_int[]));
#ifdef USE_YP
-char *find_entry __P((char *, char *));
+char *find_entry __P((const char *, const char *));
#endif
void free_pr_list_item __P((pr_list));
void free_pr_queue_item __P((pr_queue));
Index: src/usr.sbin/rpc.pcnfsd/pcnfsd.x
diff -u src/usr.sbin/rpc.pcnfsd/pcnfsd.x:1.5 src/usr.sbin/rpc.pcnfsd/pcnfsd.x:1.6
--- src/usr.sbin/rpc.pcnfsd/pcnfsd.x:1.5 Tue Sep 30 06:25:22 2008
+++ src/usr.sbin/rpc.pcnfsd/pcnfsd.x Sat Apr 18 13:02:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pcnfsd.x,v 1.5 2008/09/30 06:25:22 dholland Exp $ */
+/* $NetBSD: pcnfsd.x,v 1.6 2009/04/18 13:02:36 lukem Exp $ */
/* The maximum number of bytes in a user name argument */
const IDENTLEN = 32;
@@ -631,10 +631,10 @@
*/
%#if RPC_SVC
% static void _msgout __P((const char *));
-% void msg_out(msg) char *msg; {_msgout(msg);}
+% void msg_out(msg) const char *msg; {_msgout(msg);}
%#endif
%#if RPC_HDR
-% extern void msg_out __P((char *));
+% extern void msg_out __P((const char *));
%#endif
/*
Index: src/usr.sbin/rpc.pcnfsd/pcnfsd_print.c
diff -u src/usr.sbin/rpc.pcnfsd/pcnfsd_print.c:1.8 src/usr.sbin/rpc.pcnfsd/pcnfsd_print.c:1.9
--- src/usr.sbin/rpc.pcnfsd/pcnfsd_print.c:1.8 Sat Oct 30 15:28:45 2004
+++ src/usr.sbin/rpc.pcnfsd/pcnfsd_print.c Sat Apr 18 13:02:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pcnfsd_print.c,v 1.8 2004/10/30 15:28:45 dsl Exp $ */
+/* $NetBSD: pcnfsd_print.c,v 1.9 2009/04/18 13:02:36 lukem Exp $ */
/* RE_SID: @(%)/usr/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.pcnfsd_print.c 1.7 92/01/24 19:58:58 SMI */
/*
@@ -78,7 +78,7 @@
char *expand_alias __P((char *, char *, char *, char *));
pr_list list_virtual_printers __P((void));
char *map_printer_name __P((char *));
-void substitute __P((char *, char *, char *));
+void substitute __P((char *, const char *, const char *));
int suspicious __P((char *));
int valid_pr __P((char *));
@@ -208,8 +208,8 @@
return (PI_RES_OK);
}
psrstat
-pr_start2(system, pr, user, fname, opts, id)
- char *system;
+pr_start2(sys, pr, user, fname, opts, id)
+ char *sys;
char *pr;
char *user;
char *fname;
@@ -230,14 +230,14 @@
#endif
- if (suspicious(system) ||
+ if (suspicious(sys) ||
suspicious(pr) ||
suspicious(user) ||
suspicious(fname))
return (PS_RES_FAIL);
(void) snprintf(pathname, sizeof(pathname), "%s/%s/%s", sp_name,
- system,
+ sys,
fname);
*id = &req_id[0];
@@ -336,7 +336,7 @@
/*
** Try to match to an aliased printer
*/
- xcmd = expand_alias(pr, new_pathname, user, system);
+ xcmd = expand_alias(pr, new_pathname, user, sys);
if (!xcmd) {
#ifdef SVR4
/*
@@ -985,7 +985,7 @@
char *cp1;
char *cp2;
int n;
- pirstat stat = PI_RES_NO_SUCH_PRINTER;
+ pirstat pstat = PI_RES_NO_SUCH_PRINTER;
/* assume the worst */
*avail = FALSE;
@@ -1014,7 +1014,7 @@
** We have a match. The only failure now is PI_RES_FAIL if
** lpstat output cannot be decoded
*/
- stat = PI_RES_FAIL;
+ pstat = PI_RES_FAIL;
/*
** The next four lines are usually if the form
**
@@ -1060,11 +1060,11 @@
if (*needs_operator || strstr(buff2, "waiting") != NULL)
strlcpy(status, cp, sizeof(status));
}
- stat = PI_RES_OK;
+ pstat = PI_RES_OK;
break;
}
(void) pclose(p);
- return (stat);
+ return (pstat);
}
#endif /* SVR4 */
@@ -1161,7 +1161,7 @@
char resbuf[256];
FILE *fd;
int i;
- pcrstat stat = PC_RES_NO_SUCH_JOB;
+ pcrstat pstat = PC_RES_NO_SUCH_JOB;
pr = map_printer_name(pr);
if (pr == NULL || suspicious(pr))
@@ -1179,15 +1179,15 @@
if (i)
resbuf[i - 1] = '\0'; /* trim NL */
if (strstr(resbuf, "dequeued") != NULL)
- stat = PC_RES_OK;
+ pstat = PC_RES_OK;
if (strstr(resbuf, "unknown printer") != NULL)
- stat = PC_RES_NO_SUCH_PRINTER;
+ pstat = PC_RES_NO_SUCH_PRINTER;
if (strstr(resbuf, "Permission denied") != NULL)
- stat = PC_RES_NOT_OWNER;
+ pstat = PC_RES_NOT_OWNER;
}
if (su_pclose(fd) == 255)
msg_out("rpc.pcnfsd: su_pclose alert");
- return (stat);
+ return (pstat);
}
#endif /* SVR4 */
@@ -1317,8 +1317,8 @@
void
substitute(string, token, data)
char *string;
- char *token;
- char *data;
+ const char *token;
+ const char *data;
{
char temp[512];
char *c;
Index: src/usr.sbin/rpc.pcnfsd/pcnfsd_v2.c
diff -u src/usr.sbin/rpc.pcnfsd/pcnfsd_v2.c:1.9 src/usr.sbin/rpc.pcnfsd/pcnfsd_v2.c:1.10
--- src/usr.sbin/rpc.pcnfsd/pcnfsd_v2.c:1.9 Wed Jul 16 08:22:01 2003
+++ src/usr.sbin/rpc.pcnfsd/pcnfsd_v2.c Sat Apr 18 13:02:36 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pcnfsd_v2.c,v 1.9 2003/07/16 08:22:01 itojun Exp $ */
+/* $NetBSD: pcnfsd_v2.c,v 1.10 2009/04/18 13:02:36 lukem Exp $ */
/* RE_SID: @(%)/usr/dosnfs/shades_SCCS/unix/pcnfsd/v2/src/SCCS/s.pcnfsd_v2.c 1.2 91/12/18 13:26:13 SMI */
/*
@@ -512,8 +512,8 @@
*/
char *
find_entry(key, map)
- char *key;
- char *map;
+ const char *key;
+ const char *map;
{
int err;
char *val = NULL;