=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/word.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/usr.bin/mg/word.c 2000/02/25 19:08:52 1.1 +++ src/usr.bin/mg/word.c 2000/04/13 06:12:18 1.2 @@ -13,10 +13,11 @@ * are performed by the "backchar" and "forwchar" * routines. */ -/*ARGSUSED*/ +/* ARGSUSED */ backword(f, n) { - if (n < 0) return forwword(f | FFRAND, -n); + if (n < 0) + return forwword(f | FFRAND, -n); if (backchar(FFRAND, 1) == FALSE) return FALSE; while (n--) { @@ -37,7 +38,7 @@ * the specified number of words. All of the * motion is done by "forwchar". */ -/*ARGSUSED*/ +/* ARGSUSED */ forwword(f, n) { if (n < 0) @@ -60,12 +61,13 @@ * the specified number of words. As you move, * convert any characters to upper case. */ -/*ARGSUSED*/ +/* ARGSUSED */ upperword(f, n) { - register int c; + register int c; - if (n < 0) return FALSE; + if (n < 0) + return FALSE; while (n--) { while (inword() == FALSE) { if (forwchar(FFRAND, 1) == FALSE) @@ -90,12 +92,13 @@ * the specified number of words. As you move * convert characters to lower case. */ -/*ARGSUSED*/ +/* ARGSUSED */ lowerword(f, n) { - register int c; + register int c; - if (n < 0) return FALSE; + if (n < 0) + return FALSE; while (n--) { while (inword() == FALSE) { if (forwchar(FFRAND, 1) == FALSE) @@ -122,13 +125,14 @@ * case, and subsequent characters to lower case. Error * if you try and move past the end of the buffer. */ -/*ARGSUSED*/ +/* ARGSUSED */ capword(f, n) { - register int c; - VOID lchange(); + register int c; + VOID lchange(); - if (n < 0) return FALSE; + if (n < 0) + return FALSE; while (n--) { while (inword() == FALSE) { if (forwchar(FFRAND, 1) == FALSE) @@ -161,16 +165,16 @@ /* * Kill forward by "n" words. */ -/*ARGSUSED*/ +/* ARGSUSED */ delfword(f, n) { - register RSIZE size; - register LINE *dotp; - register int doto; + register RSIZE size; + register LINE *dotp; + register int doto; if (n < 0) return FALSE; - if ((lastflag&CFKILL) == 0) /* Purge kill buffer. */ + if ((lastflag & CFKILL) == 0) /* Purge kill buffer. */ kdelete(); thisflag |= CFKILL; dotp = curwp->w_dotp; @@ -179,12 +183,12 @@ while (n--) { while (inword() == FALSE) { if (forwchar(FFRAND, 1) == FALSE) - goto out; /* Hit end of buffer. */ + goto out; /* Hit end of buffer. */ ++size; } while (inword() != FALSE) { if (forwchar(FFRAND, 1) == FALSE) - goto out; /* Hit end of buffer. */ + goto out; /* Hit end of buffer. */ ++size; } } @@ -206,34 +210,35 @@ * be wierd. Normally this is bound to "M-Rubout" and * to "M-Backspace". */ -/*ARGSUSED*/ +/* ARGSUSED */ delbword(f, n) { - register RSIZE size; - VOID kdelete(); + register RSIZE size; + VOID kdelete(); - if (n < 0) return FALSE; - if ((lastflag&CFKILL) == 0) /* Purge kill buffer. */ + if (n < 0) + return FALSE; + if ((lastflag & CFKILL) == 0) /* Purge kill buffer. */ kdelete(); thisflag |= CFKILL; if (backchar(FFRAND, 1) == FALSE) - return (TRUE); /* Hit buffer start. */ - size = 1; /* One deleted. */ + return (TRUE); /* Hit buffer start. */ + size = 1; /* One deleted. */ while (n--) { while (inword() == FALSE) { if (backchar(FFRAND, 1) == FALSE) - goto out; /* Hit buffer start. */ + goto out; /* Hit buffer start. */ ++size; } while (inword() != FALSE) { if (backchar(FFRAND, 1) == FALSE) - goto out; /* Hit buffer start. */ + goto out; /* Hit buffer start. */ ++size; } } if (forwchar(FFRAND, 1) == FALSE) return FALSE; - --size; /* Undo assumed delete. */ + --size; /* Undo assumed delete. */ out: return ldelete(size, KBACK); } @@ -244,9 +249,9 @@ * part of a word. The word character list is hard * coded. Should be setable. */ -inword() { -/* can't use lgetc in ISWORD due to bug in OSK cpp */ - return curwp->w_doto != llength(curwp->w_dotp) && +inword() +{ + /* can't use lgetc in ISWORD due to bug in OSK cpp */ + return curwp->w_doto != llength(curwp->w_dotp) && ISWORD(curwp->w_dotp->l_text[curwp->w_doto]); } -