diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-03-11 13:02:57 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2002-03-11 13:02:57 +0000 |
commit | 195cf29954aced38f2c3260a00e78b6c543347d7 (patch) | |
tree | 24960afa1083d432e589842ec187e8c39819c7ba /usr.bin/mg/buffer.c | |
parent | 3acf70e568831a61d560c056d28ea06bf89c72df (diff) |
* Move to ANSI function definitions.
* Add a whole lot of consts where I thought it made sense
no ok, but no objections either...
Diffstat (limited to 'usr.bin/mg/buffer.c')
-rw-r--r-- | usr.bin/mg/buffer.c | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/usr.bin/mg/buffer.c b/usr.bin/mg/buffer.c index 8efa928b964..b4023b9e792 100644 --- a/usr.bin/mg/buffer.c +++ b/usr.bin/mg/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.25 2002/03/05 20:31:10 vincent Exp $ */ +/* $OpenBSD: buffer.c,v 1.26 2002/03/11 13:02:56 vincent Exp $ */ /* * Buffer handling. @@ -18,8 +18,7 @@ static BUFFER *makelist(void); */ /* ARGSUSED */ int -usebuffer(f, n) - int f, n; +usebuffer(int f, int n) { BUFFER *bp; int s; @@ -50,8 +49,7 @@ usebuffer(f, n) */ /* ARGSUSED */ int -poptobuffer(f, n) - int f, n; +poptobuffer(int f, int n) { BUFFER *bp; MGWIN *wp; @@ -90,8 +88,7 @@ poptobuffer(f, n) */ /* ARGSUSED */ int -killbuffer(f, n) - int f, n; +killbuffer(int f, int n) { BUFFER *bp; BUFFER *bp1; @@ -165,7 +162,7 @@ killbuffer(f, n) rec = next; } - free(bp->b_bname); /* Release name block */ + free((char *)bp->b_bname); /* Release name block */ free(bp); /* Release buffer block */ return TRUE; } @@ -175,8 +172,7 @@ killbuffer(f, n) */ /* ARGSUSED */ int -savebuffers(f, n) - int f, n; +savebuffers(int f, int n) { if (anycb(f) == ABORT) return ABORT; @@ -212,8 +208,7 @@ static struct KEYMAPE (1 + IMAPEXT) listbufmap = { */ /* ARGSUSED */ int -listbuffers(f, n) - int f, n; +listbuffers(int f, int n) { static int initialized = 0; BUFFER *bp; @@ -224,7 +219,6 @@ listbuffers(f, n) initialized = 1; } - if ((bp = makelist()) == NULL || (wp = popbuf(bp)) == NULL) return FALSE; wp->w_dotp = bp->b_dotp;/* fix up if window already on screen */ @@ -243,7 +237,7 @@ listbuffers(f, n) * is an error (if there is no memory). */ static BUFFER * -makelist() +makelist(void) { int w = ncol / 2; BUFFER *bp, *blp; @@ -382,8 +376,7 @@ addlinef(BUFFER *bp, char *fmt, ...) * no changed buffers. */ int -anycb(f) - int f; +anycb(int f) { BUFFER *bp; int s = FALSE, save = FALSE; @@ -418,9 +411,7 @@ anycb(f) * block for the buffer. */ BUFFER * -bfind(bname, cflag) - char *bname; - int cflag; +bfind(const char *bname, int cflag) { BUFFER *bp; LINE *lp; @@ -445,7 +436,7 @@ bfind(bname, cflag) return NULL; } if ((lp = lalloc(0)) == NULL) { - free(bp->b_bname); + free((char *) bp->b_bname); free((char *) bp); return NULL; } @@ -483,8 +474,7 @@ bfind(bname, cflag) * looks good. */ int -bclear(bp) - BUFFER *bp; +bclear(BUFFER *bp) { LINE *lp; int s; @@ -507,10 +497,7 @@ bclear(bp) * action on redisplay. */ int -showbuffer(bp, wp, flags) - BUFFER *bp; - MGWIN *wp; - int flags; +showbuffer(BUFFER *bp, MGWIN *wp, int flags) { BUFFER *obp; MGWIN *owp; @@ -555,8 +542,7 @@ showbuffer(bp, wp, flags) * Returns a status. */ MGWIN * -popbuf(bp) - BUFFER *bp; +popbuf(BUFFER *bp) { MGWIN *wp; @@ -579,7 +565,7 @@ popbuf(bp) */ /* ARGSUSED */ int -bufferinsert(f, n) +bufferinsert(int f, int n) { BUFFER *bp; LINE *clp; @@ -638,7 +624,7 @@ bufferinsert(f, n) */ /* ARGSUSED */ int -notmodified(f, n) +notmodified(int f, int n) { MGWIN *wp; @@ -659,8 +645,7 @@ notmodified(f, n) * help functions. */ int -popbuftop(bp) - BUFFER *bp; +popbuftop(BUFFER *bp) { MGWIN *wp; |