Date: Sun, 19 Dec 2010 16:25:24 +0000 (UTC) From: Philippe Charnier <charnier@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216564 - head/usr.bin/mail Message-ID: <201012191625.oBJGPO56099126@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: charnier Date: Sun Dec 19 16:25:23 2010 New Revision: 216564 URL: http://svn.freebsd.org/changeset/base/216564 Log: Add __unused. Ansi prototypes. Modified: head/usr.bin/mail/cmd2.c head/usr.bin/mail/cmd3.c head/usr.bin/mail/collect.c head/usr.bin/mail/edit.c head/usr.bin/mail/fio.c head/usr.bin/mail/getname.c head/usr.bin/mail/head.c head/usr.bin/mail/lex.c head/usr.bin/mail/list.c head/usr.bin/mail/main.c head/usr.bin/mail/names.c head/usr.bin/mail/popen.c head/usr.bin/mail/quit.c head/usr.bin/mail/send.c head/usr.bin/mail/strings.c head/usr.bin/mail/temp.c head/usr.bin/mail/tty.c head/usr.bin/mail/util.c head/usr.bin/mail/v7.local.c head/usr.bin/mail/vars.c Modified: head/usr.bin/mail/cmd2.c ============================================================================== --- head/usr.bin/mail/cmd2.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/cmd2.c Sun Dec 19 16:25:23 2010 (r216564) @@ -53,8 +53,7 @@ extern int wait_status; * If given as first command with no arguments, print first message. */ int -next(msgvec) - int *msgvec; +next(int *msgvec) { struct message *mp; int *ip, *ip2, list[2], mdot; @@ -131,8 +130,7 @@ hitit: * so we can discard when the user quits. */ int -save(str) - char str[]; +save(char str[]) { return (save1(str, 1, "save", saveignore)); @@ -142,8 +140,7 @@ save(str) * Copy a message to a file without affected its saved-ness */ int -copycmd(str) - char str[]; +copycmd(char str[]) { return (save1(str, 0, "copy", saveignore)); @@ -154,11 +151,7 @@ copycmd(str) * If mark is true, mark the message "saved." */ int -save1(str, mark, cmd, ignore) - char str[]; - int mark; - const char *cmd; - struct ignoretab *ignore; +save1(char str[], int mark, const char *cmd, struct ignoretab *ignore) { struct message *mp; char *file; @@ -215,8 +208,7 @@ save1(str, mark, cmd, ignore) * file name, minus header and trailing blank line. */ int -swrite(str) - char str[]; +swrite(char str[]) { return (save1(str, 1, "write", ignoreall)); @@ -232,9 +224,7 @@ swrite(str) */ char * -snarf(linebuf, flag) - char linebuf[]; - int *flag; +snarf(char linebuf[], int *flag) { char *cp; @@ -270,8 +260,7 @@ snarf(linebuf, flag) * Delete messages. */ int -delete(msgvec) - int msgvec[]; +delete(int msgvec[]) { delm(msgvec); @@ -282,8 +271,7 @@ delete(msgvec) * Delete messages, then type the new dot. */ int -deltype(msgvec) - int msgvec[]; +deltype(int msgvec[]) { int list[2]; int lastdot; @@ -308,8 +296,7 @@ deltype(msgvec) * Internal interface. */ int -delm(msgvec) - int *msgvec; +delm(int *msgvec) { struct message *mp; int *ip, last; @@ -346,8 +333,7 @@ delm(msgvec) * Undelete the indicated messages. */ int -undelete_messages(msgvec) - int *msgvec; +undelete_messages(int *msgvec) { struct message *mp; int *ip; @@ -365,7 +351,7 @@ undelete_messages(msgvec) * Interactively dump core on "core" */ int -core() +core(void) { int pid; @@ -391,8 +377,7 @@ core() * Clobber as many bytes of stack as the user requests. */ int -clobber(argv) - char **argv; +clobber(char **argv) { int times; @@ -408,8 +393,7 @@ clobber(argv) * Clobber the stack. */ void -clob1(n) - int n; +clob1(int n) { char buf[512]; char *cp; @@ -426,8 +410,7 @@ clob1(n) * If no arguments, print the current list of retained fields. */ int -retfield(list) - char *list[]; +retfield(char *list[]) { return (ignore1(list, ignore + 1, "retained")); @@ -438,34 +421,28 @@ retfield(list) * If no arguments, print the current list of ignored fields. */ int -igfield(list) - char *list[]; +igfield(char *list[]) { return (ignore1(list, ignore, "ignored")); } int -saveretfield(list) - char *list[]; +saveretfield(char *list[]) { return (ignore1(list, saveignore + 1, "retained")); } int -saveigfield(list) - char *list[]; +saveigfield(char *list[]) { return (ignore1(list, saveignore, "ignored")); } int -ignore1(list, tab, which) - char *list[]; - struct ignoretab *tab; - const char *which; +ignore1(char *list[], struct ignoretab *tab, const char *which) { char field[LINESIZE]; int h; @@ -494,9 +471,7 @@ ignore1(list, tab, which) * Print out all currently retained fields. */ int -igshow(tab, which) - struct ignoretab *tab; - const char *which; +igshow(struct ignoretab *tab, const char *which) { int h; struct ignore *igp; @@ -522,8 +497,7 @@ igshow(tab, which) * Compare two names for sorting ignored field list. */ int -igcomp(l, r) - const void *l, *r; +igcomp(const void *l, const void *r) { return (strcmp(*(const char **)l, *(const char **)r)); Modified: head/usr.bin/mail/cmd3.c ============================================================================== --- head/usr.bin/mail/cmd3.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/cmd3.c Sun Dec 19 16:25:23 2010 (r216564) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); * and forking a sh -c */ int -shell(str) - char *str; +shell(char *str) { sig_t sigint = signal(SIGINT, SIG_IGN); char *sh; @@ -73,8 +72,7 @@ shell(str) */ /*ARGSUSED*/ int -dosh(str) - char *str; +dosh(char *str __unused) { sig_t sigint = signal(SIGINT, SIG_IGN); char *sh; @@ -92,9 +90,7 @@ dosh(str) * last issued command where possible. */ int -bangexp(str, strsize) - char *str; - size_t strsize; +bangexp(char *str, size_t strsize) { char bangbuf[BUFSIZ]; static char lastbang[BUFSIZ]; @@ -148,7 +144,7 @@ overf: */ int -help() +help(void) { int c; FILE *f; @@ -167,8 +163,7 @@ help() * Change user's working directory. */ int -schdir(arglist) - char **arglist; +schdir(char **arglist) { char *cp; @@ -187,8 +182,7 @@ schdir(arglist) } int -respond(msgvec) - int *msgvec; +respond(int *msgvec) { if (value("Replyall") == NULL && value("flipr") == NULL) return (dorespond(msgvec)); @@ -201,8 +195,7 @@ respond(msgvec) * message header and send them off to mail1() */ int -dorespond(msgvec) - int *msgvec; +dorespond(int *msgvec) { struct message *mp; char *cp, *rcv, *replyto; @@ -267,8 +260,7 @@ dorespond(msgvec) * it does not already. */ char * -reedit(subj) - char *subj; +reedit(char *subj) { char *newsubj; @@ -288,8 +280,7 @@ reedit(subj) * back to the system mailbox. */ int -preserve(msgvec) - int *msgvec; +preserve(int *msgvec) { int *ip, mesg; struct message *mp; @@ -312,8 +303,7 @@ preserve(msgvec) * Mark all given messages as unread. */ int -unread(msgvec) - int msgvec[]; +unread(int msgvec[]) { int *ip; @@ -329,8 +319,7 @@ unread(msgvec) * Print the size of each message. */ int -messize(msgvec) - int *msgvec; +messize(int *msgvec) { struct message *mp; int *ip, mesg; @@ -348,8 +337,7 @@ messize(msgvec) * by returning an error. */ int -rexit(e) - int e; +rexit(int e __unused) { if (sourcing) return (1); @@ -362,8 +350,7 @@ rexit(e) * of csh. */ int -set(arglist) - char **arglist; +set(char **arglist) { struct var *vp; char *cp, *cp2; @@ -409,8 +396,7 @@ set(arglist) * Unset a bunch of variable values. */ int -unset(arglist) - char **arglist; +unset(char **arglist) { struct var *vp, *vp2; int errs, h; @@ -449,8 +435,7 @@ unset(arglist) * Put add users to a group. */ int -group(argv) - char **argv; +group(char **argv) { struct grouphead *gh; struct group *gp; @@ -505,8 +490,7 @@ group(argv) * order. */ void -sort(list) - char **list; +sort(char **list) { char **ap; @@ -522,8 +506,7 @@ sort(list) * qsort. */ int -diction(a, b) - const void *a, *b; +diction(const void *a, const void *b) { return (strcmp(*(const char **)a, *(const char **)b)); } @@ -534,8 +517,7 @@ diction(a, b) /*ARGSUSED*/ int -null(e) - int e; +null(int e __unused) { return (0); } @@ -545,8 +527,7 @@ null(e) * the current file. */ int -file(argv) - char **argv; +file(char **argv) { if (argv[0] == NULL) { @@ -563,8 +544,7 @@ file(argv) * Expand file names like echo */ int -echo(argv) - char **argv; +echo(char **argv) { char **ap, *cp; @@ -581,8 +561,7 @@ echo(argv) } int -Respond(msgvec) - int *msgvec; +Respond(int *msgvec) { if (value("Replyall") == NULL && value("flipr") == NULL) return (doRespond(msgvec)); @@ -596,8 +575,7 @@ Respond(msgvec) * reply. */ int -doRespond(msgvec) - int msgvec[]; +doRespond(int msgvec[]) { struct header head; struct message *mp; @@ -634,8 +612,7 @@ doRespond(msgvec) * .mailrc and do some things if sending, others if receiving. */ int -ifcmd(argv) - char **argv; +ifcmd(char **argv) { char *cp; @@ -666,7 +643,7 @@ ifcmd(argv) * flip over the conditional flag. */ int -elsecmd() +elsecmd(void) { switch (cond) { @@ -694,7 +671,7 @@ elsecmd() * End of if statement. Just set cond back to anything. */ int -endifcmd() +endifcmd(void) { if (cond == CANY) { @@ -709,8 +686,7 @@ endifcmd() * Set the list of alternate names. */ int -alternates(namelist) - char **namelist; +alternates(char **namelist) { int c; char **ap, **ap2, *cp; Modified: head/usr.bin/mail/collect.c ============================================================================== --- head/usr.bin/mail/collect.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/collect.c Sun Dec 19 16:25:23 2010 (r216564) @@ -70,9 +70,7 @@ static int colljmp_p; /* whether to lon static jmp_buf collabort; /* To end collection with error */ FILE * -collect(hp, printheaders) - struct header *hp; - int printheaders; +collect(struct header *hp, int printheaders) { FILE *fbuf; int lc, cc, escape, eofcount, fd, c, t; @@ -495,10 +493,7 @@ out: * Write a file, ex-like if f set. */ int -exwrite(name, fp, f) - char name[]; - FILE *fp; - int f; +exwrite(char name[], FILE *fp, int f) { FILE *of; int c, lc; @@ -543,9 +538,7 @@ exwrite(name, fp, f) * On return, make the edit file the new temp file. */ void -mesedit(fp, c) - FILE *fp; - int c; +mesedit(FILE *fp, int c) { sig_t sigint = signal(SIGINT, SIG_IGN); FILE *nf = run_editor(fp, (off_t)-1, c, 0); @@ -565,9 +558,7 @@ mesedit(fp, c) * Sh -c must return 0 to accept the new message. */ void -mespipe(fp, cmd) - FILE *fp; - char cmd[]; +mespipe(FILE *fp, char cmd[]) { FILE *nf; int fd; @@ -617,11 +608,7 @@ out: * should shift over and 'f' if not. */ int -forward(ms, fp, fn, f) - char ms[]; - FILE *fp; - char *fn; - int f; +forward(char ms[], FILE *fp, char *fn, int f) { int *msgvec; struct ignoretab *ig; @@ -665,8 +652,7 @@ forward(ms, fp, fn, f) */ /*ARGSUSED*/ void -collstop(s) - int s; +collstop(int s) { sig_t old_action = signal(s, SIG_DFL); sigset_t nset; @@ -690,8 +676,7 @@ collstop(s) */ /*ARGSUSED*/ void -collint(s) - int s; +collint(int s __unused) { /* * the control flow is subtle, because we can be called from ~q. @@ -714,8 +699,7 @@ collint(s) /*ARGSUSED*/ void -collhup(s) - int s; +collhup(int s __unused) { rewind(collf); savedeadletter(collf); @@ -727,8 +711,7 @@ collhup(s) } void -savedeadletter(fp) - FILE *fp; +savedeadletter(FILE *fp) { FILE *dbuf; int c; Modified: head/usr.bin/mail/edit.c ============================================================================== --- head/usr.bin/mail/edit.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/edit.c Sun Dec 19 16:25:23 2010 (r216564) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); * Edit a message list. */ int -editor(msgvec) - int *msgvec; +editor(int *msgvec) { return (edit1(msgvec, 'e')); @@ -60,8 +59,7 @@ editor(msgvec) * Invoke the visual editor on a message list. */ int -visual(msgvec) - int *msgvec; +visual(int *msgvec) { return (edit1(msgvec, 'v')); @@ -73,9 +71,7 @@ visual(msgvec) * We get the editor from the stuff above. */ int -edit1(msgvec, type) - int *msgvec; - int type; +edit1(int *msgvec, int type) { int c, i; FILE *fp; @@ -137,10 +133,7 @@ edit1(msgvec, type) * "Type" is 'e' for _PATH_EX, 'v' for _PATH_VI. */ FILE * -run_editor(fp, size, type, readonly) - FILE *fp; - off_t size; - int type, readonly; +run_editor(FILE *fp, off_t size, int type, int readonly) { FILE *nf = NULL; int t; Modified: head/usr.bin/mail/fio.c ============================================================================== --- head/usr.bin/mail/fio.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/fio.c Sun Dec 19 16:25:23 2010 (r216564) @@ -56,9 +56,7 @@ extern int wait_status; * Set up the input pointers while copying the mail file into /tmp. */ void -setptr(ibuf, offset) - FILE *ibuf; - off_t offset; +setptr(FILE *ibuf, off_t offset) { int c, count; char *cp, *cp2; @@ -163,10 +161,7 @@ setptr(ibuf, offset) * characters written, including the newline if requested. */ int -putline(obuf, linebuf, outlf) - FILE *obuf; - char *linebuf; - int outlf; +putline(FILE *obuf, char *linebuf, int outlf) { int c; @@ -187,10 +182,7 @@ putline(obuf, linebuf, outlf) * include the newline (or carriage return) at the end. */ int -readline(ibuf, linebuf, linesize) - FILE *ibuf; - char *linebuf; - int linesize; +readline(FILE *ibuf, char *linebuf, int linesize) { int n; @@ -210,8 +202,7 @@ readline(ibuf, linebuf, linesize) * passed message pointer. */ FILE * -setinput(mp) - struct message *mp; +setinput(struct message *mp) { (void)fflush(otf); @@ -226,9 +217,7 @@ setinput(mp) * a dynamically allocated message structure. */ void -makemessage(f, omsgCount) - FILE *f; - int omsgCount; +makemessage(FILE *f, int omsgCount) { size_t size; struct message *nmessage; @@ -258,9 +247,7 @@ makemessage(f, omsgCount) * If the write fails, return 1, else 0 */ int -append(mp, f) - struct message *mp; - FILE *f; +append(struct message *mp, FILE *f) { return (fwrite((char *)mp, sizeof(*mp), 1, f) != 1); } @@ -269,8 +256,7 @@ append(mp, f) * Delete a file, but only if the file is a plain file. */ int -rm(name) - char *name; +rm(char *name) { struct stat sb; @@ -289,7 +275,7 @@ static sigset_t nset, oset; * Hold signals SIGHUP, SIGINT, and SIGQUIT. */ void -holdsigs() +holdsigs(void) { if (sigdepth++ == 0) { @@ -305,7 +291,7 @@ holdsigs() * Release signals SIGHUP, SIGINT, and SIGQUIT. */ void -relsesigs() +relsesigs(void) { if (--sigdepth == 0) @@ -317,8 +303,7 @@ relsesigs() * the passed buffer. */ off_t -fsize(iob) - FILE *iob; +fsize(FILE *iob) { struct stat sbuf; @@ -339,8 +324,7 @@ fsize(iob) * Return the file name as a dynamic string. */ char * -expand(name) - char *name; +expand(char *name) { char xname[PATHSIZE]; char cmdbuf[PATHSIZE]; /* also used for file names */ @@ -432,9 +416,7 @@ expand(name) * Determine the current folder directory name. */ int -getfold(name, namelen) - char *name; - int namelen; +getfold(char *name, int namelen) { char *folder; int copylen; @@ -453,7 +435,7 @@ getfold(name, namelen) * Return the name of the dead.letter file. */ char * -getdeadletter() +getdeadletter(void) { char *cp; Modified: head/usr.bin/mail/getname.c ============================================================================== --- head/usr.bin/mail/getname.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/getname.c Sun Dec 19 16:25:23 2010 (r216564) @@ -45,8 +45,7 @@ __FBSDID("$FreeBSD$"); * Search the passwd file for a uid. Return name on success, NULL on failure. */ char * -getname(uid) - int uid; +getname(int uid) { struct passwd *pw; @@ -60,8 +59,7 @@ getname(uid) * on error. */ int -getuserid(name) - char name[]; +getuserid(char name[]) { struct passwd *pw; Modified: head/usr.bin/mail/head.c ============================================================================== --- head/usr.bin/mail/head.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/head.c Sun Dec 19 16:25:23 2010 (r216564) @@ -50,8 +50,7 @@ __FBSDID("$FreeBSD$"); * accomodate all funny formats. */ int -ishead(linebuf) - char linebuf[]; +ishead(char linebuf[]) { struct headline hl; char parbuf[BUFSIZ]; @@ -73,10 +72,8 @@ ishead(linebuf) return (1); } -/*ARGSUSED*/ void -fail(linebuf, reason) - const char *linebuf, *reason; +fail(const char *linebuf __unused, const char *reason __unused) { /* @@ -93,9 +90,7 @@ fail(linebuf, reason) * structure. Actually, it scans. */ void -parse(line, hl, pbuf) - char line[], pbuf[]; - struct headline *hl; +parse(char line[], struct headline *hl, char pbuf[]) { char *cp, *sp; char word[LINESIZE]; @@ -134,9 +129,7 @@ parse(line, hl, pbuf) * the left string into it. */ char * -copyin(src, space) - char *src; - char **space; +copyin(char *src, char **space) { char *cp, *top; @@ -183,8 +176,7 @@ static char *date_formats[] = { }; int -isdate(date) - char date[]; +isdate(char date[]) { int i; @@ -200,8 +192,7 @@ isdate(date) * Return 1 if they match, 0 if they don't */ int -cmatch(cp, tp) - char *cp, *tp; +cmatch(char *cp, char *tp) { while (*cp != '\0' && *tp != '\0') @@ -256,8 +247,7 @@ cmatch(cp, tp) * or NULL if none follow. */ char * -nextword(wp, wbuf) - char *wp, *wbuf; +nextword(char *wp, char *wbuf) { int c; Modified: head/usr.bin/mail/lex.c ============================================================================== --- head/usr.bin/mail/lex.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/lex.c Sun Dec 19 16:25:23 2010 (r216564) @@ -62,8 +62,7 @@ extern const char *version; * mail. */ int -setfile(name) - char *name; +setfile(char *name) { FILE *ibuf; int checkmode, i, fd; @@ -165,7 +164,7 @@ nomail: * started reading mail. */ int -incfile() +incfile(void) { off_t newsize; int omsgCount = msgCount; @@ -198,7 +197,7 @@ static int reset_on_stop; /* do a reset * print no prompt. */ void -commands() +commands(void) { int n, eofloop = 0; char linebuf[LINESIZE]; @@ -275,9 +274,7 @@ commands() * Contxt is non-zero if called while composing mail. */ int -execute(linebuf, contxt) - char linebuf[]; - int contxt; +execute(char linebuf[], int contxt) { char word[LINESIZE]; char *arglist[MAXARGC]; @@ -472,8 +469,7 @@ out: * lists to message list functions. */ void -setmsize(sz) - int sz; +setmsize(int sz) { if (msgvec != NULL) @@ -487,8 +483,7 @@ setmsize(sz) */ __const struct cmd * -lex(word) - char word[]; +lex(char word[]) { const struct cmd *cp; @@ -514,8 +509,7 @@ lex(word) * Return true if yep. */ int -isprefix(as1, as2) - const char *as1, *as2; +isprefix(const char *as1, const char *as2) { const char *s1, *s2; @@ -537,10 +531,8 @@ isprefix(as1, as2) static int inithdr; /* am printing startup headers */ -/*ARGSUSED*/ void -intr(s) - int s; +intr(int s __unused) { noreset = 0; @@ -564,8 +556,7 @@ intr(s) * When we wake up after ^Z, reprint the prompt. */ void -stop(s) - int s; +stop(int s) { sig_t old_action = signal(s, SIG_DFL); sigset_t nset; @@ -585,10 +576,8 @@ stop(s) /* * Branch here on hangup signal and simulate "exit". */ -/*ARGSUSED*/ void -hangup(s) - int s; +hangup(int s __unused) { /* nothing to do? */ @@ -600,7 +589,7 @@ hangup(s) * give the message count, and print a header listing. */ void -announce() +announce(void) { int vec[2], mdot; @@ -620,8 +609,7 @@ announce() * Return a likely place to set dot. */ int -newfileinfo(omsgCount) - int omsgCount; +newfileinfo(int omsgCount) { struct message *mp; int u, n, mdot, d, s; @@ -681,10 +669,8 @@ newfileinfo(omsgCount) * Print the current version number. */ -/*ARGSUSED*/ int -pversion(e) - int e; +pversion(int e __unused) { printf("Version %s\n", version); @@ -695,8 +681,7 @@ pversion(e) * Load a file of user definitions. */ void -load(name) - char *name; +load(char *name) { FILE *in, *oldin; Modified: head/usr.bin/mail/list.c ============================================================================== --- head/usr.bin/mail/list.c Sun Dec 19 16:07:53 2010 (r216563) +++ head/usr.bin/mail/list.c Sun Dec 19 16:25:23 2010 (r216564) @@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$"); * Returns the count of messages picked up or -1 on error. */ int -getmsglist(buf, vector, flags) - char *buf; - int *vector, flags; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012191625.oBJGPO56099126>