head 1.1; access; symbols pkgsrc-2026Q1:1.1.0.112 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.110 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.108 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.106 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.104 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.102 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.100 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.98 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.96 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.94 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.92 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.90 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.88 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.86 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.84 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.82 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.80 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.78 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.76 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.74 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.72 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.70 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.68 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.64 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.44 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.66 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.62 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.60 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.58 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.56 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.54 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.52 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.50 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.48 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.46 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.42 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.40 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.38 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.36 pkgsrc-2016Q3-base:1.1 pkgsrc-2016Q2:1.1.0.34 pkgsrc-2016Q2-base:1.1 pkgsrc-2016Q1:1.1.0.32 pkgsrc-2016Q1-base:1.1 pkgsrc-2015Q4:1.1.0.30 pkgsrc-2015Q4-base:1.1 pkgsrc-2015Q3:1.1.0.28 pkgsrc-2015Q3-base:1.1 pkgsrc-2015Q2:1.1.0.26 pkgsrc-2015Q2-base:1.1 pkgsrc-2015Q1:1.1.0.24 pkgsrc-2015Q1-base:1.1 pkgsrc-2014Q4:1.1.0.22 pkgsrc-2014Q4-base:1.1 pkgsrc-2014Q3:1.1.0.20 pkgsrc-2014Q3-base:1.1 pkgsrc-2014Q2:1.1.0.18 pkgsrc-2014Q2-base:1.1 pkgsrc-2014Q1:1.1.0.16 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.14 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.12 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.10 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.8 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.6 pkgsrc-2012Q4-base:1.1 pkgsrc-2012Q3:1.1.0.4 pkgsrc-2012Q3-base:1.1 pkgsrc-2012Q2:1.1.0.2 pkgsrc-2012Q2-base:1.1; locks; strict; comment @# @; 1.1 date 2012.05.10.20.53.30; author dholland; state Exp; branches; next ; desc @@ 1.1 log @Pass -Wall. Fix a number of minor bugs and possibly some major ones. Should also fix clang build. PKGREVISION++ @ text @$NetBSD$ - don't use implicit int - fix uninitialized variable usage caught by gcc - silence gcc braces warnings --- src/random.c~ 2012-05-10 19:25:36.000000000 +0000 +++ src/random.c @@@@ -17,7 +17,7 @@@@ * Normally this is bound to "C-X =". */ -PASCAL NEAR showcpos(f, n) +int PASCAL NEAR showcpos(f, n) int f, n; /* prefix flag and argument */ @@@@ -37,6 +37,9 @@@@ int f, n; /* prefix flag and argument lp = lforw(curbp->b_linep); curchar = '\r'; + predlines = 0; + predchars = 0; + /* start counting chars and lines */ numchars = 0; numlines = 0L; @@@@ -124,7 +127,7 @@@@ LINE *sline; /* line to search for */ * Return current column. Stop at first non-blank given TRUE argument. */ -PASCAL NEAR getccol(bflg) +int PASCAL NEAR getccol(bflg) int bflg; { @@@@ -182,7 +185,7 @@@@ int pos; /* character offset */ * Set current column. */ -PASCAL NEAR setccol(pos) +int PASCAL NEAR setccol(pos) int pos; /* position to set cursor */ { @@@@ -232,7 +235,7 @@@@ int pos; /* position to set cursor */ * to keep this working as it always has. */ -PASCAL NEAR twiddle(f, n) +int PASCAL NEAR twiddle(f, n) int f, n; /* prefix flag and argument */ @@@@ -287,7 +290,7 @@@@ int f, n; /* prefix flag and argument * function key is pressed, its symbolic MicroEMACS name gets inserted! */ -PASCAL NEAR quote(f, n) +int PASCAL NEAR quote(f, n) int f, n; /* prefix flag and argument */ { @@@@ -334,7 +337,7 @@@@ int f, n; /* prefix flag and argument * into "C-I" (in 10 bit code) already. Bound to "C-I". */ -PASCAL NEAR tab(f, n) +int PASCAL NEAR tab(f, n) int f, n; /* prefix flag and argument */ { @@@@ -350,7 +353,7 @@@@ int f, n; /* prefix flag and argument return(linsert(stabsize - (getccol(FALSE) % stabsize), ' ')); } -PASCAL NEAR detab(f, n) /* change tabs to spaces */ +int PASCAL NEAR detab(f, n) /* change tabs to spaces */ int f, n; /* default flag and numeric repeat count */ { @@@@ -395,7 +398,7 @@@@ int f, n; /* default flag and numeric } -PASCAL NEAR entab(f, n) /* change spaces to tabs where posible */ +int PASCAL NEAR entab(f, n) /* change spaces to tabs where posible */ int f, n; /* default flag and numeric repeat count */ { @@@@ -425,7 +428,7 @@@@ int f, n; /* default flag and numeric while (curwp->w_doto < lused(curwp->w_dotp)) { /* see if it is time to compress */ - if ((fspace >= 0) && (nextab(fspace) <= ccol)) + if ((fspace >= 0) && (nextab(fspace) <= ccol)) { if (ccol - fspace < 2) fspace = -1; else { @@@@ -434,6 +437,7 @@@@ int f, n; /* default flag and numeric linsert(1, '\t'); fspace = -1; } + } /* get the current character */ cchar = lgetc(curwp->w_dotp, curwp->w_doto); @@@@ -472,7 +476,7 @@@@ int f, n; /* default flag and numeric with no arguments, it trims the current region */ -PASCAL NEAR trim(f, n) +int PASCAL NEAR trim(f, n) int f, n; /* default flag and numeric repeat count */ { @@@@ -520,7 +524,7 @@@@ int f, n; /* default flag and numeric * procerssors. They even handle the looping. Normally this is bound to "C-O". */ -PASCAL NEAR openline(f, n) +int PASCAL NEAR openline(f, n) int f, n; /* prefix flag and argument */ { @@@@ -548,7 +552,7 @@@@ int f, n; /* prefix flag and argument * indentation as specified. */ -PASCAL NEAR newline(f, n) +int PASCAL NEAR newline(f, n) int f, n; /* prefix flag and argument */ { @@@@ -583,7 +587,7 @@@@ int f, n; /* prefix flag and argument return(TRUE); } -PASCAL NEAR cinsert() /* insert a newline and indentation for C */ +int PASCAL NEAR cinsert() /* insert a newline and indentation for C */ { register char *cptr; /* string pointer into text to copy */ @@@@ -645,7 +649,7 @@@@ PASCAL NEAR cinsert() /* insert a newlin return(TRUE); } -PASCAL NEAR insbrace(n, c) /* insert a brace into the text here...we are in CMODE */ +int PASCAL NEAR insbrace(n, c) /* insert a brace into the text here...we are in CMODE */ int n; /* repeat count */ int c; /* brace to insert (always } for now) */ @@@@ -741,7 +745,7 @@@@ int c; /* brace to insert (always } return(linsert(n, c)); } -PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */ +int PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */ { register int ch; /* last character before input */ @@@@ -776,7 +780,7 @@@@ PASCAL NEAR inspound() /* insert a # int * ignored. */ -PASCAL NEAR deblank(f, n) +int PASCAL NEAR deblank(f, n) int f, n; /* prefix flag and argument */ { @@@@ -809,7 +813,7 @@@@ int f, n; /* prefix flag and argument * subcomands failed. Normally bound to "C-J". */ -PASCAL NEAR indent(f, n) +int PASCAL NEAR indent(f, n) int f, n; /* prefix flag and argument */ { @@@@ -829,11 +833,12 @@@@ int f, n; /* prefix flag and argument c = lgetc(curwp->w_dotp, i); if (c != ' ' && c != '\t') break; - if (c == '\t') + if (c == '\t') { if (tabsize > 0) nicol += -(nicol % tabsize) + (tabsize - 1); else break; + } ++nicol; } if (lnewline() == FALSE) @@@@ -857,7 +862,7 @@@@ int f, n; /* prefix flag and argument * of text if typed with a big argument. Normally bound to "C-D". */ -PASCAL NEAR forwdel(f, n) +int PASCAL NEAR forwdel(f, n) int f, n; /* prefix flag and argument */ @@@@ -886,7 +891,7 @@@@ int f, n; /* prefix flag and argument * both "RUBOUT" and "C-H". */ -PASCAL NEAR backdel(f, n) +int PASCAL NEAR backdel(f, n) int f, n; /* prefix flag and argument */ @@@@ -926,7 +931,7 @@@@ int f, n; /* prefix flag and argument */ * that number of newlines. Normally bound to "C-K". */ -PASCAL NEAR killtext(f, n) +int PASCAL NEAR killtext(f, n) int f, n; /* prefix flag and argument */ @@@@ -974,35 +979,35 @@@@ int f, n; /* prefix flag and argument */ return(ldelete(chunk, TRUE)); } -PASCAL NEAR setmod(f, n) /* prompt and set an editor mode */ +int PASCAL NEAR setmod(f, n) /* prompt and set an editor mode */ int f, n; /* default and argument */ { return(adjustmode(TRUE, FALSE)); } -PASCAL NEAR delmode(f, n) /* prompt and delete an editor mode */ +int PASCAL NEAR delmode(f, n) /* prompt and delete an editor mode */ int f, n; /* default and argument */ { return(adjustmode(FALSE, FALSE)); } -PASCAL NEAR setgmode(f, n) /* prompt and set a global editor mode */ +int PASCAL NEAR setgmode(f, n) /* prompt and set a global editor mode */ int f, n; /* default and argument */ { return(adjustmode(TRUE, TRUE)); } -PASCAL NEAR delgmode(f, n) /* prompt and delete a global editor mode */ +int PASCAL NEAR delgmode(f, n) /* prompt and delete a global editor mode */ int f, n; /* default and argument */ { return(adjustmode(FALSE, TRUE)); } -PASCAL NEAR adjustmode(kind, global) /* change the editor mode status */ +int PASCAL NEAR adjustmode(kind, global) /* change the editor mode status */ int kind; /* true = set, false = delete */ int global; /* true = global flag, false = current buffer flag */ @@@@ -1118,7 +1123,7 @@@@ int global; /* true = global flag, fa /* This function simply clears the message line, mainly for macro usage */ -PASCAL NEAR clrmes(f, n) +int PASCAL NEAR clrmes(f, n) int f, n; /* arguments ignored */ { @@@@ -1129,7 +1134,7 @@@@ int f, n; /* arguments ignored */ /* This function writes a string on the message line mainly for macro usage */ -PASCAL NEAR writemsg(f, n) +int PASCAL NEAR writemsg(f, n) int f, n; /* arguments ignored */ { @@@@ -1147,7 +1152,7 @@@@ int f, n; /* arguments ignored */ /* the cursor is moved to a matching fence */ -PASCAL NEAR getfence(f, n) +int PASCAL NEAR getfence(f, n) int f, n; /* not used */ { @@@@ -1242,9 +1247,9 @@@@ int f, n; /* not used */ on screen the cursor briefly lights there */ #if PROTO -PASCAL NEAR fmatch(char ch) +int PASCAL NEAR fmatch(char ch) #else -PASCAL NEAR fmatch(ch) +int PASCAL NEAR fmatch(ch) char ch; /* fence type to match against */ #endif @@@@ -1318,7 +1323,7 @@@@ char ch; /* fence type to match against /* ask for and insert a string into the current buffer at the current point */ -PASCAL NEAR istring(f, n) +int PASCAL NEAR istring(f, n) int f, n; /* ignored arguments */ @@@@ -1344,7 +1349,7 @@@@ int f, n; /* ignored arguments */ return(status); } -PASCAL NEAR ovstring(f, n) /* ask for and overwite a string into the current +int PASCAL NEAR ovstring(f, n) /* ask for and overwite a string into the current buffer at the current point */ int f, n; /* ignored arguments */ @