From 0f2cb9b020b907000a28323fc57a82fdb7d6626d Mon Sep 17 00:00:00 2001 From: des Date: Wed, 6 Feb 2002 13:30:31 +0000 Subject: 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 --- usr.bin/chpass/pw_yp.c | 8 ++++---- usr.bin/chpass/pw_yp.h | 10 +++++----- usr.bin/passwd/yp_passwd.c | 6 +++--- usr.bin/ypcat/ypcat.c | 22 ++++++++++----------- usr.bin/ypmatch/ypmatch.c | 18 ++++++++--------- usr.bin/ypwhich/ypwhich.c | 48 +++++++++++++++++++++++----------------------- 6 files changed, 56 insertions(+), 56 deletions(-) (limited to 'usr.bin') 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 * Center for Telecommunications Research * Columbia University, New York City @@ -41,7 +41,7 @@ #ifdef YP #include #include -#include +#include #include #include #include @@ -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 * 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 #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; ih_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; ih_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) && imap, &master); - switch(r) { + switch (r) { case 0: printf("%s %s\n", ypml->map, master); free(master); -- cgit v1.1