summaryrefslogtreecommitdiff
path: root/usr.bin/mg/theo.c
diff options
context:
space:
mode:
authorDavid Berghoff <db@cvs.openbsd.org>2005-04-03 02:09:29 +0000
committerDavid Berghoff <db@cvs.openbsd.org>2005-04-03 02:09:29 +0000
commitb6dc95251a8aa6c607dcb85f78ca2049dab538f7 (patch)
treeaaa772418d7ccfd0a020a53d1c6d7e85f7f7a47a /usr.bin/mg/theo.c
parentbadc0ff2f722af5ded41bf6344b8e76a32e9017d (diff)
This is a no binary change which does:
- spelling, punctuation fixes - variable declaration lineup - use parentheses for return and sizeof - K&R function declarations -> ANSI - other minor code beautification ok henning@
Diffstat (limited to 'usr.bin/mg/theo.c')
-rw-r--r--usr.bin/mg/theo.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/usr.bin/mg/theo.c b/usr.bin/mg/theo.c
index 717cb15a404..f91930476ef 100644
--- a/usr.bin/mg/theo.c
+++ b/usr.bin/mg/theo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: theo.c,v 1.80 2005/03/09 11:11:52 henning Exp $ */
+/* $OpenBSD: theo.c,v 1.81 2005/04/03 02:09:28 db Exp $ */
/*
* Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -28,12 +28,12 @@
#include "kbd.h"
#include "funmap.h"
-void theo_init(void);
+void theo_init(void);
static int theo_analyze(int, int);
static int theo(int, int);
static PF theo_pf[] = {
- theo_analyze,
+ theo_analyze
};
static struct KEYMAPE (1 + IMAPEXT) theomap = {
@@ -41,7 +41,7 @@ static struct KEYMAPE (1 + IMAPEXT) theomap = {
1 + IMAPEXT,
rescan,
{
- { CCHR('M'), CCHR('M'), theo_pf, NULL },
+ { CCHR('M'), CCHR('M'), theo_pf, NULL }
}
};
@@ -57,23 +57,23 @@ theo_init(void)
static int
theo(int f, int n)
{
- BUFFER *bp;
- MGWIN *wp;
+ BUFFER *bp;
+ MGWIN *wp;
bp = bfind("theo", TRUE);
if (bclear(bp) != TRUE)
- return FALSE;
+ return (FALSE);
bp->b_modes[0] = name_mode("fundamental");
bp->b_modes[1] = name_mode("theo");
bp->b_nmodes = 1;
if ((wp = popbuf(bp)) == NULL)
- return FALSE;
+ return (FALSE);
tbuf = curbp = bp;
curwp = wp;
- return TRUE;
+ return (TRUE);
}
static const char *talk[] = {
@@ -178,19 +178,18 @@ static const int ntalk = sizeof(talk)/sizeof(talk[0]);
static int
theo_analyze(int f, int n)
{
- const char *str;
- int len;
+ const char *str;
+ int len;
str = talk[arc4random() % ntalk];
len = strlen(str);
newline(FFRAND, 2);
- while (len--) {
+ while (len--)
linsert(1, *str++);
- }
newline(FFRAND, 2);
- return TRUE;
+ return (TRUE);
}