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.09; 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$ - declare local functions static - declare void functions void - avoid implicit int - hide unused function in the proper matching ifdef --- ex_vwind.c~ 2012-12-27 21:58:41.000000000 +0000 +++ ex_vwind.c @@@@ -89,10 +89,14 @@@@ static char sccsid[] = "@@(#)ex_vwind.c 1 * directions. Code here is very dependent on mode (open versus visual). */ -int vfit __P((register line *, int)); -int vrollR __P((register int)); -line *vback __P((register line *, register int)); -int vreset __P((int)); +static int vfit __P((register line *, int)); +static void vrollR __P((register int)); +static line *vback __P((register line *, register int)); +static void vreset __P((int)); + +#ifndef CBREAK +static int vcookit(register int cnt); +#endif /* * Move in a nonlocal way to line addr. @@@@ -100,9 +104,11 @@@@ int vreset __P((int)); * New position for cursor is curs. * Like most routines here, we vsave(). */ +void vmoveto(addr, curs, context) register line *addr; char *curs; + int context; { markit(addr); @@@@ -114,9 +120,11 @@@@ vmoveto(addr, curs, context) * Vjumpto is like vmoveto, but doesn't mark previous * context or save linebuf as current line. */ +void vjumpto(addr, curs, context) register line *addr; char *curs; + int context; { noteit(0); @@@@ -131,6 +139,7 @@@@ vjumpto(addr, curs, context) /* * Go up or down cnt (negative is up) to new position curs. */ +void vupdown(cnt, curs) register int cnt; char *curs; @@@@ -152,6 +161,7 @@@@ vupdown(cnt, curs) * If scroll, then we MUST use a scroll. * Otherwise clear and redraw if motion is far. */ +void vup(cnt, ind, scroll) register int cnt, ind; bool scroll; @@@@ -201,6 +211,7 @@@@ okr: /* * Like vup, but scrolling down. */ +void vdown(cnt, ind, scroll) register int cnt, ind; bool scroll; @@@@ -250,8 +261,10 @@@@ dcontxt: * Work here is in determining new top line implied by * this placement of line addr, since we always draw from the top. */ +void vcontext(addr, where) register line *addr; + int where; { register line *top; @@@@ -293,6 +306,7 @@@@ vcontext(addr, where) * we may be able to reuse the line we are on * if it is blank. This is a real win. */ +void vclean() { @@@@ -310,6 +324,7 @@@@ vclean() * (and call us recursively). Eventually, we clear the screen * (or its open mode equivalent) and redraw. */ +void vshow(addr, top) line *addr, *top; { @@@@ -363,6 +378,7 @@@@ vshow(addr, top) * area; we are called this way in the middle of a :e escape * from visual, e.g. */ +static void vreset(inecho) bool inecho; { @@@@ -378,7 +394,7 @@@@ vreset(inecho) * Starting from which line preceding tp uses almost (but not more * than) cnt physical lines? */ -line * +static line * vback(tp, cnt) register int cnt; register line *tp; @@@@ -399,6 +415,7 @@@@ vback(tp, cnt) /* * How much scrolling will it take to roll cnt lines starting at tp? */ +static int vfit(tp, cnt) register line *tp; int cnt; @@@@ -419,6 +436,7 @@@@ vfit(tp, cnt) /* * Roll cnt lines onto the screen. */ +void vroll(cnt) register int cnt; { @@@@ -460,6 +478,7 @@@@ vroll(cnt) /* * Roll backwards (scroll up). */ +static void vrollR(cnt) register int cnt; { @@@@ -504,16 +523,20 @@@@ vrollR(cnt) * BUG: An interrupt during a scroll in this way * dumps to command mode. */ +#ifndef CBREAK +static int vcookit(cnt) register int cnt; { return (cnt > 1 && (ospeed < B1200 && !initev || cnt > TLINES * 2)); } +#endif /* * Determine displayed depth of current line. */ +int vdepth() { register int d; @@@@ -529,6 +552,7 @@@@ vdepth() /* * Move onto a new line, with cursor at position curs. */ +void vnline(curs) char *curs; { @