From 2990d002bec8a9d8103d0082a5a78aa59489e89c Mon Sep 17 00:00:00 2001 From: purplerain Date: Sat, 16 Sep 2023 04:38:16 +0000 Subject: [PATCH] zap trailing whitespace and tabs --- usr.bin/aucat/aucat.c | 2 +- usr.bin/awk/lex.c | 2 +- usr.bin/awk/run.c | 2 +- usr.bin/banner/banner.c | 22 +-- usr.bin/banner/banner.h | 18 +-- usr.bin/banner/chset.c | 18 +-- usr.bin/bc/tty.c | 2 +- usr.bin/cal/cal.c | 8 +- usr.bin/calendar/calendars/calendar.fictional | 2 +- usr.bin/calendar/calendars/calendar.history | 2 +- usr.bin/calendar/calendars/calendar.music | 4 +- .../calendars/de_DE.UTF-8/calendar.feiertag | 2 +- .../calendars/hr_HR.UTF-8/calendar.praznici | 6 +- .../calendars/ru_RU.UTF-8/calendar.primety | 2 +- usr.bin/cdio/extern.h | 2 +- usr.bin/col/col.c | 2 +- usr.bin/colrm/colrm.c | 2 +- usr.bin/compress/compress.h | 2 +- usr.bin/csplit/csplit.c | 2 +- usr.bin/ctags/C.c | 8 +- usr.bin/dig/lib/isc/unix/socket.c | 4 +- usr.bin/du/du.c | 2 +- usr.bin/fgen/fgen.h | 18 +-- usr.bin/fgen/fgen.l | 132 +++++++++--------- usr.bin/gencat/gencat.c | 6 +- usr.bin/gprof/dfn.c | 4 +- usr.bin/gprof/gprof.c | 12 +- usr.bin/gprof/gprof.callg | 2 +- usr.bin/gprof/gprof.flat | 6 +- usr.bin/gprof/gprof.h | 2 +- usr.bin/gprof/lookup.c | 2 +- usr.bin/gprof/printgprof.c | 4 +- usr.bin/indent/indent.c | 2 +- usr.bin/indent/io.c | 52 +++---- usr.bin/indent/lexi.c | 2 +- usr.bin/infocmp/infocmp.c | 2 +- usr.bin/kdump/ktrstruct.c | 4 +- usr.bin/kdump/mksubr | 2 +- usr.bin/ktrace/ktrace.c | 4 +- usr.bin/last/last.c | 2 +- usr.bin/ldap/aldap.c | 8 +- usr.bin/ldap/aldap.h | 2 +- usr.bin/leave/leave.c | 2 +- usr.bin/lex/ccl.c | 16 +-- usr.bin/lex/ecs.c | 8 +- usr.bin/lex/filter.c | 8 +- usr.bin/lex/flex.skl | 58 ++++---- usr.bin/lex/flexint.h | 4 +- usr.bin/lex/gen.c | 40 +++--- usr.bin/lex/libmain.c | 2 +- usr.bin/lex/libyywrap.c | 2 +- usr.bin/lex/misc.c | 80 +++++------ usr.bin/lex/nfa.c | 32 ++--- usr.bin/lex/options.c | 2 +- usr.bin/lex/options.h | 2 +- usr.bin/lex/parse.y | 16 +-- usr.bin/lex/scan.l | 4 +- usr.bin/lex/scanopt.c | 6 +- usr.bin/lex/scanopt.h | 4 +- usr.bin/lex/tables.c | 8 +- usr.bin/lex/tables.h | 2 +- usr.bin/lex/tables_shared.c | 24 ++-- usr.bin/lex/tables_shared.h | 2 +- usr.bin/lex/tblcmp.c | 28 ++-- usr.bin/libtool/LT/Archive.pm | 2 +- usr.bin/libtool/LT/Exec.pm | 4 +- usr.bin/libtool/LT/Getopt.pm | 6 +- usr.bin/libtool/LT/Mode/Compile.pm | 14 +- usr.bin/libtool/LT/Mode/Link.pm | 4 +- usr.bin/libtool/LT/Mode/Link/Library.pm | 4 +- usr.bin/libtool/LT/Mode/Link/Program.pm | 6 +- usr.bin/libtool/LT/UList.pm | 16 +-- usr.bin/libtool/Makefile | 4 +- usr.bin/libtool/libtool | 12 +- usr.bin/locate/locate/mklocatedb.sh | 2 +- usr.bin/m4/PSD.doc/m4.ms | 56 ++++---- usr.bin/m4/TEST/sqroot.m4 | 2 +- usr.bin/m4/TEST/test.m4 | 40 +++--- usr.bin/m4/eval.c | 22 +-- usr.bin/m4/gnum4.c | 12 +- usr.bin/m4/look.c | 6 +- usr.bin/m4/mdef.h | 2 +- usr.bin/m4/parser.y | 2 +- usr.bin/mail/list.c | 2 +- usr.bin/mail/names.c | 2 +- usr.bin/mail/send.c | 2 +- usr.bin/mail/util.c | 2 +- usr.bin/mandoc/tbl_layout.c | 2 +- usr.bin/mandoc/term_ascii.c | 2 +- usr.bin/mandoc/term_ps.c | 2 +- usr.bin/mg/cinfo.c | 2 +- usr.bin/mg/cmode.c | 2 +- usr.bin/mg/dired.c | 12 +- usr.bin/mg/echo.c | 2 +- usr.bin/mg/file.c | 2 +- usr.bin/mg/fileio.c | 2 +- usr.bin/mg/interpreter.c | 30 ++-- usr.bin/mg/line.c | 4 +- usr.bin/mg/log.c | 18 +-- usr.bin/mg/paragraph.c | 12 +- usr.bin/mg/re_search.c | 2 +- usr.bin/mg/search.c | 4 +- usr.bin/mg/tutorial | 92 ++++++------ usr.bin/mg/word.c | 2 +- usr.bin/mkdep/mkdep.gcc.sh | 2 +- usr.bin/mklocale/yacc.y | 2 +- usr.bin/netstat/if.c | 8 +- usr.bin/netstat/inet.c | 2 +- usr.bin/pkg-config/pkg-config | 4 +- usr.bin/pr/pr.c | 10 +- usr.bin/quota/quota.c | 14 +- usr.bin/radioctl/radioctl.c | 4 +- usr.bin/rcs/ci.c | 2 +- usr.bin/rcs/co.c | 2 +- usr.bin/rcs/ident.c | 2 +- usr.bin/rcs/rcsparse.c | 2 +- usr.bin/rdist/child.c | 52 +++---- usr.bin/rdist/client.c | 90 ++++++------ usr.bin/rdist/common.c | 28 ++-- usr.bin/rdist/distopt.c | 2 +- usr.bin/rdist/docmd.c | 48 +++---- usr.bin/rdist/expand.c | 24 ++-- usr.bin/rdist/gram.y | 30 ++-- usr.bin/rdist/lookup.c | 2 +- usr.bin/rdist/message.c | 20 +-- usr.bin/rdist/rdist.c | 8 +- usr.bin/rdistd/filesys.c | 10 +- usr.bin/rdistd/rdistd.c | 2 +- usr.bin/rdistd/server.c | 80 +++++------ usr.bin/rpcgen/rpc_parse.h | 2 +- usr.bin/rpcinfo/rpcinfo.c | 14 +- usr.bin/sed/TEST/sed.test | 4 +- usr.bin/sed/USD.doc/sed | 26 ++-- usr.bin/skeyaudit/skeyaudit.c | 2 +- usr.bin/skeyinit/skeyinit.c | 2 +- usr.bin/snmp/smi.c | 2 +- usr.bin/snmp/snmpc.c | 4 +- usr.bin/spell/look.c | 48 +++---- usr.bin/ssh/poly1305.c | 2 +- usr.bin/ssh/xmss_hash.c | 2 +- usr.bin/systat/cache.c | 2 +- usr.bin/systat/main.c | 4 +- usr.bin/systat/malloc.c | 4 +- usr.bin/systat/mbufs.c | 4 +- usr.bin/systat/netstat.c | 2 +- usr.bin/systat/pf.c | 2 +- usr.bin/systat/pftop.c | 12 +- usr.bin/systat/pigs.c | 4 +- usr.bin/systat/sensors.c | 4 +- usr.bin/systat/swap.c | 2 +- usr.bin/tail/forward.c | 2 +- usr.bin/tail/reverse.c | 2 +- usr.bin/talk/init_disp.c | 2 +- usr.bin/talk/io.c | 2 +- usr.bin/talk/talk.c | 2 +- usr.bin/telnet/README | 2 +- usr.bin/tput/tput.c | 2 +- usr.bin/tsort/tsort.c | 14 +- usr.bin/ul/ul.c | 2 +- usr.bin/uniq/uniq.c | 2 +- usr.bin/units/README | 2 +- usr.bin/usbhidctl/usbhid.c | 2 +- usr.bin/vi/FAQ | 2 +- usr.bin/vi/README | 2 +- usr.bin/vi/docs/USD.doc/exref/ex.summary | 6 +- usr.bin/vi/docs/help | 10 +- usr.bin/vi/docs/internals/cscope.NOTES | 4 +- usr.bin/vi/docs/internals/openmode | 2 +- usr.bin/vi/docs/interp/interp | 2 +- usr.bin/vi/docs/tutorial/vi.advanced | 100 ++++++------- usr.bin/vi/docs/tutorial/vi.beginner | 34 ++--- usr.bin/vis/foldit.c | 2 +- usr.bin/vis/vis.c | 8 +- usr.bin/yacc/PSD.doc/ss1 | 2 +- usr.bin/yacc/PSD.doc/ss2 | 4 +- usr.bin/yacc/PSD.doc/ss4 | 12 +- usr.bin/yacc/PSD.doc/ss7 | 2 +- usr.bin/yacc/PSD.doc/ssa | 6 +- usr.bin/yacc/lalr.c | 2 +- 179 files changed, 992 insertions(+), 992 deletions(-) diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 64b9986d4..c70ed9677 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -549,7 +549,7 @@ slot_mix_badd(struct slot *s, adata_t *odata) odone = 0; otodo = dev_round; - if (s->skip > 0) { + if (s->skip > 0) { ocnt = otodo; if (ocnt > s->skip) ocnt = s->skip; diff --git a/usr.bin/awk/lex.c b/usr.bin/awk/lex.c index 9ca1d0dda..5d9510154 100644 --- a/usr.bin/awk/lex.c +++ b/usr.bin/awk/lex.c @@ -626,7 +626,7 @@ int input(void) /* get next lexical input character */ void unput(int c) /* put lexical character back on input */ { - if (c == '\n') + if (c == '\n') lineno--; if (yysptr >= yysbuf + sizeof(yysbuf)) FATAL("pushed back too much: %.20s...", yysbuf); diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c index 5d87b43e8..5ffccfe86 100644 --- a/usr.bin/awk/run.c +++ b/usr.bin/awk/run.c @@ -2292,7 +2292,7 @@ Cell *gensub(Node **a, int nnn) /* global selective substitute */ FATAL("gensub doesn't support backreferences (subst \"%s\")", rptr); } } - + do { if (whichm >= 0 && whichm != num) { num++; diff --git a/usr.bin/banner/banner.c b/usr.bin/banner/banner.c index c2b4780c4..94acc7042 100644 --- a/usr.bin/banner/banner.c +++ b/usr.bin/banner/banner.c @@ -5,17 +5,17 @@ * Changes for banner(1) * * @(#)Copyright (c) 1995, Simon J. Gerraty. - * + * * This is free software. It comes with NO WARRANTY. - * Permission to use, modify and distribute this source code + * Permission to use, modify and distribute this source code * is granted subject to the following conditions. - * 1/ that the above copyright notice and this notice - * are preserved in all copies and that due credit be given - * to the author. - * 2/ that any changes to this code are clearly commented - * as such so that the author does not get blamed for bugs + * 1/ that the above copyright notice and this notice + * are preserved in all copies and that due credit be given + * to the author. + * 2/ that any changes to this code are clearly commented + * as such so that the author does not get blamed for bugs * other than his own. - * + * * Please send copies of changes and bug-fixes to: * sjg@zen.void.oz.au */ @@ -72,7 +72,7 @@ scnline(int key, char *p, int c) * banner(1) does is more consistent. */ c = '#'; - + for (scnwidth = WIDTH; --scnwidth;) { key <<= 1; *p++ = key & 0200 ? c : BACKGND; @@ -135,7 +135,7 @@ scan_out(int scfd, char *scsp, int dlm) while (*--strp == BACKGND && strp >= outbuf) ; strp++; - *strp++ = '\n'; + *strp++ = '\n'; (void) write(scfd, outbuf, strp-outbuf); } } @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) { char word[10+1]; /* strings limited to 10 chars */ - + if (pledge("stdio", NULL) == -1) err(1, "pledge"); diff --git a/usr.bin/banner/banner.h b/usr.bin/banner/banner.h index e30593e99..39b42a13a 100644 --- a/usr.bin/banner/banner.h +++ b/usr.bin/banner/banner.h @@ -3,19 +3,19 @@ /* * Various defines needed for code lifted from lpd. - * + * * @(#)Copyright (c) 1995, Simon J. Gerraty. - * + * * This is free software. It comes with NO WARRANTY. - * Permission to use, modify and distribute this source code + * Permission to use, modify and distribute this source code * is granted subject to the following conditions. - * 1/ that the above copyright notice and this notice - * are preserved in all copies and that due credit be given - * to the author. - * 2/ that any changes to this code are clearly commented - * as such so that the author does not get blamed for bugs + * 1/ that the above copyright notice and this notice + * are preserved in all copies and that due credit be given + * to the author. + * 2/ that any changes to this code are clearly commented + * as such so that the author does not get blamed for bugs * other than his own. - * + * * Please send copies of changes and bug-fixes to: * sjg@zen.void.oz.au */ diff --git a/usr.bin/banner/chset.c b/usr.bin/banner/chset.c index 63b4ef798..f3654bf6c 100644 --- a/usr.bin/banner/chset.c +++ b/usr.bin/banner/chset.c @@ -4,17 +4,17 @@ /* * Changes for banner(1) * @(#)Copyright (c) 1995, Simon J. Gerraty. - * + * * This is free software. It comes with NO WARRANTY. - * Permission to use, modify and distribute this source code + * Permission to use, modify and distribute this source code * is granted subject to the following conditions. - * 1/ that the above copyright notice and this notice - * are preserved in all copies and that due credit be given - * to the author. - * 2/ that any changes to this code are clearly commented - * as such so that the author does not get blamed for bugs + * 1/ that the above copyright notice and this notice + * are preserved in all copies and that due credit be given + * to the author. + * 2/ that any changes to this code are clearly commented + * as such so that the author does not get blamed for bugs * other than his own. - * + * * Please send copies of changes and bug-fixes to: * sjg@zen.void.oz.au */ @@ -187,7 +187,7 @@ char scnkey[][HEIGHT] = /* this is relatively easy to modify */ /* just look: */ { - + /* this is the real banner char set */ { c_______, diff --git a/usr.bin/bc/tty.c b/usr.bin/bc/tty.c index c48feab81..25c17c027 100644 --- a/usr.bin/bc/tty.c +++ b/usr.bin/bc/tty.c @@ -52,7 +52,7 @@ tstpcont(int sig) if (sig == SIGTSTP) { signal(SIGCONT, tstpcont); gettty(&ttyedit); - settty(&ttysaved); + settty(&ttysaved); } else { signal(SIGTSTP, tstpcont); settty(&ttyedit); diff --git a/usr.bin/cal/cal.c b/usr.bin/cal/cal.c index c37402dfd..741d5c703 100644 --- a/usr.bin/cal/cal.c +++ b/usr.bin/cal/cal.c @@ -248,7 +248,7 @@ week(int day, int month, int year) int firstday; int firstsunday; int shift; - + if (mflag) return isoweek(day, month, year); @@ -261,7 +261,7 @@ week(int day, int month, int year) shift = 1; if (yearday < firstsunday) return (1); - if (firstweekday > THURSDAY - 1) + if (firstweekday > THURSDAY - 1) shift = 2; return ((((yearday + 1) - (weekday - 1)) / 7) + shift); } @@ -291,7 +291,7 @@ isoweek(int day, int month, int year) return 53 - (g - s) / 5; else if (n > 364 + s) return 1; - else + else return n/7 + 1; } @@ -388,7 +388,7 @@ yearly(int year) for (row = 0; row < 6; row++) { for (which_cal = 0; which_cal < 3; which_cal++) { p = lineout + which_cal * (week_len + 2); - + dp = &days[month + which_cal][row * 7]; firstday = SPACE; for (col = 0; col < 7; col++, p += DAY_LEN) { diff --git a/usr.bin/calendar/calendars/calendar.fictional b/usr.bin/calendar/calendars/calendar.fictional index c19f3a827..309a270e9 100644 --- a/usr.bin/calendar/calendars/calendar.fictional +++ b/usr.bin/calendar/calendars/calendar.fictional @@ -24,7 +24,7 @@ 04/17 An unexpected party (LOTR) 04/23 Crowning of King Ellesar (LOTR) 05/19 Arwen leaves Lorien to wed King Ellesar (LOTR) -05/25 Towel Day (The Hitchhiker's Guide to the Galaxy) +05/25 Towel Day (The Hitchhiker's Guide to the Galaxy) 06/11 Sauron attacks Osgilliath (LOTR) 06/13 Bilbo returns to Bag End (LOTR) 06/23 Wedding of Ellesar & Arwen (LOTR) diff --git a/usr.bin/calendar/calendars/calendar.history b/usr.bin/calendar/calendars/calendar.history index 131ee6898..26aeefc68 100644 --- a/usr.bin/calendar/calendars/calendar.history +++ b/usr.bin/calendar/calendars/calendar.history @@ -450,7 +450,7 @@ 11/21 Birmingham Pub Bombings by the IRA kill 21 people, 1974 11/22 John F. Kennedy is assassinated in Dallas, Texas, 1963 11/23 The first edition of Life is published. 1936 -11/24 Alleged assassin Lee Harvey Oswald is killed by +11/24 Alleged assassin Lee Harvey Oswald is killed by Jack Ruby in Dallas, Texas, 1963 11/25 Alfred Nobel invents dynamite, 1867 11/26 Last flight ever with a Concorde made over Bristol, UK, 2003 diff --git a/usr.bin/calendar/calendars/calendar.music b/usr.bin/calendar/calendars/calendar.music index d272521d4..cc7310cb8 100644 --- a/usr.bin/calendar/calendars/calendar.music +++ b/usr.bin/calendar/calendars/calendar.music @@ -333,7 +333,7 @@ 08/12 Maurice Greene is born in London, 1696 08/12 Leos Janacek dies in Ostrava, Czechoslovakia, 1928 08/13 Dan Fogelberg is born in Peoria, Illinois, 1951 -08/13 The Bayreuth Festspielhaus opens with the first complete +08/13 The Bayreuth Festspielhaus opens with the first complete performance of Wagner's "Ring Cycle", 1876 08/13 John Ireland is born, 1879 08/13 Jules Emile Frederic Massenet dies, 1912 @@ -520,7 +520,7 @@ 12/18 Horatio Parker dies in Cedarhurst, New York, 1919 12/21 Frank Zappa is born in Baltimore, 1940 12/21 Silvestre Revueltas born in Santiago Papasquiaro, Durango, Mexico, 1899 -12/22 Beethoven's Symphony No. 5 and Symphony No. 6 premier, under +12/22 Beethoven's Symphony No. 5 and Symphony No. 6 premier, under rehearsed, at Theater an der Wien in Vienna, Austria, 1808 12/22 Edgard Varese is born in France, 1883 12/22 Jean-Joseph Mouret dies in Charenton, France, 1738 diff --git a/usr.bin/calendar/calendars/de_DE.UTF-8/calendar.feiertag b/usr.bin/calendar/calendars/de_DE.UTF-8/calendar.feiertag index d28c6ada4..5c8bbdd9c 100644 --- a/usr.bin/calendar/calendars/de_DE.UTF-8/calendar.feiertag +++ b/usr.bin/calendar/calendars/de_DE.UTF-8/calendar.feiertag @@ -30,7 +30,7 @@ Easter+39 Christi Himmelfahrt 03/21* Frühlingsanfang 06/21* Sommeranfang 09/21* Herbstanfang -12/21* Winteranfang +12/21* Winteranfang /* Sommer- und Winterzeit */ 03/SundayLast Anfang der Sommerzeit diff --git a/usr.bin/calendar/calendars/hr_HR.UTF-8/calendar.praznici b/usr.bin/calendar/calendars/hr_HR.UTF-8/calendar.praznici index 491a52d95..0dd980f60 100644 --- a/usr.bin/calendar/calendars/hr_HR.UTF-8/calendar.praznici +++ b/usr.bin/calendar/calendars/hr_HR.UTF-8/calendar.praznici @@ -12,8 +12,8 @@ LANG=hr_HR.UTF-8 /* slobodni državni praznici */ 01/01 Nova godina 05/01 Prvi maj - - + + /* slobodni kršćanski praznici */ Easter-2 Veliki petak Easter Uskrs @@ -29,7 +29,7 @@ Easter+39 Uzašašće 06/21* Početak ljeta 09/21* Početak jesena 12/21* Početak zime - + /* ljetno vrijeme */ 03/SundayLast Početak ljetnog vremena 10/SundayLast Kraj ljetnog vremena diff --git a/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.primety b/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.primety index d2c1a7396..0497d148e 100644 --- a/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.primety +++ b/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.primety @@ -219,7 +219,7 @@ CALENDAR=julian на овес с ячменем. Пронеси, Господи, Калиника мороком, а не морозом. 07/30 Силин день. На Силы и Селуяна рожь бывает пьяна (т.е. полна зерном и клонится к земле). На Силу рожь посеянная родится сильно, а - ведьмы обмирают, опившись молока. + ведьмы обмирают, опившись молока. 08/01 Первый, мокрый, медовый Спас. Пчелиный праздник. На Маковея собирают мак. Дождь на Маковея - мало пожаров. Во что Маковея, в то и diff --git a/usr.bin/cdio/extern.h b/usr.bin/cdio/extern.h index ee765981b..59f2a2799 100644 --- a/usr.bin/cdio/extern.h +++ b/usr.bin/cdio/extern.h @@ -38,7 +38,7 @@ struct track_info { char *file; SLIST_ENTRY(track_info) track_list; char type; - int speed; + int speed; }; SLIST_HEAD(track_head, track_info); extern struct track_head tracks; diff --git a/usr.bin/col/col.c b/usr.bin/col/col.c index 3000ffbde..079ad1d9d 100644 --- a/usr.bin/col/col.c +++ b/usr.bin/col/col.c @@ -133,7 +133,7 @@ main(int argc, char *argv[]) max_bufd_lines = strtonum(optarg, 1, (INT_MAX - BUFFER_MARGIN) / 2, &errstr) * 2; if (errstr != NULL) - errx(1, "bad -l argument, %s: %s", errstr, + errx(1, "bad -l argument, %s: %s", errstr, optarg); break; case 'x': /* do not compress spaces into tabs */ diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c index f001982f0..a3924859e 100644 --- a/usr.bin/colrm/colrm.c +++ b/usr.bin/colrm/colrm.c @@ -113,7 +113,7 @@ main(int argc, char *argv[]) putchar('\b'); if (width > 1 && p[1] == '\b') putchar('\b'); - } + } if (width > 1 && p[1] == '\b') p++; column -= width; diff --git a/usr.bin/compress/compress.h b/usr.bin/compress/compress.h index 5faf59d0a..c2de7ad6a 100644 --- a/usr.bin/compress/compress.h +++ b/usr.bin/compress/compress.h @@ -83,4 +83,4 @@ extern int null_write(void *, const char *, int); extern int null_close(void *, struct z_info *, const char *, struct stat *); extern int null_flush(void *, int); -extern void setfile(const char *, int, struct stat *); +extern void setfile(const char *, int, struct stat *); diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c index 9977743af..eb7d95db6 100644 --- a/usr.bin/csplit/csplit.c +++ b/usr.bin/csplit/csplit.c @@ -463,5 +463,5 @@ do_lineno(const char *expr) if (reps-- == 0) break; lastline += tgtline; - } + } } diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c index 85551f1e7..f102dbb9d 100644 --- a/usr.bin/ctags/C.c +++ b/usr.bin/ctags/C.c @@ -246,7 +246,7 @@ endtok: if (sp > tok) { /* hell... truncate it */ if (sp == tok + sizeof tok - 1) *sp = EOS; - else + else *sp++ = c; token = YES; } @@ -385,7 +385,7 @@ hash_entry(void) /* hell... truncate it */ if (sp == tok + sizeof tok - 1) *sp = EOS; - else + else *sp++ = c; } *sp = EOS; @@ -401,7 +401,7 @@ hash_entry(void) /* hell... truncate it */ if (sp == tok + sizeof tok - 1) *sp = EOS; - else + else *sp++ = c; if (GETC(==, EOF)) return; @@ -446,7 +446,7 @@ str_entry(int c) /* hell... truncate it */ if (sp == tok + sizeof tok - 1) *sp = EOS; - else + else *sp++ = c; if (GETC(==, EOF)) return (NO); diff --git a/usr.bin/dig/lib/isc/unix/socket.c b/usr.bin/dig/lib/isc/unix/socket.c index 4e6141b56..171bcaf7f 100644 --- a/usr.bin/dig/lib/isc/unix/socket.c +++ b/usr.bin/dig/lib/isc/unix/socket.c @@ -837,7 +837,7 @@ doio_recv(isc_socket_t *sock, isc_socketevent_t *dev) { struct msghdr msghdr; char m[RECVCMSGBUFLEN]; } cmsgbuf; - + memset(&cmsgbuf, 0, sizeof(cmsgbuf)); build_msghdr_recv(sock, cmsgbuf.m, dev, &msghdr, iov, &read_count); @@ -997,7 +997,7 @@ doio_send(isc_socket_t *sock, isc_socketevent_t *dev) { struct msghdr msghdr; char m[SENDCMSGBUFLEN]; } cmsgbuf; - + memset(&cmsgbuf, 0, sizeof(cmsgbuf)); build_msghdr_send(sock, cmsgbuf.m, dev, &msghdr, iov, &write_count); diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index 3d68413a5..41b5071b5 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -166,7 +166,7 @@ main(int argc, char *argv[]) case FTS_D: /* Ignore. */ break; case FTS_DP: - p->fts_parent->fts_number += + p->fts_parent->fts_number += p->fts_number += p->fts_statp->st_blocks; if (cflag) totalblocks += p->fts_statp->st_blocks; diff --git a/usr.bin/fgen/fgen.h b/usr.bin/fgen/fgen.h index c6eb46b1d..47ebebe68 100644 --- a/usr.bin/fgen/fgen.h +++ b/usr.bin/fgen/fgen.h @@ -61,7 +61,7 @@ struct macro { }; /* - * FCode header -- assumes big-endian machine, + * FCode header -- assumes big-endian machine, * otherwise the bits need twiddling. */ struct fcode_header { @@ -72,21 +72,21 @@ struct fcode_header { }; /* Tokenizer tokens */ -enum toktypes { +enum toktypes { TOK_OCTAL = 8, TOK_DECIMAL = 10, TOK_HEX = 16, - TOK_NUMBER, - TOK_STRING_LIT, + TOK_NUMBER, + TOK_STRING_LIT, TOK_C_LIT, - TOK_PSTRING, + TOK_PSTRING, TOK_TOKENIZE, - TOK_COMMENT, - TOK_COLON, - TOK_SEMICOLON, + TOK_COMMENT, + TOK_COLON, + TOK_SEMICOLON, TOK_TOSTRING, - + /* These are special */ TOK_ABORT_S, TOK_AGAIN, diff --git a/usr.bin/fgen/fgen.l b/usr.bin/fgen/fgen.l index 5c14572a9..e28a0768a 100644 --- a/usr.bin/fgen/fgen.l +++ b/usr.bin/fgen/fgen.l @@ -2,7 +2,7 @@ /* $OpenBSD: fgen.l,v 1.15 2022/12/26 19:16:00 jmc Exp $ */ /* $NetBSD: fgen.l,v 1.37 2016/03/08 20:13:44 christos Exp $ */ /* FLEX input for FORTH input file scanner */ -/* +/* * Copyright (c) 1998 Eduardo Horvath. * All rights reserved. * @@ -72,7 +72,7 @@ static struct fcode *dictionary = NULL; static struct macro *aliases = NULL; static int outf = 1; /* stdout */ static int state = 0; -static int nextfcode = 0x800; +static int nextfcode = 0x800; static int numbase = TOK_HEX; static long outpos; static char *outbuf = NULL; @@ -152,16 +152,16 @@ erealloc(void *p, size_t sz) \'.\' { ltoken.type = TOK_C_LIT; ltoken.text = yytext; return <oken; } -\"{white}*(\\\"|[^"])*\" { ltoken.type = TOK_STRING_LIT; ltoken.text = yytext; +\"{white}*(\\\"|[^"])*\" { ltoken.type = TOK_STRING_LIT; ltoken.text = yytext; return <oken; } /* String started by `"' or `."' */ -\.\({white}*(\\\"|[^)])*\) { ltoken.type = TOK_PSTRING; ltoken.text = yytext; +\.\({white}*(\\\"|[^)])*\) { ltoken.type = TOK_PSTRING; ltoken.text = yytext; return <oken; } /* String of type `.(.....)' */ -\.\"{white}*(\\\"|[^"])*\" { ltoken.type = TOK_PSTRING; ltoken.text = yytext; +\.\"{white}*(\\\"|[^"])*\" { ltoken.type = TOK_PSTRING; ltoken.text = yytext; return <oken; } -[aA][bB][oO][rR][tT]\"{white}*(\\\"|[^"])*\" { ltoken.type = TOK_ABORT_S; +[aA][bB][oO][rR][tT]\"{white}*(\\\"|[^"])*\" { ltoken.type = TOK_ABORT_S; ltoken.text = yytext; return <oken; } "(" { ltoken.type = TOK_COMMENT; ltoken.text = yytext; @@ -233,7 +233,7 @@ erealloc(void *p, size_t sz) [eE][xX][tT][eE][rR][nN][aA][lL] { ltoken.type = TOK_EXTERNAL; ltoken.text = yytext; return <oken; } -[fF][cC][oO][dD][eE]-[vV][eE][rR][sS][iI][oO][nN]2 { +[fF][cC][oO][dD][eE]-[vV][eE][rR][sS][iI][oO][nN]2 { ltoken.type = TOK_FCODE_VERSION2; ltoken.text = yytext; return <oken; } @@ -281,7 +281,7 @@ erealloc(void *p, size_t sz) [sS][tT][aA][rR][tT][0124] { ltoken.type = TOK_STARTX; ltoken.text = yytext; return <oken; } - + [tT][hH][eE][nN] { ltoken.type = TOK_THEN; ltoken.text = yytext; return <oken; } @@ -778,7 +778,7 @@ cvt(const char *s, char **e, int base) for (c = *s; (c = *s); s++) { /* Ignore `.' */ - if (c == '.') + if (c == '.') continue; if (c >= '0' && c <= '9') c -= '0'; @@ -838,9 +838,9 @@ fadd(struct fcode *dict, struct fcode *new) new->type = FCODE; ASSERT(dict->type == FCODE); if (!res) { - /* + /* * Duplicate entry. Give the old name the new FCode - * number. + * number. */ dict->num = new->num; return (0); @@ -850,7 +850,7 @@ fadd(struct fcode *dict, struct fcode *new) return fadd(dict->l, new); else { if (debug > 5) - printf("fadd: new FCode `%s' is %lx\n", + printf("fadd: new FCode `%s' is %lx\n", new->name, new->num); new->l = new->r = NULL; dict->l = new; @@ -860,7 +860,7 @@ fadd(struct fcode *dict, struct fcode *new) return fadd(dict->r, new); else { if (debug > 5) - printf("fadd: new FCode `%s' is %lx\n", + printf("fadd: new FCode `%s' is %lx\n", new->name, new->num); new->l = new->r = NULL; dict->r = new; @@ -881,12 +881,12 @@ flookup(struct fcode *dict, const char *str) res = strcmp(dict->name, str); ASSERT(dict->type == FCODE); if (debug > 5) - printf("flookup: `%s' and `%s' %s match\n", + printf("flookup: `%s' and `%s' %s match\n", str, dict->name, res?"don't":"do"); if (!res) return (dict); if (res < 0) return (flookup(dict->l, str)); - else + else return (flookup(dict->r, str)); } @@ -914,7 +914,7 @@ aadd(struct macro *dict, struct macro *new) new->l = new->r = NULL; dict->l = new; if (debug > 5) - printf("aadd: new alias `%s' to `%s'\n", + printf("aadd: new alias `%s' to `%s'\n", new->name, new->equiv); } } else { @@ -924,7 +924,7 @@ aadd(struct macro *dict, struct macro *new) new->l = new->r = NULL; dict->r = new; if (debug > 5) - printf("aadd: new alias `%s' to `%s'\n", + printf("aadd: new alias `%s' to `%s'\n", new->name, new->equiv); } } @@ -945,7 +945,7 @@ alookup(struct macro *dict, const char *str) if (!res) return (dict); if (res < 0) return (alookup(dict->l, str)); - else + else return (alookup(dict->r, str)); } @@ -989,11 +989,11 @@ static int apply_macros(YY_BUFFER_STATE yinput, const char *str) { struct macro *xform = alookup(aliases, str); - + if (xform) { YY_BUFFER_STATE newbuf; - if (debug > 1) + if (debug > 1) printf("Expanding %s to %s\n", str, xform->equiv); newbuf = yy_scan_string(xform->equiv); @@ -1039,10 +1039,10 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - + if (argc != 1) usage(); - + infile = argv[0]; /* @@ -1056,7 +1056,7 @@ main(int argc, char *argv[]) emit(hdrtype); outpos = sizeof(*fheader); - /* + /* * Do it. */ if ((inf = fopen(infile, "r")) == NULL) @@ -1109,10 +1109,10 @@ tokenize(YY_BUFFER_STATE yinput) switch (token->type) { case TOK_NUMBER: STATE(token->text, "TOK_NUMBER"); - { + { char *end; Cell value; - + if (tokenizer) { push(strtol(token->text, &end, 16)); break; @@ -1122,7 +1122,7 @@ tokenize(YY_BUFFER_STATE yinput) token_err(yylineno, infile, yytext, "illegal number conversion"); - /* + /* * If this is a 64-bit value we need to store two literals * and issue a `lxjoin' to combine them. But that's a future * project. @@ -1132,7 +1132,7 @@ tokenize(YY_BUFFER_STATE yinput) spit((value>>16)&0x0ff); spit((value>>8)&0x0ff); spit(value&0x0ff); - if ((value>>32) != value && (value>>32) != 0 && + if ((value>>32) != value && (value>>32) != 0 && (value>>32) != -1) { emit("b(lit)"); spit((value>>56)&0x0ff); @@ -1151,12 +1151,12 @@ tokenize(YY_BUFFER_STATE yinput) spit(0); spit(token->text[1]); break; - case TOK_STRING_LIT: + case TOK_STRING_LIT: STATE(token->text, "TOK_STRING_LIT:"); { size_t len; char *p = token->text; - + ++p; /* Skip the quote */ len = strlen(++p); /* Skip the 1st space */ @@ -1174,7 +1174,7 @@ tokenize(YY_BUFFER_STATE yinput) sspit(p); } break; - case TOK_PSTRING: + case TOK_PSTRING: STATE(token->text, "TOK_PSTRING:"); { size_t len; @@ -1239,21 +1239,21 @@ tokenize(YY_BUFFER_STATE yinput) /* The next pass should tokenize the FCODE number */ emit("b(')"); break; - case TOK_COMMENT: + case TOK_COMMENT: STATE(token->text, "TOK_COMMENT:"); do { off = input(); - } while ((off != ')') && (off != '\n') && + } while ((off != ')') && (off != '\n') && (off != EOF)); break; - case TOK_COLON: + case TOK_COLON: STATE(token->text, "TOK_COLON:"); token = yylex(); if (token == NULL) token_err(yylineno, infile, yytext, "EOF in colon definition"); - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; @@ -1267,7 +1267,7 @@ tokenize(YY_BUFFER_STATE yinput) free(fcode); } if (debug) - printf("Adding %s to dictionary\n", token->text); + printf("Adding %s to dictionary\n", token->text); if (state == 0) emit("new-token"); else { @@ -1283,7 +1283,7 @@ tokenize(YY_BUFFER_STATE yinput) last_token = fcode->name; defining = 1; break; - case TOK_SEMICOLON: + case TOK_SEMICOLON: STATE(token->text, "TOK_SEMICOLON:"); emit("b(;)"); defining = 0; @@ -1325,7 +1325,7 @@ tokenize(YY_BUFFER_STATE yinput) free((void *)alias->name); free(alias); return; - } + } alias->equiv = estrdup(token->text); if (!aadd(aliases, alias)) { free((void *)alias->name); @@ -1371,13 +1371,13 @@ tokenize(YY_BUFFER_STATE yinput) warnx("EOF in colon definition"); return; } - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; fcode->name = estrdup(token->text); fadd(dictionary, fcode); - + if (state == 0) emit("new-token"); else { @@ -1404,13 +1404,13 @@ tokenize(YY_BUFFER_STATE yinput) warnx("EOF in constant definition"); return; } - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; fcode->name = estrdup(token->text); fadd(dictionary, fcode); - + if (state == 0) emit("new-token"); else { @@ -1443,13 +1443,13 @@ tokenize(YY_BUFFER_STATE yinput) warnx("EOF in create definition"); return; } - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; fcode->name = estrdup(token->text); fadd(dictionary, fcode); - + if (state == 0) emit("new-token"); else { @@ -1496,7 +1496,7 @@ tokenize(YY_BUFFER_STATE yinput) token_err(yylineno, infile, NULL, "Illegal number conversion: %s", token->text); - /* + /* * If this is a 64-bit value we need to store two literals * and issue a `lxjoin' to combine them. But that's a future * project. @@ -1524,13 +1524,13 @@ tokenize(YY_BUFFER_STATE yinput) warnx("EOF in colon definition"); return; } - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; fcode->name = estrdup(token->text); fadd(dictionary, fcode); - + if (state == 0) emit("new-token"); else { @@ -1563,7 +1563,7 @@ tokenize(YY_BUFFER_STATE yinput) * it generates the FCode and returns, with outpos at b2. We then * calculate the offsets, put them in the right slots and finishup. */ - + if (token->text[0] == '?') emit("b(?do)"); else @@ -1595,7 +1595,7 @@ tokenize(YY_BUFFER_STATE yinput) /* revert to the end */ outpos = pos; break; - case TOK_ENDCASE: + case TOK_ENDCASE: STATE(token->text, "TOK_ENDCASE:"); emit("b(endcase)"); pos = outpos; /* Remember where we need to branch to */ @@ -1611,7 +1611,7 @@ tokenize(YY_BUFFER_STATE yinput) /* Load next offset to process */ disp = (signed char)(outbuf[outpos]); if (offsetsize == 16) { - disp = (disp << 8) | + disp = (disp << 8) | (unsigned char)outbuf[outpos+1]; } next = outpos + disp; @@ -1631,7 +1631,7 @@ tokenize(YY_BUFFER_STATE yinput) STATE(token->text, "TOK_ENDOF"); off = pop(); emit("b(endof)"); - /* + /* * Save back pointer in the offset field so we can traverse * the linked list and patch it in the endcase. */ @@ -1665,7 +1665,7 @@ tokenize(YY_BUFFER_STATE yinput) outpos = pos; break; case TOK_FCODE_END: - /* + /* * Another tokenizer directive. * * This should generate end0 and finish filling in @@ -1675,19 +1675,19 @@ tokenize(YY_BUFFER_STATE yinput) return; case TOK_FIELD: STATE(token->text, "TOK_FIELD"); - + token = yylex(); if (token == NULL) { warnx("EOF in field definition"); return; } - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; fcode->name = estrdup(token->text); fadd(dictionary, fcode); - + if (state == 0) emit("new-token"); else { @@ -1701,7 +1701,7 @@ tokenize(YY_BUFFER_STATE yinput) spit(fcode->num); emit("b(field)"); break; - + case TOK_HEX: STATE(token->text, "TOK_HEX"); if (token->text[1] != '#') { @@ -1729,7 +1729,7 @@ tokenize(YY_BUFFER_STATE yinput) errx(EXIT_FAILURE, "Illegal number" " conversion:%s:%d: %s\n", infile, yylineno, yytext); - /* + /* * If this is a 64-bit value we need to store two literals * and issue a `lxjoin' to combine them. But that's a future * project. @@ -1813,7 +1813,7 @@ tokenize(YY_BUFFER_STATE yinput) " conversion:%s:%d: %s\n", infile, yylineno, yytext); } - /* + /* * If this is a 64-bit value we need to store two literals * and issue a `lxjoin' to combine them. But that's a future * project. @@ -1844,7 +1844,7 @@ tokenize(YY_BUFFER_STATE yinput) * `endcase'. Here we will generate a temporary * offset of the `of' associated with the `endof'. * Then in `endcase' we should be pointing just - * after the offset of the last `endof' so we + * after the offset of the last `endof' so we * calculate the offset and thread our way backwards * searching for the previous `b(case)' or `b(endof)'. */ @@ -1912,13 +1912,13 @@ tokenize(YY_BUFFER_STATE yinput) warnx("EOF in value definition"); return; } - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; fcode->name = estrdup(token->text); fadd(dictionary, fcode); - + if (state == 0) emit("new-token"); else { @@ -1940,13 +1940,13 @@ tokenize(YY_BUFFER_STATE yinput) warnx("EOF in variable definition"); return; } - + /* Add new code to dictionary */ fcode = emalloc(sizeof(*fcode)); fcode->num = nextfcode++; fcode->name = estrdup(token->text); fadd(dictionary, fcode); - + if (state == 0) emit("new-token"); else { @@ -2002,7 +2002,7 @@ tokenize(YY_BUFFER_STATE yinput) } infile = estrdup(token->text); if (mark_fload) { - /* + /* * Insert commands to print out the * filename into the instruction * stream @@ -2026,7 +2026,7 @@ tokenize(YY_BUFFER_STATE yinput) yy_delete_buffer(inbuf); fclose(inf); if (mark_fload) { - /* + /* * Insert commands to print out the * filename into the instruction * stream @@ -2052,7 +2052,7 @@ tokenize(YY_BUFFER_STATE yinput) if (emit(token->text)) { #if 0 /* - * Call an external command + * Call an external command * * XXXXX assumes it will always find the command */ @@ -2185,7 +2185,7 @@ offspit(long n) } } -int +int yywrap(void) { /* Always generate EOF */ diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c index bb66db11c..9b016ca97 100644 --- a/usr.bin/gencat/gencat.c +++ b/usr.bin/gencat/gencat.c @@ -20,7 +20,7 @@ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS @@ -296,7 +296,7 @@ getmsg(int fd, char *cptr, char quote) if (quote && *cptr == quote) { ++cptr; - } + } clen = strlen(cptr) + 1; if (clen > msglen) { @@ -367,7 +367,7 @@ getmsg(int fd, char *cptr, char quote) * escape ' and ", let's accept * them escaped and not complain. * (XPG4 states that '\' should be - * ignored when not used in a + * ignored when not used in a * valid escape sequence) */ *tptr++ = '"'; diff --git a/usr.bin/gprof/dfn.c b/usr.bin/gprof/dfn.c index c7cce4a8c..3dfc01246 100644 --- a/usr.bin/gprof/dfn.c +++ b/usr.bin/gprof/dfn.c @@ -127,7 +127,7 @@ dfn_pre_visit(nltype *parentp) bool dfn_numbered(nltype *childp) { - + return ( childp -> toporder != DFN_NAN && childp -> toporder != DFN_BUSY ); } @@ -202,7 +202,7 @@ dfn_findcycle(nltype *childp) * if what we think is the top of the cycle * has a cyclehead field, then it's not really the * head of the cycle, which is really what we want - */ + */ if ( cycleheadp -> cyclehead != cycleheadp ) { cycleheadp = cycleheadp -> cyclehead; # ifdef DEBUG diff --git a/usr.bin/gprof/gprof.c b/usr.bin/gprof/gprof.c index cbef100bb..623905bb6 100644 --- a/usr.bin/gprof/gprof.c +++ b/usr.bin/gprof/gprof.c @@ -224,15 +224,15 @@ main(int argc, char *argv[]) /* * print the dynamic profile */ - printgprof( timesortnlp ); + printgprof( timesortnlp ); /* * print the flat profile */ - printprof(); + printprof(); /* * print the index */ - printindex(); + printindex(); return (0); } @@ -410,7 +410,7 @@ readsamples(FILE *pfile) { UNIT sample; int i; - + if (samples == 0) { samples = calloc(sampbytes, sizeof (UNIT)); if (samples == 0) @@ -491,7 +491,7 @@ asgnsamples(void) svalue0 = nl[j].svalue; svalue1 = nl[j+1].svalue; /* - * if high end of tick is below entry address, + * if high end of tick is below entry address, * go for next tick. */ if (pch < svalue0) @@ -508,7 +508,7 @@ asgnsamples(void) if (debug & SAMPLEDEBUG) { printf("[asgnsamples] (0x%lx->0x%lx-0x%lx) %s gets %f ticks %ld overlap\n", nl[j].value/sizeof(UNIT), svalue0, svalue1, - nl[j].name, + nl[j].name, overlap * time / scale, overlap); } # endif /* DEBUG */ diff --git a/usr.bin/gprof/gprof.callg b/usr.bin/gprof/gprof.callg index 533c96ca4..ed9f5b01f 100644 --- a/usr.bin/gprof/gprof.callg +++ b/usr.bin/gprof/gprof.callg @@ -105,4 +105,4 @@ index the index of this child in the call graph listing, fields as a function entry. Below it are listed the members of the cycle, and their contributions to the time and call counts of the cycle. - + diff --git a/usr.bin/gprof/gprof.flat b/usr.bin/gprof/gprof.flat index 60999a35f..d9cccd46c 100644 --- a/usr.bin/gprof/gprof.flat +++ b/usr.bin/gprof/gprof.flat @@ -15,13 +15,13 @@ seconds function alone. This is the major sort for this calls the number of times this function was invoked, if this function is profiled, else blank. - + self the average number of milliseconds spent in this ms/call function per call, if this function is profiled, else blank. total the average number of milliseconds spent in this -ms/call function and its descendents per call, if this +ms/call function and its descendents per call, if this function is profiled, else blank. name the name of the function. This is the minor sort @@ -29,4 +29,4 @@ name the name of the function. This is the minor sort the function in the gprof listing. If the index is in parenthesis it shows where it would appear in the gprof listing if it were to be printed. - + diff --git a/usr.bin/gprof/gprof.h b/usr.bin/gprof/gprof.h index 059805652..11fdfdea7 100644 --- a/usr.bin/gprof/gprof.h +++ b/usr.bin/gprof/gprof.h @@ -154,7 +154,7 @@ extern int cyclecnt; /* the number of cycles found */ #define DFN_BUSY -1 #define DFN_NAN 0 - /* + /* * namelist entries for cycle headers. * the number of discovered cycles. */ diff --git a/usr.bin/gprof/lookup.c b/usr.bin/gprof/lookup.c index af77a615c..3907d48cc 100644 --- a/usr.bin/gprof/lookup.c +++ b/usr.bin/gprof/lookup.c @@ -34,7 +34,7 @@ /* * look up an address in a sorted-by-address namelist - * this deals with misses by mapping them to the next lower + * this deals with misses by mapping them to the next lower * entry point. */ nltype * diff --git a/usr.bin/gprof/printgprof.c b/usr.bin/gprof/printgprof.c index da43e7ddf..e2b5e321c 100644 --- a/usr.bin/gprof/printgprof.c +++ b/usr.bin/gprof/printgprof.c @@ -88,7 +88,7 @@ timecmp(const void *v1, const void *v2) void flatprofheader() { - + if (bflag) printblurb( _PATH_FLAT_BLURB ); printf("\ngranularity: each sample hit covers %ld byte(s)", @@ -268,7 +268,7 @@ totalcmp(const void *v1, const void *v2) return 1; if ( np1 -> ncall > np2 -> ncall ) return -1; - if ( np1 -> ncall < np2 -> ncall ) + if ( np1 -> ncall < np2 -> ncall ) return 1; return strcmp( np1 -> name , np2 -> name ); } diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c index 8679c11bd..2a9f7e420 100644 --- a/usr.bin/indent/indent.c +++ b/usr.bin/indent/indent.c @@ -613,7 +613,7 @@ check_type: if (ps.in_decl && !ps.block_init) if (troff && !ps.dumped_decl_indent && !is_procname && ps.last_token == decl) { ps.dumped_decl_indent = 1; - snprintf(e_code, (l_code - e_code) + 5, + snprintf(e_code, (l_code - e_code) + 5, "\n.Du %dp+\200p \"%s\"\n", dec_ind * 7, token); e_code += strlen(e_code); CHECK_SIZE_CODE; diff --git a/usr.bin/indent/io.c b/usr.bin/indent/io.c index 3fcfbf585..9667baafe 100644 --- a/usr.bin/indent/io.c +++ b/usr.bin/indent/io.c @@ -316,18 +316,18 @@ compute_label_target(void) /* * Copyright (C) 1976 by the Board of Trustees of the University of Illinois - * + * * All rights reserved - * - * + * + * * NAME: fill_buffer - * + * * FUNCTION: Reads one block of input into input_buffer - * + * * HISTORY: initial coding November 1976 D A Willcox of CAC 1/7/77 A * Willcox of CAC Added check for switch back to partly full input * buffer from temporary buffer - * + * */ void fill_buffer(void) @@ -420,31 +420,31 @@ fill_buffer(void) /* * Copyright (C) 1976 by the Board of Trustees of the University of Illinois - * + * * All rights reserved - * - * + * + * * NAME: pad_output - * + * * FUNCTION: Writes tabs and spaces to move the current column up to the desired * position. - * + * * ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf. - * + * * PARAMETERS: current integer The current column target * target integer The desired column - * + * * RETURNS: Integer value of the new column. (If current >= target, no action is * taken, and current is returned. - * + * * GLOBALS: None - * + * * CALLS: write (sys) - * + * * CALLED BY: dump_line - * + * * HISTORY: initial coding November 1976 D A Willcox of CAC - * + * */ int pad_output(int current, int target) @@ -472,23 +472,23 @@ pad_output(int current, int target) /* * Copyright (C) 1976 by the Board of Trustees of the University of Illinois - * + * * All rights reserved - * - * + * + * * NAME: count_spaces - * + * * FUNCTION: Find out where printing of a given string will leave the current * character position on output. - * + * * ALGORITHM: Run thru input string and add appropriate values to current * position. - * + * * RETURNS: Integer value of position after printing "buffer" starting in column * "current". - * + * * HISTORY: initial coding November 1976 D A Willcox of CAC - * + * */ int count_spaces(int current, char *buffer) diff --git a/usr.bin/indent/lexi.c b/usr.bin/indent/lexi.c index 19b11057b..47f68e2ef 100644 --- a/usr.bin/indent/lexi.c +++ b/usr.bin/indent/lexi.c @@ -202,7 +202,7 @@ lexi(void) } break; } - if (!(seensfx & 1) && + if (!(seensfx & 1) && (*buf_ptr == 'F' || *buf_ptr == 'f')) { CHECK_SIZE_TOKEN; *e_token++ = *buf_ptr++; diff --git a/usr.bin/infocmp/infocmp.c b/usr.bin/infocmp/infocmp.c index 9caaa8f08..3e3764349 100644 --- a/usr.bin/infocmp/infocmp.c +++ b/usr.bin/infocmp/infocmp.c @@ -1523,7 +1523,7 @@ main(int argc, char *argv[]) argv[optind], tfile[termcount]); status = _nc_read_file_entry(tfile[termcount], - &entries[termcount].tterm); + &entries[termcount].tterm); #else (void) fprintf(stderr, "%s: terminfo files not supported\n", _nc_progname); diff --git a/usr.bin/kdump/ktrstruct.c b/usr.bin/kdump/ktrstruct.c index 88fedd466..6ced5cfc3 100644 --- a/usr.bin/kdump/ktrstruct.c +++ b/usr.bin/kdump/ktrstruct.c @@ -516,7 +516,7 @@ ktrcmsghdr(char *data, socklen_t len) printf("SCM_RIGHTS, data="); fds = (int *)CMSG_DATA(cmsg); for (i = 0; - cmsg->cmsg_len > CMSG_LEN(sizeof(int) * i) + cmsg->cmsg_len > CMSG_LEN(sizeof(int) * i) && (char *)fds + (i + 1) * sizeof(int) <= data + len; i++) { @@ -595,7 +595,7 @@ ktrstruct(char *buf, size_t buflen) sizeof(ss.ss_len)) goto invalid; memcpy(&ss, data, datalen); - if ((ss.ss_family != AF_UNIX && + if ((ss.ss_family != AF_UNIX && datalen < sizeof(struct sockaddr)) || datalen != ss.ss_len) goto invalid; ktrsockaddr((struct sockaddr *)&ss); diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr index 2762a0d97..74b349285 100644 --- a/usr.bin/kdump/mksubr +++ b/usr.bin/kdump/mksubr @@ -456,7 +456,7 @@ dosocktypename (int arg, int show_type) { int type = arg & 0xff; /* XXX */ int or = 0; - + printf("%#x<", arg); if (show_type || type) { or = 1; diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c index c49ecd58d..26d963761 100644 --- a/usr.bin/ktrace/ktrace.c +++ b/usr.bin/ktrace/ktrace.c @@ -151,7 +151,7 @@ main(int argc, char *argv[]) argv += optind; argc -= optind; - + if ((pidset && *argv) || (!pidset && !*argv && clear != CLEAR)) usage(); @@ -192,7 +192,7 @@ main(int argc, char *argv[]) (void)umask(omask); (void)close(fd); - if (*argv) { + if (*argv) { if (is_ltrace) { if (setenv("LD_TRACE_PLT", inherit ? "i" : "", 1) < 0) err(1, "setenv(LD_TRACE_PLT)"); diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c index 68399226c..0153595f4 100644 --- a/usr.bin/last/last.c +++ b/usr.bin/last/last.c @@ -420,7 +420,7 @@ want(struct utmp *bp, int check) if (check) { /* - * some entries, such as ftp and uucp, will + * some entries, such as ftp and uucp, will * include process name plus id; exclude entries * that start with 'console' and 'tty' from * having the process id stripped. diff --git a/usr.bin/ldap/aldap.c b/usr.bin/ldap/aldap.c index aee14a62a..abfabdbf4 100644 --- a/usr.bin/ldap/aldap.c +++ b/usr.bin/ldap/aldap.c @@ -265,9 +265,9 @@ aldap_search(struct aldap *ldap, char *basedn, enum scope scope, char *filter, goto fail; } - c = ber; + c = ber; ber = ober_printf_elements(ber, "sEEddb", basedn, (long long)scope, - (long long)LDAP_DEREF_NEVER, sizelimit, + (long long)LDAP_DEREF_NEVER, sizelimit, timelimit, typesonly); if (ber == NULL) { ldap->err = ALDAP_ERR_OPERATION_FAILED; @@ -339,7 +339,7 @@ aldap_create_page_control(struct ber_element *elm, int size, fail: if (ber != NULL) ober_free_elements(ber); - ober_free(&c); + ober_free(&c); return (-1); } @@ -451,7 +451,7 @@ parsefail: } struct aldap_page_control * -aldap_parse_page_control(struct ber_element *control, size_t len) +aldap_parse_page_control(struct ber_element *control, size_t len) { char *oid, *s; char *encoded; diff --git a/usr.bin/ldap/aldap.h b/usr.bin/ldap/aldap.h index bf36c3c2a..111b1aa2e 100644 --- a/usr.bin/ldap/aldap.h +++ b/usr.bin/ldap/aldap.h @@ -75,7 +75,7 @@ struct aldap_message { } search; } body; struct ber_element *references; - struct aldap_page_control *page; + struct aldap_page_control *page; }; enum aldap_protocol { diff --git a/usr.bin/leave/leave.c b/usr.bin/leave/leave.c index 52cabce1f..827e7e261 100644 --- a/usr.bin/leave/leave.c +++ b/usr.bin/leave/leave.c @@ -107,7 +107,7 @@ main(int argc, char *argv[]) usage(); (void)time(&now); t = localtime(&now); - while (t->tm_hour > hours || + while (t->tm_hour > hours || (t->tm_hour == hours && t->tm_min >= minutes)) { if (twentyfour) hours += 24; diff --git a/usr.bin/lex/ccl.c b/usr.bin/lex/ccl.c index 1c9e42e0f..98644ebf5 100644 --- a/usr.bin/lex/ccl.c +++ b/usr.bin/lex/ccl.c @@ -54,7 +54,7 @@ ccl_contains(const int cclp, const int ch) /* ccladd - add a single character to a ccl */ -void +void ccladd(cclp, ch) int cclp; int ch; @@ -92,7 +92,7 @@ ccladd(cclp, ch) /* dump_cclp - same thing as list_character_set, but for cclps. */ -static void +static void dump_cclp(FILE * file, int cclp) { int i; @@ -189,7 +189,7 @@ ccl_set_union(int a, int b) /* cclinit - return an empty ccl */ -int +int cclinit() { if (++lastccl >= current_maxccls) { @@ -230,7 +230,7 @@ cclinit() /* cclnegate - negate the given ccl */ -void +void cclnegate(cclp) int cclp; { @@ -246,7 +246,7 @@ cclnegate(cclp) * has a non-zero value in the cset array. */ -void +void list_character_set(file, cset) FILE *file; int cset[]; @@ -288,7 +288,7 @@ list_character_set(file, cset) * @param c2 the upper end of the range * @return true if [c1-c2] is not ambiguous for a caseless scanner. */ -bool +bool range_covers_case(int c1, int c2) { int i, o; @@ -306,14 +306,14 @@ range_covers_case(int c1, int c2) /** Reverse the case of a character, if possible. * @return c if case-reversal does not apply. */ -int +int reverse_case(int c) { return isupper(c) ? tolower(c) : (islower(c) ? toupper(c) : c); } /** Return true if c is uppercase or lowercase. */ -bool +bool has_case(int c) { return (isupper(c) || islower(c)) ? true : false; diff --git a/usr.bin/lex/ecs.c b/usr.bin/lex/ecs.c index c5267516b..a096245a0 100644 --- a/usr.bin/lex/ecs.c +++ b/usr.bin/lex/ecs.c @@ -38,7 +38,7 @@ /* ccl2ecl - convert character classes to set of equivalence classes */ -void +void ccl2ecl(void) { int i, ich, newlen, cclp, ccls, cclmec; @@ -78,7 +78,7 @@ ccl2ecl(void) * Returned is the number of classes. */ -int +int cre8ecs(int *fwd, int *bck, int num) { int i, j, numcl; @@ -115,7 +115,7 @@ cre8ecs(int *fwd, int *bck, int num) * NUL_mapping is the value which NUL (0) should be mapped to. */ -void +void mkeccl(u_char *ccls, int lenccl, int *fwd, int *bck, int llsiz, int NUL_mapping) { int cclp, oldec, newec; @@ -206,7 +206,7 @@ mkeccl(u_char *ccls, int lenccl, int *fwd, int *bck, int llsiz, int NUL_mapping) /* mkechar - create equivalence class for single character */ -void +void mkechar(int tch, int *fwd, int *bck) { /* diff --git a/usr.bin/lex/filter.c b/usr.bin/lex/filter.c index 22b3fccba..2c9bbce46 100644 --- a/usr.bin/lex/filter.c +++ b/usr.bin/lex/filter.c @@ -125,7 +125,7 @@ filter_create_int(struct filter * chain, * @param chain The head of the chain. * @return true on success. */ -bool +bool filter_apply_chain(struct filter * chain) { int pid, pipes[2]; @@ -201,7 +201,7 @@ filter_apply_chain(struct filter * chain) * @param max_len the maximum length of the chain. * @return the resulting length of the chain. */ -int +int filter_truncate(struct filter * chain, int max_len) { int len = 1; @@ -223,7 +223,7 @@ filter_truncate(struct filter * chain, int max_len) * The header file name is in extra. * @return 0 (zero) on success, and -1 on failure. */ -int +int filter_tee_header(struct filter * chain) { /* @@ -337,7 +337,7 @@ filter_tee_header(struct filter * chain) * not user code. This also happens to be a good place to squeeze multiple * blank lines into a single blank line. */ -int +int filter_fix_linedirs(struct filter * chain) { char *buf; diff --git a/usr.bin/lex/flex.skl b/usr.bin/lex/flex.skl index 12a78ba58..cfc6a1baa 100644 --- a/usr.bin/lex/flex.skl +++ b/usr.bin/lex/flex.skl @@ -15,10 +15,10 @@ %# through m4. Macros beginning with `m4_' will be processed. %# The quoting is "[[" and "]]" so we don't interfere with %# user code. -%# +%# %# All generate macros for the m4 stage contain the text "m4" or "M4" %# in them. This is to distinguish them from CPP macros. -%# The exception to this rule is YY_G, which is an m4 macro, +%# The exception to this rule is YY_G, which is an m4 macro, %# but it needs to be remain short because it is used everywhere. %# /* A lexical scanner generated by flex */ @@ -31,7 +31,7 @@ m4_changecom m4_changequote m4_changequote([[, ]]) -%# +%# %# Lines in this skeleton starting with a "%" character are "control lines" %# and affect the generation of the scanner. The possible control codes are %# listed and processed in misc.c. @@ -217,7 +217,7 @@ m4preproc_include(`flexint.h') %if-c++-only /* begin standard C++ headers. */ -#include +#include #include #include #include @@ -250,13 +250,13 @@ m4preproc_include(`flexint.h') %# e.g., %# The function prototype %# int foo(int x, char* y); -%# +%# %# ...should be written as %# int foo M4_YY_PARAMS(int x, char* y); -%# +%# %# ...which could possibly generate %# int foo (); -%# +%# m4_ifdef( [[M4_YY_NO_ANSI_FUNC_PROTOS]], [[ m4_define( [[M4_YY_PARAMS]], [[()]]) @@ -331,7 +331,7 @@ m4_define( [[M4_YY_DOC_PARAM]], [[@param yyscanner The scanner object.]]) #define yy_flex_debug YY_G(yy_flex_debug_r) m4_define( [[M4_YY_INCR_LINENO]], -[[ +[[ do{ yylineno++; yycolumn=0; }while(0) @@ -344,7 +344,7 @@ m4_define( [[M4_YY_INCR_LINENO]], %if-not-reentrant m4_define( [[M4_YY_INCR_LINENO]], -[[ +[[ yylineno++; ]]) @@ -493,7 +493,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]], [[ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. + * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. @@ -588,7 +588,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. @@ -1175,7 +1175,7 @@ int yytables_destroy M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG); /** Describes a mapping from a serialized table id to its deserialized state in * this scanner. This is the bridge between our "generic" deserialization code - * and the specifics of this scanner. + * and the specifics of this scanner. */ struct yytbl_dmap { enum yytbl_id dm_id;/**< table identifier */ @@ -2272,10 +2272,10 @@ void yyFlexLexer::yyensure_buffer_stack(void) M4_YY_CALL_LAST_ARG); if ( ! YY_G(yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - + + memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + YY_G(yy_buffer_stack_max) = num_to_alloc; YY_G(yy_buffer_stack_top) = 0; return; @@ -2311,7 +2311,7 @@ m4_ifdef( [[M4_YY_NO_SCAN_BUFFER]],, * @param base the character buffer * @param size the size in bytes of the character buffer * M4_YY_DOC_PARAM - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size) { @@ -2543,7 +2543,7 @@ m4_ifdef( [[M4_YY_NO_GET_LINENO]],, int yyget_lineno YYFARGS0(void) { M4_YY_DECL_GUTS_VAR(); - + m4_ifdef( [[M4_YY_REENTRANT]], [[ if (! YY_CURRENT_BUFFER) @@ -2563,7 +2563,7 @@ m4_ifdef( [[M4_YY_NO_GET_COLUMN]],, int yyget_column YYFARGS0(void) { M4_YY_DECL_GUTS_VAR(); - + m4_ifdef( [[M4_YY_REENTRANT]], [[ if (! YY_CURRENT_BUFFER) @@ -2830,20 +2830,20 @@ int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + yyset_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } @@ -3118,7 +3118,7 @@ static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap, return NULL; } -/** Read a table while mapping its contents to the local array. +/** Read a table while mapping its contents to the local array. * @param dmap used to performing mapping * @return 0 on success */ @@ -3163,7 +3163,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read if(M4_YY_TABLES_VERIFY) /* We point to the array itself */ - p = dmap->dm_arr; + p = dmap->dm_arr; else /* We point to the address of a pointer. */ *dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG); @@ -3210,7 +3210,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read rv = yytbl_read8 (&t8, rd); t32 = t8; break; - default: + default: YY_FATAL_ERROR( "invalid td_flags" ); /* TODO: not fatal. */ return -1; } @@ -3267,7 +3267,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read YY_FATAL_ERROR( "transition table not found" ); /* TODO: not fatal. */ return -1; } - + if( M4_YY_TABLES_VERIFY) v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]); else @@ -3278,7 +3278,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read YY_FATAL_ERROR( "tables verification failed at YYTD_PTRANS" ); }else ((struct yy_trans_info **) p)[0] = v; - + /* increment p */ p = (struct yy_trans_info **) p + 1; } @@ -3394,7 +3394,7 @@ int yytables_fload YYFARGS1(FILE *, fp) /** Destroy the loaded tables, freeing memory, etc.. */ int yytables_destroy YYFARGS0(void) -{ +{ struct yytbl_dmap *dmap=0; if(!M4_YY_TABLES_VERIFY){ diff --git a/usr.bin/lex/flexint.h b/usr.bin/lex/flexint.h index aa7613475..4b6c332a3 100644 --- a/usr.bin/lex/flexint.h +++ b/usr.bin/lex/flexint.h @@ -10,7 +10,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -27,7 +27,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; diff --git a/usr.bin/lex/gen.c b/usr.bin/lex/gen.c index 0a3f29fa3..e82937379 100644 --- a/usr.bin/lex/gen.c +++ b/usr.bin/lex/gen.c @@ -84,7 +84,7 @@ get_state_decl(void) /* Indent to the current level. */ -void +void do_indent() { int i = indent_level * 8; @@ -128,7 +128,7 @@ mkeoltbl(void) } /* Generate the table for possible eol matches. */ -static void +static void geneoltbl() { int i; @@ -153,7 +153,7 @@ geneoltbl() /* Generate the code to keep backing-up information. */ -void +void gen_backing_up() { if (reject || num_backing_up == 0) @@ -175,7 +175,7 @@ gen_backing_up() /* Generate the code to perform the backing up. */ -void +void gen_bu_action() { if (reject || num_backing_up == 0) @@ -238,7 +238,7 @@ mkctbl(void) * The offset is base[nxt[i]] - (base of current state)]. That's * just the difference between the starting points of the two * involved states (to - from). - * + * * First, though, we need to find some way to put in our end-of-buffer * flags and states. We do this by making a state with absolutely no * transitions. We put it at the end of the table. @@ -341,7 +341,7 @@ mkssltbl(void) /* genctbl - generates full speed compressed transition table */ -void +void genctbl() { int i; @@ -359,7 +359,7 @@ genctbl() * The offset is base[nxt[i]] - (base of current state)]. That's * just the difference between the starting points of the two * involved states (to - from). - * + * * First, though, we need to find some way to put in our end-of-buffer * flags and states. We do this by making a state with absolutely no * transitions. We put it at the end of the table. @@ -475,7 +475,7 @@ mkecstbl(void) /* Generate equivalence-class tables. */ -void +void genecs() { int i, j; @@ -511,7 +511,7 @@ genecs() /* Generate the code to find the action number. */ -void +void gen_find_action() { if (fullspd) @@ -689,7 +689,7 @@ mkftbl(void) /* genftbl - generate full transition table */ -void +void genftbl() { int i; @@ -724,7 +724,7 @@ genftbl() /* Generate the code to find the next compressed-table state. */ -void +void gen_next_compressed_state(char_map) char *char_map; { @@ -770,7 +770,7 @@ gen_next_compressed_state(char_map) /* Generate the code to find the next match. */ -void +void gen_next_match() { /* @@ -872,7 +872,7 @@ gen_next_match() /* Generate the code to find the next state. */ -void +void gen_next_state(worry_about_NULs) int worry_about_NULs; { /* NOTE - changes in here should be reflected @@ -939,7 +939,7 @@ gen_next_state(worry_about_NULs) /* Generate the code to make a NUL transition. */ -void +void gen_NUL_trans() { /* NOTE - changes in here should be reflected * in gen_next_match() */ @@ -1024,7 +1024,7 @@ gen_NUL_trans() /* Generate the code to find the start state. */ -void +void gen_start_state() { if (fullspd) { @@ -1055,7 +1055,7 @@ gen_start_state() /* gentabs - generate data statements for the transition tables */ -void +void gentabs() { int i, j, k, *accset, nacc, *acc_array, total_states; @@ -1080,7 +1080,7 @@ gentabs() if (reject) { /* * Write out accepting list and pointer list. - * + * * First we generate the "yy_acclist" array. In the process, we * compute the indices that will go into the "yy_accept" * array, and save the indices in the dfaacc array. @@ -1474,7 +1474,7 @@ gentabs() * current indentation level, adding a final newline. */ -void +void indent_put2s(fmt, arg) const char *fmt, *arg; { @@ -1488,7 +1488,7 @@ indent_put2s(fmt, arg) * newline. */ -void +void indent_puts(str) const char *str; { @@ -1500,7 +1500,7 @@ indent_puts(str) /* make_tables - generate transition tables and finishes generating output file */ -void +void make_tables() { int i; diff --git a/usr.bin/lex/libmain.c b/usr.bin/lex/libmain.c index b7b11acae..9bcca25cc 100644 --- a/usr.bin/lex/libmain.c +++ b/usr.bin/lex/libmain.c @@ -25,7 +25,7 @@ extern int yylex(); -int +int main(argc, argv) int argc; char *argv[]; diff --git a/usr.bin/lex/libyywrap.c b/usr.bin/lex/libyywrap.c index de8b09bdd..d001f2bae 100644 --- a/usr.bin/lex/libyywrap.c +++ b/usr.bin/lex/libyywrap.c @@ -23,7 +23,7 @@ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ -int +int yywrap(void) { return 1; diff --git a/usr.bin/lex/misc.c b/usr.bin/lex/misc.c index 4562beca3..59057687c 100644 --- a/usr.bin/lex/misc.c +++ b/usr.bin/lex/misc.c @@ -58,7 +58,7 @@ struct sko_state { }; static struct sko_state *sko_stack = 0; static int sko_len = 0, sko_sz = 0; -static void +static void sko_push(bool dc) { if (!sko_stack) { @@ -76,7 +76,7 @@ sko_push(bool dc) sko_stack[sko_len].dc = dc; sko_len++; } -static void +static void sko_peek(bool * dc) { if (sko_len <= 0) @@ -84,7 +84,7 @@ sko_peek(bool * dc) if (dc) *dc = sko_stack[sko_len - 1].dc; } -static void +static void sko_pop(bool * dc) { sko_peek(dc); @@ -94,7 +94,7 @@ sko_pop(bool * dc) } /* Append "#define defname value\n" to the running buffer. */ -void +void action_define(defname, value) const char *defname; int value; @@ -121,7 +121,7 @@ action_define(defname, value) * @param defname The macro name. * @param value The macro value, can be NULL, which is the same as the empty string. */ -void +void action_m4_define(const char *defname, const char *value) { char buf[MAXLINE]; @@ -139,7 +139,7 @@ action_m4_define(const char *defname, const char *value) } /* Append "new_text" to the running buffer. */ -void +void add_action(new_text) const char *new_text; { @@ -190,7 +190,7 @@ allocate_array(size, element_size) /* all_lower - true if a string is all lower-case */ -int +int all_lower(str) char *str; { @@ -206,7 +206,7 @@ all_lower(str) /* all_upper - true if a string is all upper-case */ -int +int all_upper(str) char *str; { @@ -222,7 +222,7 @@ all_upper(str) /* intcmp - compares two integers for use by qsort. */ -int +int intcmp(const void *a, const void *b) { return *(const int *) a - *(const int *) b; @@ -234,7 +234,7 @@ intcmp(const void *a, const void *b) * and exits. */ -void +void check_char(c) int c; { @@ -252,7 +252,7 @@ check_char(c) /* clower - replace upper-case letter to lower-case */ -u_char +u_char clower(c) int c; { @@ -311,7 +311,7 @@ copy_unsigned_string(str) /* cclcmp - compares two characters for use by qsort with '\0' sorting last. */ -int +int cclcmp(const void *a, const void *b) { if (!*(const u_char *) a) @@ -325,7 +325,7 @@ cclcmp(const void *a, const void *b) /* dataend - finish up a block of data declarations */ -void +void dataend() { /* short circuit any output */ @@ -344,7 +344,7 @@ dataend() /* dataflush - flush generated data statements */ -void +void dataflush() { /* short circuit any output */ @@ -368,7 +368,7 @@ dataflush() /* flexerror - report an error message and terminate */ -void +void flexerror(msg) const char *msg; { @@ -379,7 +379,7 @@ flexerror(msg) /* flexfatal - report a fatal error message and terminate */ -void +void flexfatal(msg) const char *msg; { @@ -391,7 +391,7 @@ flexfatal(msg) /* htoi - convert a hexadecimal digit string to an integer value */ -int +int htoi(str) u_char str[]; { @@ -405,7 +405,7 @@ htoi(str) /* lerrif - report an error message formatted with one integer argument */ -void +void lerrif(msg, arg) const char *msg; int arg; @@ -419,7 +419,7 @@ lerrif(msg, arg) /* lerrsf - report an error message formatted with one string argument */ -void +void lerrsf(msg, arg) const char *msg, arg[]; { @@ -433,7 +433,7 @@ lerrsf(msg, arg) /* lerrsf_fatal - as lerrsf, but call flexfatal */ -void +void lerrsf_fatal(msg, arg) const char *msg, arg[]; { @@ -447,7 +447,7 @@ lerrsf_fatal(msg, arg) /* line_directive_out - spit out a "#line" statement */ -void +void line_directive_out(output_file, do_infile) FILE *output_file; int do_infile; @@ -498,7 +498,7 @@ line_directive_out(output_file, do_infile) * representing where the user's section 1 definitions end * and the prolog begins */ -void +void mark_defs1() { defs1_offset = 0; @@ -511,7 +511,7 @@ mark_defs1() /* mark_prolog - mark the current position in the action array as * representing the end of the action prolog */ -void +void mark_prolog() { action_array[action_index++] = '\0'; @@ -524,7 +524,7 @@ mark_prolog() * * Generates a data statement initializing the current 2-D array to "value". */ -void +void mk2data(value) int value; { @@ -554,7 +554,7 @@ mk2data(value) * Generates a data statement initializing the current array element to * "value". */ -void +void mkdata(value) int value; { @@ -580,7 +580,7 @@ mkdata(value) /* myctoi - return the integer represented by a string of digits */ -int +int myctoi(array) const char *array; { @@ -594,7 +594,7 @@ myctoi(array) /* myesc - return character corresponding to escape sequence */ -u_char +u_char myesc(array) u_char array[]; { @@ -685,7 +685,7 @@ myesc(array) /* otoi - convert an octal digit string to an integer value */ -int +int otoi(str) u_char str[]; { @@ -700,14 +700,14 @@ otoi(str) * generated scanner, keeping track of the line count. */ -void +void out(str) const char *str; { fputs(str, stdout); } -void +void out_dec(fmt, n) const char *fmt; int n; @@ -715,7 +715,7 @@ out_dec(fmt, n) fprintf(stdout, fmt, n); } -void +void out_dec2(fmt, n1, n2) const char *fmt; int n1, n2; @@ -723,7 +723,7 @@ out_dec2(fmt, n1, n2) fprintf(stdout, fmt, n1, n2); } -void +void out_hex(fmt, x) const char *fmt; unsigned int x; @@ -731,21 +731,21 @@ out_hex(fmt, x) fprintf(stdout, fmt, x); } -void +void out_str(fmt, str) const char *fmt, str[]; { fprintf(stdout, fmt, str); } -void +void out_str3(fmt, s1, s2, s3) const char *fmt, s1[], s2[], s3[]; { fprintf(stdout, fmt, s1, s2, s3); } -void +void out_str_dec(fmt, str, n) const char *fmt, str[]; int n; @@ -753,14 +753,14 @@ out_str_dec(fmt, str, n) fprintf(stdout, fmt, str, n); } -void +void outc(c) int c; { fputc(c, stdout); } -void +void outn(str) const char *str; { @@ -773,7 +773,7 @@ outn(str) * @param val The definition; may be NULL. * @return buf */ -void +void out_m4_define(const char *def, const char *val) { const char *fmt = "m4_define( [[%s]], [[%s]])m4_dnl\n"; @@ -853,7 +853,7 @@ reallocate_array(array, size, element_size) * Copies skelfile or skel array to stdout until a line beginning with * "%%" or EOF is found. */ -void +void skelout() { char buf_storage[MAXLINE]; @@ -968,7 +968,7 @@ skelout() * element_n. Formats the output with spaces and carriage returns. */ -void +void transition_struct_out(element_v, element_n) int element_v, element_n; { diff --git a/usr.bin/lex/nfa.c b/usr.bin/lex/nfa.c index 272febfc6..41e5257a3 100644 --- a/usr.bin/lex/nfa.c +++ b/usr.bin/lex/nfa.c @@ -47,7 +47,7 @@ void mkxtion PROTO((int, int)); * accepting_number becomes mach's accepting number. */ -void +void add_accept(mach, accepting_number) int mach, accepting_number; { @@ -81,7 +81,7 @@ add_accept(mach, accepting_number) * num - the number of copies of singl to be present in newsng */ -int +int copysingl(singl, num) int singl, num; { @@ -98,7 +98,7 @@ copysingl(singl, num) /* dumpnfa - debugging routine to write out an nfa */ -void +void dumpnfa(state1) int state1; @@ -155,7 +155,7 @@ dumpnfa(state1) * states accessible by the arrays firstst and lastst */ -int +int dupmachine(mach) int mach; { @@ -203,7 +203,7 @@ dupmachine(mach) * context has variable length. */ -void +void finish_rule(mach, variable_trail_rule, headcnt, trailcnt, pcont_act) int mach, variable_trail_rule, headcnt, trailcnt, pcont_act; @@ -318,7 +318,7 @@ finish_rule(mach, variable_trail_rule, headcnt, trailcnt, * FIRST is set to new by the operation. last is unmolested. */ -int +int link_machines(first, last) int first, last; { @@ -346,7 +346,7 @@ link_machines(first, last) * The "beginning" states are the epsilon closure of the first state */ -void +void mark_beginning_as_normal(mach) int mach; { @@ -389,7 +389,7 @@ mark_beginning_as_normal(mach) * more mkbranch's. Compare with mkor() */ -int +int mkbranch(first, second) int first, second; { @@ -418,7 +418,7 @@ mkbranch(first, second) * new - a new state which matches the closure of "state" */ -int +int mkclos(state) int state; { @@ -440,7 +440,7 @@ mkclos(state) * 2. mach is destroyed by the call */ -int +int mkopt(mach) int mach; { @@ -478,7 +478,7 @@ mkopt(mach) * the number of epsilon states needed */ -int +int mkor(first, second) int first, second; { @@ -533,7 +533,7 @@ mkor(first, second) * new - a machine matching the positive closure of "state" */ -int +int mkposcl(state) int state; { @@ -562,7 +562,7 @@ mkposcl(state) * if "ub" is INFINITE_REPEAT then "new" matches "lb" or more occurrences of "mach" */ -int +int mkrep(mach, lb, ub) int mach, lb, ub; { @@ -608,7 +608,7 @@ mkrep(mach, lb, ub) * that it admittedly is) */ -int +int mkstate(sym) int sym; { @@ -685,7 +685,7 @@ mkstate(sym) * stateto - the state to which the transition is to be made */ -void +void mkxtion(statefrom, stateto) int statefrom, stateto; { @@ -704,7 +704,7 @@ mkxtion(statefrom, stateto) /* new_rule - initialize for a new rule */ -void +void new_rule() { if (++num_rules >= current_max_rules) { diff --git a/usr.bin/lex/options.c b/usr.bin/lex/options.c index 097cf1a26..b0a50b71c 100644 --- a/usr.bin/lex/options.c +++ b/usr.bin/lex/options.c @@ -76,7 +76,7 @@ optspec_t flexopts[] = { , {"--case-insensitive", OPT_CASE_INSENSITIVE, 0} , /* Generate case-insensitive scanner. */ - + {"-C[aefFmr]", OPT_COMPRESSION, "Specify degree of table compression (default is -Cem)"}, {"-+", OPT_CPLUSPLUS, 0} diff --git a/usr.bin/lex/options.h b/usr.bin/lex/options.h index ac5a87c32..f0c41b411 100644 --- a/usr.bin/lex/options.h +++ b/usr.bin/lex/options.h @@ -32,7 +32,7 @@ /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ - + #ifndef OPTIONS_H #define OPTIONS_H #include "scanopt.h" diff --git a/usr.bin/lex/parse.y b/usr.bin/lex/parse.y index 26a9809a6..fdf0fcf84 100644 --- a/usr.bin/lex/parse.y +++ b/usr.bin/lex/parse.y @@ -291,7 +291,7 @@ flexrule : '^' rule { if ( scon_stk_ptr > 0 ) build_eof_action(); - + else { /* This EOF applies to all start conditions @@ -422,7 +422,7 @@ rule : re2 re num_rules | YY_TRAILING_HEAD_MASK ); variable_trail_rule = true; } - + else trailcnt = rulelen; @@ -774,7 +774,7 @@ fullccl: | braceccl ; -braceccl: +braceccl: '[' ccl ']' { $$ = $2; } @@ -832,7 +832,7 @@ ccl : ccl CHAR '-' CHAR if (sf_case_ins() && has_case($2) && has_case($4)){ $2 = reverse_case ($2); $4 = reverse_case ($4); - + for ( i = $2; i <= $4; ++i ) ccladd( $1, i ); @@ -878,14 +878,14 @@ ccl : ccl CHAR '-' CHAR } ; -ccl_expr: +ccl_expr: CCE_ALNUM { CCL_EXPR(isalnum); } | CCE_ALPHA { CCL_EXPR(isalpha); } | CCE_BLANK { CCL_EXPR(isblank); } | CCE_CNTRL { CCL_EXPR(iscntrl); } | CCE_DIGIT { CCL_EXPR(isdigit); } | CCE_GRAPH { CCL_EXPR(isgraph); } - | CCE_LOWER { + | CCE_LOWER { CCL_EXPR(islower); if (sf_case_ins()) CCL_EXPR(isupper); @@ -910,7 +910,7 @@ ccl_expr: | CCE_NEG_PUNCT { CCL_NEG_EXPR(ispunct); } | CCE_NEG_SPACE { CCL_NEG_EXPR(isspace); } | CCE_NEG_XDIGIT { CCL_NEG_EXPR(isxdigit); } - | CCE_NEG_LOWER { + | CCE_NEG_LOWER { if ( sf_case_ins() ) warn(_("[:^lower:] is ambiguous in case insensitive scanner")); else @@ -923,7 +923,7 @@ ccl_expr: CCL_NEG_EXPR(isupper); } ; - + string : string CHAR { if ( $2 == nlch ) diff --git a/usr.bin/lex/scan.l b/usr.bin/lex/scan.l index 09561eddb..0f678237f 100644 --- a/usr.bin/lex/scan.l +++ b/usr.bin/lex/scan.l @@ -225,7 +225,7 @@ M4QEND "]]" { ")" yy_pop_state(); [^\n\)]+ ; - {NL} ++linenum; + {NL} ++linenum; } { @@ -725,7 +725,7 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ if (lex_compat || posix_compat){ /* Push back the "?#" and treat it like a normal parens. */ yyless(1); - sf_push(); + sf_push(); return '('; } else diff --git a/usr.bin/lex/scanopt.c b/usr.bin/lex/scanopt.c index f4de1fd29..b588f2eba 100644 --- a/usr.bin/lex/scanopt.c +++ b/usr.bin/lex/scanopt.c @@ -586,7 +586,7 @@ static int scanopt_err (s, opt_offset, is_short, err) } return err; } - + /* Internal. Match str against the regex ^--([^=]+)(=(.*))? * return 1 if *looks* like a long option. @@ -634,7 +634,7 @@ static int matchlongopt (str, optname, optlen, arg, arglen) return 1; } - + /* Internal. Look up long or short option by name. * Long options must match a non-ambiguous prefix, or exact match. @@ -704,7 +704,7 @@ static int find_opt (s, lookup_long, optstart, len, err_code, opt_offset) return *err_code ? 0 : 1; } - + int scanopt (svoid, arg, optindex) scanopt_t *svoid; diff --git a/usr.bin/lex/scanopt.h b/usr.bin/lex/scanopt.h index 59f008bcb..9ddecc78d 100644 --- a/usr.bin/lex/scanopt.h +++ b/usr.bin/lex/scanopt.h @@ -32,7 +32,7 @@ /* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ /* PURPOSE. */ - + #ifndef SCANOPT_H #define SCANOPT_H @@ -77,7 +77,7 @@ extern "C" { /* Used internally by scanopt() to maintain state. */ /* Never modify these value directly. */ typedef void *scanopt_t; - + /* Initializes scanner and checks option list for errors. * Parameters: diff --git a/usr.bin/lex/tables.c b/usr.bin/lex/tables.c index 67d33d3a3..47848bdba 100644 --- a/usr.bin/lex/tables.c +++ b/usr.bin/lex/tables.c @@ -33,14 +33,14 @@ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ - + #include "flexdef.h" #include "tables.h" /** Convert size_t to t_flag. * @param n in {1,2,4} - * @return YYTD_DATA*. + * @return YYTD_DATA*. */ #define BYTES2TFLAG(n)\ (((n) == sizeof(flex_int8_t))\ @@ -329,7 +329,7 @@ int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v) /** Extract data element [i] from array data tables treated as a single flat array of integers. * Be careful for 2-dimensional arrays or for YYTD_ID_TRANSITION, which is an array - * of structs. + * of structs. * @param tbl data table * @param i index into array. * @return data[i] @@ -353,7 +353,7 @@ static flex_int32_t yytbl_data_geti (const struct yytbl_data *tbl, int i) /** Set data element [i] in array data tables treated as a single flat array of integers. * Be careful for 2-dimensional arrays or for YYTD_ID_TRANSITION, which is an array - * of structs. + * of structs. * @param tbl data table * @param i index into array. * @param newval new value for data[i] diff --git a/usr.bin/lex/tables.h b/usr.bin/lex/tables.h index 2d5cb2293..04a019721 100644 --- a/usr.bin/lex/tables.h +++ b/usr.bin/lex/tables.h @@ -33,7 +33,7 @@ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE. */ - + #ifndef TABLES_H #define TABLES_H diff --git a/usr.bin/lex/tables_shared.c b/usr.bin/lex/tables_shared.c index 2f3ea46cd..cb56709f6 100644 --- a/usr.bin/lex/tables_shared.c +++ b/usr.bin/lex/tables_shared.c @@ -3,42 +3,42 @@ #ifdef FLEX_SCANNER /* dnl tables_shared.c - tables serialization code -dnl +dnl dnl Copyright (c) 1990 The Regents of the University of California. dnl All rights reserved. -dnl +dnl dnl This code is derived from software contributed to Berkeley by dnl Vern Paxson. -dnl +dnl dnl The United States Government has rights in this work pursuant dnl to contract no. DE-AC03-76SF00098 between the United States dnl Department of Energy and the University of California. -dnl +dnl dnl This file is part of flex. -dnl +dnl dnl Redistribution and use in source and binary forms, with or without dnl modification, are permitted provided that the following conditions dnl are met: -dnl +dnl dnl 1. Redistributions of source code must retain the above copyright dnl notice, this list of conditions and the following disclaimer. dnl 2. Redistributions in binary form must reproduce the above copyright dnl notice, this list of conditions and the following disclaimer in the dnl documentation and/or other materials provided with the distribution. -dnl +dnl dnl Neither the name of the University nor the names of its contributors dnl may be used to endorse or promote products derived from this software dnl without specific prior written permission. -dnl +dnl dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR dnl PURPOSE. -dnl +dnl */ - + /* This file is meant to be included in both the skeleton and the actual - * flex code (hence the name "_shared"). + * flex code (hence the name "_shared"). */ #ifndef yyskel_static #define yyskel_static static @@ -54,7 +54,7 @@ dnl /** Get the number of integers in this table. This is NOT the * same thing as the number of elements. - * @param td the table + * @param td the table * @return the number of integers in the table */ yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl) diff --git a/usr.bin/lex/tables_shared.h b/usr.bin/lex/tables_shared.h index 3bdfc9651..197b7a0b3 100644 --- a/usr.bin/lex/tables_shared.h +++ b/usr.bin/lex/tables_shared.h @@ -34,7 +34,7 @@ dnl THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR dnl PURPOSE. - + dnl dnl This file is meant to be included in both the skeleton and the actual dnl flex code (hence the name "_shared"). diff --git a/usr.bin/lex/tblcmp.c b/usr.bin/lex/tblcmp.c index 0792ee8d7..f61ef70d0 100644 --- a/usr.bin/lex/tblcmp.c +++ b/usr.bin/lex/tblcmp.c @@ -80,7 +80,7 @@ int tbldiff PROTO((int[], int, int[])); * cost only one difference. */ -void +void bldtbl(state, statenum, totaltrans, comstate, comfreq) int state[], statenum, totaltrans, comstate, comfreq; { @@ -230,7 +230,7 @@ bldtbl(state, statenum, totaltrans, comstate, comfreq) * classes. */ -void +void cmptmps() { int tmpstorage[CSIZE + 1]; @@ -298,7 +298,7 @@ cmptmps() /* expand_nxt_chk - expand the next check arrays */ -void +void expand_nxt_chk() { int old_max = current_max_xpairs; @@ -333,7 +333,7 @@ expand_nxt_chk() * and an action number will be added in [-1]. */ -int +int find_table_space(state, numtrans) int *state, numtrans; { @@ -434,7 +434,7 @@ find_table_space(state, numtrans) * Initializes "firstfree" to be one beyond the end of the table. Initializes * all "chk" entries to be zero. */ -void +void inittbl() { int i; @@ -466,7 +466,7 @@ inittbl() /* mkdeftbl - make the default, "jam" table entries */ -void +void mkdeftbl() { int i; @@ -517,7 +517,7 @@ mkdeftbl() * state array. */ -void +void mkentry(state, numchars, statenum, deflink, totaltrans) int *state; int numchars, statenum, deflink, totaltrans; @@ -635,7 +635,7 @@ mkentry(state, numchars, statenum, deflink, totaltrans) * has only one out-transition */ -void +void mk1tbl(state, sym, onenxt, onedef) int state, sym, onenxt, onedef; { @@ -662,7 +662,7 @@ mk1tbl(state, sym, onenxt, onedef) /* mkprot - create new proto entry */ -void +void mkprot(state, statenum, comstate) int state[], statenum, comstate; { @@ -700,7 +700,7 @@ mkprot(state, statenum, comstate) * to it */ -void +void mktemplate(state, statenum, comstate) int state[], statenum, comstate; { @@ -754,7 +754,7 @@ mktemplate(state, statenum, comstate) /* mv2front - move proto queue element to front of queue */ -void +void mv2front(qelm) int qelm; { @@ -782,7 +782,7 @@ mv2front(qelm) * Transnum is the number of out-transitions for the state. */ -void +void place_state(state, statenum, transnum) int *state, statenum, transnum; { @@ -827,7 +827,7 @@ place_state(state, statenum, transnum) * no room, we process the sucker right now. */ -void +void stack1(statenum, sym, nextstate, deflink) int statenum, sym, nextstate, deflink; { @@ -858,7 +858,7 @@ stack1(statenum, sym, nextstate, deflink) * number is "numecs" minus the number of "SAME_TRANS" entries in "ext". */ -int +int tbldiff(state, pr, ext) int state[], pr, ext[]; { diff --git a/usr.bin/libtool/LT/Archive.pm b/usr.bin/libtool/LT/Archive.pm index 7bc2c373b..12a6ecbe4 100644 --- a/usr.bin/libtool/LT/Archive.pm +++ b/usr.bin/libtool/LT/Archive.pm @@ -52,7 +52,7 @@ sub get_symbollist($self, $filepath, $regex, $objlist) tsay {"generating symbol list in file: $filepath"}; tsay {"object list is @$objlist" }; my $symbols = LT::UList->new; - open(my $sh, '-|', 'nm', '--', @$objlist) or + open(my $sh, '-|', 'nm', '--', @$objlist) or die "Error running nm on object list @$objlist\n"; my $c = 0; while (my $line = <$sh>) { diff --git a/usr.bin/libtool/LT/Exec.pm b/usr.bin/libtool/LT/Exec.pm index 54ed32c0e..55386469b 100644 --- a/usr.bin/libtool/LT/Exec.pm +++ b/usr.bin/libtool/LT/Exec.pm @@ -59,7 +59,7 @@ sub chdir($self, $dir) sub compile($self, @l) { - $self->command("compile", @l); + $self->command("compile", @l); } sub execute($self, @l) @@ -125,7 +125,7 @@ sub command($self, $mode, @l) if ($mode eq "compile"){ say "@l" if $verbose || $dry; } else { - say "libtool: $mode: @l" if $verbose || $dry; + say "libtool: $mode: @l" if $verbose || $dry; } if (!$dry) { $self->command_run(@l); diff --git a/usr.bin/libtool/LT/Getopt.pm b/usr.bin/libtool/LT/Getopt.pm index 7aaf599c3..7295bb92d 100644 --- a/usr.bin/libtool/LT/Getopt.pm +++ b/usr.bin/libtool/LT/Getopt.pm @@ -154,7 +154,7 @@ sub new($class, $string, $code) my @alternates = split(/\|/, $string); bless { - alt => [map { Option->factory($_); } @alternates], + alt => [map { Option->factory($_); } @alternates], code => $code }, $class; } @@ -190,7 +190,7 @@ sub add_option_accessor($self, $option, $isarray) my $access = $option; $access =~ s/^\-//; $access =~ s/-/_/g; - my $actual = $isarray ? + my $actual = $isarray ? sub($self) { $self->{opt}{$option} //= []; if (wantarray) { @@ -232,7 +232,7 @@ sub create_options($self, @l) }; } } - push(@options, + push(@options, Options->new($opt, $code)->setup($self, $isarray)); } return @options; diff --git a/usr.bin/libtool/LT/Mode/Compile.pm b/usr.bin/libtool/LT/Mode/Compile.pm index 8d69b5b03..c8fd2f610 100644 --- a/usr.bin/libtool/LT/Mode/Compile.pm +++ b/usr.bin/libtool/LT/Mode/Compile.pm @@ -55,11 +55,11 @@ sub run($class, $ltprog, $gp, $ltconfig) my @pie_flags = (); $gp->handle_permuted_options('o:!@', - qr{\-Wc\,(.*)}, - sub { + qr{\-Wc\,(.*)}, + sub { $gp->keep_for_later(split(/\,/, shift)); }, - 'Xcompiler:', + 'Xcompiler:', sub { $gp->keep_for_later($_[2]); }, @@ -70,12 +70,12 @@ sub run($class, $ltprog, $gp, $ltconfig) 'no-suppress', # we just ignore that one 'prefer-pic', sub { $pic_mode = 1; }, 'prefer-non-pic', sub { $pic_mode = 0; }, - 'static', - sub { - $pic = 0; + 'static', + sub { + $pic = 0; $nonpic = 1; }, - 'shared', + 'shared', sub { if (!$pic) { shortdie "bad configuration: can't build shared library"; diff --git a/usr.bin/libtool/LT/Mode/Link.pm b/usr.bin/libtool/LT/Mode/Link.pm index da8b65eef..919297d3d 100644 --- a/usr.bin/libtool/LT/Mode/Link.pm +++ b/usr.bin/libtool/LT/Mode/Link.pm @@ -535,7 +535,7 @@ sub find_first_lib($self, $lib, $dirs, $gp) # -Lfoo, -lfoo, foo.a, foo.la # recursively find .la files corresponding to -l flags; if there is no .la # file, just inspect the library file itself for any dependencies. -sub internal_parse_linkargs1($self, $deplibs, $gp, $dirs, $libs, $args, +sub internal_parse_linkargs1($self, $deplibs, $gp, $dirs, $libs, $args, $level = 0) { tsay {"parse_linkargs1, level: $level"}; @@ -791,7 +791,7 @@ sub common1($self, $parser, $gp, $deplibs, $libdirs, $dirs, $libs) $parser->resolve_la($deplibs, $libdirs); my $orderedlibs = LT::UList->new; my $staticlibs = []; - my $args = $parser->parse_linkargs2($gp, $orderedlibs, $staticlibs, + my $args = $parser->parse_linkargs2($gp, $orderedlibs, $staticlibs, $dirs, $libs); my $tiedlibs = tied(@$orderedlibs); diff --git a/usr.bin/libtool/LT/Mode/Link/Library.pm b/usr.bin/libtool/LT/Mode/Link/Library.pm index e1d84fe78..a6967c817 100644 --- a/usr.bin/libtool/LT/Mode/Link/Library.pm +++ b/usr.bin/libtool/LT/Mode/Link/Library.pm @@ -35,7 +35,7 @@ use File::Basename; sub link { - my ($linker, $self, $ltprog, $ltconfig, $la, $fname, $odir, $shared, + my ($linker, $self, $ltprog, $ltconfig, $la, $fname, $odir, $shared, $objs, $dirs, $libs, $deplibs, $libdirs, $parser, $gp) = @_; tsay {"creating link command for library (linked ", @@ -176,7 +176,7 @@ sub link if @$staticlibs; push @cmd, "-L$symlinkdir", @libflags if @libflags; - my @e = $linker->export_symbols($ltconfig, + my @e = $linker->export_symbols($ltconfig, "$odir/$ltdir/$la", $gp, @$objs, @$staticlibs); push(@cmd, join(',', "-Wl", @e)) if @e; push @cmd, join(',', "-Wl", @linkeropts) if @linkeropts; diff --git a/usr.bin/libtool/LT/Mode/Link/Program.pm b/usr.bin/libtool/LT/Mode/Link/Program.pm index 3ea2e8e4a..378fced6a 100644 --- a/usr.bin/libtool/LT/Mode/Link/Program.pm +++ b/usr.bin/libtool/LT/Mode/Link/Program.pm @@ -37,7 +37,7 @@ use File::Basename; sub link { - my ($linker, $self, $ltprog, $ltconfig, $dirs, $libs, $deplibs, + my ($linker, $self, $ltprog, $ltconfig, $dirs, $libs, $deplibs, $libdirs, $parser, $gp) = @_; tsay {"linking program (", ($gp->static ? "not " : ""), @@ -81,7 +81,7 @@ sub link tprint {"key = $k - "}; my $r = ref($libs->{$k}); tsay {"ref = $r"}; - $libs->create($k)->resolve_library($dirs, 1, $gp->static, + $libs->create($k)->resolve_library($dirs, 1, $gp->static, ref($self)); } @@ -110,7 +110,7 @@ sub link } } - push(@linkeropts, $linker->export_symbols($ltconfig, + push(@linkeropts, $linker->export_symbols($ltconfig, "$odir/$ltdir/$fname", $gp, @{$self->{objlist}}, @$staticlibs)); @cmd = @$ltprog; diff --git a/usr.bin/libtool/LT/UList.pm b/usr.bin/libtool/LT/UList.pm index c2f066695..99eb98996 100644 --- a/usr.bin/libtool/LT/UList.pm +++ b/usr.bin/libtool/LT/UList.pm @@ -63,27 +63,27 @@ sub TIEARRAY($class, @p) # presence of particular item, call the method below on the reference # returned by tie() or tied() instead. sub exists($self, $key) -{ - return exists $self->[0]{$key}; +{ + return exists $self->[0]{$key}; } sub indexof($self, $key) -{ - return exists($self->[0]{$key}) ? ($self->[0]{$key} - 1) : undef; +{ + return exists($self->[0]{$key}) ? ($self->[0]{$key} - 1) : undef; } sub FETCHSIZE($self) -{ - return scalar(@$self) - 1; +{ + return scalar(@$self) - 1; } sub STORE($, $, $) -{ +{ die "overwriting elements is unimplemented"; } sub DELETE($, $) -{ +{ die "delete is unimplemented"; } diff --git a/usr.bin/libtool/Makefile b/usr.bin/libtool/Makefile index ea14ec68f..987a45bd0 100644 --- a/usr.bin/libtool/Makefile +++ b/usr.bin/libtool/Makefile @@ -3,7 +3,7 @@ .include MAN=libtool.1 -NOPROG= +NOPROG= PACKAGES= \ LT/Archive.pm \ @@ -25,7 +25,7 @@ PACKAGES= \ LIBBASE=/usr/libdata/perl5 -realinstall: +realinstall: .for d in LT LT/Mode LT/Mode/Link ${INSTALL} -d -o ${LIBOWN} -g ${LIBGRP} -m ${DIRMODE} \ ${DESTDIR}${LIBBASE}/$d diff --git a/usr.bin/libtool/libtool b/usr.bin/libtool/libtool index 6083ad6aa..6d4cbce07 100755 --- a/usr.bin/libtool/libtool +++ b/usr.bin/libtool/libtool @@ -124,7 +124,7 @@ sub load_subclass } } -my $mode_maker = { compile => 'LT::Mode::Compile', +my $mode_maker = { compile => 'LT::Mode::Compile', clean => 'LT::Mode::Clean', execute => 'LT::Mode::Execute', finish => 'LT::Mode::Finish', @@ -239,9 +239,9 @@ sub add_tag { my ($self, $value) = @_; if ($value =~ m/[^\-\w,\/]/) { - shortdie "invalid tag name: $value"; + shortdie "invalid tag name: $value"; exit 1; - } + } if (grep {$value eq $_} @known_tags) { $self->{tags}{$value} = 1; } else { @@ -321,8 +321,8 @@ unless ($ARGV[0] eq 'install' && $ARGV[1] =~ m/^-[bcCdpSsBfgmo]/) { my $gp = LT::Options->new; $gp->handle_options( '-config' => \&config, - '-debug|x' => sub { - LT::Trace->set(1); + '-debug|x' => sub { + LT::Trace->set(1); LT::Exec->verbose_run; }, '-dry-run|-dryrun|n' => sub { LT::Exec->dry_run; }, @@ -341,7 +341,7 @@ $gp->handle_options( '-quiet|-silent|-no-verbose' => sub { $verbose = 0; }, '-verbose|-no-silent|-no-quiet|v' => sub {$verbose = 1;}, '-tag=' => sub { $gp->add_tag($_[2]); }, - '-version' => sub { + '-version' => sub { say "libtool (not (GNU libtool)) ", $ltconfig->version; exit 0; }, diff --git a/usr.bin/locate/locate/mklocatedb.sh b/usr.bin/locate/locate/mklocatedb.sh index a34812c0e..58827a2cf 100644 --- a/usr.bin/locate/locate/mklocatedb.sh +++ b/usr.bin/locate/locate/mklocatedb.sh @@ -53,7 +53,7 @@ sortopt="-u -T $TMPDIR" sortcmd="$sort" # Input already sorted -case X"$1" in +case X"$1" in X-nosort|X-presort) sortcmd=cat; sortopt=;shift;; esac diff --git a/usr.bin/m4/PSD.doc/m4.ms b/usr.bin/m4/PSD.doc/m4.ms index 1163ee4e2..730a76cd2 100644 --- a/usr.bin/m4/PSD.doc/m4.ms +++ b/usr.bin/m4/PSD.doc/m4.ms @@ -100,14 +100,14 @@ and .UC GCOS . Its primary use has been as a front end for Ratfor for those -cases where parameterless macros +cases where parameterless macros are not adequately powerful. It has also been used for languages as disparate as C and Cobol. M4 is particularly suited for functional languages like Fortran, PL/I and C since macros are specified in a functional notation. .PP M4 provides features seldom found even in much larger -macro processors, +macro processors, including .IP " \(bu" arguments @@ -259,7 +259,7 @@ define(N, 100) ... if (NNN > 100) .P2 -the variable +the variable .UL NNN is absolutely unrelated to the defined macro .UL N , @@ -278,7 +278,7 @@ What happens if .UL N is redefined? Or, to say it another way, is -.UL M +.UL M defined as .UL N or as 100? @@ -286,7 +286,7 @@ In M4, the latter is true _ .UL M is 100, so even if -.UL N +.UL N subsequently changes, .UL M does not. @@ -315,10 +315,10 @@ Now .UL M is defined to be the string .UL N , -so when you ask for +so when you ask for .UL M later, you'll always get the value of -.UL N +.UL N at that time (because the .UL M @@ -330,7 +330,7 @@ Quoting .PP The more general solution is to delay the expansion of the arguments of -.UL define +.UL define by .ul quoting @@ -345,7 +345,7 @@ define(M, `N') the quotes around the .UL N are stripped off as the argument is being collected, -but they have served their purpose, and +but they have served their purpose, and .UL M is defined as the string @@ -385,7 +385,7 @@ define(100, 200) .P2 This statement is ignored by M4, since you can only define things that look like names, but it obviously doesn't have the effect you wanted. -To really redefine +To really redefine .UL N , you must delay the evaluation by quoting: .P1 @@ -418,7 +418,7 @@ undefine(`N') removes the definition of .UL N . (Why are the quotes absolutely necessary?) -Built-ins can be removed with +Built-ins can be removed with .UL undefine , as in .P1 @@ -426,7 +426,7 @@ undefine(`define') .P2 but once you remove one, you can never get it back. .PP -The built-in +The built-in .UL ifdef provides a way to determine if a macro is currently defined. In particular, M4 has pre-defined the names @@ -462,7 +462,7 @@ Within the replacement text for a macro .UL define ) any occurrence of .UL $n -will be replaced by the +will be replaced by the .UL n th argument when the macro is actually used. @@ -586,13 +586,13 @@ is and 36 bits on .UC GCOS . .PP -As a simple example, suppose we want +As a simple example, suppose we want .UL M -to be +to be .UL 2**N+1 . Then .P1 -define(N, 3) +define(N, 3) define(M, `eval(2**N+1)') .P2 As a matter of principle, it is advisable @@ -629,7 +629,7 @@ cannot be accessed. To get some control over this situation, the alternate form .UL sinclude can be used; -.UL sinclude +.UL sinclude (``silent include'') says nothing and continues if it can't access the file. .PP @@ -643,8 +643,8 @@ divert(n) all subsequent output is put onto the end of a temporary file referred to as .UL n . -Diverting to this file is stopped by another -.UL divert +Diverting to this file is stopped by another +.UL divert command; in particular, .UL divert @@ -666,7 +666,7 @@ brings back all diversions in numeric order, and with arguments brings back the selected diversions in the order given. The act of undiverting discards the diverted stuff, -as does diverting into a diversion +as does diverting into a diversion whose number is not between 0 and 9 inclusive. .PP The value of @@ -727,7 +727,7 @@ compares the two strings .UL a and .UL b . -If these are identical, +If these are identical, .UL ifelse returns the string @@ -776,7 +776,7 @@ ifelse(a, b, c) .P2 is .UL c -if +if .UL a matches .UL b , @@ -808,7 +808,7 @@ position and is .UL n characters long. -If +If .UL n is omitted, the rest of the string is returned, so @@ -819,7 +819,7 @@ is .P1 ow is the time .P2 -If +If .UL i or .UL n @@ -863,22 +863,22 @@ are deleted; as a limiting case, if .UL t is not present at all, -characters from +characters from .UL f -are deleted from +are deleted from .UL s . So .P1 translit(s, aeiou) .P2 -deletes vowels from +deletes vowels from .UL s . .PP There is also a built-in called .UL dnl which deletes all characters that follow it up to and including the next newline; -it is useful mainly for throwing away +it is useful mainly for throwing away empty lines that otherwise tend to clutter up M4 output. For example, if you say .P1 diff --git a/usr.bin/m4/TEST/sqroot.m4 b/usr.bin/m4/TEST/sqroot.m4 index fa01674d4..8a3475274 100644 --- a/usr.bin/m4/TEST/sqroot.m4 +++ b/usr.bin/m4/TEST/sqroot.m4 @@ -34,7 +34,7 @@ # @(#)sqroot.m4 8.1 (Berkeley) 6/6/93 # -define(square_root, +define(square_root, `ifelse(eval($1<0),1,negative-square-root, `square_root_aux($1, 1, eval(($1+1)/2))')') define(square_root_aux, diff --git a/usr.bin/m4/TEST/test.m4 b/usr.bin/m4/TEST/test.m4 index 934d2c7dc..b2394a393 100644 --- a/usr.bin/m4/TEST/test.m4 +++ b/usr.bin/m4/TEST/test.m4 @@ -81,7 +81,7 @@ divert(0) define(abc,xxx) ifdef(`abc',defined,undefined) # -# v7 m4 does this wrong. The right output is +# v7 m4 does this wrong. The right output is # this is A vEry lon sEntEnCE # see m4 documentation for translit. # @@ -118,7 +118,7 @@ square_root(21372) # [taken from the 'Clemson University Computer Newsletter', September 1981, pp. 6-7] - + I am a wizard in the magical Kingdom of Transformation and I slay dragons for a living. Actually, I am a systems programmer. One of the problems with systems programming is explaining to @@ -127,7 +127,7 @@ describe my job are totally meaningless to them. Usually my response to questions about my work is to say as little as possible. For instance, if someone asks what happened at work this week, I say "Nothing much" and then I change the subject. - + With the assistance of my brother, a mechanical engineer, I have devised an analogy that everyone can understand. The analogy describes the "Kingdom of Transformation" where travelers wander and are magically @@ -136,7 +136,7 @@ The purpose of the computer is to change information to a more meaningful forma. The law of conservation applies here: The computer never creates and never intentionally destroys data. With no further ado, let us travel to the Kingdom of Transformation: - + In a land far, far away, there is a magical kingdom called the Kingdom of Transformation. A king rules over this land and employs a Council of Wizardry. The main purpose of this kingdom is to provide a way for @@ -145,39 +145,39 @@ is done by allowing the citizens to enter the kingdom at one of its ports and to travel any of the many routes in the kingdom. They are magically transformed along the way. The income of the Kingdom of Transformation comes from the many toll roads within its boundaries. - + The Kingdom of Transformation was created when several kingdoms got together and discovered a mutual need for new talents and abilities for citizens. They employed CTK, Inc. (Creators of Transformation, Inc.) to create this kingdom. CTK designed the country, its transportation routes, and its laws of transformation, and created the major highway system. - + Hazards ======= - + Because magic is not truly controllable, CTK invariably, but unknowingly, creates dragons. Dragons are huge fire-breathing beasts which sometimes injure or kill travelers. Fortunately, they do not travel, but always remain near their den. - + Other hazards also exist which are potentially harmful. As the roads become older and more weatherbeaten, pot-holes will develop, trees will fall on travelers, etc. CTK maintenance men are called to fix these problems. - + Wizards ======= - + The wizards play a major role in creating and maintaining the kingdom but get little credit for their work because it is performed secretly. The wizards do not wan the workers or travelers to learn their incantations because many laws would be broken and chaos would result. - + CTK's grand design is always general enough to be applicable in many different situations. As a result, it is often difficult to use. The first duty of the wizards is to tailor the transformation laws so as to be more beneficial and easier to use in their particular environment. - + After creation of the kingdom, a major duty of the wizards is to search for and kill dragons. If travelers do not return on time or if they return injured, the ruler of the country contacts the wizards. If the wizards @@ -187,7 +187,7 @@ If not, they must determine if the cause was a road hazard or a dragon. If the suspect a road hazard, they call in a CTK maintenance man to locate the hazard and to eliminate it, as in repairing the pothole in the road. If they think that cause was a dragon, then they must find and slay it. - + The most difficult part of eliminating a dragon is finding it. Sometimes the wizard magically knows where the dragon's lair it, but often the wizard must send another traveler along the same route and watch to see where he @@ -195,26 +195,26 @@ disappears. This sounds like a failsafe method for finding dragons (and a suicide mission for thr traveler) but the second traveler does not always disappear. Some dragons eat any traveler who comes too close; others are very picky. - + The wizards may call in CTK who designed the highway system and transformation laws to help devise a way to locate the dragon. CTK also helps provide the right spell or incantation to slay the dragon. (There is no general spell to slay dragons; each dragon must be eliminated with a different spell.) - + Because neither CTK nor wizards are perfect, spells to not always work correctly. At best, nothing happens when the wrong spell is uttered. At worst, the dragon becomes a much larger dragon or multiplies into several smaller ones. In either case, new spells must be found. - + If all existing dragons are quiet (i.e. have eaten sufficiently), wizards have time to do other things. They hide in castles and practice spells and incantations. They also devise shortcuts for travelers and new laws of transformation. - + Changes in the Kingdom ====================== - + As new transformation kingdoms are created and old ones are maintained, CTK, Inc. is constantly learning new things. It learns ways to avoid creating some of the dragons that they have previously created. It also @@ -224,7 +224,7 @@ The wizards determine when is a good time to implement this new design. This is when the tourist season is slow or when no important travelers (VIPs) are to arrive. The kingdom must be closed for the actual implementation and is leter reopened as a new and better place to go. - + A final question you might ask is what happens when the number of tourists becomes too great for the kingdom to handle in a reasonable period of time (i.e., the tourist lines at the ports are too long). The Kingdom of @@ -232,7 +232,7 @@ Transformation has three options: (1) shorten the paths that a tourist must travel, or (2) convince CTK to develop a faster breed of horses so that the travelers can finish sooner, or (3) annex more territories so that the kingdom can handle more travelers. - + Thus ends the story of the Kingdom of Transformation. I hope this has explained my job to you: I slay dragons for a living. diff --git a/usr.bin/m4/eval.c b/usr.bin/m4/eval.c index 748932ce2..53cfa8eef 100644 --- a/usr.bin/m4/eval.c +++ b/usr.bin/m4/eval.c @@ -180,14 +180,14 @@ expand_builtin(const char *argv[], int argc, int td) if (argc > 3) { base = strtonum(argv[3], 2, 36, &errstr); if (errstr) { - m4errx(1, "expr: base is %s: %s.", + m4errx(1, "expr: base is %s: %s.", errstr, argv[3]); } } if (argc > 4) { maxdigits = strtonum(argv[4], 0, INT_MAX, &errstr); if (errstr) { - m4errx(1, "expr: maxdigits is %s: %s.", + m4errx(1, "expr: maxdigits is %s: %s.", errstr, argv[4]); } } @@ -299,7 +299,7 @@ expand_builtin(const char *argv[], int argc, int td) case PASTTYPE: if (argc > 2) if (!dopaste(argv[2])) - err(1, "%s at line %lu: paste(%s)", + err(1, "%s at line %lu: paste(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); break; @@ -351,7 +351,7 @@ expand_builtin(const char *argv[], int argc, int td) if (argc > 2) { n = strtonum(argv[2], INT_MIN, INT_MAX, &errstr); if (errstr) - m4errx(1, "divert: argument is %s: %s.", + m4errx(1, "divert: argument is %s: %s.", errstr, argv[2]); if (n != 0) { dodiv(n); @@ -908,11 +908,11 @@ dosub(const char *argv[], int argc) * map every character of s1 that is specified in from * into s3 and replace in s. (source s1 remains untouched) * - * This is derived from the a standard implementation of map(s,from,to) - * function of ICON language. Within mapvec, we replace every character - * of "from" with the corresponding character in "to". - * If "to" is shorter than "from", than the corresponding entries are null, - * which means that those characters disappear altogether. + * This is derived from the a standard implementation of map(s,from,to) + * function of ICON language. Within mapvec, we replace every character + * of "from" with the corresponding character in "to". + * If "to" is shorter than "from", than the corresponding entries are null, + * which means that those characters disappear altogether. */ static void map(char *dest, const char *src, const char *from, const char *to) @@ -1002,7 +1002,7 @@ handledash(char *buffer, char *end, const char *src) if (src[1] == '-' && src[2]) { unsigned char i; if ((unsigned char)src[0] <= (unsigned char)src[2]) { - for (i = (unsigned char)src[0]; + for (i = (unsigned char)src[0]; i <= (unsigned char)src[2]; i++) { *p++ = i; if (p == end) { @@ -1011,7 +1011,7 @@ handledash(char *buffer, char *end, const char *src) } } } else { - for (i = (unsigned char)src[0]; + for (i = (unsigned char)src[0]; i >= (unsigned char)src[2]; i--) { *p++ = i; if (p == end) { diff --git a/usr.bin/m4/gnum4.c b/usr.bin/m4/gnum4.c index 22b2b640e..45107eb33 100644 --- a/usr.bin/m4/gnum4.c +++ b/usr.bin/m4/gnum4.c @@ -184,10 +184,10 @@ static void addchar(int); static char *twiddle(const char *); static char *getstring(void); static void exit_regerror(int, regex_t *, const char *); -static void do_subst(const char *, regex_t *, const char *, const char *, +static void do_subst(const char *, regex_t *, const char *, const char *, regmatch_t *); static void do_regexpindex(const char *, regex_t *, const char *, regmatch_t *); -static void do_regexp(const char *, regex_t *, const char *, const char *, +static void do_regexp(const char *, regex_t *, const char *, const char *, regmatch_t *); static void add_sub(int, const char *, regex_t *, regmatch_t *); static void add_replace(const char *, regex_t *, const char *, regmatch_t *); @@ -316,7 +316,7 @@ add_replace(const char *string, regex_t *re, const char *replace, regmatch_t *pm } static void -do_subst(const char *string, regex_t *re, const char *source, +do_subst(const char *string, regex_t *re, const char *source, const char *replace, regmatch_t *pm) { int error; @@ -357,7 +357,7 @@ do_subst(const char *string, regex_t *re, const char *source, } static void -do_regexp(const char *string, regex_t *re, const char *source, +do_regexp(const char *string, regex_t *re, const char *source, const char *replace, regmatch_t *pm) { int error; @@ -375,7 +375,7 @@ do_regexp(const char *string, regex_t *re, const char *source, } static void -do_regexpindex(const char *string, regex_t *re, const char *source, +do_regexpindex(const char *string, regex_t *re, const char *source, regmatch_t *pm) { int error; @@ -485,7 +485,7 @@ dopatsubst(const char *argv[], int argc) if (error != 0) exit_regerror(error, &re, source); - pmatch = xreallocarray(NULL, re.re_nsub+1, sizeof(regmatch_t), + pmatch = xreallocarray(NULL, re.re_nsub+1, sizeof(regmatch_t), NULL); do_subst(argv[2], &re, source, argc > 4 && argv[4] != NULL ? argv[4] : "", pmatch); diff --git a/usr.bin/m4/look.c b/usr.bin/m4/look.c index ac504570a..134e11bf4 100644 --- a/usr.bin/m4/look.c +++ b/usr.bin/m4/look.c @@ -292,7 +292,7 @@ keep(char *ptr) kept_capacity *= 2; else kept_capacity = 50; - kept = xreallocarray(kept, kept_capacity, + kept = xreallocarray(kept, kept_capacity, sizeof(char *), "Out of memory while saving %d strings\n", kept_capacity); } @@ -300,7 +300,7 @@ keep(char *ptr) } static int -string_in_use(const char *ptr) +string_in_use(const char *ptr) { int i; for (i = 0; i <= sp; i++) { @@ -321,7 +321,7 @@ free_definition(char *ptr) if (!string_in_use(kept[i])) { kept_size--; free(kept[i]); - if (i != kept_size) + if (i != kept_size) kept[i] = kept[kept_size]; i--; } diff --git a/usr.bin/m4/mdef.h b/usr.bin/m4/mdef.h index 9f4aa4ccf..aa0a008f0 100644 --- a/usr.bin/m4/mdef.h +++ b/usr.bin/m4/mdef.h @@ -204,7 +204,7 @@ struct input_file { mstack[sp].sstr = macro_getdef(p)->defn;\ sstack[sp] = STORAGE_MACRO; \ } while (0) - + /* * . . diff --git a/usr.bin/m4/parser.y b/usr.bin/m4/parser.y index 5b46d261a..4ec629686 100644 --- a/usr.bin/m4/parser.y +++ b/usr.bin/m4/parser.y @@ -52,7 +52,7 @@ expr : expr '+' expr { $$ = $1 + $3; } } $$ = $1 / $3; } - | expr '%' expr { + | expr '%' expr { if ($3 == 0) { yyerror("modulo zero"); exit(1); diff --git a/usr.bin/mail/list.c b/usr.bin/mail/list.c index c870b9be9..b5d1b532c 100644 --- a/usr.bin/mail/list.c +++ b/usr.bin/mail/list.c @@ -698,7 +698,7 @@ matchsubj(char *str, int mesg) else strlcpy(lastscan, str, sizeof(lastscan)); mp = &message[mesg-1]; - + /* * Now look, ignoring case, for the word in the string. */ diff --git a/usr.bin/mail/names.c b/usr.bin/mail/names.c index 77986dc48..4cab17358 100644 --- a/usr.bin/mail/names.c +++ b/usr.bin/mail/names.c @@ -536,7 +536,7 @@ elide(struct name *names) np = np->n_flink; continue; } - + /* * Now t points to the last entry with the same name * as np. Make np point beyond t. diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c index 9582675f9..359dd0783 100644 --- a/usr.bin/mail/send.c +++ b/usr.bin/mail/send.c @@ -369,7 +369,7 @@ mail1(struct header *hp, int printheaders) } if ((cp = value("record")) != NULL) (void)savemail(expand(cp), mtf); - + /* Setup sendmail arguments. */ *ap++ = "sendmail"; *ap++ = "-i"; diff --git a/usr.bin/mail/util.c b/usr.bin/mail/util.c index 68fa944bc..a093b6813 100644 --- a/usr.bin/mail/util.c +++ b/usr.bin/mail/util.c @@ -112,7 +112,7 @@ argcount(char **argv) char **ap; for (ap = argv; *ap++ != NULL;) - ; + ; return(ap - argv - 1); } diff --git a/usr.bin/mandoc/tbl_layout.c b/usr.bin/mandoc/tbl_layout.c index 020a3b843..c7f7e7d98 100644 --- a/usr.bin/mandoc/tbl_layout.c +++ b/usr.bin/mandoc/tbl_layout.c @@ -184,7 +184,7 @@ mod: isz++; if (strchr(" \t.", p[*pos + isz]) == NULL) isz++; - + fontesc = mandoc_font(p + *pos, isz); switch (fontesc) { diff --git a/usr.bin/mandoc/term_ascii.c b/usr.bin/mandoc/term_ascii.c index 9aed8551f..43277fd46 100644 --- a/usr.bin/mandoc/term_ascii.c +++ b/usr.bin/mandoc/term_ascii.c @@ -398,7 +398,7 @@ locale_endline(struct termp *p) p->line++; if ((int)p->tcol->offset > p->ti) p->tcol->offset -= p->ti; - else + else p->tcol->offset = 0; p->ti = 0; putwchar(L'\n'); diff --git a/usr.bin/mandoc/term_ps.c b/usr.bin/mandoc/term_ps.c index 3d16520ce..7c24f1bd1 100644 --- a/usr.bin/mandoc/term_ps.c +++ b/usr.bin/mandoc/term_ps.c @@ -1250,7 +1250,7 @@ ps_endline(struct termp *p) if ((int)p->tcol->offset > p->ti) p->tcol->offset -= p->ti; - else + else p->tcol->offset = 0; p->ti = 0; } diff --git a/usr.bin/mg/cinfo.c b/usr.bin/mg/cinfo.c index d4e30cf5c..d20ce8c49 100644 --- a/usr.bin/mg/cinfo.c +++ b/usr.bin/mg/cinfo.c @@ -27,7 +27,7 @@ */ /* * Due to incompatible behaviour between "standard" emacs and - * ctags word traversing, '_' character's value is changed on + * ctags word traversing, '_' character's value is changed on * the fly in ctags mode, hence non-const. */ char cinfo[256] = { diff --git a/usr.bin/mg/cmode.c b/usr.bin/mg/cmode.c index 2a2a10900..5155a7545 100644 --- a/usr.bin/mg/cmode.c +++ b/usr.bin/mg/cmode.c @@ -263,7 +263,7 @@ getindent(const struct line *lp, int *curi) if (!firstnwsp && !isspace(c)) { if (c == '#') cppp = TRUE; - firstnwsp = TRUE; + firstnwsp = TRUE; } if (c == '\\') escp = !escp; diff --git a/usr.bin/mg/dired.c b/usr.bin/mg/dired.c index 5cb747c37..dcb372e3b 100644 --- a/usr.bin/mg/dired.c +++ b/usr.bin/mg/dired.c @@ -786,7 +786,7 @@ refreshbuffer(struct buffer *bp) /* remark any previously deleted files with a 'D' */ if (ddel) - redelete(bp); + redelete(bp); /* find dot line */ bp->b_dotp = bfirstlp(bp); @@ -989,7 +989,7 @@ redelete(struct buffer *bp) /* reset the deleted file buffer flag until a deleted file is found */ bp->b_flag &= ~BFDIREDDEL; - for (lp = bfirstlp(bp); lp != bp->b_headp; lp = nlp) { + for (lp = bfirstlp(bp); lp != bp->b_headp; lp = nlp) { bp->b_dotp = lp; if ((p = findfname(lp, p)) == NULL) { nlp = lforw(lp); @@ -998,7 +998,7 @@ redelete(struct buffer *bp) plen = strlen(p); SLIST_FOREACH_SAFE(d1, &delhead, entry, dt) { fnlen = strlen(d1->fn); - if ((plen == fnlen) && + if ((plen == fnlen) && (strncmp(p, d1->fn, plen) == 0)) { lputc(bp->b_dotp, 0, DDELCHAR); bp->b_flag |= BFDIREDDEL; @@ -1006,7 +1006,7 @@ redelete(struct buffer *bp) if (SLIST_EMPTY(&delhead)) { finished = 1; break; - } + } } } if (finished) @@ -1035,7 +1035,7 @@ createlist(struct buffer *bp) int ret = FALSE; for (lp = bfirstlp(bp); lp != bp->b_headp; lp = nlp) { - /* + /* * Check if the line has 'D' on the first char and if a valid * filename can be extracted from it. */ @@ -1070,7 +1070,7 @@ createlist(struct buffer *bp) SLIST_INSERT_HEAD(&delhead, d2, entry); else SLIST_INSERT_AFTER(d1, d2, entry); - d1 = d2; + d1 = d2; } ret = TRUE; nlp = lforw(lp); diff --git a/usr.bin/mg/echo.c b/usr.bin/mg/echo.c index 9b90aaa5e..08cc5302a 100644 --- a/usr.bin/mg/echo.c +++ b/usr.bin/mg/echo.c @@ -842,7 +842,7 @@ ewprintf(const char *fmt, ...) * Printf style formatting. This is called by "ewprintf" to provide * formatting services to its clients. The move to the start of the * echo line, and the erase to the end of the echo line, is done by - * the caller. + * the caller. * %c prints the "name" of the supplied character. * %k prints the name of the current key (and takes no arguments). * %d prints a decimal integer diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c index d71093593..8498fd556 100644 --- a/usr.bin/mg/file.c +++ b/usr.bin/mg/file.c @@ -605,7 +605,7 @@ buffsave(struct buffer *bp) "Save anyway")) != TRUE) return (s); } - + if (makebackup && (bp->b_flag & BFBAK)) { s = fbackupfile(bp->b_fname); /* hard error */ diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c index fd44a8bcf..f643555b5 100644 --- a/usr.bin/mg/fileio.c +++ b/usr.bin/mg/fileio.c @@ -736,7 +736,7 @@ expandtilde(const char *fn) plen = strlcpy(path, pw->pw_dir, sizeof(path)); if (plen == 0 || path[plen - 1] != '/') { if (strlcat(path, "/", sizeof(path)) >= sizeof(path)) { - dobeep(); + dobeep(); ewprintf("Path too long"); return (NULL); } diff --git a/usr.bin/mg/interpreter.c b/usr.bin/mg/interpreter.c index d73e3d643..800219212 100644 --- a/usr.bin/mg/interpreter.c +++ b/usr.bin/mg/interpreter.c @@ -18,7 +18,7 @@ * * If you do want to do some testing, you can add some lines to your .mg file * like: - * + * * 1. Give multiple arguments to a function that usually would accept only one: * (find-file "a.txt" "b.txt" "c.txt") * @@ -42,7 +42,7 @@ * 7. oh so many things.... * [...] * n. implement user definable functions. - * + * * Notes: * - Currently calls to excline() from this file have the line length and * line number set to zero. @@ -98,13 +98,13 @@ struct expentry { }; /* - * Structure for scheme keywords. + * Structure for scheme keywords. */ #define NUMSCHKEYS 4 #define MAXLENSCHKEYS 17 /* 17 = longest keyword (16) + 1 */ char scharkey[NUMSCHKEYS][MAXLENSCHKEYS] = - { + { "define", "list", "if", @@ -304,7 +304,7 @@ parse(char *begp, const char *par1, const char *par2, int blkid, int expctr, if (doregex(regs, begp)) return(exitinterpreter(NULL, NULL, FALSE)); - /* mg function name regex */ + /* mg function name regex */ regs = "^[A-Za-z-]+$"; if (doregex(regs, begp)) return(excline(begp, 0, 0)); @@ -467,7 +467,7 @@ multiarg(char *cmdp, char *argbuf, int numparams) if (*p != ' ') { if (*p == '"') { if (inquote == 1) - inquote = 0; + inquote = 0; else inquote = 1; } @@ -614,7 +614,7 @@ founddef(char *defstr, int blkid, int expctr, int hasval, int elen) expandvals(NULL, valp, defnam); defnam = NULL; } - *vendp = ' '; + *vendp = ' '; return (TRUE); } @@ -645,7 +645,7 @@ expandvals(char *cmdp, char *valp, char *bp) if (*p != ' ') { if (*p == '"') { if (inquote == 1) - inquote = 0; + inquote = 0; else inquote = 1; } @@ -658,12 +658,12 @@ expandvals(char *cmdp, char *valp, char *bp) continue; /* terminate arg string */ if (*p == ' ') { - *p = '\0'; + *p = '\0'; } endp = p + 1; excbuf[0] = '\0'; varbuf[0] = '\0'; - contbuf[0] = '\0'; + contbuf[0] = '\0'; sizof = sizeof(varbuf); v = varbuf; regs = "[\"]+.*[\"]+"; @@ -680,7 +680,7 @@ expandvals(char *cmdp, char *valp, char *bp) (void)(strlcat(varbuf, contbuf, sizof) >= sizof); - + argbuf[0] = ' '; argbuf[1] = '\0'; (void)(strlcat(argbuf, varbuf, @@ -709,7 +709,7 @@ expandvals(char *cmdp, char *valp, char *bp) return (dobeep_msg("strlcat error")); } /* v1->v_count++;*/ - + if (fin) break; @@ -894,7 +894,7 @@ getenvironmentvariable(char *ptr, char *dobuf, int dosiz) return (dobeep_msg("strlcat error")); if (strlcat(dobuf, q, dosiz) >= dosiz) return (dobeep_msg("strlcat error")); - + return (TRUE); } @@ -932,14 +932,14 @@ stringappend(char *ptr, char *dobuf, int dosiz) v = v + 1; } if (strlcat(f, v, sizof) >= sizof) - return (dobeep_msg("strlcat error")); + return (dobeep_msg("strlcat error")); } else { if (p[0] == '"' && p[strlen(p) - 1] == '"' ) { p[strlen(p) - 1] = '\0'; p = p + 1; } if (strlcat(f, p, sizof) >= sizof) - return (dobeep_msg("strlcat error")); + return (dobeep_msg("strlcat error")); } if (fin) break; diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c index 5a635ae54..9a2d37f11 100644 --- a/usr.bin/mg/line.c +++ b/usr.bin/mg/line.c @@ -169,7 +169,7 @@ linsert(int n, int c) if ((s = checkdirty(curbp)) != TRUE) return (s); - + if (curbp->b_flag & BFREADONLY) { dobeep(); ewprintf("Buffer is read only"); @@ -281,7 +281,7 @@ lnewline_at(struct line *lp1, int doto) for (wp = wheadp; wp != NULL; wp = wp->w_wndp) { if (wp->w_linep == lp1) wp->w_linep = lp2; - if (wp->w_dotline >= tcurwpdotline && + if (wp->w_dotline >= tcurwpdotline && wp->w_bufp == curwp->w_bufp) wp->w_dotline++; } diff --git a/usr.bin/mg/log.c b/usr.bin/mg/log.c index 55910323d..f3fda4973 100644 --- a/usr.bin/mg/log.c +++ b/usr.bin/mg/log.c @@ -1,6 +1,6 @@ /* $OpenBSD: log.c,v 1.13 2022/12/26 19:16:02 jmc Exp $ */ -/* +/* * This file is in the public domain. * * Author: Mark Lumsden @@ -9,27 +9,27 @@ /* * Record a history of an mg session for temporal debugging. - * Sometimes pressing a key will set the scene for a bug only visible + * Sometimes pressing a key will set the scene for a bug only visible * dozens of keystrokes later. gdb has its limitations in this scenario. * * Note this file is not compiled into mg by default, you will need to * amend the 'Makefile' for that to happen. Because of this, the code - * is subject to bit-rot. However, I know myself and others have - * written similar functionally often enough, that recording the below + * is subject to bit-rot. However, I know myself and others have + * written similar functionally often enough, that recording the below * in a code repository could aid the development efforts of mg, even * if it requires a bit of effort to get working. The current code is * written in the spirit of debugging (quickly and perhaps not ideal, * but it does what is required well enough). Should debugging become * more formalised within mg, then I would expect that to change. * - * If you open a file with long lines to run through this debugging + * If you open a file with long lines to run through this debugging * code, you may run into problems with the 1st fprintf statement in * in the mglog_lines() function. mg sometimes segvs at a strlen call * in fprintf - possibly something to do with the format string? * "%s%p b^%p f.%p %d %d\t%c|%s\n" - * When I get time I will look into it. But since my debugging + * When I get time I will look into it. But since my debugging * generally revolves around a file like: - * + * * abc * def * ghk @@ -347,7 +347,7 @@ mgloginit(void) mglogfile_interpreter = "interpreter.log"; mglogfile_misc = "misc.log"; - /* + /* * Change mgloglevel for desired level of logging. * log.h has relevant level info. */ @@ -384,7 +384,7 @@ mgloginit(void) return (FALSE); return (TRUE); -} +} static char * diff --git a/usr.bin/mg/paragraph.c b/usr.bin/mg/paragraph.c index 4e35770e6..d6999d0c0 100644 --- a/usr.bin/mg/paragraph.c +++ b/usr.bin/mg/paragraph.c @@ -26,7 +26,7 @@ static int do_gotoeop(int, int, int *); /* * Move to start of paragraph. * Move backwards by line, checking from the 1st character forwards for the - * existence a non-space. If a non-space character is found, move to the + * existence a non-space. If a non-space character is found, move to the * preceding line. Keep doing this until a line with only spaces is found or * the start of buffer. */ @@ -320,7 +320,7 @@ markpara(int f, int n) /* * Transpose the current paragraph with the following paragraph. If invoked - * multiple times, transpose to the n'th paragraph. If invoked between + * multiple times, transpose to the n'th paragraph. If invoked between * paragraphs, move to the previous paragraph, then continue. */ int @@ -341,14 +341,14 @@ transposepara(int f, int n) (void)gotoeop(FFRAND, 1); /* take a note of buffer flags - we may need them */ - flg = curbp->b_flag; + flg = curbp->b_flag; /* clean out kill buffer then kill region */ kdelete(); if ((status = killregion(FFRAND, 1)) != TRUE) return (status); - /* + /* * Now step through n paragraphs. If we reach the end of buffer, * stop and paste the killed region back, then display a message. */ @@ -356,7 +356,7 @@ transposepara(int f, int n) ewprintf("Cannot transpose paragraph, end of buffer reached."); (void)gotobop(FFRAND, i); (void)yank(FFRAND, 1); - curbp->b_flag = flg; + curbp->b_flag = flg; return (FALSE); } (void)yank(FFRAND, 1); @@ -391,7 +391,7 @@ findpara(void) if (lforw(curwp->w_dotp) == curbp->b_headp) return (FALSE); - curwp->w_dotp = lforw(curwp->w_dotp); + curwp->w_dotp = lforw(curwp->w_dotp); curwp->w_dotline++; } while (1); diff --git a/usr.bin/mg/re_search.c b/usr.bin/mg/re_search.c index 81fb1dd27..53ba9d61f 100644 --- a/usr.bin/mg/re_search.c +++ b/usr.bin/mg/re_search.c @@ -231,7 +231,7 @@ re_repl(int f, int n) update(CMODE); if (!inmacro) ewprintf("(%d replacement(s) done)", rcnt); - + return(TRUE); } diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c index a6926e048..6070a98b8 100644 --- a/usr.bin/mg/search.c +++ b/usr.bin/mg/search.c @@ -133,7 +133,7 @@ forwisearch(int f, int n) if (macrodef || inmacro) /* We can't isearch in macro. Use search instead */ return (forwsearch(f,n)); - else + else return (isearch(SRCH_FORW)); } @@ -147,7 +147,7 @@ backisearch(int f, int n) if (macrodef || inmacro) /* We can't isearch in macro. Use search instead */ return (backsearch(f,n)); - else + else return (isearch(SRCH_BACK)); } diff --git a/usr.bin/mg/tutorial b/usr.bin/mg/tutorial index 1e6e5536e..0a26879cc 100644 --- a/usr.bin/mg/tutorial +++ b/usr.bin/mg/tutorial @@ -2,9 +2,9 @@ The mg Tutorial --------------- The mg editor is a public domain editor intended to loosely resemble GNU Emacs, -while still retaining fast speed and a small memory footprint. +while still retaining fast speed and a small memory footprint. -Most mg commands involve using the Control (sometimes labelled "Ctrl") or the +Most mg commands involve using the Control (sometimes labelled "Ctrl") or the Meta (sometimes labelled "Alt") key. We will use the following conventions in this tutorial: @@ -14,33 +14,33 @@ this tutorial: If you don't have a Meta key, you can use Esc instead. Press and release the Esc key and type . This is equivalent to M-. -The first thing to learn is how to move up and down a document. To move your +The first thing to learn is how to move up and down a document. To move your cursor down a line, use the down-arrow cursor key or C-n (Control and n). >> Now type C-n multiple times and move your cursor past this line. Congratulations. You have now learned how to move your cursor down. To move your cursor up one line, you can use the up-arrow cursor key or C-p (Control -and p). +and p). >> Try using C-p and C-n to move up and down and then move past this line. -The next commands to learn are how to move your cursor left and right. To do -this, you can use the left-arrow and right-arrow cursor keys. Alternatively, +The next commands to learn are how to move your cursor left and right. To do +this, you can use the left-arrow and right-arrow cursor keys. Alternatively, you can use C-b and C-f to do this. >> Practise using the arrow keys or C-b and C-f on this line. -To make it easy to remember these commands, it helps to remember by letter: +To make it easy to remember these commands, it helps to remember by letter: P - Previous line, N - Next line, B - Backwards and F - Forward. Now that you've learned how to move single characters at a time, next we learn -how to move one word at a time. To do this, you can use M-f (Meta and f) or +how to move one word at a time. To do this, you can use M-f (Meta and f) or M-b (Meta and b) to move forwards and backwards, one word at a time. >> Try moving one word at a time by using M-f and M-b on this line. -Notice how the Ctrl and Meta key combinations perform related functions. C-f +Notice how the Ctrl and Meta key combinations perform related functions. C-f moves one letter forward, whereas M-f moves one word forward. There are many key combinations in mg, where C- will perform one function and M- will perform a similar related function. @@ -62,13 +62,13 @@ or you can use C-a and C-e to move to the beginning and end. >> Use C-a and C-e to move to the beginning and end of this line. The next commands we will learn is how to move up and down, one page at a time. -To do this, you can use the Page Up (sometimes labelled PgUp) and Page Down +To do this, you can use the Page Up (sometimes labelled PgUp) and Page Down (sometimes labelled PgDn) keys. You can also use C-v and M-v to do this. C-v moves the cursor down one page and M-v moves it up one page. >> Try using M-v and C-v to move up and down, one page at a time. -The final two motion commands we will learn are M-< (Meta-Less than) and +The final two motion commands we will learn are M-< (Meta-Less than) and M-> (Meta-Greater than) which move you to the beginning and end of a file, respectively. You may not want to try that now as you will probably lose your place in this tutorial. Note that on most terminals, < is above the , key, so @@ -98,9 +98,9 @@ followed by some digits followed by a movement command. >> Type C-u 5 C-f to move forward 5 characters. -In general, C-u allows you to execute any command multiple times, not just -cursor motion commands. The only exception to this rule are C-v and M-v. -When using these two commands with an argument, they move the cursor by that +In general, C-u allows you to execute any command multiple times, not just +cursor motion commands. The only exception to this rule are C-v and M-v. +When using these two commands with an argument, they move the cursor by that many lines instead of pages. Cancelling mg Commands @@ -114,7 +114,7 @@ can use the C-g command to cancel the command immediately. In general, you can use C-g to stop any mg commands. You may type it multiple times if you wish. You should see the word "Quit" appear in the bottom of the -screen when you type C-g indicating that a command was cancelled. +screen when you type C-g indicating that a command was cancelled. In general, when in doubt, use C-g to get out of trouble. @@ -132,12 +132,12 @@ C-d, you can delete one word at a time instead of one character at a time. >> Try inserting and deleting characters and words on this line. -Note that if you type too many characters on a single line, the line will -scroll off the screen and you will see a $ on the line to indicate that the +Note that if you type too many characters on a single line, the line will +scroll off the screen and you will see a $ on the line to indicate that the line is too long to fit on the screen at one time. -To delete a line at a time, you can use C-k to kill the line from the current -cursor position to the end of the line. You can type C-k multiple times to +To delete a line at a time, you can use C-k to kill the line from the current +cursor position to the end of the line. You can type C-k multiple times to kill many lines. You can issue insert or delete commands multiple times using C-u. For example, @@ -160,16 +160,16 @@ that as you start typing the characters, mg automatically searches as you type the characters. To continue searching the text you're looking for, type C-s to find the next -instance. To search in reverse, type C-r instead of C-s. If you type C-s or +instance. To search in reverse, type C-r instead of C-s. If you type C-s or C-r twice, it will simply search for the last text that you searched for. To stop searching for text, simply use the cursor keys (or C-f, C-b etc.) or -C-g to stop the search operation. +C-g to stop the search operation. >> Use C-s foo to search for "foo" in the text. You can use C-s again to find other instances of foo in the file. - -Note that if a word cannot be found, it will say Failing I-search: at the + +Note that if a word cannot be found, it will say Failing I-search: at the bottom of the screen. Typing C-s again will wrap the search around from the top of the file and begin searching from there. @@ -179,7 +179,7 @@ Replace Text To replace text, use M-%. You will be prompted for the text to search for and the text to replace it with. You will then be taken to the first instance of text from the current position. At this point you can do one of the following: - + y - Replace the text at this instance and search for more items. n - Skip this instance and search for more items. . or Enter - Stop replacing text (you can also use C-g). @@ -191,7 +191,7 @@ Cut/Copy/Paste Text ------------------- As explained above, you can cut regions using C-k to kill multiple lines. To -paste the text that you just cut, simply move your cursor to the point and +paste the text that you just cut, simply move your cursor to the point and then type C-y to restore the text. You may type C-y multiple times to restore the text. Hence, to copy text, you can use C-k to kill all the lines, use C-y to restore it immediately, then move to the region you want to copy it to and @@ -199,12 +199,12 @@ then type C-y again to restore the last cut text block again. Another way to cut or copy chunks of text is to first position your cursor at the starting point of the chunk of text. Then type C- to mark this as -the starting point to cut or copy. Then move the cursor to the end point of the -text chunk that you wish to manipulate. Then type C-w to cut the region, or +the starting point to cut or copy. Then move the cursor to the end point of the +text chunk that you wish to manipulate. Then type C-w to cut the region, or M-w to copy the region. If you wish to cancel marking a block of text, simply type C-g to cancel the operation. -To paste the region that you've cut or copied above, simply move your cursor +To paste the region that you've cut or copied above, simply move your cursor to the desired location and then type C-y to paste it. Status Line @@ -213,10 +213,10 @@ Status Line At the bottom of your screen is a reverse highlighted line. This is the status line and lets you know some useful information about the file you're editing. -On the status line, you should see "Mg: tutorial". This lets you know that -you're editing a file named "tutorial". If you've edited this file and not -saved it, it should have a "**" to the left of those words. If this file is -read-only, you should see a "%%" to the left of those words. +On the status line, you should see "Mg: tutorial". This lets you know that +you're editing a file named "tutorial". If you've edited this file and not +saved it, it should have a "**" to the left of those words. If this file is +read-only, you should see a "%%" to the left of those words. To the right of the status line, you should see L followed by digits and, if column-number-mode is enabled, C followed by some more digits. @@ -225,10 +225,10 @@ default). These indicate the line number and column number of the file that your cursor is currently on. If you move the cursor around, you should see the line and column number change. -In the middle of the screen, you should see the word "(fundamental)" which +In the middle of the screen, you should see the word "(fundamental)" which indicates that the current editing mode is "fundamental-mode". The mg editor also supports a c-mode that is more suited to editing C code. There are also -some other useful editing modes for different situations. See the man page +some other useful editing modes for different situations. See the man page for mg(1) to learn about the various editing modes. Opening and Saving Files @@ -236,12 +236,12 @@ Opening and Saving Files To open a file, you can use C-x C-f. You will then be prompted for a file name. If you type a file name that doesn't already exist, a new file will be opened -for you. If the file name already exists, then it will be opened for you and -you can begin editing it. Note that you do not need to type the whole file +for you. If the file name already exists, then it will be opened for you and +you can begin editing it. Note that you do not need to type the whole file name for an existing file. You can type part of the file name and then press the TAB key. If there is only file name that matches, mg will fill in the rest -of the file name for you. If there are multiple files, mg will display that -the choice is ambiguous. If you type the TAB key again, mg will show you all +of the file name for you. If there are multiple files, mg will display that +the choice is ambiguous. If you type the TAB key again, mg will show you all the available choices for file names. NOTE: If you type C-x f instead of C-x C-f, you can use C-g to cancel the @@ -250,7 +250,7 @@ if you don't wish to open a new file. To save the file once you've edited it, use C-x C-s to save the file. When mg is done saving the file, you should see the words "Wrote /path/to/file" -in the bottom of your screen. In general, it is a good idea to save quite +in the bottom of your screen. In general, it is a good idea to save quite often. When you save a file, mg saves a backup of the file with a tilde (~) character at the end. @@ -281,14 +281,14 @@ at the same time, each one displaying different text. To split a screen into two horizontal windows use C-x 2. To return to one window, use C-x 1 to close the other windows and only keep the current window. ->> Use C-x 2 to split the screen into two windows. +>> Use C-x 2 to split the screen into two windows. >> Use C-x o to move from one window to the other. You can scroll up and down in each window using the cursor keys or C-n and C-p keys. >> Use C-x 1 to restore back to one window. -You can list all the buffers that are opened by mg by typing C-x C-b. The +You can list all the buffers that are opened by mg by typing C-x C-b. The screen should divide into two and the top window will list the buffers that are currently open. Use C-x o to switch to the top window, then use the arrow keys to move to the buffer you wish to switch to, and then type the Enter key to @@ -321,8 +321,8 @@ the command at the bottom of the screen. You can type out the whole command if you wish, or you can type out part of the command and then use the TAB key for autocompleting the command. -For instance, to replace text, you can type M-x repl TAB enter to execute -the replace-text command. To cancel this command, type C-g. +For instance, to replace text, you can type M-x repl TAB enter to execute +the replace-text command. To cancel this command, type C-g. To see a list of all available mg(1) commands, consult the man page. @@ -333,8 +333,8 @@ To exit mg temporarily and return to the shell, use C-z. This will take you back to the command shell. To return back to mg, type fg in the shell and you will be returned to your mg session. -To exit mg permanently, type C-x C-c. If you have any unsaved buffers, you -will be asked if you wish to save them or not. +To exit mg permanently, type C-x C-c. If you have any unsaved buffers, you +will be asked if you wish to save them or not. Conclusion ---------- @@ -347,7 +347,7 @@ a diff to tech@openbsd.org. Author Info ----------- -Original Author of this document: Mayukh Bose, +Original Author of this document: Mayukh Bose, Date last updated: 2018-05-27 Copyright diff --git a/usr.bin/mg/word.c b/usr.bin/mg/word.c index 2409bb433..c37eb3163 100644 --- a/usr.bin/mg/word.c +++ b/usr.bin/mg/word.c @@ -67,7 +67,7 @@ forwword(int f, int n) } /* - * Transpose 2 words. + * Transpose 2 words. * The function below is artificially restricted to only a maximum of 1 iteration * at the moment because the 'undo' functionality within mg needs amended for * multiple movements of point, backwards and forwards. diff --git a/usr.bin/mkdep/mkdep.gcc.sh b/usr.bin/mkdep/mkdep.gcc.sh index dbd2333a3..8dfd81ba2 100644 --- a/usr.bin/mkdep/mkdep.gcc.sh +++ b/usr.bin/mkdep/mkdep.gcc.sh @@ -41,7 +41,7 @@ scanfordasho() { while [ $# != 0 ] do case "$1" in - -o) + -o) file="$2"; shift; shift ;; -o*) file="${1#-o}"; shift ;; diff --git a/usr.bin/mklocale/yacc.y b/usr.bin/mklocale/yacc.y index 091591fca..16d17f489 100644 --- a/usr.bin/mklocale/yacc.y +++ b/usr.bin/mklocale/yacc.y @@ -823,7 +823,7 @@ dump_tables() fprintf(stderr, " %4s", (r & _RUNETYPE_Q) ? "phon" : ""); fprintf(stderr, " %1u", (unsigned)((r & _RUNETYPE_SWM)>>_RUNETYPE_SWS)); fprintf(stderr, "\n"); - } else + } else for (x = list->min; x <= list->max; ++x) { u_int32_t r = ntohl(list->types[x - list->min]); diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index c5571ea5c..6135aa747 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -142,7 +142,7 @@ intpr(int interval, int repeatcount) bzero(name, sizeof(name)); if (sdl->sdl_nlen >= IFNAMSIZ) memcpy(name, sdl->sdl_data, IFNAMSIZ - 1); - else if (sdl->sdl_nlen > 0) + else if (sdl->sdl_nlen > 0) memcpy(name, sdl->sdl_data, sdl->sdl_nlen); if (interface != 0 && strcmp(name, interface) != 0) @@ -450,7 +450,7 @@ catchalarm(int signo) static void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) -{ +{ int i; for (i = 0; i < RTAX_MAX; i++) { @@ -458,7 +458,7 @@ get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) rti_info[i] = sa; sa = (struct sockaddr *)((char *)(sa) + roundup(sa->sa_len, sizeof(long))); - } else + } else rti_info[i] = NULL; } } @@ -540,7 +540,7 @@ fetchifs(void) bzero(name, sizeof(name)); if (sdl->sdl_nlen >= IFNAMSIZ) memcpy(name, sdl->sdl_data, IFNAMSIZ - 1); - else if (sdl->sdl_nlen > 0) + else if (sdl->sdl_nlen > 0) memcpy(name, sdl->sdl_data, sdl->sdl_nlen); if (interface != NULL && !strcmp(name, interface)) { diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 94089d5b8..66f72c598 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -153,7 +153,7 @@ protopr(kvm_t *kvmd, u_long pcbaddr, u_int tableid, int proto) printf("Out of memory (file table).\n"); return; } - + /* sort sockets by AF and type */ qsort(kf, fcnt, sizeof(*kf), kf_comp); diff --git a/usr.bin/pkg-config/pkg-config b/usr.bin/pkg-config/pkg-config index 29aaf47cb..51131a006 100644 --- a/usr.bin/pkg-config/pkg-config +++ b/usr.bin/pkg-config/pkg-config @@ -24,7 +24,7 @@ use File::stat; use OpenBSD::PkgConfig; use constant { - ONLY_I => 1, + ONLY_I => 1, ONLY_l => 2, ONLY_L => 4, ONLY_OTHER => 8 @@ -674,7 +674,7 @@ sub parse_suffix($s) if (@l) { say_debug("valid suffix @l found in $full."); - } + } return ($s, @l); } diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index cfd075456..9a5622708 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -473,7 +473,7 @@ vertcol(int argc, char *argv[]) if (!i) { ptbf = buf + indy[j]; lstdat[j] = ptbf; - } else + } else ptbf = lstdat[j]; vc[cvc].pt = ptbf; @@ -1036,7 +1036,7 @@ mulfile(int argc, char *argv[]) fproc++; } else cnt = 0; - + if (rc[j] == END) { /* * EOF close file @@ -1135,7 +1135,7 @@ out: * lim: buffer length * cnt: line length or -1 if no line (EOF for example) * cps: column position 1st char in buffer (large line support) - * trnc: throw away data more than lim up to \n + * trnc: throw away data more than lim up to \n * mor: set if more data in line (not truncated) */ int @@ -1249,7 +1249,7 @@ inln(FILE *inf, char *buf, int lim, int *cnt, int *cps, int trnc, int *mor) * cnt: number of chars of valid data in buf * svips: buffer input column position (for large lines) * svops: buffer output column position (for large lines) - * mor: output line not complete in this buf; more data to come. + * mor: output line not complete in this buf; more data to come. * 1 is more, 0 is complete, -1 is no \n's */ int @@ -1748,7 +1748,7 @@ usage(void) } /* - * setup: Validate command args, initialize and perform sanity + * setup: Validate command args, initialize and perform sanity * checks on options */ int diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c index b73fe2900..05fb5a897 100644 --- a/usr.bin/quota/quota.c +++ b/usr.bin/quota/quota.c @@ -94,7 +94,7 @@ int vflag; int main(int argc, char *argv[]) { - int ngroups; + int ngroups; gid_t mygid, gidset[NGROUPS_MAX]; int i, gflag = 0, uflag = 0; int ch; @@ -345,7 +345,7 @@ showquotas(int type, u_long id, const char *name) if (strlen(qup->fsname) > 15) { printf("%s\n", qup->fsname); nam = ""; - } + } printf("%12s %7d%c %7d %7d %7s", nam, (int)(dbtob((u_quad_t)qup->dqblk.dqb_curblocks) @@ -585,7 +585,7 @@ getnfsquota(struct statfs *fst, struct fstab *fs, struct quotause *qup, warnx("cannot find hostname for %s", fst->f_mntfromname); return (0); } - + *cp = '\0'; if (cp[1] != '/') { *cp = ':'; @@ -640,7 +640,7 @@ getnfsquota(struct statfs *fst, struct fstab *fs, struct quotause *qup, *cp = ':'; return (0); } - + int callaurpc(char *host, int prognum, int versnum, int procnum, xdrproc_t inproc, void *in, xdrproc_t outproc, void *out) @@ -649,10 +649,10 @@ callaurpc(char *host, int prognum, int versnum, int procnum, enum clnt_stat clnt_stat; struct hostent *hp; struct timeval timeout, tottimeout; - + CLIENT *client = NULL; int socket = RPC_ANYSOCK; - + if ((hp = gethostbyname(host)) == NULL) return ((int) RPC_UNKNOWNHOST); timeout.tv_usec = 0; @@ -672,7 +672,7 @@ callaurpc(char *host, int prognum, int versnum, int procnum, tottimeout.tv_usec = 0; clnt_stat = clnt_call(client, procnum, inproc, in, outproc, out, tottimeout); - + return ((int) clnt_stat); } diff --git a/usr.bin/radioctl/radioctl.c b/usr.bin/radioctl/radioctl.c index a6e57cf05..86ab52aa0 100644 --- a/usr.bin/radioctl/radioctl.c +++ b/usr.bin/radioctl/radioctl.c @@ -405,7 +405,7 @@ parse_opt(char *s, struct opt_t *o) { static const char badvalue[] = "bad value `%s'"; char *topt = NULL; int slen, optlen; - + if (s == NULL || *s == '\0' || o == NULL) return 0; @@ -443,7 +443,7 @@ parse_opt(char *s, struct opt_t *o) { o->string = topt; topt = &s[optlen]; - + if (strcmp(o->string, "chnlset") == 0) { for (i = 0; chansets[i].name; i++) if (strncmp(chansets[i].name, topt, diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index d77e12cb0..79fe91170 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -773,7 +773,7 @@ checkin_revert(struct checkin_params *pb) pb->flags |= CO_REVERT; (void)close(workfile_fd); (void)unlink(pb->filename); - + /* If needed, write out RCSFILE before calling checkout_rev() */ if (pb->symbol != NULL) rcs_write(pb->file); diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c index c13b30aa2..2fc6d11e6 100644 --- a/usr.bin/rcs/co.c +++ b/usr.bin/rcs/co.c @@ -225,7 +225,7 @@ checkout_usage(void) "usage: co [-TV] [-ddate] [-f[rev]] [-I[rev]] [-kmode] [-l[rev]]\n" " [-M[rev]] [-p[rev]] [-q[rev]] [-r[rev]] [-sstate]\n" " [-u[rev]] [-w[user]] [-xsuffixes] [-ztz] file ...\n"); - + exit(1); } diff --git a/usr.bin/rcs/ident.c b/usr.bin/rcs/ident.c index 10a221a7c..8e029d3d2 100644 --- a/usr.bin/rcs/ident.c +++ b/usr.bin/rcs/ident.c @@ -164,6 +164,6 @@ __dead void ident_usage(void) { fprintf(stderr, "usage: ident [-qV] [file ...]\n"); - + exit(1); } diff --git a/usr.bin/rcs/rcsparse.c b/usr.bin/rcs/rcsparse.c index 6527da8ad..b8ad97b19 100644 --- a/usr.bin/rcs/rcsparse.c +++ b/usr.bin/rcs/rcsparse.c @@ -1198,7 +1198,7 @@ static void rcsparse_growbuf(RCSFILE *rfp) { struct rcs_pdata *pdp = (struct rcs_pdata *)rfp->rf_pdata; - + pdp->rp_buf = xreallocarray(pdp->rp_buf, 1, pdp->rp_blen + RCS_BUFEXTSIZE); pdp->rp_blen += RCS_BUFEXTSIZE; diff --git a/usr.bin/rdist/child.c b/usr.bin/rdist/child.c index 8f8153e51..1ff8f1eb1 100644 --- a/usr.bin/rdist/child.c +++ b/usr.bin/rdist/child.c @@ -75,7 +75,7 @@ static void reap(int); static void childscan(void); /* - * Remove a child that has died (exited) + * Remove a child that has died (exited) * from the list of active children */ static void @@ -89,9 +89,9 @@ removechild(CHILD *child) /* * Find the child in the list */ - for (pc = childlist, prevpc = NULL; pc != NULL; + for (pc = childlist, prevpc = NULL; pc != NULL; prevpc = pc, pc = pc->c_next) - if (pc == child) + if (pc == child) break; if (pc == NULL) @@ -144,7 +144,7 @@ copychild(CHILD *child) /* * Add a child to the list of children. - */ + */ static void addchild(CHILD *child) { @@ -172,7 +172,7 @@ readchild(CHILD *child) char rbuf[BUFSIZ]; ssize_t amt; - debugmsg(DM_CALL, "[readchild(%s, %d, %d) start]", + debugmsg(DM_CALL, "[readchild(%s, %d, %d) start]", child->c_name, child->c_pid, child->c_readfd); /* @@ -189,7 +189,7 @@ readchild(CHILD *child) */ while ((amt = read(child->c_readfd, rbuf, sizeof(rbuf))) > 0) { /* XXX remove these debug calls */ - debugmsg(DM_MISC, "[readchild(%s, %d, %d) got %zd bytes]", + debugmsg(DM_MISC, "[readchild(%s, %d, %d) got %zd bytes]", child->c_name, child->c_pid, child->c_readfd, amt); (void) xwrite(fileno(stdout), rbuf, amt); @@ -201,8 +201,8 @@ readchild(CHILD *child) debugmsg(DM_MISC, "readchild(%s, %d, %d) done: amt = %zd errno = %d\n", child->c_name, child->c_pid, child->c_readfd, amt, errno); - /* - * See if we've reached EOF + /* + * See if we've reached EOF */ if (amt == 0) debugmsg(DM_MISC, "readchild(%s, %d, %d) at EOF\n", @@ -222,7 +222,7 @@ waitproc(int *statval, int block) pid_t pid; int exitval; - debugmsg(DM_CALL, "waitproc() %s, active children = %d...\n", + debugmsg(DM_CALL, "waitproc() %s, active children = %d...\n", (block) ? "blocking" : "nonblocking", activechildren); pid = waitpid(-1, &status, (block) ? 0 : WNOHANG); @@ -231,7 +231,7 @@ waitproc(int *statval, int block) if (pid > 0 && exitval != 0) { nerrs++; - debugmsg(DM_MISC, + debugmsg(DM_MISC, "Child process %d exited with status %d.\n", pid, exitval); } @@ -239,7 +239,7 @@ waitproc(int *statval, int block) if (statval) *statval = exitval; - debugmsg(DM_CALL, "waitproc() done (activechildren = %d)\n", + debugmsg(DM_CALL, "waitproc() done (activechildren = %d)\n", activechildren); return(pid); @@ -269,7 +269,7 @@ reap(int dummy) * Do a non-blocking check for exiting processes */ pid = waitproc(&status, FALSE); - debugmsg(DM_MISC, + debugmsg(DM_MISC, "reap() pid = %d status = %d activechildren=%d\n", pid, status, activechildren); @@ -305,14 +305,14 @@ reap(int dummy) } /* - * Scan the children list to find the child that just exited, + * Scan the children list to find the child that just exited, * read any unread input, then remove it from the list of active children. */ static void childscan(void) { CHILD *pc, *nextpc; - + debugmsg(DM_CALL, "childscan() start"); for (pc = childlist; pc; pc = nextpc) { @@ -367,12 +367,12 @@ waitup(void) * Actually call select() */ /* XXX remove debugmsg() calls */ - debugmsg(DM_MISC, "waitup() Call select(), activechildren=%d\n", + debugmsg(DM_MISC, "waitup() Call select(), activechildren=%d\n", activechildren); count = select(rchildfdsn+1, rchildfdsp, NULL, NULL, NULL); - debugmsg(DM_MISC, "waitup() select returned %d activechildren = %d\n", + debugmsg(DM_MISC, "waitup() select returned %d activechildren = %d\n", count, activechildren); /* @@ -381,7 +381,7 @@ waitup(void) */ if (count < 0) { if (errno != EINTR) - error("Select failed reading children input: %s", + error("Select failed reading children input: %s", SYSERR); free(rchildfdsp); return; @@ -401,12 +401,12 @@ waitup(void) * which select() detected as ready for reading. */ for (pc = childlist; pc && count > 0; pc = pc->c_next) { - /* - * Make sure child still exists + /* + * Make sure child still exists */ - if (pc->c_name && kill(pc->c_pid, 0) == -1 && + if (pc->c_name && kill(pc->c_pid, 0) == -1 && errno == ESRCH) { - debugmsg(DM_MISC, + debugmsg(DM_MISC, "waitup() proc %d (%s) died unexpectedly!", pc->c_pid, pc->c_name); pc->c_state = PSdead; @@ -457,7 +457,7 @@ spawn(struct cmd *cmd, struct cmd *cmdlist) pid = fork(); if (pid == (pid_t)-1) { - error("Cannot spawn child for %s: fork failed: %s", + error("Cannot spawn child for %s: fork failed: %s", childname, SYSERR); return(-1); } else if (pid > 0) { @@ -496,8 +496,8 @@ spawn(struct cmd *cmd, struct cmd *cmdlist) pid, childname, activechildren); return(pid); } else { - /* - * Child + /* + * Child */ /* We're not going to read from our parent */ @@ -505,12 +505,12 @@ spawn(struct cmd *cmd, struct cmd *cmdlist) /* Make stdout and stderr go to PIPE_WRITE (our parent) */ if (dup2(fildes[PIPE_WRITE], (int)fileno(stdout)) == -1) { - error("Cannot duplicate stdout file descriptor: %s", + error("Cannot duplicate stdout file descriptor: %s", SYSERR); return(-1); } if (dup2(fildes[PIPE_WRITE], (int)fileno(stderr)) == -1) { - error("Cannot duplicate stderr file descriptor: %s", + error("Cannot duplicate stderr file descriptor: %s", SYSERR); return(-1); } diff --git a/usr.bin/rdist/client.c b/usr.bin/rdist/client.c index ef4a574b5..392ca3f5d 100644 --- a/usr.bin/rdist/client.c +++ b/usr.bin/rdist/client.c @@ -91,7 +91,7 @@ remfilename(char *src, char *dest, char *path, char *rname, int destdir) char *p; - debugmsg(DM_MISC, + debugmsg(DM_MISC, "remfilename: src=%s dest=%s path=%s rname=%s destdir=%d\n", A(src), A(dest), A(path), A(rname), destdir); @@ -352,17 +352,17 @@ sendhardlink(opt_t opts, struct linkbuf *lp, char *rname, int destdir) char *lname; /* name of file to link to */ char ername[PATH_MAX*4], elname[PATH_MAX*4]; - debugmsg(DM_MISC, + debugmsg(DM_MISC, "sendhardlink: rname='%s' pathname='%s' src='%s' target='%s'\n", rname, lp->pathname ? lp->pathname : "", lp->src ? lp->src : "", lp->target ? lp->target : ""); - + if (lp->target == NULL) lname = lp->pathname; else { lname = buff; - strlcpy(lname, remfilename(lp->src, lp->target, - lp->pathname, rname, + strlcpy(lname, remfilename(lp->src, lp->target, + lp->pathname, rname, destdir), sizeof(buff)); debugmsg(DM_MISC, "sendhardlink: lname=%s\n", lname); } @@ -386,7 +386,7 @@ sendfile(char *rname, opt_t opts, struct stat *stb, char *user, if (stb->st_nlink > 1) { struct linkbuf *lp; - + if ((lp = linkinfo(stb)) != NULL) return(sendhardlink(opts, lp, rname, destdir)); } @@ -401,8 +401,8 @@ sendfile(char *rname, opt_t opts, struct stat *stb, char *user, */ ENCODE(ername, rname); - (void) sendcmd(C_RECVREG, "%o %04o %lld %lld %lld %s %s %s", - opts, stb->st_mode & 07777, (long long) stb->st_size, + (void) sendcmd(C_RECVREG, "%o %04o %lld %lld %lld %s %s %s", + opts, stb->st_mode & 07777, (long long) stb->st_size, (long long)stb->st_mtime, (long long)stb->st_atime, user, group, ername); if (response() < 0) { @@ -442,7 +442,7 @@ sendfile(char *rname, opt_t opts, struct stat *stb, char *user, */ } if (xwrite(rem_w, buf, (size_t) amt) < 0) { - error("%s: Error writing to client: %s", + error("%s: Error writing to client: %s", target, SYSERR); err(); ++goterr; @@ -454,7 +454,7 @@ sendfile(char *rname, opt_t opts, struct stat *stb, char *user, (void) alarm(0); /* Insure alarm is off */ (void) close(f); - debugmsg(DM_MISC, "Send file '%s' %s.\n", + debugmsg(DM_MISC, "Send file '%s' %s.\n", (goterr) ? "failed" : "complete", rname); /* @@ -590,7 +590,7 @@ senddir(char *rname, opt_t opts, struct stat *stb, char *user, * Send recvdir command in recvit() format. */ ENCODE(ername, rname); - (void) sendcmd(C_RECVDIR, "%o %04o 0 0 0 %s %s %s", + (void) sendcmd(C_RECVDIR, "%o %04o 0 0 0 %s %s %s", opts, stb->st_mode & 07777, user, group, ername); if (response() < 0) return(-1); @@ -608,7 +608,7 @@ senddir(char *rname, opt_t opts, struct stat *stb, char *user, if (IS_ON(opts, DO_REMOVE)) if (rmchk(opts) > 0) ++didupdate; - + if ((d = opendir(target)) == NULL) { error("%s: opendir failed: %s", target, SYSERR); didupdate = -1; @@ -664,7 +664,7 @@ sendlink(char *rname, opt_t opts, struct stat *stb, char *user, if (stb->st_nlink > 1) { struct linkbuf *lp; - + if ((lp = linkinfo(stb)) != NULL) return(sendhardlink(opts, lp, rname, destdir)); } @@ -673,8 +673,8 @@ sendlink(char *rname, opt_t opts, struct stat *stb, char *user, * Gather and send basic link info */ ENCODE(ername, rname); - (void) sendcmd(C_RECVSYMLINK, "%o %04o %lld %lld %lld %s %s %s", - opts, stb->st_mode & 07777, (long long) stb->st_size, + (void) sendcmd(C_RECVSYMLINK, "%o %04o %lld %lld %lld %s %s %s", + opts, stb->st_mode & 07777, (long long) stb->st_size, (long long)stb->st_mtime, (long long)stb->st_atime, user, group, ername); if (response() < 0) @@ -721,7 +721,7 @@ sendlink(char *rname, opt_t opts, struct stat *stb, char *user, error("expected control record"); continue; } - + switch (*s++) { case C_END: /* End of send operation */ *ptarget = CNULL; @@ -729,7 +729,7 @@ sendlink(char *rname, opt_t opts, struct stat *stb, char *user, runspecial(target, opts, rname, destdir); addcmdspecialfile(target, rname, destdir); return(0); - + case C_LOGMSG: if (n > 0) message(MT_INFO, "%s", s); @@ -750,7 +750,7 @@ sendlink(char *rname, opt_t opts, struct stat *stb, char *user, finish(); default: - error("install link: unexpected response '%s'", + error("install link: unexpected response '%s'", respbuff); err(); } @@ -819,22 +819,22 @@ update(char *rname, opt_t opts, struct stat *statp) switch (*cp++) { case QC_ONNFS: /* Resides on a NFS */ debugmsg(DM_MISC, - "update: %s is on a NFS. Skipping...\n", + "update: %s is on a NFS. Skipping...\n", rname); return(US_NOTHING); case QC_SYM: /* Is a symbolic link */ debugmsg(DM_MISC, - "update: %s is a symlink. Skipping...\n", + "update: %s is a symlink. Skipping...\n", rname); return(US_NOTHING); case QC_ONRO: /* Resides on a Read-Only fs */ debugmsg(DM_MISC, - "update: %s is on a RO fs. Skipping...\n", + "update: %s is on a RO fs. Skipping...\n", rname); return(US_NOTHING); - + case QC_YES: done = 1; break; @@ -926,14 +926,14 @@ update(char *rname, opt_t opts, struct stat *statp) */ lmode = statp->st_mode & 07777; - debugmsg(DM_MISC, "update(%s,) local mode %#04o remote mode %#04o\n", + debugmsg(DM_MISC, "update(%s,) local mode %#04o remote mode %#04o\n", rname, lmode, rmode); debugmsg(DM_MISC, "update(%s,) size %lld mtime %lld owner '%s' grp '%s'" "\n", rname, (long long) size, (long long)mtime, owner, group); if (statp->st_mtime != mtime) { if (statp->st_mtime < mtime && IS_ON(opts, DO_YOUNGER)) { - message(MT_WARNING, + message(MT_WARNING, "%s: Warning: remote copy is newer", target); return(US_NOTHING); @@ -945,7 +945,7 @@ update(char *rname, opt_t opts, struct stat *statp) debugmsg(DM_MISC, "size does not match (%lld != %lld).\n", (long long) statp->st_size, (long long) size); return(US_OUTDATE); - } + } if (!IS_ON(opts, DO_NOCHKMODE) && lmode != rmode) { debugmsg(DM_MISC, "modes do not match (%#04o != %#04o).\n", @@ -960,16 +960,16 @@ update(char *rname, opt_t opts, struct stat *statp) if (!IS_ON(opts, DO_NOCHKOWNER) && owner) { if (!IS_ON(opts, DO_NUMCHKOWNER)) { /* Check by string compare */ - if (strcmp(owner, getusername(statp->st_uid, + if (strcmp(owner, getusername(statp->st_uid, target, opts)) != 0) { - debugmsg(DM_MISC, + debugmsg(DM_MISC, "owner does not match (%s != %s).\n", - getusername(statp->st_uid, + getusername(statp->st_uid, target, opts), owner); return(US_CHMOG); } } else { - /* + /* * Check numerically. * Allow negative numbers. */ @@ -977,26 +977,26 @@ update(char *rname, opt_t opts, struct stat *statp) (*owner != '-')) ++owner; if (owner && (uid_t)atoi(owner) != statp->st_uid) { - debugmsg(DM_MISC, + debugmsg(DM_MISC, "owner does not match (%d != %s).\n", statp->st_uid, owner); return(US_CHMOG); } } - } + } if (!IS_ON(opts, DO_NOCHKGROUP) && group) { if (!IS_ON(opts, DO_NUMCHKGROUP)) { /* Check by string compare */ - if (strcmp(group, getgroupname(statp->st_gid, + if (strcmp(group, getgroupname(statp->st_gid, target, opts)) != 0) { - debugmsg(DM_MISC, + debugmsg(DM_MISC, "group does not match (%s != %s).\n", - getgroupname(statp->st_gid, + getgroupname(statp->st_gid, target, opts), group); return(US_CHMOG); } - } else { + } else { /* Check numerically */ /* Allow negative gid */ while (*group && !isdigit((unsigned char) *group) && @@ -1052,7 +1052,7 @@ statupdate(int u, char *starget, opt_t opts, char *rname, int destdir, runspecial(starget, opts, rname, destdir); } else { - message(MT_CHANGE, "%s: change to perm %#04o, owner %s, group %s", + message(MT_CHANGE, "%s: change to perm %#04o, owner %s, group %s", starget, lmode, user, group); ENCODE(ername, rname); (void) sendcmd(C_CHMOG, "%o %04o %s %s %s", @@ -1105,7 +1105,7 @@ fullupdate(int u, char *starget, opt_t opts, char *rname, int destdir, */ (void) sendlink(rname, opts, st, user, group, destdir); return(0); - } else if (S_ISREG(st->st_mode)) { + } else if (S_ISREG(st->st_mode)) { if (u == US_OUTDATE) { if (IS_ON(opts, DO_VERIFY)) { message(MT_INFO, "%s: need to update", starget); @@ -1160,7 +1160,7 @@ sendit(char *rname, opt_t opts, int destdir) * Does rname need updating? */ u = update(rname, opts, &stb); - debugmsg(DM_MISC, "sendit(%s, %#x): update status of %s is %d\n", + debugmsg(DM_MISC, "sendit(%s, %#x): update status of %s is %d\n", rname, opts, target, u); /* @@ -1189,7 +1189,7 @@ sendit(char *rname, opt_t opts, int destdir) return(0); } - + /* * Remove temporary files and do any cleanup operations before exiting. */ @@ -1243,9 +1243,9 @@ install(char *src, char *dest, int ddir, int destdir, opt_t opts) char *cp; cp = getondistoptlist(opts); - (void) snprintf(buff, sizeof(buff), "%s%s%s %s %s", + (void) snprintf(buff, sizeof(buff), "%s%s%s %s %s", IS_ON(opts, DO_VERIFY) ? "verify" : "install", - (cp) ? " -o" : "", (cp) ? cp : "", + (cp) ? " -o" : "", (cp) ? cp : "", src, dest); if (nflag) { printf("%s\n", buff); @@ -1273,16 +1273,16 @@ install(char *src, char *dest, int ddir, int destdir, opt_t opts) } else { rname = strrchr(target, '/'); /* Check if no '/' or target ends in '/' */ - if (rname == NULL || - rname+1 == NULL || + if (rname == NULL || + rname+1 == NULL || *(rname+1) == CNULL) rname = target; else rname++; } - debugmsg(DM_MISC, - "install: target=%s src=%s rname=%s dest='%s' destdir=%d, ddir=%d\n", + debugmsg(DM_MISC, + "install: target=%s src=%s rname=%s dest='%s' destdir=%d, ddir=%d\n", target, source, rname, dest, destdir, ddir); /* diff --git a/usr.bin/rdist/common.c b/usr.bin/rdist/common.c index 8243dfe24..eb1db5227 100644 --- a/usr.bin/rdist/common.c +++ b/usr.bin/rdist/common.c @@ -81,7 +81,7 @@ static int sendcmdmsg(int, char *, size_t); static ssize_t remread(int, u_char *, size_t); static int remmore(void); -/* +/* * Front end to write() that handles partial write() requests. */ ssize_t @@ -90,7 +90,7 @@ xwrite(int fd, void *buf, size_t len) size_t nleft = len; ssize_t nwritten; char *ptr = buf; - + while (nleft > 0) { if ((nwritten = write(fd, ptr, nleft)) <= 0) { return nwritten; @@ -156,7 +156,7 @@ init(int argc, char **argv, char **envp) void finish(void) { - debugmsg(DM_CALL, + debugmsg(DM_CALL, "finish() called: do_fork = %d amchild = %d isserver = %d", do_fork, amchild, isserver); cleanup(0); @@ -194,7 +194,7 @@ lostconn(void) rem_r = rem_w = -1; /* Ensure we don't try to send to server */ checkhostname(); - error("Lost connection to %s", + error("Lost connection to %s", (currenthost) ? currenthost : "(unknown)"); finish(); @@ -311,7 +311,7 @@ static ssize_t remleft; /* * Back end to remote read() */ -static ssize_t +static ssize_t remread(int fd, u_char *buf, size_t bufsiz) { return(read(fd, (char *)buf, bufsiz)); @@ -335,7 +335,7 @@ remmore(void) remleft--; return (*remptr++); } - + /* * Read an input line from the remote. Return the number of bytes * stored (equivalent to strlen(p)). If `cleanup' is set, EOF at @@ -380,8 +380,8 @@ remline(u_char *buffer, int space, int doclean) static char mbuf[BUFSIZ]; (void) snprintf(mbuf, sizeof(mbuf), - "<<< Cmd = %c (\\%3.3o) Msg = \"%s\"", - buffer[0], buffer[0], + "<<< Cmd = %c (\\%3.3o) Msg = \"%s\"", + buffer[0], buffer[0], buffer + 1); debugmsg(DM_PROTO, "%s", mbuf); @@ -445,7 +445,7 @@ getusername(uid_t uid, char *file, opt_t opts) * The value of opts may have changed so we always * do the opts check. */ - if (IS_ON(opts, DO_NUMCHKOWNER)) { + if (IS_ON(opts, DO_NUMCHKOWNER)) { (void) snprintf(buf, sizeof(buf), ":%u", uid); return(buf); } @@ -459,7 +459,7 @@ getusername(uid_t uid, char *file, opt_t opts) lastuid = uid; if ((name = user_from_uid(uid, 1)) == NULL) { - if (IS_ON(opts, DO_DEFOWNER) && !isserver) + if (IS_ON(opts, DO_DEFOWNER) && !isserver) (void) strlcpy(buf, defowner, sizeof(buf)); else { message(MT_WARNING, @@ -487,7 +487,7 @@ getgroupname(gid_t gid, char *file, opt_t opts) * The value of opts may have changed so we always * do the opts check. */ - if (IS_ON(opts, DO_NUMCHKGROUP)) { + if (IS_ON(opts, DO_NUMCHKGROUP)) { (void) snprintf(buf, sizeof(buf), ":%u", gid); return(buf); } @@ -501,7 +501,7 @@ getgroupname(gid_t gid, char *file, opt_t opts) lastgid = gid; if ((name = group_from_gid(gid, 1)) == NULL) { - if (IS_ON(opts, DO_DEFGROUP) && !isserver) + if (IS_ON(opts, DO_DEFGROUP) && !isserver) (void) strlcpy(buf, defgroup, sizeof(buf)); else { message(MT_WARNING, "%s: No name for group %u", @@ -653,7 +653,7 @@ getversion(void) { static char buff[BUFSIZ]; - (void) snprintf(buff, sizeof(buff), + (void) snprintf(buff, sizeof(buff), "Version %s.%d (%s) - Protocol Version %d, Release %s, Patch level %d", DISTVERSION, PATCHLEVEL, DISTSTATUS, VERSION, DISTVERSION, PATCHLEVEL); @@ -804,7 +804,7 @@ char * xbasename(char *path) { char *cp; - + if ((cp = strrchr(path, '/')) != NULL) return(cp+1); else diff --git a/usr.bin/rdist/distopt.c b/usr.bin/rdist/distopt.c index 3f0b88a24..e6632838d 100644 --- a/usr.bin/rdist/distopt.c +++ b/usr.bin/rdist/distopt.c @@ -134,7 +134,7 @@ parsedistopts(char *str, opt_t *optptr, int doerrs) } /* - * Get a list of the Distfile Option Entries for each enabled + * Get a list of the Distfile Option Entries for each enabled * value in "opts". */ char * diff --git a/usr.bin/rdist/docmd.c b/usr.bin/rdist/docmd.c index 5d0279bcf..171fb6c35 100644 --- a/usr.bin/rdist/docmd.c +++ b/usr.bin/rdist/docmd.c @@ -45,7 +45,7 @@ * Functions for rdist that do command (cmd) related activities. */ -struct subcmd *subcmds; /* list of sub-commands for +struct subcmd *subcmds; /* list of sub-commands for current cmd */ struct namelist *filelist; /* list of source files */ time_t lastmod; /* Last modify time */ @@ -73,7 +73,7 @@ closeconn(void) if (rem_w >= 0) { /* We don't care if the connection is still good or not */ - signal(SIGPIPE, SIG_IGN); + signal(SIGPIPE, SIG_IGN); (void) sendcmd(C_FERRMSG, NULL); (void) close(rem_w); @@ -105,7 +105,7 @@ notify(char *rhost, struct namelist *to, time_t lmod) return; if (!IS_ON(options, DO_QUIET)) { - message(MT_INFO, "notify %s%s %s", + message(MT_INFO, "notify %s%s %s", (rhost) ? "@" : "", (rhost) ? rhost : "", getnlstr(to)); } @@ -133,7 +133,7 @@ notify(char *rhost, struct namelist *to, time_t lmod) * Set IFS to avoid possible security problem with users * setting "IFS=/". */ - (void) snprintf(buf, sizeof(buf), "IFS=\" \t\"; export IFS; %s -oi -t", + (void) snprintf(buf, sizeof(buf), "IFS=\" \t\"; export IFS; %s -oi -t", _PATH_SENDMAIL); pf = popen(buf, "w"); if (pf == NULL) { @@ -166,11 +166,11 @@ notify(char *rhost, struct namelist *to, time_t lmod) user = locuser; if (rhost != NULL) - (void) fprintf(pf, + (void) fprintf(pf, "Subject: files updated by %s from %s to %s\n", locuser, host, rhost); else - (void) fprintf(pf, "Subject: files updated after %s\n", + (void) fprintf(pf, "Subject: files updated after %s\n", ctime(&lmod)); (void) putc('\n', pf); (void) putc('\n', pf); @@ -184,7 +184,7 @@ notify(char *rhost, struct namelist *to, time_t lmod) (void) unlink(file); } -/* +/* * XXX Hack for NFS. If a hostname from the distfile * ends with a '+', then the normal restriction of * skipping files that are on an NFS filesystem is @@ -217,7 +217,7 @@ void markassigned(struct cmd *cmd, struct cmd *cmdlist) { struct cmd *pcmd; - + for (pcmd = cmdlist; pcmd; pcmd = pcmd->c_next) { checkcmd(pcmd); if (pcmd->c_type == cmd->c_type && @@ -324,7 +324,7 @@ makeconn(char *rhost) (void) snprintf(buf, sizeof(buf), "%.*s -S", (int)(sizeof(buf)-5), path_rdistd); - + if ((rem_r = rem_w = remotecmd(rhost, locuser, ruser, buf)) < 0) return(0); @@ -353,7 +353,7 @@ makeconn(char *rhost) * The server wants us to send it our version number */ (void) sendcmd(S_VERSION, "%d", VERSION); - if (response() < 0) + if (response() < 0) return(0); } else { /* @@ -377,13 +377,13 @@ makeconn(char *rhost) return(0); } if (min_freespace) { - (void) sendcmd(C_SETCONFIG, "%c%lld", SC_FREESPACE, + (void) sendcmd(C_SETCONFIG, "%c%lld", SC_FREESPACE, min_freespace); if (response() < 0) return(0); } if (min_freefiles) { - (void) sendcmd(C_SETCONFIG, "%c%lld", SC_FREEFILES, + (void) sendcmd(C_SETCONFIG, "%c%lld", SC_FREEFILES, min_freefiles); if (response() < 0) return(0); @@ -438,12 +438,12 @@ doarrow(struct cmd *cmd, char **filev) rhost = cmd->c_name; if (files == NULL) { - error("No files to be updated on %s for target \"%s\"", + error("No files to be updated on %s for target \"%s\"", rhost, cmd->c_label); return; } - debugmsg(DM_CALL, "doarrow(%p, %s, %p) start", + debugmsg(DM_CALL, "doarrow(%p, %s, %p) start", files, A(rhost), sbcmds); if (nflag) @@ -509,7 +509,7 @@ doarrow(struct cmd *cmd, char **filev) debugmsg(DM_MISC, "Debug files->n_next= %p, destdir=%d, ddir=%d", files->n_next, destdir, ddir); - + if (!sc->sc_name || !*sc->sc_name) { destdir = 0; ddir = 0; @@ -571,11 +571,11 @@ doarrow(struct cmd *cmd, char **filev) for (l = ihead; l != NULL; freelinkinfo(l), l = nextl) { nextl = l->nextp; - if (contimedout || IS_ON(opts, DO_IGNLNKS) || + if (contimedout || IS_ON(opts, DO_IGNLNKS) || l->count == 0) continue; message(MT_WARNING, "%s: Warning: %d %s link%s", - l->pathname, abs(l->count), + l->pathname, abs(l->count), (l->count > 0) ? "missing" : "extra", (l->count == 1) ? "" : "s"); } @@ -692,7 +692,7 @@ cmptime(char *name, struct subcmd *sbcmds, char **env) continue; if (sc->sc_args != NULL && !inlist(sc->sc_args, name)) continue; - (void) snprintf(buf, sizeof(buf), "%s=%s;%s", + (void) snprintf(buf, sizeof(buf), "%s=%s;%s", E_LOCFILE, name, sc->sc_name); message(MT_CHANGE, "special \"%s\"", buf); if (*env) { @@ -726,7 +726,7 @@ dodcolon(struct cmd *cmd, char **filev) debugmsg(DM_CALL, "dodcolon()"); if (files == NULL) { - error("No files to be updated for target \"%s\"", + error("No files to be updated for target \"%s\"", cmd->c_label); return; } @@ -851,7 +851,7 @@ docmdhost(struct cmd *cmd, char **filev) checkcmd(cmd); /* - * If we're multi-threaded and we're the parent, spawn a + * If we're multi-threaded and we're the parent, spawn a * new child process. */ if (do_fork && !amchild) { @@ -964,14 +964,14 @@ docmds(struct namelist *hostlist, int argc, char **argv) int found; for (found = FALSE, c = cmds; c != NULL; c = c->c_next) { - if (c->c_label && argv[i] && + if (c->c_label && argv[i] && strcmp(c->c_label, argv[i]) == 0) { found = TRUE; break; } } if (!found) - error("Label \"%s\" is not defined in the distfile.", + error("Label \"%s\" is not defined in the distfile.", argv[i]); } if (nerrs) @@ -1023,7 +1023,7 @@ docmds(struct namelist *hostlist, int argc, char **argv) */ if (amchild) { if (!IS_ON(options, DO_QUIET)) - message(MT_VERBOSE, "updating of %s finished", + message(MT_VERBOSE, "updating of %s finished", currenthost); closeconn(); cleanup(0); @@ -1034,7 +1034,7 @@ docmds(struct namelist *hostlist, int argc, char **argv) * Wait for all remaining active children to finish */ while (activechildren > 0) { - debugmsg(DM_MISC, + debugmsg(DM_MISC, "Waiting for %d children to finish.\n", activechildren); waitup(); diff --git a/usr.bin/rdist/expand.c b/usr.bin/rdist/expand.c index 7d94a7d8d..127aab419 100644 --- a/usr.bin/rdist/expand.c +++ b/usr.bin/rdist/expand.c @@ -80,14 +80,14 @@ Cat(u_char *s1, u_char *s2) /* quote in s1 and s2 */ eargv[++eargc] = NULL; eargv[eargc - 1] = cp = xmalloc(len); - do { - if (*s1 == QUOTECHAR) - s1++; + do { + if (*s1 == QUOTECHAR) + s1++; } while ((*cp++ = *s1++) != '\0'); cp--; - do { - if (*s2 == QUOTECHAR) - s2++; + do { + if (*s2 == QUOTECHAR) + s2++; } while ((*cp++ = *s2++) != '\0'); } @@ -119,7 +119,7 @@ expand(struct namelist *list, int wh) /* quote in list->n_name */ int n; if (debug) - debugmsg(DM_CALL, "expand(%p, %d) start, list = %s", + debugmsg(DM_CALL, "expand(%p, %d) start, list = %s", list, wh, getnlstr(list)); if (wh == 0) @@ -195,7 +195,7 @@ expstr(u_char *s) return; } for (cp = s, cp1 = varbuff; cp && *cp; ++cp) { - /* + /* * remove quoted character if the next * character is not $ */ @@ -212,7 +212,7 @@ expstr(u_char *s) * Consider string 's' a variable that should be expanded if * there is a '$' in 's' that is not quoted. */ - if (IS_ON(which, E_VARS) && + if (IS_ON(which, E_VARS) && ((cp = xstrchr(s, '$')) && !(cp > s && *(cp-1) == QUOTECHAR))) { *cp++ = CNULL; if (*cp == CNULL) { @@ -253,7 +253,7 @@ expstr(u_char *s) expstr(ebuf); return; } - if ((which & ~E_VARS) == 0 || !strcmp((char *)s, "{") || + if ((which & ~E_VARS) == 0 || !strcmp((char *)s, "{") || !strcmp((char *)s, "{}")) { Cat(s, (u_char *)""); sort(); @@ -569,10 +569,10 @@ slash: if (stat(path, &stb) == 0 && S_ISDIR(stb.st_mode)) { if (*p == CNULL) { if (which & E_TILDE) { - Cat((u_char *)path, + Cat((u_char *)path, (u_char *)""); } else { - Cat((u_char *)tilde, + Cat((u_char *)tilde, (u_char *)tpathp); } } else diff --git a/usr.bin/rdist/gram.y b/usr.bin/rdist/gram.y index 14a03b994..1bfbcb06e 100644 --- a/usr.bin/rdist/gram.y +++ b/usr.bin/rdist/gram.y @@ -95,17 +95,17 @@ command: NAME '=' namelist = { | error ; -namelist: nlist { - $$ = $1; +namelist: nlist { + $$ = $1; } - | nlist '-' nlist { - $$ = subnl($1, $3); + | nlist '-' nlist { + $$ = subnl($1, $3); } - | nlist '+' nlist { - $$ = addnl($1, $3); + | nlist '+' nlist { + $$ = addnl($1, $3); } - | nlist '&' nlist { - $$ = andnl($1, $3); + | nlist '&' nlist { + $$ = andnl($1, $3); } ; @@ -232,7 +232,7 @@ yylex(void) int c; char *cp1, *cp2; static char quotechars[] = "[]{}*?$"; - + again: switch (c = getc(fin)) { case EOF: /* end of file */ @@ -251,8 +251,8 @@ again: case '=': /* EQUAL */ case ';': /* SM */ - case '+': - case '&': + case '+': + case '&': return(c); case '(': /* LP */ @@ -329,7 +329,7 @@ again: } } *cp1 = '\0'; - if (yytext[0] == '-' && yytext[1] == CNULL) + if (yytext[0] == '-' && yytext[1] == CNULL) return '-'; if (yytext[0] == '-' && parendepth <= 0) { opt_t opt = 0; @@ -339,7 +339,7 @@ again: case 'o': if (parsedistopts(&yytext[2], &opt, TRUE)) { (void) snprintf(ebuf, sizeof(ebuf), - "Bad distfile options \"%s\".", + "Bad distfile options \"%s\".", &yytext[2]); yyerror(ebuf); } @@ -413,13 +413,13 @@ insert(char *label, struct namelist *files, struct namelist *hosts, struct cmd *c, *prev, *nc; struct namelist *h, *lasth; - debugmsg(DM_CALL, "insert(%s, %p, %p, %p) start, files = %s", + debugmsg(DM_CALL, "insert(%s, %p, %p, %p) start, files = %s", label == NULL ? "(null)" : label, files, hosts, scmds, getnlstr(files)); files = expand(files, E_VARS|E_SHELL); hosts = expand(hosts, E_ALL); - for (h = hosts; h != NULL; lasth = h, h = h->n_next, + for (h = hosts; h != NULL; lasth = h, h = h->n_next, free((char *)lasth)) { /* * Search command list for an update to the same host. diff --git a/usr.bin/rdist/lookup.c b/usr.bin/rdist/lookup.c index 983808e1c..e09aecd60 100644 --- a/usr.bin/rdist/lookup.c +++ b/usr.bin/rdist/lookup.c @@ -134,7 +134,7 @@ lookup(char *name, int action, struct namelist *value) if (action != INSERT || s->s_type != CONST) { (void) snprintf(ebuf, sizeof(ebuf), "%.*s redefined", - (int)(sizeof(ebuf) - + (int)(sizeof(ebuf) - sizeof(" redefined")), name); yyerror(ebuf); } diff --git a/usr.bin/rdist/message.c b/usr.bin/rdist/message.c index 8119141f1..af065f1dd 100644 --- a/usr.bin/rdist/message.c +++ b/usr.bin/rdist/message.c @@ -128,10 +128,10 @@ msgprconfig(void) debugmsg(DM_MISC, "Current message logging config:"); for (i = 0; msgfacility[i].mf_name; ++i) { - (void) snprintf(buf, sizeof(buf), " %.*s=", + (void) snprintf(buf, sizeof(buf), " %.*s=", (int)(sizeof(buf) - 7), msgfacility[i].mf_name); for (x = 0; msgtypes[x].mt_name; ++x) - if (IS_ON(msgfacility[i].mf_msgtypes, + if (IS_ON(msgfacility[i].mf_msgtypes, msgtypes[x].mt_type)) { if (x > 0) (void) strlcat(buf, ",", sizeof(buf)); @@ -188,7 +188,7 @@ setmsgtypes(struct msgfacility *msgfac, char *str) /* * MF_SYSLOG is the only supported message facility for the server */ - if (isserver && (msgfac->mf_msgfac != MF_SYSLOG && + if (isserver && (msgfac->mf_msgfac != MF_SYSLOG && msgfac->mf_msgfac != MF_FILE)) { (void) snprintf(ebuf, sizeof(ebuf), "The \"%.*s\" message facility cannot be used by the server.", @@ -247,7 +247,7 @@ setmsgtypes(struct msgfacility *msgfac, char *str) * XXX This is really a kludge until we add real * control over debugging. */ - if (!debug && isserver && + if (!debug && isserver && strcasecmp(word, "debug") == 0) debug = DM_ALL; } else { @@ -296,11 +296,11 @@ msgparseopts(char *msgstr, int doset) if ((msgfac = getmsgfac(word)) == NULL) { (void) snprintf(ebuf, sizeof(ebuf), - "%.*s is not a valid message facility", + "%.*s is not a valid message facility", 100, word); return(ebuf); } - + if (doset) { char *mcp; @@ -352,7 +352,7 @@ msgsendstdout(struct msgfacility *msgfac, int mtype, int flags, char *msgbuf) break; case MT_DEBUG: - /* + /* * Only things that are strictly MT_DEBUG should * be shown. */ @@ -511,7 +511,7 @@ _message(int flags, char *msgbuf) if (strncmp(currenthost, msgbuf, strlen(currenthost)) == 0) (void) strlcpy(mbuf, msgbuf, sizeof(mbuf)); else - (void) snprintf(mbuf, sizeof(mbuf), + (void) snprintf(mbuf, sizeof(mbuf), "%s: %s", currenthost, msgbuf); } else mbuf[0] = '\0'; @@ -545,8 +545,8 @@ _message(int flags, char *msgbuf) */ for (i = 0; msgfacility[i].mf_name; ++i) for (x = 0; msgtypes[x].mt_name; ++x) - /* - * XXX MT_ALL should not be used directly + /* + * XXX MT_ALL should not be used directly */ if (msgtypes[x].mt_type != MT_ALL && IS_ON(flags, msgtypes[x].mt_type) && diff --git a/usr.bin/rdist/rdist.c b/usr.bin/rdist/rdist.c index 9f7396e60..5466b99a0 100644 --- a/usr.bin/rdist/rdist.c +++ b/usr.bin/rdist/rdist.c @@ -98,14 +98,14 @@ main(int argc, char **argv, char **envp) progname = __progname; if ((cp = msgparseopts(localmsglist, TRUE)) != NULL) { - error("Bad builtin log option (%s): %s.", + error("Bad builtin log option (%s): %s.", localmsglist, cp); usage(); } if ((cp = getenv("RDIST_OPTIONS")) != NULL) if (parsedistopts(cp, &options, TRUE)) { - error("Bad dist option environment string \"%s\".", + error("Bad dist option environment string \"%s\".", cp); exit(1); } @@ -202,7 +202,7 @@ main(int argc, char **argv, char **envp) case 'o': if (parsedistopts(optarg, &options, TRUE)) { - error("Bad dist option string \"%s\".", + error("Bad dist option string \"%s\".", optarg); usage(); } @@ -311,7 +311,7 @@ opendist(char *distfile) * Try to test to see if file is readable before running m4. */ if (access(distfile, R_OK) != 0) - fatalerr("%s: Cannot access file: %s.", + fatalerr("%s: Cannot access file: %s.", distfile, SYSERR); file = distfile; } diff --git a/usr.bin/rdistd/filesys.c b/usr.bin/rdistd/filesys.c index dbbc102f5..0f0260f2b 100644 --- a/usr.bin/rdistd/filesys.c +++ b/usr.bin/rdistd/filesys.c @@ -65,7 +65,7 @@ find_file(char *pathname, struct stat *statbuf, int *isvalid) /* * If this is the same pathname as the last time, and * the file buffer is valid and we're doing the same stat() - * or lstat(), then set statbuf to the last filestat and + * or lstat(), then set statbuf to the last filestat and * return the last file we found. */ if (strcmp(pathname, last_pathname) == 0 && file[0]) { @@ -244,7 +244,7 @@ makemntinfo(struct mntinfo *mi) * Get stat info */ if (stat(mnt->me_path, &mntstat) != 0) { - message(MT_WARNING, "%s: Cannot stat filesystem: %s", + message(MT_WARNING, "%s: Cannot stat filesystem: %s", mnt->me_path, SYSERR); continue; } @@ -292,7 +292,7 @@ getmntpt(char *pathname, struct stat *statbuf, int *isvalid) /* * Use the supplied stat buffer if not NULL or our own. */ - if (statbuf) + if (statbuf) pstat = statbuf; else pstat = &filestat; @@ -345,7 +345,7 @@ is_nfs_mounted(char *path, struct stat *statbuf, int *isvalid) } /* - * Is "path" on a read-only mounted filesystem? + * Is "path" on a read-only mounted filesystem? * Return 1 if it is, 0 if not, or -1 on error. */ int @@ -376,7 +376,7 @@ is_symlinked(char *path, struct stat *statbuf, int *isvalid) return(-1); statbuf = &stb; } - + if (S_ISLNK(statbuf->st_mode)) return(1); diff --git a/usr.bin/rdistd/rdistd.c b/usr.bin/rdistd/rdistd.c index 90d9078d0..698aa531b 100644 --- a/usr.bin/rdistd/rdistd.c +++ b/usr.bin/rdistd/rdistd.c @@ -95,7 +95,7 @@ main(int argc, char **argv, char **envp) /* Set logging */ if ((cp = msgparseopts(localmsglist, TRUE)) != NULL) - fatalerr("Bad message logging option (%s): %s", + fatalerr("Bad message logging option (%s): %s", localmsglist, cp); /* diff --git a/usr.bin/rdistd/server.c b/usr.bin/rdistd/server.c index 7a0f98c05..cc4d025af 100644 --- a/usr.bin/rdistd/server.c +++ b/usr.bin/rdistd/server.c @@ -99,7 +99,7 @@ cattarget(char *string) return(0); } - + /* * Set uid and gid ownership of a file. */ @@ -136,7 +136,7 @@ setownership(char *file, int fd, uid_t uid, gid_t gid, int islink) message(MT_NOTICE, "%s: chgrp %d failed: %s", target, gid, SYSERR); else - message(MT_NOTICE, "%s: chown %d:%d failed: %s", + message(MT_NOTICE, "%s: chown %d:%d failed: %s", target, uid, gid, SYSERR); return(-1); } @@ -210,7 +210,7 @@ fchog(int fd, char *file, char *owner, char *group, int mode) } } else { /* not root, setuid only if user==owner */ if (mode != -1) { - if (IS_ON(mode, S_ISUID) && + if (IS_ON(mode, S_ISUID) && strcmp(locuser, owner) != 0) mode &= ~S_ISUID; if (mode) @@ -224,12 +224,12 @@ fchog(int fd, char *file, char *owner, char *group, int mode) gid = (gid_t) atoi(group + 1); } else if (gid_from_group(group, &gid) == -1) { if (mode != -1 && IS_ON(mode, S_ISGID)) { - message(MT_NOTICE, + message(MT_NOTICE, "%s: unknown group \"%s\", clearing setgid", target, group); mode &= ~S_ISGID; } else - message(MT_NOTICE, + message(MT_NOTICE, "%s: unknown group \"%s\"", target, group); } @@ -240,7 +240,7 @@ fchog(int fd, char *file, char *owner, char *group, int mode) goto ok; } if (mode != -1 && IS_ON(mode, S_ISGID)) { - message(MT_NOTICE, + message(MT_NOTICE, "%s: user %s not in group %s, clearing setgid", target, locuser, group); mode &= ~S_ISGID; @@ -259,12 +259,12 @@ ok: */ if (setownership(file, fd, uid, gid, S_ISLNK(st.st_mode)) < 0) { if (mode != -1 && IS_ON(mode, S_ISUID)) { - message(MT_NOTICE, + message(MT_NOTICE, "%s: chown failed, clearing setuid", target); mode &= ~S_ISUID; } if (mode != -1 && IS_ON(mode, S_ISGID)) { - message(MT_NOTICE, + message(MT_NOTICE, "%s: chown failed, clearing setgid", target); mode &= ~S_ISGID; } @@ -299,7 +299,7 @@ removefile(struct stat *statb, int silent) if (unlink(target) == -1) { if (errno == ETXTBSY) { if (!silent) - message(MT_REMOTE|MT_NOTICE, + message(MT_REMOTE|MT_NOTICE, "%s: unlink failed: %s", target, SYSERR); return(0); @@ -333,8 +333,8 @@ removefile(struct stat *statb, int silent) if (len + 1 + (int)strlen(dp->d_name) >= PATH_MAX - 1) { if (!silent) - message(MT_REMOTE|MT_WARNING, - "%s/%s: Name too long", + message(MT_REMOTE|MT_WARNING, + "%s/%s: Name too long", target, dp->d_name); continue; } @@ -347,7 +347,7 @@ removefile(struct stat *statb, int silent) if (lstat(target, &stb) == -1) { if (!silent) message(MT_REMOTE|MT_WARNING, - "%s: lstat failed: %s", + "%s: lstat failed: %s", target, SYSERR); continue; } @@ -415,7 +415,7 @@ doclean(char *cp) continue; if (len + 1 + (int)strlen(dp->d_name) >= PATH_MAX - 1) { - message(MT_REMOTE|MT_WARNING, "%s/%s: Name too long", + message(MT_REMOTE|MT_WARNING, "%s/%s: Name too long", target, dp->d_name); continue; } @@ -426,7 +426,7 @@ doclean(char *cp) continue; ptarget--; if (lstat(target, &stb) == -1) { - message(MT_REMOTE|MT_WARNING, "%s: lstat failed: %s", + message(MT_REMOTE|MT_WARNING, "%s: lstat failed: %s", target, SYSERR); continue; } @@ -439,7 +439,7 @@ doclean(char *cp) continue; if (IS_ON(opts, DO_VERIFY)) - message(MT_REMOTE|MT_INFO, "%s: need to remove", + message(MT_REMOTE|MT_INFO, "%s: need to remove", target); else (void) removefile(&stb, 0); @@ -508,7 +508,7 @@ docmdspecial(void) if (env == NULL) { len = (2 * sizeof(E_FILES)) + strlen(cp) + 10; env = xmalloc(len); - (void) snprintf(env, len, "export %s;%s=%s", + (void) snprintf(env, len, "export %s;%s=%s", E_FILES, E_FILES, cp); } else { len = strlen(env) + 1 + strlen(cp) + 1; @@ -620,7 +620,7 @@ query(char *xname) (long long) stb.st_size, (long long) stb.st_mtime, stb.st_mode & 07777, - getusername(stb.st_uid, target, options), + getusername(stb.st_uid, target, options), getgroupname(stb.st_gid, target, options)); break; @@ -654,8 +654,8 @@ chkparent(char *name, opt_t opts) if (mkdir(name, 0777 & ~oumask) == 0) { message(MT_NOTICE, "%s: mkdir", name); r = 0; - } else - debugmsg(DM_MISC, + } else + debugmsg(DM_MISC, "chkparent(%s, %#04o) mkdir fail: %s\n", name, opts, SYSERR); } @@ -696,7 +696,7 @@ savetarget(char *file, opt_t opts) } if (i == 1000) { - message(MT_NOTICE, + message(MT_NOTICE, "%s: More than 1000 versions for %s; reusing 1\n", savefile, SYSERR); i = 1; @@ -716,7 +716,7 @@ savetarget(char *file, opt_t opts) } if (rename(file, savefile) != 0 && errno != ENOENT) { - error("%s -> %s: rename failed: %s", + error("%s -> %s: rename failed: %s", file, savefile, SYSERR); return(NULL); } @@ -817,7 +817,7 @@ recvfile(char *new, opt_t opts, int mode, char *owner, char *group, } while ((c = getc(f1)) == getc(f2)) if (c == EOF) { - debugmsg(DM_MISC, + debugmsg(DM_MISC, "Files are the same '%s' '%s'.", target, new); (void) fclose(f1); @@ -837,7 +837,7 @@ recvfile(char *new, opt_t opts, int mode, char *owner, char *group, (void) fclose(f1); (void) fclose(f2); if (IS_ON(opts, DO_VERIFY)) { - message(MT_REMOTE|MT_INFO, "%s: need to update", + message(MT_REMOTE|MT_INFO, "%s: need to update", target); (void) close(f); (void) unlink(new); @@ -980,21 +980,21 @@ recvdir(opt_t opts, int mode, char *owner, char *group) if (!IS_ON(opts, DO_NOCHKMODE) && (stb.st_mode & 07777) != mode) { if (IS_ON(opts, DO_VERIFY)) - message(MT_NOTICE, + message(MT_NOTICE, "%s: need to chmod to %#04o", target, mode); else if (chmod(target, mode) != 0) message(MT_NOTICE, "%s: chmod from %#04o to %#04o failed: %s", - target, - stb.st_mode & 07777, + target, + stb.st_mode & 07777, mode, SYSERR); else message(MT_NOTICE, "%s: chmod from %#04o to %#04o", - target, - stb.st_mode & 07777, + target, + stb.st_mode & 07777, mode); } @@ -1032,13 +1032,13 @@ recvdir(opt_t opts, int mode, char *owner, char *group) */ #define PRN(n) ((n[0] == ':') ? n+1 : n) if (lowner[0] != CNULL || lgroup[0] != CNULL) { - if (lowner[0] == CNULL && - (cp = getusername(stb.st_uid, + if (lowner[0] == CNULL && + (cp = getusername(stb.st_uid, target, opts))) (void) strlcpy(lowner, cp, sizeof(lowner)); - if (lgroup[0] == CNULL && - (cp = getgroupname(stb.st_gid, + if (lgroup[0] == CNULL && + (cp = getgroupname(stb.st_gid, target, opts))) (void) strlcpy(lgroup, cp, sizeof(lgroup)); @@ -1046,18 +1046,18 @@ recvdir(opt_t opts, int mode, char *owner, char *group) if (IS_ON(opts, DO_VERIFY)) message(MT_NOTICE, "%s: need to chown from %s:%s to %s:%s", - target, + target, PRN(lowner), PRN(lgroup), PRN(owner), PRN(group)); else { - if (fchog(-1, target, owner, + if (fchog(-1, target, owner, group, -1) == 0) message(MT_NOTICE, "%s: chown from %s:%s to %s:%s", target, - PRN(lowner), + PRN(lowner), PRN(lgroup), - PRN(owner), + PRN(owner), PRN(group)); } } @@ -1078,7 +1078,7 @@ recvdir(opt_t opts, int mode, char *owner, char *group) if (s < 0) { if (errno == ENOENT) { if (mkdir(target, mode) == 0 || - (chkparent(target, opts) == 0 && + (chkparent(target, opts) == 0 && mkdir(target, mode) == 0)) { message(MT_NOTICE, "%s: mkdir", target); (void) fchog(-1, target, owner, group, mode); @@ -1313,7 +1313,7 @@ setconfig(char *cmd) case SC_LOGGING: /* Logging options */ if ((estr = msgparseopts(cp, TRUE)) != NULL) { - fatalerr("Bad message option string (%s): %s", + fatalerr("Bad message option string (%s): %s", cp, estr); return; } @@ -1482,7 +1482,7 @@ recvit(char *cmd, int type) * filesystem values < 0 indicate unsupported or unavailable * information. */ - if (min_freespace && (freespace >= 0) && + if (min_freespace && (freespace >= 0) && (freespace - fsize < min_freespace)) { error( "%s: Not enough free space on filesystem: min %lld " @@ -1673,7 +1673,7 @@ server(void) #endif /* SETARGS */ } - /* + /* * Let client know we want it to send its version number */ (void) sendcmd(S_VERSION, NULL); diff --git a/usr.bin/rpcgen/rpc_parse.h b/usr.bin/rpcgen/rpc_parse.h index 4f4cf3c68..5349a0a41 100644 --- a/usr.bin/rpcgen/rpc_parse.h +++ b/usr.bin/rpcgen/rpc_parse.h @@ -35,7 +35,7 @@ /* @(#)rpc_parse.h 1.3 90/08/29 (C) 1987 SMI */ /* - * rpc_parse.h, Definitions for the RPCL parser + * rpc_parse.h, Definitions for the RPCL parser */ enum defkind { diff --git a/usr.bin/rpcinfo/rpcinfo.c b/usr.bin/rpcinfo/rpcinfo.c index 4fdf948c6..9b48a2108 100644 --- a/usr.bin/rpcinfo/rpcinfo.c +++ b/usr.bin/rpcinfo/rpcinfo.c @@ -190,7 +190,7 @@ main(int argc, char *argv[]) return (0); } - + void udpping(u_short portnum, int argc, char **argv) { @@ -202,7 +202,7 @@ udpping(u_short portnum, int argc, char **argv) int sock = RPC_ANYSOCK; struct rpc_err rpcerr; int failure; - + if (argc < 2) usage("too few arguments"); if (argc > 3) @@ -485,7 +485,7 @@ pmapdump(int argc, char **argv) struct timeval minutetimeout; CLIENT *client; struct rpcent *rpc; - + if (argc > 1) usage("too many arguments"); @@ -538,8 +538,8 @@ pmapdump(int argc, char **argv) } } -/* - * reply_proc collects replies from the broadcast. +/* + * reply_proc collects replies from the broadcast. * to get a unique list of responses the output of rpcinfo should * be piped through sort(1) and then uniq(1). */ @@ -567,7 +567,7 @@ brdcst(int argc, char **argv) usage("program number out of range"); if (getul(argv[1], &vers_num)) usage("version number out of range"); - + rpc_stat = clnt_broadcast(prognum, vers_num, NULLPROC, xdr_void, (char *)NULL, xdr_void, (char *)NULL, reply_proc); if ((rpc_stat != RPC_SUCCESS) && (rpc_stat != RPC_TIMEDOUT)) { @@ -613,7 +613,7 @@ setreg(int argc, char **argv) usage("cannot parse port number"); if (port_num >= 65536) usage("port number out of range"); - + if ((pmap_set(prog_num, version_num, IPPROTO_TCP, (u_short)port_num)) == 0) { fprintf(stderr, "rpcinfo: Could not set registration " diff --git a/usr.bin/sed/TEST/sed.test b/usr.bin/sed/TEST/sed.test index 4579730e8..0bcd710ae 100644 --- a/usr.bin/sed/TEST/sed.test +++ b/usr.bin/sed/TEST/sed.test @@ -459,7 +459,7 @@ test_print() echo "" >> lines3 $SED -n -e '$p' lines3 /dev/null fi - + } test_subst() @@ -490,7 +490,7 @@ u2/g' lines1 cat lines4 mark '8.12' ; $SED -e 's/[123]/X/g' lines1 mark '8.13' ; $SED -e 'y/0123456789/9876543210/' lines1 - mark '8.14' ; + mark '8.14' ; if [ $BSD -eq 1 -o $GNU -eq 1 -o $SUN -eq 1 ] ; then echo BSD/GNU/SUN sed fail this test else diff --git a/usr.bin/sed/USD.doc/sed b/usr.bin/sed/USD.doc/sed index 1797b2ca8..e26b54771 100644 --- a/usr.bin/sed/USD.doc/sed +++ b/usr.bin/sed/USD.doc/sed @@ -113,7 +113,7 @@ by the requirement that the input and output fit simultaneously into available secondary storage. .LP Complicated editing scripts can be created separately and given -to +to .I sed as a command file. For complex edits, this saves considerable typing, and its @@ -139,7 +139,7 @@ and even confirmed users of .I ed will frequently be surprised (and probably chagrined), -if they rashly use +if they rashly use .I sed without reading Sections 2 and 3 of this document. The most striking family resemblance between the two @@ -210,7 +210,7 @@ not to copy all lines, but only those specified by .I p functions or .I p -flags after +flags after .I s functions (see Section 3.3); .RE @@ -261,7 +261,7 @@ Through caverns measureless to man Down to a sunless sea. .DE .LP -(In no case is the output of the +(In no case is the output of the .I sed commands to be considered an improvement on Coleridge.) @@ -467,8 +467,8 @@ function reads the next line from the input, replacing the current line. The current line is written to the output if it should be. -The list of editing commands is continued -following the +The list of editing commands is continued +following the .I n command. .RE @@ -500,7 +500,7 @@ Once an function is successfully executed, will be written to the output regardless of what later commands do to the line which triggered it. -The triggering line may be +The triggering line may be deleted entirely; will still be written to the output. .LP The is not scanned for address matches, and no editing @@ -584,7 +584,7 @@ function is described in Section 3.4.) .RS .I Note : Within the text put in the output by these functions, -leading blanks and tabs will disappear, as always in +leading blanks and tabs will disappear, as always in .I sed commands. To get leading blanks and tabs into the output, precede the first @@ -660,7 +660,7 @@ The argument begins immediately after the second delimiting character of , and must be followed immediately by another instance of the delimiting character. -(Thus there are exactly +(Thus there are exactly .I three instances of the delimiting character.) .LP @@ -719,7 +719,7 @@ If exists before is run, it is overwritten; if not, it is created. The possibilities of multiple, somewhat different copies of -one input line being written are the same as for +one input line being written are the same as for .I p. A maximum of 10 different file names may be mentioned after .I w @@ -837,7 +837,7 @@ If and .I a functions are executed on the same line, -the text from the +the text from the .I a functions and the .I r @@ -923,7 +923,7 @@ from its beginning. .LP Print up to and including the first newline in the pattern space. .LP -The +The .I P and .I D @@ -1079,7 +1079,7 @@ beginning on the new line. .LP The .I t -function tests whether +function tests whether .I any successful substitutions have been made on the current input line; diff --git a/usr.bin/skeyaudit/skeyaudit.c b/usr.bin/skeyaudit/skeyaudit.c index 3cad9b2ea..afb861eaf 100644 --- a/usr.bin/skeyaudit/skeyaudit.c +++ b/usr.bin/skeyaudit/skeyaudit.c @@ -158,7 +158,7 @@ main(int argc, char **argv) if (left < limit) notify(pw, left, iflag); } - + exit(0); } diff --git a/usr.bin/skeyinit/skeyinit.c b/usr.bin/skeyinit/skeyinit.c index d616d0dbd..e7775ccd5 100644 --- a/usr.bin/skeyinit/skeyinit.c +++ b/usr.bin/skeyinit/skeyinit.c @@ -124,7 +124,7 @@ main(int argc, char **argv) err(1, "no user with uid %u", getuid()); if (argc == 1) { - char me[UT_NAMESIZE + 1]; + char me[UT_NAMESIZE + 1]; (void)strlcpy(me, pp->pw_name, sizeof me); if ((pp = getpwnam(argv[0])) == NULL) diff --git a/usr.bin/snmp/smi.c b/usr.bin/snmp/smi.c index 5a29914af..4213fc955 100644 --- a/usr.bin/snmp/smi.c +++ b/usr.bin/snmp/smi.c @@ -668,7 +668,7 @@ smi_displayhint_os(struct textconv *tc, int print_hint, const char *src, errno = EINVAL; return NULL; } - + if (displayformat[0] == 't' || displayformat[0] == 'a') { if ((rbuf = malloc(prefixlen + octetlength + 1)) == NULL) return NULL; diff --git a/usr.bin/snmp/snmpc.c b/usr.bin/snmp/snmpc.c index 3930c9192..831ad5475 100644 --- a/usr.bin/snmp/snmpc.c +++ b/usr.bin/snmp/snmpc.c @@ -904,7 +904,7 @@ snmpc_df(int argc, char *argv[]) ober_oid_cmp(&oid, &descroid) != 2) break; rows++; - } + } if ((df = reallocarray(df, rows, sizeof(*df))) == NULL) err(1, "malloc"); (void) ober_scanf_elements(pdu, "{SSS{e", &varbind); @@ -932,7 +932,7 @@ snmpc_df(int argc, char *argv[]) err(1, "df: invalid hrStorageDescr"); if (df[i].descrwidth > descrlen) descrlen = df[i].descrwidth; - } + } ober_free_elements(pdu); if (varbind != NULL) break; diff --git a/usr.bin/spell/look.c b/usr.bin/spell/look.c index 87e0caa48..32dcf7ccf 100644 --- a/usr.bin/spell/look.c +++ b/usr.bin/spell/look.c @@ -63,40 +63,40 @@ look(u_char *string, u_char *front, u_char *back) /* * Binary search for "string" in memory between "front" and "back". - * + * * This routine is expected to return a pointer to the start of a line at * *or before* the first word matching "string". Relaxing the constraint * this way simplifies the algorithm. - * + * * Invariants: - * front points to the beginning of a line at or before the first + * front points to the beginning of a line at or before the first * matching string. - * - * back points to the beginning of a line at or after the first + * + * back points to the beginning of a line at or after the first * matching line. - * + * * Base of the Invariants. - * front = NULL; + * front = NULL; * back = EOF; - * + * * Advancing the Invariants: - * + * * p = first newline after halfway point from front to back. - * - * If the string at "p" is not greater than the string to match, + * + * If the string at "p" is not greater than the string to match, * p is the new front. Otherwise it is the new back. - * + * * Termination: - * - * The definition of the routine allows it return at any point, + * + * The definition of the routine allows it return at any point, * since front is always at or before the line to print. - * - * In fact, it returns when the chosen "p" equals "back". This - * implies that there exists a string is least half as long as - * (back - front), which in turn implies that a linear search will + * + * In fact, it returns when the chosen "p" equals "back". This + * implies that there exists a string is least half as long as + * (back - front), which in turn implies that a linear search will * be no more expensive than the cost of simply printing a string or two. - * - * Trying to continue with binary search at this point would be + * + * Trying to continue with binary search at this point would be * more trouble than it's worth. */ #define SKIP_PAST_NEWLINE(p, back) \ @@ -128,12 +128,12 @@ binary_search(u_char *string, u_char *front, u_char *back) /* * Find the first line that matches string, linearly searching from front * to back. - * + * * Return NULL for no such line. - * + * * This routine assumes: - * - * o front points at the first character in a line. + * + * o front points at the first character in a line. * o front is before or at the first line to be printed. */ u_char * diff --git a/usr.bin/ssh/poly1305.c b/usr.bin/ssh/poly1305.c index ead974177..7d21c765a 100644 --- a/usr.bin/ssh/poly1305.c +++ b/usr.bin/ssh/poly1305.c @@ -1,5 +1,5 @@ /* $OpenBSD: poly1305.c,v 1.4 2023/07/17 05:26:38 djm Exp $ */ -/* +/* * Public Domain poly1305 from Andrew Moon * poly1305-donna-unrolled.c from https://github.com/floodyberry/poly1305-donna */ diff --git a/usr.bin/ssh/xmss_hash.c b/usr.bin/ssh/xmss_hash.c index 87e59f328..c8359f679 100644 --- a/usr.bin/ssh/xmss_hash.c +++ b/usr.bin/ssh/xmss_hash.c @@ -28,7 +28,7 @@ unsigned char* addr_to_byte(unsigned char *bytes, const uint32_t addr[8]){ #else memcpy(bytes, addr, 32); return bytes; -#endif +#endif } int core_hash_SHA2(unsigned char *out, const unsigned int type, const unsigned char *key, unsigned int keylen, const unsigned char *in, unsigned long long inlen, unsigned int n){ diff --git a/usr.bin/systat/cache.c b/usr.bin/systat/cache.c index ea3bc6ce6..97f45650a 100644 --- a/usr.bin/systat/cache.c +++ b/usr.bin/systat/cache.c @@ -157,7 +157,7 @@ cache_state(struct pfsync_state *st) if (td > 0) { r = sd/td; - update_state(old, st, r); + update_state(old, st, r); } /* move to active queue */ diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index ce7851d8b..72c5523a1 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -109,7 +109,7 @@ print_header(void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])); snprintf(uloadbuf, sizeof(uloadbuf), - "%4d users Load %.2f %.2f %.2f", + "%4d users Load %.2f %.2f %.2f", ucount(), avenrun[0], avenrun[1], avenrun[2]); time(&now); @@ -126,7 +126,7 @@ print_header(void) snprintf(tmpbuf, sizeof(tmpbuf), "%s %s", uloadbuf, paused ? "PAUSED" : ""); - + snprintf(header, sizeof(header), "%-*s %19.19s %s", TIMEPOS - 1, tmpbuf, hostname, timebuf); diff --git a/usr.bin/systat/malloc.c b/usr.bin/systat/malloc.c index c25373d8a..4bf857613 100644 --- a/usr.bin/systat/malloc.c +++ b/usr.bin/systat/malloc.c @@ -289,13 +289,13 @@ read_types(void) siz = sizeof(struct kmemstats); num_types = 0; - + for (i = 0; i < M_LAST; i++) { mib[0] = CTL_KERN; mib[1] = KERN_MALLOCSTATS; mib[2] = KERN_MALLOC_KMEMSTATS; mib[3] = i; - + /* * Skip errors -- these are presumed to be unallocated * entries. diff --git a/usr.bin/systat/mbufs.c b/usr.bin/systat/mbufs.c index 8a1b93c90..60c52b34c 100644 --- a/usr.bin/systat/mbufs.c +++ b/usr.bin/systat/mbufs.c @@ -259,7 +259,7 @@ read_mb(void) if (ifa->ifa_addr == NULL || ifa->ifa_addr->sa_family != AF_LINK) continue; - + strlcpy(ifi->name, ifa->ifa_name, sizeof(ifi->name)); for (;;) { struct ifreq ifreq; @@ -284,7 +284,7 @@ read_mb(void) } if (rings >= ifi->data.ifri_total) - break; + break; ifr = reallocarray(ifi->data.ifri_entries, ifi->data.ifri_total, sizeof(*ifr)); diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 1e13de5fe..289e1386c 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -383,7 +383,7 @@ shownetstat(struct netinfo *p) proto, FLD_NS_FOREIGN); break; } - + tb_start(); switch (p->nif_proto) { case IPPROTO_TCP: diff --git a/usr.bin/systat/pf.c b/usr.bin/systat/pf.c index 64d627d92..f65d776f8 100644 --- a/usr.bin/systat/pf.c +++ b/usr.bin/systat/pf.c @@ -246,7 +246,7 @@ print_pf(void) break; default: debug = "unknown"; - break; + break; } ADD_LINE_S("pf", "Debug", debug); diff --git a/usr.bin/systat/pftop.c b/usr.bin/systat/pftop.c index d64dec2e3..e41c3c271 100644 --- a/usr.bin/systat/pftop.c +++ b/usr.bin/systat/pftop.c @@ -311,9 +311,9 @@ TAILQ_HEAD(qnodes, pfctl_queue_node) qnodes = TAILQ_HEAD_INITIALIZER(qnodes); int sort_size_callback(const void *s1, const void *s2) { - u_int64_t b1 = COUNTER(state_buf[* (size_t *) s1].bytes[0]) + + u_int64_t b1 = COUNTER(state_buf[* (size_t *) s1].bytes[0]) + COUNTER(state_buf[* (size_t *) s1].bytes[1]); - u_int64_t b2 = COUNTER(state_buf[* (size_t *) s2].bytes[0]) + + u_int64_t b2 = COUNTER(state_buf[* (size_t *) s2].bytes[0]) + COUNTER(state_buf[* (size_t *) s2].bytes[1]); if (b2 > b1) return sortdir; @@ -325,9 +325,9 @@ sort_size_callback(const void *s1, const void *s2) int sort_pkt_callback(const void *s1, const void *s2) { - u_int64_t p1 = COUNTER(state_buf[* (size_t *) s1].packets[0]) + + u_int64_t p1 = COUNTER(state_buf[* (size_t *) s1].packets[0]) + COUNTER(state_buf[* (size_t *) s1].packets[1]); - u_int64_t p2 = COUNTER(state_buf[* (size_t *) s2].packets[0]) + + u_int64_t p2 = COUNTER(state_buf[* (size_t *) s2].packets[0]) + COUNTER(state_buf[* (size_t *) s2].packets[1]); if (p2 > p1) return sortdir; @@ -1050,7 +1050,7 @@ read_rulesets(const char *path) if (path == NULL) ruleset.path[0] = '\0'; - else if (strlcpy(ruleset.path, path, sizeof(ruleset.path)) >= + else if (strlcpy(ruleset.path, path, sizeof(ruleset.path)) >= sizeof(ruleset.path)) return (-1); @@ -1146,7 +1146,7 @@ read_rules(void) if (nw > 16) nw = 16; - if (FLD_LABEL->norm_width != nw || + if (FLD_LABEL->norm_width != nw || FLD_LABEL->max_width != mw) { FLD_LABEL->norm_width = nw; FLD_LABEL->max_width = mw; diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c index b65d02391..f4cb71158 100644 --- a/usr.bin/systat/pigs.c +++ b/usr.bin/systat/pigs.c @@ -123,7 +123,7 @@ getprocs(void) { size_t size; int mib[6] = {CTL_KERN, KERN_PROC, KERN_PROC_KTHREAD, 0, sizeof(struct kinfo_proc), 0}; - + int st; free(procbase); @@ -290,7 +290,7 @@ compar(const void *a, const void *b) int i1 = *((int *)a); int i2 = *((int *)b); - return procbase[i1].p_pctcpu > + return procbase[i1].p_pctcpu > procbase[i2].p_pctcpu ? -1 : 1; } diff --git a/usr.bin/systat/sensors.c b/usr.bin/systat/sensors.c index d1bba1017..4668fbf73 100644 --- a/usr.bin/systat/sensors.c +++ b/usr.bin/systat/sensors.c @@ -368,8 +368,8 @@ fmttime(double in) in *= 1e12; } - snprintf(outbuf, LEN, - tiny ? "%s%f %s" : "%s%.3f %s", + snprintf(outbuf, LEN, + tiny ? "%s%f %s" : "%s%.3f %s", signbit == -1 ? "-" : "", in, unit); return outbuf; diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c index c632bfc7e..517c9c67a 100644 --- a/usr.bin/systat/swap.c +++ b/usr.bin/systat/swap.c @@ -185,7 +185,7 @@ showswap(int i) p = p ? p+1 : sep->se_path; print_fld_str(FLD_SW_NAME, p); - + xsize = sep->se_nblks; used = sep->se_inuse; diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index 09c748449..54f3f5c59 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -219,7 +219,7 @@ forward(struct tailfile *tf, int nfiles, enum STYLE style, off_t origoff) * * Continue to look at it until * a new file reappears with - * the same name. + * the same name. */ (void) tfreopen(ctf); } else if (ke.fflags & NOTE_TRUNCATE) { diff --git a/usr.bin/tail/reverse.c b/usr.bin/tail/reverse.c index 144c481b6..c8dad7166 100644 --- a/usr.bin/tail/reverse.c +++ b/usr.bin/tail/reverse.c @@ -135,7 +135,7 @@ r_reg(struct tailfile *tf, enum STYLE style, off_t off) return (0); } if ((ch = getc(tf->fp)) == '\n') { - while (--end > pos) + while (--end > pos) COPYCHAR(tf, ch); end++; if (style == RLINES && --off == 0) diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c index 2f55e99f8..ddd834322 100644 --- a/usr.bin/talk/init_disp.c +++ b/usr.bin/talk/init_disp.c @@ -102,7 +102,7 @@ set_edit_chars(void) u_char buf[3]; int cc; struct termios tty; - + tcgetattr(STDIN_FILENO, &tty); buf[0] = my_win.cerase = (tty.c_cc[VERASE] == (u_char)_POSIX_VDISABLE) ? CERASE : tty.c_cc[VERASE]; diff --git a/usr.bin/talk/io.c b/usr.bin/talk/io.c index 490f762f5..d5df4d283 100644 --- a/usr.bin/talk/io.c +++ b/usr.bin/talk/io.c @@ -76,7 +76,7 @@ talk(void) fds[0].events = POLLIN; fds[1].fd = sockt; fds[1].events = POLLIN; - + for (;;) { nb = poll(fds, 2, A_LONG_TIME * 1000); if (gotwinch) { diff --git a/usr.bin/talk/talk.c b/usr.bin/talk/talk.c index 6ad8a011c..e826caf1d 100644 --- a/usr.bin/talk/talk.c +++ b/usr.bin/talk/talk.c @@ -45,7 +45,7 @@ * one character at a time... * * Written by Kipp Hickman - * + * * Modified to run under 4.1a by Clem Cole and Peter Moore * Modified to run between hosts by Peter Moore, 8/19/82 * Modified to run under 4.1c by Peter Moore 3/17/83 diff --git a/usr.bin/telnet/README b/usr.bin/telnet/README index 980c852f4..7e2caa860 100644 --- a/usr.bin/telnet/README +++ b/usr.bin/telnet/README @@ -2,7 +2,7 @@ The following TELNET options are supported: - + LINEMODE: The LINEMODE option is supported as per RFC1116. The FORWARDMASK option is not currently supported. diff --git a/usr.bin/tput/tput.c b/usr.bin/tput/tput.c index b2e4e0a7a..99f7ebd64 100644 --- a/usr.bin/tput/tput.c +++ b/usr.bin/tput/tput.c @@ -204,7 +204,7 @@ process(char *cap, char *str, char **argv) if (arg_need > NUM_PARM) errx(2, "too many arguments (%d) for capability `%s'", arg_need, cap); - + for (i = 0; i < arg_need; i++) { const char *errstr; long l; diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c index 3e0e1abf7..9077c5bd6 100644 --- a/usr.bin/tsort/tsort.c +++ b/usr.bin/tsort/tsort.c @@ -199,7 +199,7 @@ ereallocarray(void *p, size_t n, size_t s) return emem(reallocarray(p, n, s)); } - + /*** *** Hash table. ***/ @@ -390,7 +390,7 @@ read_hints(FILE *f, struct ohash *h, int quiet, const char *name, return order; } - + /*** *** Standard heap handling routines. ***/ @@ -520,7 +520,7 @@ make_transparent(struct ohash *hash) } while (adjusted); } - + /*** *** Search through hash array for nodes. ***/ @@ -597,7 +597,7 @@ find_smallest_node(struct array *h) return u; } - + /*** *** Graph algorithms. ***/ @@ -816,10 +816,10 @@ find_normal_cycle(struct array *h, struct array *c) return b; } - + #define plural(n) ((n) > 1 ? "s" : "") -static void +static void parse_args(int argc, char *argv[], struct ohash *pairs) { int c; @@ -881,7 +881,7 @@ parse_args(int argc, char *argv[], struct ohash *pairs) nodes_init(pairs); order = 0; - + for (j = 0; j != i-argc; j++) { FILE *f; diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c index 7803df1f6..5b7ed31e6 100644 --- a/usr.bin/ul/ul.c +++ b/usr.bin/ul/ul.c @@ -512,7 +512,7 @@ initcap(void) ENTER_REVERSE = ENTER_STANDOUT; if (!EXIT_ATTRIBUTES && EXIT_STANDOUT) EXIT_ATTRIBUTES = EXIT_STANDOUT; - + /* * Note that we use REVERSE for the alternate character set, * not the as/ae capabilities. This is because we are modelling diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c index 27c3e287c..813032744 100644 --- a/usr.bin/uniq/uniq.c +++ b/usr.bin/uniq/uniq.c @@ -132,7 +132,7 @@ main(int argc, char *argv[]) p = skip(prevline); else p = prevline; - + thissize = 0; thisline = NULL; while ((len = getline(&thisline, &thissize, stdin)) != -1) { diff --git a/usr.bin/units/README b/usr.bin/units/README index e18fa1b9f..dda01a5a5 100644 --- a/usr.bin/units/README +++ b/usr.bin/units/README @@ -4,7 +4,7 @@ This is a program which I wrote as a clone of the UNIX 'units' command. I threw it together in a couple days, but it seems to work, with some restrictions. I have tested it under DOS with Borland C and -Ultrix 4.2, and SunOS 4.1. +Ultrix 4.2, and SunOS 4.1. This program differs from the unix units program in the following ways: diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c index 9a54c338a..d5302b75f 100644 --- a/usr.bin/usbhidctl/usbhid.c +++ b/usr.bin/usbhidctl/usbhid.c @@ -187,7 +187,7 @@ hidtestrule(struct Susbvar *var, struct usagedata *cache) if (pagesplit >= 0) { /* * Page name was specified, determine whether it was - * symbolic or numeric. + * symbolic or numeric. */ char const *strstart; int numpage; diff --git a/usr.bin/vi/FAQ b/usr.bin/vi/FAQ index f29fd0d52..61ead5544 100644 --- a/usr.bin/vi/FAQ +++ b/usr.bin/vi/FAQ @@ -25,7 +25,7 @@ A: Vi uses the C library routine isprint(3) to determine if a character If there's no other solution, you can use the print and noprint edit options of vi to specify that a specific character is printable or not printable. - + Q: My map won't work! A: One thing that you should immediately check if a vi map doesn't work is if depends on the final cursor position after a P or p command. diff --git a/usr.bin/vi/README b/usr.bin/vi/README index 6b9160d41..b12c09eb7 100644 --- a/usr.bin/vi/README +++ b/usr.bin/vi/README @@ -36,7 +36,7 @@ please send email to: bostic@bostic.com =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -o This software is several years old and is the product of many folks' work. +o This software is several years old and is the product of many folks' work. This software was originally derived from software contributed to the University of California, Berkeley by Steve Kirkendall, the diff --git a/usr.bin/vi/docs/USD.doc/exref/ex.summary b/usr.bin/vi/docs/USD.doc/exref/ex.summary index 0213189bc..1413a765e 100644 --- a/usr.bin/vi/docs/USD.doc/exref/ex.summary +++ b/usr.bin/vi/docs/USD.doc/exref/ex.summary @@ -480,7 +480,7 @@ T} .\" \fIEdit\fP is designed to .\" prevent accidental use of .\" the open command. -.\" T} +.\" T} .SP \fBpreserve pre T{ Saves a copy of the current buffer contents as though the system had @@ -668,7 +668,7 @@ or, if \fIcount\fR is specified, prints that number of lines. Variants of the \fIz\fR command are described in the manual. -T} +T} .SP \fB!\fIcommand T{ .fi @@ -736,7 +736,7 @@ T} \fB?\fIpattern\fB? T{ Searches in the reverse direction for \fIpattern\fP. -T} +T} .SP \fB?? T{ Repeats the most recent search, diff --git a/usr.bin/vi/docs/help b/usr.bin/vi/docs/help index 97d477d26..4a09bcc2f 100644 --- a/usr.bin/vi/docs/help +++ b/usr.bin/vi/docs/help @@ -29,13 +29,13 @@ VI COMMANDS: ^D scroll down by half screens (setting count) ^E scroll down by lines ^F scroll down by screens - ^G file status + ^G file status ^H move left by characters ^J move down by lines ^L redraw screen ^M move down by lines (to first non-blank) - ^N move down by lines - ^P move up by lines + ^N move down by lines + ^P move up by lines ^R redraw screen ^T tag pop ^U half page up (set count) @@ -133,8 +133,8 @@ EX COMMANDS: *: execute a buffer <: shift lines left =: display line number - >: shift lines right - @: execute a buffer + >: shift lines right + @: execute a buffer append: append input to a line abbreviate: specify an input abbreviation args: display file argument list diff --git a/usr.bin/vi/docs/internals/cscope.NOTES b/usr.bin/vi/docs/internals/cscope.NOTES index e0e3483d2..8b030cb13 100644 --- a/usr.bin/vi/docs/internals/cscope.NOTES +++ b/usr.bin/vi/docs/internals/cscope.NOTES @@ -19,7 +19,7 @@ queue has one or more "tag locations". +----+ +----+ | Q3 | <-- | T1 | +----+ --> +----+ - + In the above diagram, each "Q" is a "tag queue", and each "T" is a tag location. Generally, the commands: @@ -59,7 +59,7 @@ More specifically: the query returned at least one result. :cs[cope] h[elp] [command] - + List the cscope commands, or usage help on one command. :display c[onnections] diff --git a/usr.bin/vi/docs/internals/openmode b/usr.bin/vi/docs/internals/openmode index c64b76774..9e6b05e95 100644 --- a/usr.bin/vi/docs/internals/openmode +++ b/usr.bin/vi/docs/internals/openmode @@ -13,7 +13,7 @@ z, ^F, ^B: until: (((count + 1) / 2) * 2) - 1 - + lines, or the last line in the edit buffer has been written. A line consisting of the smaller of the number of columns in the display divided by two or 40 ``-'' characters shall be written diff --git a/usr.bin/vi/docs/interp/interp b/usr.bin/vi/docs/interp/interp index ba8858870..e682691f8 100644 --- a/usr.bin/vi/docs/interp/interp +++ b/usr.bin/vi/docs/interp/interp @@ -166,7 +166,7 @@ Interpreter functions in nvi: Nvi will have a new ex command "inter", which will pipe the rest of the line up to the first unescaped to the interpreter, of the following form: - + :[address[,address]] inter [count] command The interface from the ex command to the interpreter is a function: diff --git a/usr.bin/vi/docs/tutorial/vi.advanced b/usr.bin/vi/docs/tutorial/vi.advanced index ce55554e1..ba9856346 100644 --- a/usr.bin/vi/docs/tutorial/vi.advanced +++ b/usr.bin/vi/docs/tutorial/vi.advanced @@ -2,7 +2,7 @@ Section 26: Index to the rest of the tutorial The remainder of the tutorial can be perused at your leisure. Simply find the topic of interest in the following list, and {/Section xx:/^M} to get to the -appropriate section. (Remember that ^M means the return key) +appropriate section. (Remember that ^M means the return key) The material in the following sections is not necessarily in a bottom up order. It should be fairly obvious that if a section mentions something with @@ -64,8 +64,8 @@ commands. 34.4 escaping to a shell: {:sh} {:!} 34.5 writing parts of a file: {:w} 34.6 filtering portions of text: {!} - 35 advanced searching: magic patterns - 36 advanced substitution: {:s} + 35 advanced searching: magic patterns + 36 advanced substitution: {:s} 37 advanced line addressing: {:p} {:g} {:v} 38 higher level text objects and nroff: ( ) { } [[ ]] 39 more about inserting text @@ -86,7 +86,7 @@ commands. 44.10 lisp 44.11 list 44.12 magic - 44.13 mesg + 44.13 mesg 44.14 number 44.15 open 44.16 optimize @@ -224,7 +224,7 @@ suffixes (suffices? suffici?) and the ranges they specify: ^ to the beginning of the line / .. / up to, but not including, the string ? .. ? back to and including the string - fc up to and including the occurrence of c + fc up to and including the occurrence of c Fc back to and including the occurrence of c tc up to but not including the occurrence of c Tc back to but not including the occurrence of c @@ -232,8 +232,8 @@ suffixes (suffices? suffici?) and the ranges they specify: (number)^M that many lines plus one (number)G up to and including line (number) ( the previous sentence if you are at the beginning of - the current sentence, or the current sentence up to where - you are if you are not at the beginning of the current + the current sentence, or the current sentence up to where + you are if you are not at the beginning of the current sentence. Here, 'sentence' refers to the intuitive notion of an English sentence, ending with '!', '?', or '.' and followed by an end of line or two spaces. @@ -270,10 +270,10 @@ looks like, and what it would look like after a command has been executed. Vi then compares the two, and updates only those portions of the screen that have changed. -Furthermore, some of you may have noticed (it depends on your terminal) that -deleting lines or changing large portions of text may leave some lines on the -screen looking like: -@ +Furthermore, some of you may have noticed (it depends on your terminal) that +deleting lines or changing large portions of text may leave some lines on the +screen looking like: +@ meaning that this line of the screen does not correspond to any line in your file. It would cost more to update the line than to leave it blank for the moment. If you would like to see your screen fully up-to-date with the @@ -283,8 +283,8 @@ To see it in action, delete several lines with {5dd}, type {^R}, and then type {u} to get the lines back. Here is as good a place as any to mention that if the editor is displaying the -end of your file, there may be lines on the screen that look like: -~ +end of your file, there may be lines on the screen that look like: +~ indicating that that screen line would not be affected by {^R}. These lines simply indicate the end of the file. @@ -336,7 +336,7 @@ puts the line BEFORE the cursor. To get Line 15 where it belongs again type {dd}{p}. Also in Line 15 note that the words 'tree' and 'poem' are reversed. Using the -unnamed buffer again: {ft}{dw}{ma}{fp}{P}{w}{dw}{`aP} will set things aright +unnamed buffer again: {ft}{dw}{ma}{fp}{P}{w}{dw}{`aP} will set things aright (note the use of the reverse quote). The put commands {p} and {P} do not affect the contents of the buffer. @@ -421,7 +421,7 @@ after each put {p} and {.}: will show you all the buffers and leave them and your file intact. If you had cheated above and deleted the nine lines with {9dd}, all nine lines -would have been stored in both the unnamed buffer and in buffer number 1. +would have been stored in both the unnamed buffer and in buffer number 1. (Obviously, buffer number 1 IS the unnamed buffer and is just the default buffer for the modify commands.) @@ -577,9 +577,9 @@ nroff -i form.mac | awk "length != 0 { print }" .na .nh .ll 79 -.ec  -.c2  -.cc  +.ec +.c2 +.cc ************************************** Determine the line numbers of the two lines of file f. They should be @@ -593,9 +593,9 @@ Observe that this paragraph is rather ratty in appearance. With our newly created files we can clean it up dramatically. Position the cursor at the beginning of this paragraph and type the following sequence of -characters +characters (note that we must abandon temporarily our convention -of curly braces since the command itself contains a curly brace - we +of curly braces since the command itself contains a curly brace - we will use square brackets for the nonce): [!}f^M]. Here is a brief explanation of what has happened. By typing [!}f^M] we @@ -702,7 +702,7 @@ In summary, here are the primitives for building regular expressions: [x-y] matches any character in the ASCII range between x and y * matches any number (including zero) of the preceding pattern -Section 36: advanced substitution: {:s} +Section 36: advanced substitution: {:s} The straightforward colon-substitute command looks like the substitute command of most line-oriented editors. Indeed, vi is nothing more than a @@ -721,8 +721,8 @@ Line 28: This is an esample. The {u} and {U} commands work for {:s}. The first pattern (the search pattern) may be a regular expression just as for the search command (after all, it IS a search, albeit limited to the current line). Do an {u} on the above line, and -try the following substitute, which will do almost the same thing: -{:s/s[^ ]/x/^M}. +try the following substitute, which will do almost the same thing: +{:s/s[^ ]/x/^M}. Better undo it with {u}. The first pattern {s[^ ]} matches an 's' NOT followed by a blank: the search therefore ignores the 's'es in 'This' and 'is'. However, the character matched by {[^ ]} must appear in the replacement @@ -785,7 +785,7 @@ to make every time he attempts to type the word 'test'. To change all of these 'text's into 'test's, try the following: {:/^Line 30/,/^Line 32/s/text/test/^M}. This finds the beginning and end of the portion of text to be changed, and limits the substitution to each of the -lines in that range. The {u} command applies to ALL of the substitutions as +lines in that range. The {u} command applies to ALL of the substitutions as a group. This provides a mechanism for powerful text manipulations. @@ -820,7 +820,7 @@ patterns named for easier reference: |--------search pattern------------------|-replacement| |--pattern---| -In overview, the substitute looks for a particular pattern made up of +In overview, the substitute looks for a particular pattern made up of sub-patterns, which are named \1, \2, \3, and \4. These patterns are specified by stating what they are NOT. Pattern \1 is the sequence of characters that are NOT colons: in the search string, {[^:]} will match exactly one character @@ -859,7 +859,7 @@ lines have the commands following the pattern executed over them. Line 36: ABC rhino george farmer Dick jester lest Line 37: george farmer rhino lest jester ABC -Line 38: rhino lest george Dick farmer ABC jester +Line 38: rhino lest george Dick farmer ABC jester Type: @@ -878,10 +878,10 @@ the test for 'tagging' the lines is reversed: all lines NOT matching the search pattern are tagged and operated on by the commands. Using {^V} to quote carriage return (see section 39) can be used in global -substitutions to split two lines. For example, the command -{:g/\. /s//.^V^M/g^M} will change your file so that each sentence is on a +substitutions to split two lines. For example, the command +{:g/\. /s//.^V^M/g^M} will change your file so that each sentence is on a separate line. (Note that we have to 'escape' the '.', because '.' by itself -matches any character. Our command says to find any line which contains a +matches any character. Our command says to find any line which contains a period followed by 2 spaces, and inserts a carriage return after the period.) Caveat: In some of the documentation for ex and vi you may find the @@ -905,7 +905,7 @@ the beginning of the previous and next sentences, respectively. Thus the command {d)} will delete the rest of the current sentence; likewise {d(} will delete the previous sentence if you are at the beginning of the current sentence, or, if you are not at the beginning of a sentence, -it will delete the current sentence from the beginning +it will delete the current sentence from the beginning up to where you are. A sentence is defined to end at a '.', '!', or '?' which is followed @@ -938,7 +938,7 @@ during input mode. These are summarized in the following table. ^H deletes the last input character ^W deletes the last input word - (erase) same as ^H; each terminal can define its own erase character; + (erase) same as ^H; each terminal can define its own erase character; for some it is ^H, for others it is the DELETE key, and for others it is '@'. (kill) deletes the input on this line; each terminal can define its @@ -953,7 +953,7 @@ during input mode. These are summarized in the following table. ^M the return key; starts a new line. ^D backtabs over the indentation set by the autoindent option 0^D backtabs over all indentation back to the beginning of the line - ^^D (up-arrow followed by control-d)same as 0^D, except the indentation + ^^D (up-arrow followed by control-d)same as 0^D, except the indentation will be restored at the beginning of the next line. ^V quotes the next non-printing character into the file @@ -966,13 +966,13 @@ and it will be inserted into the file at that point. There are a few exceptions to note. The implementation of the editor does not allow the null character ^@ to appear in files. Also the linefeed character ^J is used by the editor to separate lines in the file, so it cannot appear in the middle of a -line. (Trying to insert a ^M into a file, or putting it in the replacement -part of a substitution string will result in the matched line being split in -two. This, in effect, is how to split lines by using a substitution.) You can -insert any other character, however, if you wait for the editor to echo the ^ -before you type the character. In fact, the editor will treat a following -letter as a request for the corresponding control character. This is the only -way to type ^S or ^Q, since the system normally uses them to suspend and resume +line. (Trying to insert a ^M into a file, or putting it in the replacement +part of a substitution string will result in the matched line being split in +two. This, in effect, is how to split lines by using a substitution.) You can +insert any other character, however, if you wait for the editor to echo the ^ +before you type the character. In fact, the editor will treat a following +letter as a request for the corresponding control character. This is the only +way to type ^S or ^Q, since the system normally uses them to suspend and resume output and never gives them to the editor to process. If you are using the autoindent option you can backtab over the indent which it @@ -1008,7 +1008,7 @@ operator to work on just the current line, double it. E.g. {<<}. ^ to the beginning of the line / .. / up to, but not including, the string ? .. ? back to and including the string - fc up to and including the occurrence of c + fc up to and including the occurrence of c Fc back to and including the occurrence of c tc up to but not including the occurrence of c Tc back to but not including the occurrence of c @@ -1016,8 +1016,8 @@ operator to work on just the current line, double it. E.g. {<<}. (number)^M that many lines plus one (number)G up to and including line (number) ( the previous sentence if you are at the beginning of - the current sentence, or the current sentence up to where - you are if you are not at the beginning of the current + the current sentence, or the current sentence up to where + you are if you are not at the beginning of the current sentence. Here, 'sentence' refers to the intuitive notion of an English sentence, ending with '!', '?', or '.' and followed by an end of line or two spaces. @@ -1058,7 +1058,7 @@ Vi is actually one mode of editing within the editor ex. When you are running vi you can escape to the line oriented editor of ex by giving the command {Q}. All of the colon-commands which were introduced above are available in ex. Likewise, most ex commands can be invoked from vi -using {:}. +using {:}. In rare instances, an internal error may occur in vi. In this case you will get a diagnostic and will be left in the command mode of ex. You can @@ -1179,7 +1179,7 @@ Causes all control characters except tab ^I, newline ^M and form-feed ^L to be discarded from the input. A complaint is registered the first time a backspace character is discarded. Beautify does not apply to command input. -Section 44.5: {directory}, {dir} default: dir=/tmp +Section 44.5: {directory}, {dir} default: dir=/tmp Specifies the directory in which ex places its buffer file. If this directory in not writable, then the editor will exit abruptly when it fails to be able to @@ -1285,7 +1285,7 @@ Command mode input is prompted for with a `:'. [Author's note: Doesn't seem to have any effect on vi.] -Section 44.19: {readonly}, {ro} default: noro, unless invoked with -R +Section 44.19: {readonly}, {ro} default: noro, unless invoked with -R or insufficient privileges on file This option allows you to guarantee that you won't clobber your file by @@ -1326,13 +1326,13 @@ command mode z command (double the value of scroll). [Author's note: Doesn't seem to affect {^D} and {z} in visual (vi) mode.] -Section 44.24: sections {sections} default: sections=SHNHH HU +Section 44.24: sections {sections} default: sections=SHNHH HU Specifies the section macros from nroff for the {[[} and {]]} operations in open and visual. The pairs of characters in the options's value are the names of the macros which start paragraphs. -Section 44.25: {shell}, {sh} default: sh=/bin/sh +Section 44.25: {shell}, {sh} default: sh=/bin/sh Gives the path name of the shell forked for the shell escape command `!', and by the shell command. The default is taken from SHELL in the environment, if @@ -1343,13 +1343,13 @@ your .login file: setenv SHELL '/bin/csh' ] -Section 44.26: {shiftwidth}, {sw} default: sw=8 +Section 44.26: {shiftwidth}, {sw} default: sw=8 Used in reverse tabbing with {^D} when using autoindent to append text, and used by the shift commands. Should probably be the same value as the tabstop option. -Section 44.27: {showmatch}, {sm} default: nosm +Section 44.27: {showmatch}, {sm} default: nosm In open and visual mode, when a `)' or `}' is typed, if the matching `(' or `{' is on the screen, move the cursor to it for one second. Extremely useful with @@ -1445,7 +1445,7 @@ Here are some editor limits that the user is likely to encounter: 1024 characters per line 256 characters per global command list 128 characters per file name - 128 characters in the previous inserted and deleted text in open or + 128 characters in the previous inserted and deleted text in open or visual 100 characters in a shell escape command 63 characters in a string valued option diff --git a/usr.bin/vi/docs/tutorial/vi.beginner b/usr.bin/vi/docs/tutorial/vi.beginner index 757be1b4b..9249084e6 100644 --- a/usr.bin/vi/docs/tutorial/vi.beginner +++ b/usr.bin/vi/docs/tutorial/vi.beginner @@ -5,7 +5,7 @@ To get out of this tutorial, type: ZZ (two capital Z's). Learning a new computer system implies learning a new text editor. These tutorial lessons were created by Dain Samples to help you come to grips with UC Berkeley's screen oriented editor called vi (for VIsual). This tutorial -uses the vi editor itself as the means of presentation. +uses the vi editor itself as the means of presentation. For best use of this tutorial, read all of a screen before performing any of the indicated actions. This tutorial (or, at least, the first half of it) has @@ -67,7 +67,7 @@ them unambiguously. For example, if you are to type the command sequence "control B control F" (as we asked you to do above) it would appear as {^B^F}. This allows clear delineation of the command strings from the text. Remember that the curly braces are NOT part of the command string you are to type. Do -NOT type the curly braces. +NOT type the curly braces. Sometimes, the command string in the curly braces will be rather long, and may be such that the first couple of characters of the command will erase from @@ -163,7 +163,7 @@ file. Now type {ma}. Your location in the file has been given the name 'a'. If you type {'p'a} you will see the previous location we marked in section 7, and then will be returned to the current location. (You will want to do a {z^M} -to repaint the screen afterwards.) Try it. +to repaint the screen afterwards.) Try it. {^F} Section 9: {m} {''} @@ -185,11 +185,11 @@ been issued. (Unless you've been experimenting.) The command {''} attempts to return you to the location at which you last modified some part of your file. However, my experience has been that it is -difficult to predict exactly where you will end up. +difficult to predict exactly where you will end up. Section 10: {^M} {-} Now do {ma}, marking your position at the top of the screen. Now hit {^M} (or -return) until the cursor is right ... +return) until the cursor is right ... * <- here, over/under the asterisk. Now type {mb'a'b} and watch the cursor move from the asterisk to the top of the screen and back again. @@ -347,7 +347,7 @@ beginning of the file. However, if you do want the search to find the PREVIOUS rather than the NEXT occurrence of the string, surround the string with question marks instead of slash marks. -Below are several occurrences of the same string. +Below are several occurrences of the same string. Here 2 Here 2 Here 2 Here 2 Here 2. Observe the effect of the following search commands (try them in the @@ -395,7 +395,7 @@ Following is a list of the characters that have special meanings in search strings. If you wish to find a string containing one of these characters, you will have to precede the character with a backslash. These characters are called magic characters because of the fun and games you can have with them -and they can have with you, if you aren't aware of what they do. +and they can have with you, if you aren't aware of what they do. ^ - (caret) beginning of a line $ - (dollar-sign) end of a line @@ -527,9 +527,9 @@ on the word 'of'.) Now carefully type the following string and observe the effects: {iexample ^[} (remember: ^[ is the escape key)} -The {i} begins the insert mode, and 'example ' is inserted into the line: -be sure to notice the blank in 'example '. The ^[ ends insertion mode, -and the line is updated to include the new string. Line 1 should look exactly +The {i} begins the insert mode, and 'example ' is inserted into the line: +be sure to notice the blank in 'example '. The ^[ ends insertion mode, +and the line is updated to include the new string. Line 1 should look exactly like Line 2. Move the cursor to the beginning of Line 3 below and type {z^M}: @@ -542,8 +542,8 @@ We need to append an 's' to the word 'line'. Position the cursor on the 'e' of 'line'. You can do this in several ways, one way is the following: First, type {/line /^M}. This puts us on the word 'line' in Line 4 (the blank in the search string is important!). Next, type {e}. The 'e' puts -us at the end of the word. Now, type {as^[ (^[ is the escape character)}. -The 'a' puts us in insert mode, AFTER the current character. We appended the +us at the end of the word. Now, type {as^[ (^[ is the escape character)}. +The 'a' puts us in insert mode, AFTER the current character. We appended the 's', and the escape ^[ ended the insert mode. The difference between {i} (insert) and {a} (append) is that {i} begins @@ -620,8 +620,8 @@ and type {Rmany^[}. You may have noticed that, when inserting text, a new line is formed by typing {^M}. When changing, replacing, or substituting text you can make a new line -by typing {^M}. However, neither {x} nor {X} will remove ^M to make two lines -into one line. To do this, position the cursor on the first of the two lines +by typing {^M}. However, neither {x} nor {X} will remove ^M to make two lines +into one line. To do this, position the cursor on the first of the two lines you wish to make into a single line and type {J} (uppercase J for 'Join'). Section 24: {u} {U} @@ -632,10 +632,10 @@ your cursor on line 11 below and {z^M}. Line 11: The quick brown fox jumped over the lazy hound dog. Line 12: the qwick black dog dumped over the laxy poune fox. -Type the following set of commands, and observe carefully the effect of each +Type the following set of commands, and observe carefully the effect of each of the commands: -{/^Line 12:/^M} {ft} {rT} {fw} {ru} {w} {Rbrown fox^[} {w} {rj} +{/^Line 12:/^M} {ft} {rT} {fw} {ru} {w} {Rbrown fox^[} {w} {rj} {fx} {rz} {w} {Rhound dog^[} Line 12 now matches line 11. Now type {U} - capital 'U'. And line 12 now @@ -675,7 +675,7 @@ to exit the editor when no changes have been made {:q^M} save a file without exiting the editor {:w^M} write the file into another file {:w filename^M} -insert text +insert text before the cursor {i ...text... ^[} at the beginning of the line {I ...text... ^[} after the cursor (append) {a ...text... ^[} diff --git a/usr.bin/vis/foldit.c b/usr.bin/vis/foldit.c index aaa05922a..a99443761 100644 --- a/usr.bin/vis/foldit.c +++ b/usr.bin/vis/foldit.c @@ -68,7 +68,7 @@ again: col = 0; first = 0; goto again; - } + } cp++; } return (col); diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c index c114d7be1..e8584848f 100644 --- a/usr.bin/vis/vis.c +++ b/usr.bin/vis/vis.c @@ -124,15 +124,15 @@ main(int argc, char *argv[]) } exit(0); } - + void process(FILE *fp) { static int col = 0; char *cp = "\0"; - int c, rachar; + int c, rachar; char buff[5]; - + cp++; /* so *(cp-1) starts out != '\n' */ c = getc(fp); while (c != EOF) { @@ -150,7 +150,7 @@ process(FILE *fp) *cp++ = '$'; *cp++ = '\n'; *cp = '\0'; - } else + } else (void) vis(buff, (char)c, eflags, (char)rachar); cp = buff; diff --git a/usr.bin/yacc/PSD.doc/ss1 b/usr.bin/yacc/PSD.doc/ss1 index 773944fda..b65898753 100644 --- a/usr.bin/yacc/PSD.doc/ss1 +++ b/usr.bin/yacc/PSD.doc/ss1 @@ -168,5 +168,5 @@ If the endmarker is seen in any other context, it is an error. .PP It is the job of the user-supplied lexical analyzer to return the endmarker when appropriate; see section 3, below. -Usually the endmarker represents some reasonably obvious +Usually the endmarker represents some reasonably obvious I/O status, such as ``end-of-file'' or ``end-of-record''. diff --git a/usr.bin/yacc/PSD.doc/ss2 b/usr.bin/yacc/PSD.doc/ss2 index b5c3866f7..1c0351197 100644 --- a/usr.bin/yacc/PSD.doc/ss2 +++ b/usr.bin/yacc/PSD.doc/ss2 @@ -161,7 +161,7 @@ creates a node with label L, and descendants n1 and n2, and returns the index of the newly created node. Then parse tree can be built by supplying actions such as: .DS -expr : expr \'+\' expr +expr : expr \'+\' expr { $$ = node( \'+\', $1, $3 ); } .DE in the specification. @@ -170,7 +170,7 @@ The user may define other variables to be used by the actions. Declarations and definitions can appear in the declarations section, enclosed in the marks ``%{'' and ``%}''. -These declarations and definitions have global scope, +These declarations and definitions have global scope, so they are known to the action statements and the lexical analyzer. For example, .DS diff --git a/usr.bin/yacc/PSD.doc/ss4 b/usr.bin/yacc/PSD.doc/ss4 index 9859b2489..d47aa7577 100644 --- a/usr.bin/yacc/PSD.doc/ss4 +++ b/usr.bin/yacc/PSD.doc/ss4 @@ -202,7 +202,7 @@ The .I accept action indicates that the entire input has been seen and that it matches the specification. -This action appears only when the lookahead token is +This action appears only when the lookahead token is the endmarker, and indicates that the parser has successfully done its job. The @@ -240,7 +240,7 @@ file corresponding to the above grammar (with some statistics stripped off the end) is: .DS state 0 - $accept : \_rhyme $end + $accept : \_rhyme $end DING shift 3 . error @@ -249,13 +249,13 @@ state 0 sound goto 2 state 1 - $accept : rhyme\_$end + $accept : rhyme\_$end $end accept . error state 2 - rhyme : sound\_place + rhyme : sound\_place DELL shift 5 . error @@ -263,7 +263,7 @@ state 2 place goto 4 state 3 - sound : DING\_DONG + sound : DING\_DONG DONG shift 6 . error @@ -321,7 +321,7 @@ the parser reduces by rule 2. .DE This rule has two symbols on the right hand side, so two states, 6 and 3, are popped off of the stack, uncovering state 0. -Consulting the description of state 0, looking for a goto on +Consulting the description of state 0, looking for a goto on .I sound , .DS sound goto 2 diff --git a/usr.bin/yacc/PSD.doc/ss7 b/usr.bin/yacc/PSD.doc/ss7 index 30e0664c2..37be2799d 100644 --- a/usr.bin/yacc/PSD.doc/ss7 +++ b/usr.bin/yacc/PSD.doc/ss7 @@ -146,7 +146,7 @@ be the first token in a legal statement; the old, illegal token must be discarded, and the error state reset. This could be done by a rule like .DS -stat : error +stat : error { resynch(); yyerrok ; yyclearin ; } diff --git a/usr.bin/yacc/PSD.doc/ssa b/usr.bin/yacc/PSD.doc/ssa index 29d654b41..ca05b9b48 100644 --- a/usr.bin/yacc/PSD.doc/ssa +++ b/usr.bin/yacc/PSD.doc/ssa @@ -111,7 +111,7 @@ expr : \'(\' expr \')\' { $$ = \- $2; } | LETTER { $$ = regs[$1]; } - | number + | number ; number : DIGIT @@ -133,11 +133,11 @@ yylex() { /* lexical analysis routine */ /* c is now nonblank */ - if( islower( c ) ) { + if( islower( c ) ) { yylval = c \- \'a\'; return ( LETTER ); } - if( isdigit( c ) ) { + if( isdigit( c ) ) { yylval = c \- \'0\'; return( DIGIT ); } diff --git a/usr.bin/yacc/lalr.c b/usr.bin/yacc/lalr.c index 86874077e..daa1cedd4 100644 --- a/usr.bin/yacc/lalr.c +++ b/usr.bin/yacc/lalr.c @@ -320,7 +320,7 @@ initialize_F(void) if (nullable[symbol]) edge[nedges++] = map_goto(stateno, symbol); } - + if (nedges) { reads[i] = rp = NEW2(nedges + 1, short);