summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-02-06 13:30:31 +0000
committerdes <des@FreeBSD.org>2002-02-06 13:30:31 +0000
commit0f2cb9b020b907000a28323fc57a82fdb7d6626d (patch)
treed44f2702502c982570c85130c91c845a83ea8052 /usr.bin
parent0e1bb965cc26648289a6a22baf0ad5ef4891edb4 (diff)
downloadFreeBSD-src-0f2cb9b020b907000a28323fc57a82fdb7d6626d.zip
FreeBSD-src-0f2cb9b020b907000a28323fc57a82fdb7d6626d.tar.gz
Apply the following mechanical transformations in preparation for
ansification and constification: s{\s+__P\((\(.*?\))\)}{$1}g; s{\(\s+}{\(}g; s{\s+\)}{\)}g; s{\s+,}{,}g; s{(\s+)(for|if|switch|while)\(}{$1$2 \(}g; s{return ([^\(].*?);}{return ($1);}g; s{([\w\)])([!=+/\*-]?=)([\w\(+-])}{$1 $2 $3}g; s{\s+$}{\n};g Also add $FreeBSD$ where needed. MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/chpass/pw_yp.c8
-rw-r--r--usr.bin/chpass/pw_yp.h10
-rw-r--r--usr.bin/passwd/yp_passwd.c6
-rw-r--r--usr.bin/ypcat/ypcat.c22
-rw-r--r--usr.bin/ypmatch/ypmatch.c18
-rw-r--r--usr.bin/ypwhich/ypwhich.c48
6 files changed, 56 insertions, 56 deletions
diff --git a/usr.bin/chpass/pw_yp.c b/usr.bin/chpass/pw_yp.c
index 1c523ae..921f30e 100644
--- a/usr.bin/chpass/pw_yp.c
+++ b/usr.bin/chpass/pw_yp.c
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* NIS interface routines for chpass
- *
+ *
* Written by Bill Paul <wpaul@ctr.columbia.edu>
* Center for Telecommunications Research
* Columbia University, New York City
@@ -41,7 +41,7 @@
#ifdef YP
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
+#include <string.h>
#include <netdb.h>
#include <time.h>
#include <sys/types.h>
@@ -307,8 +307,8 @@ int use_yp (user, uid, which)
copy_yp_pass(result, 0, resultlen);
}
/* Is the user in the NIS master.passwd map */
- if (user_yp && !my_yp_match(server, yp_domain, which ?
- "master.passwd.byuid" : "master.passwd.byname",
+ if (user_yp && !my_yp_match(server, yp_domain, which ?
+ "master.passwd.byuid" : "master.passwd.byname",
user, strlen(user),
&result, &resultlen)) {
*(char *)(result + resultlen) = '\0';
diff --git a/usr.bin/chpass/pw_yp.h b/usr.bin/chpass/pw_yp.h
index 15f63d0..774722e 100644
--- a/usr.bin/chpass/pw_yp.h
+++ b/usr.bin/chpass/pw_yp.h
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*
* NIS interface routines for chpass
- *
+ *
* Written by Bill Paul <wpaul@ctr.columbia.edu>
* Center for Telecommunications Research
* Columbia University, New York City
@@ -54,12 +54,12 @@ extern int _use_yp;
extern int suser_override;
extern struct passwd local_password;
extern struct passwd yp_password;
-extern void copy_yp_pass __P(( char *, int, int ));
+extern void copy_yp_pass(char *, int, int);
extern char *yp_domain;
extern char *yp_server;
-extern void yp_submit __P(( struct passwd * ));
-extern int use_yp __P(( char * , uid_t , int ));
-extern char *get_yp_master __P(( int ));
+extern void yp_submit(struct passwd *);
+extern int use_yp(char *, uid_t, int);
+extern char *get_yp_master(int);
extern int yp_in_pw_file;
/*
diff --git a/usr.bin/passwd/yp_passwd.c b/usr.bin/passwd/yp_passwd.c
index fb39c76..16a4a13 100644
--- a/usr.bin/passwd/yp_passwd.c
+++ b/usr.bin/passwd/yp_passwd.c
@@ -50,7 +50,7 @@
#include <err.h>
#include "yppasswd_private.h"
-extern char *getnewpasswd __P(( struct passwd * , int ));
+extern char *getnewpasswd(struct passwd *, int);
int
yp_passwd(char *user)
@@ -130,7 +130,7 @@ for other users");
/* Get old password */
- if(pw->pw_passwd[0] && !suser_override) {
+ if (pw->pw_passwd[0] && !suser_override) {
yppasswd.oldpass = strdup(getpass("Old Password: "));
if (strcmp(crypt(yppasswd.oldpass, pw->pw_passwd),
pw->pw_passwd)) {
@@ -193,7 +193,7 @@ for other users");
clnt_destroy(clnt);
if (err.re_status != RPC_SUCCESS || status == NULL || *status) {
- errx(1, "failed to change NIS password: %s",
+ errx(1, "failed to change NIS password: %s",
clnt_sperrno(err.re_status));
}
diff --git a/usr.bin/ypcat/ypcat.c b/usr.bin/ypcat/ypcat.c
index 0fd91ec..033d343 100644
--- a/usr.bin/ypcat/ypcat.c
+++ b/usr.bin/ypcat/ypcat.c
@@ -75,12 +75,12 @@ usage(void)
static int
printit(unsigned long instatus, char *inkey, int inkeylen, char *inval, int invallen, void *dummy __unused)
{
- if(instatus != YP_TRUE)
- return instatus;
- if(key)
+ if (instatus != YP_TRUE)
+ return (instatus);
+ if (key)
printf("%*.*s ", inkeylen, inkeylen, inkey);
printf("%*.*s\n", invallen, invallen, inval);
- return 0;
+ return (0);
}
int
@@ -95,10 +95,10 @@ main(int argc, char *argv[])
notrans = key = 0;
- while( (c=getopt(argc, argv, "xd:kt")) != -1)
- switch(c) {
+ while ((c = getopt(argc, argv, "xd:kt")) != -1)
+ switch (c) {
case 'x':
- for(i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ for (i = 0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
printf("Use \"%s\" for \"%s\"\n",
ypaliases[i].alias,
ypaliases[i].name);
@@ -116,21 +116,21 @@ main(int argc, char *argv[])
usage();
}
- if(optind + 1 != argc )
+ if (optind + 1 != argc)
usage();
if (!domainname)
yp_get_default_domain(&domainname);
inmap = argv[optind];
- for(i=0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
- if( strcmp(inmap, ypaliases[i].alias) == 0)
+ for (i = 0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ if (strcmp(inmap, ypaliases[i].alias) == 0)
inmap = ypaliases[i].name;
ypcb.foreach = printit;
ypcb.data = NULL;
r = yp_all(domainname, inmap, &ypcb);
- switch(r) {
+ switch (r) {
case 0:
break;
case YPERR_YPBIND:
diff --git a/usr.bin/ypmatch/ypmatch.c b/usr.bin/ypmatch/ypmatch.c
index d9193b2..e85f335 100644
--- a/usr.bin/ypmatch/ypmatch.c
+++ b/usr.bin/ypmatch/ypmatch.c
@@ -81,10 +81,10 @@ main(int argc, char *argv[])
notrans = key = 0;
- while( (c=getopt(argc, argv, "xd:kt")) != -1)
- switch(c) {
+ while ((c = getopt(argc, argv, "xd:kt")) != -1)
+ switch (c) {
case 'x':
- for(i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ for (i = 0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
printf("Use \"%s\" for \"%s\"\n",
ypaliases[i].alias,
ypaliases[i].name);
@@ -102,24 +102,24 @@ main(int argc, char *argv[])
usage();
}
- if( (argc-optind) < 2 )
+ if ((argc-optind) < 2)
usage();
if (!domainname)
yp_get_default_domain(&domainname);
inmap = argv[argc-1];
- for(i=0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
- if( strcmp(inmap, ypaliases[i].alias) == 0)
+ for (i = 0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ if (strcmp(inmap, ypaliases[i].alias) == 0)
inmap = ypaliases[i].name;
- for(; optind < argc-1; optind++) {
+ for (; optind < argc-1; optind++) {
inkey = argv[optind];
r = yp_match(domainname, inmap, inkey,
strlen(inkey), &outbuf, &outbuflen);
- switch(r) {
+ switch (r) {
case 0:
- if(key)
+ if (key)
printf("%s ", inkey);
printf("%*.*s\n", outbuflen, outbuflen, outbuf);
break;
diff --git a/usr.bin/ypwhich/ypwhich.c b/usr.bin/ypwhich/ypwhich.c
index cce0ce6..9137c99 100644
--- a/usr.bin/ypwhich/ypwhich.c
+++ b/usr.bin/ypwhich/ypwhich.c
@@ -102,25 +102,25 @@ bind_host(char *dom, struct sockaddr_in *lsin)
tv.tv_sec = 15;
tv.tv_usec = 0;
client = clntudp_create(lsin, YPBINDPROG, YPBINDVERS, tv, &sock);
- if(client==NULL) {
+ if (client == NULL) {
warnx("can't clntudp_create: %s", yperr_string(YPERR_YPBIND));
- return YPERR_YPBIND;
+ return (YPERR_YPBIND);
}
tv.tv_sec = 5;
tv.tv_usec = 0;
r = clnt_call(client, YPBINDPROC_DOMAIN,
xdr_domainname, &dom, xdr_ypbind_resp, &ypbr, tv);
- if( r != RPC_SUCCESS) {
+ if (r != RPC_SUCCESS) {
warnx("can't clnt_call: %s", yperr_string(YPERR_YPBIND));
clnt_destroy(client);
- return YPERR_YPBIND;
+ return (YPERR_YPBIND);
} else {
if (ypbr.ypbind_status != YPBIND_SUCC_VAL) {
warnx("can't yp_bind: reason: %s",
ypbinderr_string(ypbr.ypbind_resp_u.ypbind_error));
clnt_destroy(client);
- return r;
+ return (r);
}
}
clnt_destroy(client);
@@ -132,7 +132,7 @@ bind_host(char *dom, struct sockaddr_in *lsin)
printf("%s\n", hent->h_name);
else
printf("%s\n", inet_ntoa(ss_addr));
- return 0;
+ return (0);
}
int
@@ -148,10 +148,10 @@ main(int argc, char *argv[])
u_int i;
getmap = notrans = mode = 0;
- while( (c=getopt(argc, argv, "xd:mt")) != -1)
- switch(c) {
+ while ((c = getopt(argc, argv, "xd:mt")) != -1)
+ switch (c) {
case 'x':
- for(i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ for (i = 0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
printf("\"%s\" is an alias for \"%s\"\n",
ypaliases[i].alias,
ypaliases[i].name);
@@ -169,30 +169,30 @@ main(int argc, char *argv[])
usage();
}
- if(!domnam)
+ if (!domnam)
yp_get_default_domain(&domnam);
- if(mode==0) {
- switch(argc-optind) {
+ if (mode == 0) {
+ switch (argc-optind) {
case 0:
bzero(&lsin, sizeof lsin);
lsin.sin_family = AF_INET;
lsin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- if(bind_host(domnam, &lsin))
+ if (bind_host(domnam, &lsin))
exit(ERR_NOBINDING);
break;
case 1:
bzero(&lsin, sizeof lsin);
lsin.sin_family = AF_INET;
- if( (lsin.sin_addr.s_addr=inet_addr(argv[optind]))==-1) {
+ if ((lsin.sin_addr.s_addr = inet_addr(argv[optind])) == -1) {
hent = gethostbyname(argv[optind]);
- if(!hent)
+ if (!hent)
errx(ERR_NOSUCHHOST, "host %s unknown", argv[optind]);
bcopy((char *)hent->h_addr_list[0],
(char *)&lsin.sin_addr, sizeof lsin.sin_addr);
}
- if(bind_host(domnam, &lsin))
+ if (bind_host(domnam, &lsin))
exit(ERR_NOBINDING);
break;
default:
@@ -201,16 +201,16 @@ main(int argc, char *argv[])
exit(0);
}
- if( argc-optind > 1)
+ if (argc-optind > 1)
usage();
- if(argv[optind]) {
+ if (argv[optind]) {
map = argv[optind];
- for(i=0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
- if( strcmp(map, ypaliases[i].alias) == 0)
+ for (i = 0; (!notrans) && i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+ if (strcmp(map, ypaliases[i].alias) == 0)
map = ypaliases[i].name;
r = yp_master(domnam, map, &master);
- switch(r) {
+ switch (r) {
case 0:
printf("%s\n", master);
free(master);
@@ -226,12 +226,12 @@ main(int argc, char *argv[])
ypml = NULL;
r = yp_maplist(domnam, &ypml);
- switch(r) {
+ switch (r) {
case 0:
- for(y=ypml; y; ) {
+ for (y = ypml; y;) {
ypml = y;
r = yp_master(domnam, ypml->map, &master);
- switch(r) {
+ switch (r) {
case 0:
printf("%s %s\n", ypml->map, master);
free(master);
OpenPOWER on IntegriCloud