1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-12-18 07:16:23 -05:00

More ANSI'fication

Next up: enabling "-Wall" in the makefile. Not because it's ready,
but because it gets easier to track where we are in the process..
This commit is contained in:
Linus Torvalds 2005-09-30 18:06:17 -07:00
parent de0961e007
commit e3ca2a12cf
3 changed files with 62 additions and 60 deletions

5
bind.c
View File

@ -12,8 +12,6 @@
#include "edef.h" #include "edef.h"
#include "epath.h" #include "epath.h"
extern int meta(), cex(), unarg(), ctrlg(); /* dummy prefix binding functions */
int help(int f, int n) int help(int f, int n)
{ /* give me some help!!!! { /* give me some help!!!!
bring up a fake buffer and read the help file bring up a fake buffer and read the help file
@ -60,7 +58,6 @@ int deskey(int f, int n)
register int c; /* key to describe */ register int c; /* key to describe */
register char *ptr; /* string pointer to scan output strings */ register char *ptr; /* string pointer to scan output strings */
char outseq[NSTRING]; /* output buffer for command sequence */ char outseq[NSTRING]; /* output buffer for command sequence */
int (*getbind()) ();
/* prompt the user to type us a key to describe */ /* prompt the user to type us a key to describe */
mlwrite(": describe-key "); mlwrite(": describe-key ");
@ -94,7 +91,6 @@ int bindtokey(int f, int n)
register KEYTAB *ktp; /* pointer into the command table */ register KEYTAB *ktp; /* pointer into the command table */
register int found; /* matched command flag */ register int found; /* matched command flag */
char outseq[80]; /* output buffer for keystroke sequence */ char outseq[80]; /* output buffer for keystroke sequence */
int (*getname()) ();
/* prompt the user to type in a key to bind */ /* prompt the user to type in a key to bind */
mlwrite(": bind-to-key "); mlwrite(": bind-to-key ");
@ -710,7 +706,6 @@ char *transbind(char *skey)
{ {
char *bindname; char *bindname;
unsigned int stock(); unsigned int stock();
int (*getbind()) ();
bindname = getfname(getbind(stock(skey))); bindname = getfname(getbind(stock(skey)));
if (bindname == NULL) if (bindname == NULL)

View File

@ -19,7 +19,7 @@
* if the use count is 0. Otherwise, they come * if the use count is 0. Otherwise, they come
* from some other window. * from some other window.
*/ */
usebuffer(f, n) int usebuffer(int f, int n)
{ {
register BUFFER *bp; register BUFFER *bp;
register int s; register int s;
@ -32,9 +32,12 @@ usebuffer(f, n)
return (swbuffer(bp)); return (swbuffer(bp));
} }
nextbuffer(f, n) /*
/* switch to the next buffer in the buffer list */ * switch to the next buffer in the buffer list
int f, n; /* default flag, numeric argument */ *
* int f, n; default flag, numeric argument
*/
int nextbuffer(int f, int n)
{ {
register BUFFER *bp; /* eligable buffer to switch to */ register BUFFER *bp; /* eligable buffer to switch to */
register BUFFER *bbp; /* eligable buffer to switch to */ register BUFFER *bbp; /* eligable buffer to switch to */
@ -69,10 +72,10 @@ int f, n; /* default flag, numeric argument */
return (swbuffer(bp)); return (swbuffer(bp));
} }
swbuffer(bp) /*
/* make buffer BP current */ * make buffer BP current
BUFFER *bp; */
int swbuffer(BUFFER *bp)
{ {
register WINDOW *wp; register WINDOW *wp;
@ -125,7 +128,7 @@ BUFFER *bp;
* if the buffer has been changed). Then free the header * if the buffer has been changed). Then free the header
* line and the buffer header. Bound to "C-X K". * line and the buffer header. Bound to "C-X K".
*/ */
killbuffer(f, n) int killbuffer(int f, int n)
{ {
register BUFFER *bp; register BUFFER *bp;
register int s; register int s;
@ -140,10 +143,10 @@ killbuffer(f, n)
return (zotbuf(bp)); return (zotbuf(bp));
} }
zotbuf(bp) /*
/* kill the buffer pointed to by bp */ * kill the buffer pointed to by bp
register BUFFER *bp; */
int zotbuf(BUFFER *bp)
{ {
register BUFFER *bp1; register BUFFER *bp1;
register BUFFER *bp2; register BUFFER *bp2;
@ -171,10 +174,12 @@ register BUFFER *bp;
return (TRUE); return (TRUE);
} }
namebuffer(f, n) /*
/* Rename the current buffer */ * Rename the current buffer
int f, n; /* default Flag & Numeric arg */ *
* int f, n; default Flag & Numeric arg
*/
int namebuffer(int f, int n)
{ {
register BUFFER *bp; /* pointer to scan through all buffers */ register BUFFER *bp; /* pointer to scan through all buffers */
char bufn[NBUFN]; /* buffer to hold buffer name */ char bufn[NBUFN]; /* buffer to hold buffer name */
@ -202,16 +207,16 @@ int f, n; /* default Flag & Numeric arg */
} }
/* /*
List all of the active buffers. First update the special * List all of the active buffers. First update the special
buffer that holds the list. Next make sure at least 1 * buffer that holds the list. Next make sure at least 1
window is displaying the buffer list, splitting the screen * window is displaying the buffer list, splitting the screen
if this is what it takes. Lastly, repaint all of the * if this is what it takes. Lastly, repaint all of the
windows that are displaying the list. Bound to "C-X C-B". * windows that are displaying the list. Bound to "C-X C-B".
A numeric argument forces it to list invisable buffers as *
well. * A numeric argument forces it to list invisible buffers as
*/ * well.
*/
listbuffers(f, n) int listbuffers(int f, int n)
{ {
register WINDOW *wp; register WINDOW *wp;
register BUFFER *bp; register BUFFER *bp;
@ -254,13 +259,12 @@ listbuffers(f, n)
* by the list buffers command. Return TRUE * by the list buffers command. Return TRUE
* if everything works. Return FALSE if there * if everything works. Return FALSE if there
* is an error (if there is no memory). Iflag * is an error (if there is no memory). Iflag
* indecates weather to list hidden buffers. * indicates wether to list hidden buffers.
*
* int iflag; list hidden buffer flag
*/ */
#define MAXLINE MAXCOL #define MAXLINE MAXCOL
makelist(iflag) int makelist(int iflag)
int iflag; /* list hidden buffer flag */
{ {
register char *cp1; register char *cp1;
register char *cp2; register char *cp2;
@ -368,12 +372,7 @@ int iflag; /* list hidden buffer flag */
return (TRUE); /* All done */ return (TRUE); /* All done */
} }
ltoa(buf, width, num) void ltoa(char *buf, int width, long num)
char buf[];
int width;
long num;
{ {
buf[width] = 0; /* End of string. */ buf[width] = 0; /* End of string. */
while (num >= 10) { /* Conditional digits. */ while (num >= 10) { /* Conditional digits. */
@ -392,8 +391,7 @@ long num;
* on the end. Return TRUE if it worked and * on the end. Return TRUE if it worked and
* FALSE if you ran out of room. * FALSE if you ran out of room.
*/ */
addline(text) int addline(char *text)
char *text;
{ {
register LINE *lp; register LINE *lp;
register int i; register int i;
@ -423,7 +421,7 @@ char *text;
* Return FALSE if no buffers * Return FALSE if no buffers
* have been changed. * have been changed.
*/ */
anycb() int anycb(void)
{ {
register BUFFER *bp; register BUFFER *bp;
@ -444,8 +442,7 @@ anycb()
* and the "cflag" is TRUE, create it. The "bflag" is * and the "cflag" is TRUE, create it. The "bflag" is
* the settings for the flags in in buffer. * the settings for the flags in in buffer.
*/ */
BUFFER *bfind(bname, cflag, bflag) BUFFER *bfind(char *bname, int cflag, int bflag)
register char *bname;
{ {
register BUFFER *bp; register BUFFER *bp;
register BUFFER *sb; /* buffer to insert after */ register BUFFER *sb; /* buffer to insert after */
@ -513,8 +510,7 @@ register char *bname;
* that are required. Return TRUE if everything * that are required. Return TRUE if everything
* looks good. * looks good.
*/ */
bclear(bp) int bclear(BUFFER *bp)
register BUFFER *bp;
{ {
register LINE *lp; register LINE *lp;
register int s; register int s;
@ -533,10 +529,12 @@ register BUFFER *bp;
return (TRUE); return (TRUE);
} }
unmark(f, n) /*
/* unmark the current buffers change flag */ * unmark the current buffers change flag
int f, n; /* unused command arguments */ *
* int f, n; unused command arguments
*/
int unmark(int f, int n)
{ {
curbp->b_flag &= ~BFCHG; curbp->b_flag &= ~BFCHG;
curwp->w_flag |= WFMODE; curwp->w_flag |= WFMODE;

21
edef.h
View File

@ -17,9 +17,6 @@ typedef int (*fn_t)(int, int);
struct VIDEO; struct VIDEO;
char *flook();
char *getctext();
char *getfname();
char *getval(); char *getval();
char *gtenv(); char *gtenv();
char *gtfun(); char *gtfun();
@ -29,9 +26,6 @@ char *ltos();
char *mklower(); char *mklower();
char *mkupper(); char *mkupper();
char *token(); char *token();
char *transbind();
unsigned int getckey();
unsigned int stock();
#ifdef maindef #ifdef maindef
@ -535,3 +529,18 @@ extern char *getfname(fn_t);
extern fn_t fncmatch(char *); extern fn_t fncmatch(char *);
extern unsigned int stock(char *keyname); extern unsigned int stock(char *keyname);
extern char *transbind(char *skey); extern char *transbind(char *skey);
/* buffer.c */
extern int usebuffer(int f, int n);
extern int nextbuffer(int f, int n);
extern int swbuffer(BUFFER *bp);
extern int killbuffer(int f, int n);
extern int zotbuf(BUFFER *bp);
extern int namebuffer(int f, int n);
extern int listbuffers(int f, int n);
extern int makelist(int iflag);
extern void ltoa(char *buf, int width, long num);
extern int addline(char *text);
extern int anycb(void);
extern int bclear(BUFFER *bp);
extern int unmark(int f, int n);