head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.108 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.106 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.104 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.102 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.100 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.98 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.96 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.94 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.92 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.90 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.88 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.86 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.84 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.82 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.80 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.78 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.76 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.74 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.72 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.70 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.68 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.66 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.64 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.60 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.40 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.62 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.58 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.56 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.54 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.52 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.50 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.48 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.46 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.44 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.42 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.38 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.36 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.34 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.32 pkgsrc-2016Q3-base:1.1 pkgsrc-2016Q2:1.1.0.30 pkgsrc-2016Q2-base:1.1 pkgsrc-2016Q1:1.1.0.28 pkgsrc-2016Q1-base:1.1 pkgsrc-2015Q4:1.1.0.26 pkgsrc-2015Q4-base:1.1 pkgsrc-2015Q3:1.1.0.24 pkgsrc-2015Q3-base:1.1 pkgsrc-2015Q2:1.1.0.22 pkgsrc-2015Q2-base:1.1 pkgsrc-2015Q1:1.1.0.20 pkgsrc-2015Q1-base:1.1 pkgsrc-2014Q4:1.1.0.18 pkgsrc-2014Q4-base:1.1 pkgsrc-2014Q3:1.1.0.16 pkgsrc-2014Q3-base:1.1 pkgsrc-2014Q2:1.1.0.14 pkgsrc-2014Q2-base:1.1 pkgsrc-2014Q1:1.1.0.12 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.10 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.8 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.6 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.4 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.2 pkgsrc-2012Q4-base:1.1; locks; strict; comment @# @; 1.1 date 2012.12.28.03.03.08; author dholland; state Exp; branches; next ; desc @@ 1.1 log @Fix legacy C. Pass -Wall -W -Wmissing-declarations -Wwrite-strings on gcc45. - avoid implicit int, declare void functions void - return values from non-void functions - put most external declarations properly in header files - use some static and const - fix up a big mess with function pointer casting - use standard includes, don't provide own decls of standard functions - use types matching libc when providing own malloc, printf, and putchar - use functions correctly - silence assorted compiler warnings - fix some bugs exposed by compiler warnings - don't intentionally exercise signed overflow - remove some unused items - add patch comments to other patch (patch-aa) As this includes several fixes and removes some undefined behavior on a commonly reachable code path, bump PKGREVISION. @ text @$NetBSD$ - avoid implicit int - declare void functions void - use const for string constants --- ex_cmds2.c~ 2002-02-02 02:08:35.000000000 +0000 +++ ex_cmds2.c @@@@ -95,6 +95,7 @@@@ extern int poffset; /* mjm: extern; als /* * Is there a single letter indicating a named buffer next? */ +int cmdreg() { register int c = 0; @@@@ -108,6 +109,7 @@@@ cmdreg() /* * Tell whether the character ends a command */ +int endcmd(ch) int ch; { @@@@ -129,6 +131,7 @@@@ endcmd(ch) /* * Insist on the end of the command. */ +void eol() { @@@@ -144,7 +147,8 @@@@ eol() * just fixing up the echo area for the print. * Otherwise we reset a number of externals, and discard unused input. */ -error0() +static void +error0(void) { if (vcatch) { @@@@ -191,8 +195,8 @@@@ error0() * Otherwise, in the normal command mode error case, * finish state reset, and throw to top. */ -error1(str) - char *str; +static void +error1(const char *str) { bool die; @@@@ -230,17 +234,18 @@@@ error1(str) * with i an integer argument to printf. */ /*VARARGS2*/ +void #ifndef __STDC__ error(str, i) #ifdef lint - register char *str; + register const char *str; #else register int str; #endif int i; { #else -error(char *str, ...) +error(const char *str, ...) { va_list ap; #endif @@@@ -265,6 +270,7 @@@@ error(char *str, ...) /* * Rewind the argument list. */ +void erewind() { @@@@ -280,6 +286,7 @@@@ erewind() } } +void fixol() { if (Outchar != vputchar) { @@@@ -298,6 +305,7 @@@@ fixol() /* * Does an ! character follow in the command stream? */ +int exclam() { @@@@ -311,6 +319,7 @@@@ exclam() /* * Make an argument list for e.g. next. */ +void makargs() { @@@@ -324,6 +333,7 @@@@ makargs() /* * Advance to next file in argument list. */ +void next() { extern short isalt; /* defined in ex_io.c */ @@@@ -343,6 +353,7 @@@@ next() * Eat trailing flags and offsets after a command, * saving for possible later post-command prints. */ +void newline() { register int c; @@@@ -399,6 +410,7 @@@@ serror(catgets(catd, 1, 32, * Before quit or respec of arg list, check that there are * no more files in the arg list. */ +void nomore() { @@@@ -413,6 +425,7 @@@@ nomore() * Before edit of new file check that either an ! follows * or the file has not been changed. */ +int quickly() { @@@@ -432,6 +445,7 @@@@ quickly() /* * Reset the flavor of the output to print mode with no numbering. */ +void resetflav() { @@@@ -448,10 +462,11 @@@@ resetflav() * Print an error message with a %s type argument to printf. * Message text comes from error message file. */ +void #ifndef __STDC__ serror(str, cp) #ifdef lint - register char *str; + register const char *str; #else register int str; #endif @@@@ -463,7 +478,7 @@@@ serror(str, cp) error1(str); } #else /* __STDC__ */ -serror(char *str, ...) +serror(const char *str, ...) { va_list ap; @@@@ -482,6 +497,7 @@@@ serror(char *str, ...) * and either use normally decoded (ARPAnet standard) characters or list mode, * where end of lines are marked and tabs print as ^I. */ +void setflav() { @@@@ -495,6 +511,7 @@@@ setflav() /* * Skip white space and tell whether command ends then. */ +int skipend() { @@@@ -505,6 +522,7 @@@@ skipend() /* * Set the command name for non-word commands. */ +void tailspec(c) int c; { @@@@ -518,15 +536,17 @@@@ tailspec(c) * Try to read off the rest of the command word. * If alphabetics follow, then this is not the command we seek. */ +void tail(comm) - char *comm; + const char *comm; { tailprim(comm, 1, 0); } +void tail2of(comm) - char *comm; + const char *comm; { tailprim(comm, 2, 0); @@@@ -534,8 +554,9 @@@@ tail2of(comm) char tcommand[20]; +void tailprim(comm, i, notinvis) - register char *comm; + register const char *comm; int i; bool notinvis; { @@@@ -574,6 +595,7 @@@@ ret: /* * Continue after a : command from open/visual. */ +void vcontin(ask) bool ask; { @@@@ -643,6 +665,7 @@@@ vcontin(ask) * Put out a newline (before a shell escape) * if in open/visual. */ +void vnfl() { @