From 1135d136574770c931622467a52204daf2d84a94 Mon Sep 17 00:00:00 2001 From: Gunnar Ritter Date: Mon, 25 Dec 2006 19:31:50 +0000 Subject: [PATCH] gcc -Wstrict-prototypes and related fixes --- ex_put.c | 4 ++-- ex_subr.c | 6 +++--- ex_temp.c | 26 +++++++++++++++----------- ex_version.c | 16 ++++++++-------- ex_vops2.c | 4 ++-- ex_vput.c | 4 ++-- exrecover.c | 13 +++++++------ 7 files changed, 39 insertions(+), 34 deletions(-) diff --git a/ex_put.c b/ex_put.c index d008249..0b77955 100644 --- a/ex_put.c +++ b/ex_put.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_put.c 1.34 (gritter) 8/6/05"; +static char sccsid[] = "@(#)ex_put.c 1.35 (gritter) 12/25/06"; #endif #endif @@ -1054,7 +1054,7 @@ setoutt(void) void vlprintf(char *cp, va_list ap) { - register int (*P)(); + register int (*P)(int); P = setlist(1); vprintf(cp, ap); diff --git a/ex_subr.c b/ex_subr.c index 18fcba0..663a78e 100644 --- a/ex_subr.c +++ b/ex_subr.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_subr.c 1.40 (gritter) 8/6/05"; +static char sccsid[] = "@(#)ex_subr.c 1.41 (gritter) 12/25/06"; #endif #endif @@ -638,7 +638,7 @@ qcolumn(register char *lim, register char *gp) { register int x = 0, n = 1; int c, i; - int (*OO)(); + int (*OO)(int); OO = Outchar; Outchar = qcount; @@ -851,7 +851,7 @@ char * vfindcol(int i) { register char *cp; - register int (*OO)() = Outchar; + register int (*OO)(int) = Outchar; int c, n = 0; Outchar = qcount; diff --git a/ex_temp.c b/ex_temp.c index 789a66d..da908b3 100644 --- a/ex_temp.c +++ b/ex_temp.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_temp.c 1.26 (gritter) 8/4/05"; +static char sccsid[] = "@(#)ex_temp.c 1.27 (gritter) 12/25/06"; #endif #endif @@ -265,25 +265,29 @@ getblock(line atl, int iof) if (iof == READ) { if (hitin2 == 0) { if (ichang2) { - blkio(iblock2, ibuff2, (ssize_t(*)())write); + blkio(iblock2, ibuff2, + (ssize_t(*)(int, void *, size_t))write); } ichang2 = 0; iblock2 = bno; - blkio(bno, ibuff2, (ssize_t(*)())read); + blkio(bno, ibuff2, + (ssize_t(*)(int, void *, size_t))read); hitin2 = 1; return (ibuff2 + off); } hitin2 = 0; if (ichanged) { - blkio(iblock, ibuff, (ssize_t(*)())write); + blkio(iblock, ibuff, + (ssize_t(*)(int, void *, size_t))write); } ichanged = 0; iblock = bno; - blkio(bno, ibuff, (ssize_t(*)())read); + blkio(bno, ibuff, (ssize_t(*)(int, void *, size_t))read); return (ibuff + off); } if (oblock >= 0) { - blkio(oblock, obuff, (ssize_t(*)())write); + blkio(oblock, obuff, + (ssize_t(*)(int, void *, size_t))write); } oblock = bno; return (obuff + off); @@ -301,7 +305,7 @@ blkio(bloc b, char *buf, ssize_t (*iofcn)(int, void *, size_t)) #ifdef INCORB if (b < INCORB) { - if (iofcn == (ssize_t(*)())read) { + if (iofcn == (ssize_t(*)(int, void *, size_t))read) { copy(buf, pagrnd(incorb[b+1]), (size_t) BUFSIZ); return; } @@ -358,13 +362,13 @@ synctmp(void) if (dol == zero) return; if (ichanged) - blkio(iblock, ibuff, (ssize_t(*)())write); + blkio(iblock, ibuff, (ssize_t(*)(int, void *, size_t))write); ichanged = 0; if (ichang2) - blkio(iblock2, ibuff2, (ssize_t(*)())write); + blkio(iblock2, ibuff2, (ssize_t(*)(int, void *, size_t))write); ichang2 = 0; if (oblock != -1) - blkio(oblock, obuff, (ssize_t(*)())write); + blkio(oblock, obuff, (ssize_t(*)(int, void *, size_t))write); time(&H.Time); uid = getuid(); *zero = (line) H.Time; @@ -566,7 +570,7 @@ shread(void) return (0); } -int getREG(); +int getREG(void); void putreg(int c) diff --git a/ex_version.c b/ex_version.c index f854692..103d5a9 100644 --- a/ex_version.c +++ b/ex_version.c @@ -70,12 +70,12 @@ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * Sccsid @(#)ex_version.c 1.145 (gritter) 8/18/05 + * Sccsid @(#)ex_version.c 1.146 (gritter) 12/25/06 */ #include "ex.h" -static char *versionstring = "@(#)Version 4.0 (gritter) 8/18/05"; +static char *versionstring = "@(#)Version 4.0 (gritter) 12/25/06"; void printver(void) @@ -102,13 +102,13 @@ ex_extern.c:static char sccsid[] = "@(#)ex_extern.c 1.6 (gritter) 11/23/04"; ex_get.c:static char sccsid[] = "@(#)ex_get.c 1.18 (gritter) 8/4/05"; ex_io.c:static char sccsid[] = "@(#)ex_io.c 1.42 (gritter) 8/4/05"; ex_proto.h: * Sccsid @(#)ex_proto.h 1.33 (gritter) 8/6/05 -ex_put.c:static char sccsid[] = "@(#)ex_put.c 1.34 (gritter) 8/6/05"; +ex_put.c:static char sccsid[] = "@(#)ex_put.c 1.35 (gritter) 12/25/06"; ex_re.c:static char sccsid[] = "@(#)ex_re.c 1.60 (gritter) 8/6/05"; ex_re.h: * Sccsid @(#)ex_re.h 1.24 (gritter) 8/4/05 ex_set.c:static char sccsid[] = "@(#)ex_set.c 1.11 (gritter) 11/24/04"; -ex_subr.c:static char sccsid[] = "@(#)ex_subr.c 1.40 (gritter) 8/6/05"; +ex_subr.c:static char sccsid[] = "@(#)ex_subr.c 1.41 (gritter) 12/25/06"; ex_tagio.c:static char sccsid[] = "@(#)ex_tagio.c 1.12 (gritter) 8/4/05"; -ex_temp.c:static char sccsid[] = "@(#)ex_temp.c 1.26 (gritter) 8/4/05"; +ex_temp.c:static char sccsid[] = "@(#)ex_temp.c 1.27 (gritter) 12/25/06"; ex_temp.h: * Sccsid @(#)ex_temp.h 1.10 (gritter) 8/4/05 ex_tty.c:static char sccsid[] = "@(#)ex_tty.c 1.30 (gritter) 8/4/05"; ex_tty.h: * Sccsid @(#)ex_tty.h 1.14 (gritter) 8/4/05 @@ -121,12 +121,12 @@ ex_vis.h: * Sccsid @(#)ex_vis.h 1.22 (gritter) 8/6/05 ex_vmain.c:static char sccsid[] = "@(#)ex_vmain.c 1.34 (gritter) 8/6/05"; ex_voper.c:static char sccsid[] = "@(#)ex_voper.c 1.28 (gritter) 8/6/05"; ex_vops.c:static char sccsid[] = "@(#)ex_vops.c 1.28 (gritter) 8/4/05"; -ex_vops2.c:static char sccsid[] = "@(#)ex_vops2.c 1.35 (gritter) 8/4/05"; +ex_vops2.c:static char sccsid[] = "@(#)ex_vops2.c 1.36 (gritter) 12/25/06"; ex_vops3.c:static char sccsid[] = "@(#)ex_vops3.c 1.21 (gritter) 8/4/05"; -ex_vput.c:static char sccsid[] = "@(#)ex_vput.c 1.51 (gritter) 8/6/05"; +ex_vput.c:static char sccsid[] = "@(#)ex_vput.c 1.52 (gritter) 12/25/06"; ex_vwind.c:static char sccsid[] = "@(#)ex_vwind.c 1.9 (gritter) 11/23/04"; expreserve.c:static char sccsid[] UNUSED = "@(#)expreserve.c 1.23 (gritter) 11/27/04"; -exrecover.c:static char sccsid[] UNUSED = "@(#)exrecover.c 1.22 (gritter) 8/4/05"; +exrecover.c:static char sccsid[] UNUSED = "@(#)exrecover.c 1.23 (gritter) 12/25/06"; mapmalloc.c: * Sccsid @(#)mapmalloc.c 1.7 (gritter) 8/18/05 printf.c:static char sccsid[] = "@(#)printf.c 1.15 (gritter) 12/1/04"; */ diff --git a/ex_vops2.c b/ex_vops2.c index 8039a0b..48050ff 100644 --- a/ex_vops2.c +++ b/ex_vops2.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vops2.c 1.35 (gritter) 8/4/05"; +static char sccsid[] = "@(#)ex_vops2.c 1.36 (gritter) 12/25/06"; #endif #endif @@ -611,7 +611,7 @@ vgetline(int cnt, char *gcursor, bool *aescaped, int commch) int x, y, iwhite, backsl=0; cell *iglobp; char cstr[2]; - int (*OO)() = Outchar; + int (*OO)(int) = Outchar; /* * Clear the output state and counters diff --git a/ex_vput.c b/ex_vput.c index bca3a2b..1851b67 100644 --- a/ex_vput.c +++ b/ex_vput.c @@ -73,7 +73,7 @@ #ifndef lint #ifdef DOSCCS -static char sccsid[] = "@(#)ex_vput.c 1.51 (gritter) 8/6/05"; +static char sccsid[] = "@(#)ex_vput.c 1.52 (gritter) 12/25/06"; #endif #endif @@ -893,7 +893,7 @@ vnpins(int dosync) e = vglitchup(vcline, d); vigoto(e, 0); vclreol(); if (dosync) { - int (*Ooutchar)() = Outchar; + int (*Ooutchar)(int) = Outchar; Outchar = vputchar; vsync(e + 1); Outchar = Ooutchar; diff --git a/exrecover.c b/exrecover.c index 0515ad0..eda7870 100644 --- a/exrecover.c +++ b/exrecover.c @@ -83,7 +83,7 @@ char *copyright = "@(#) Copyright (c) 1980 Regents of the University of California.\n\ All rights reserved.\n"; #endif -static char sccsid[] UNUSED = "@(#)exrecover.c 1.22 (gritter) 8/4/05"; +static char sccsid[] UNUSED = "@(#)exrecover.c 1.23 (gritter) 12/25/06"; #endif /* from exrecover.c 7.9.2 (2.11BSD) 1996/10/26 */ @@ -428,7 +428,7 @@ listfiles(char *dirname) xfprintf(xstderr, catgets(catd, 2, 6, "No files saved.\n")); return; } - qsort(&svbuf[0], ecount, sizeof svbuf[0], (int(*)()) qucmp); + qsort(&svbuf[0], ecount, sizeof svbuf[0], (int(*)(const void *, const void *)) qucmp); for (fp = &svbuf[0]; fp < &svbuf[ecount]; fp++) { cp = ctime(&fp->sf_time); cp[10] = 0; @@ -449,7 +449,7 @@ enter(struct svfile *fp, char *fname, int count) { register char *cp, *cp2; register struct svfile *f, *fl; - time_t curtime, itol(); + time_t curtime; f = 0; if (count >= NENTRY) { @@ -841,14 +841,15 @@ getblock(line atl, int iof) return (obuff + off); if (iof == READ) { if (ichanged) - blkio(iblock, ibuff, (ssize_t(*)())write); + blkio(iblock, ibuff, + (ssize_t(*)(int, void *, size_t))write); ichanged = 0; iblock = bno; - blkio(bno, ibuff, (ssize_t(*)())read); + blkio(bno, ibuff, (ssize_t(*)(int, void *, size_t))read); return (ibuff + off); } if (oblock >= 0) - blkio(oblock, obuff, (ssize_t(*)())write); + blkio(oblock, obuff, (ssize_t(*)(int, void *, size_t))write); oblock = bno; return (obuff + off); }