Protoized.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@129 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1995-09-28 18:41:39 +00:00
parent 989c329cc8
commit 10edfeed4d

View File

@@ -12,6 +12,7 @@
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <X11/StringDefs.h> #include <X11/StringDefs.h>
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include <X11/keysym.h> #include <X11/keysym.h>
@@ -122,10 +123,9 @@ static XrmOptionDescRec options[] = {
}; };
static char * static char *
get_words(argv) get_words(char **argv)
char **argv;
{ {
FILE *pp; FILE *pp = 0;
static char buf[BUFSIZ]; static char buf[BUFSIZ];
register char *p = buf; register char *p = buf;
@@ -167,9 +167,7 @@ char **argv;
} }
static void static void
init_words (argc, argv) init_words (int argc, char **argv)
int argc;
char *argv[];
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
@@ -219,8 +217,7 @@ char *argv[];
} }
static void static void
ScreenSaver(save) ScreenSaver(int save)
int save;
{ {
static int timeout, interval, prefer_blank, allow_exp; static int timeout, interval, prefer_blank, allow_exp;
if (save) { if (save) {
@@ -231,13 +228,13 @@ ScreenSaver(save)
XSetScreenSaver(dpy, timeout, interval, prefer_blank, allow_exp); XSetScreenSaver(dpy, timeout, interval, prefer_blank, allow_exp);
} }
/* XXX */ /* Forward decls necessary */
static void talk(int force_erase); static void talk(int force_erase);
static unsigned long look(void); static unsigned long look(void);
static void static void
leave() leave(void)
{ {
#if 0 #if 0
XUngrabServer(dpy); XUngrabServer(dpy);
@@ -250,8 +247,7 @@ leave()
} }
static void static void
walk(dir) walk(int dir)
register int dir;
{ {
register int incr = 0; register int incr = 0;
static int lastdir; static int lastdir;
@@ -314,7 +310,7 @@ register int dir;
} }
static int static int
think() think(void)
{ {
if (rand() & 1) if (rand() & 1)
walk(FRONT); walk(FRONT);
@@ -327,7 +323,7 @@ think()
} }
static void static void
move() move(XtPointer _p, XtIntervalId *_id)
{ {
static int length, dir; static int length, dir;
@@ -385,8 +381,7 @@ move()
} }
static void static void
post_prompt_box(window) post_prompt_box(Window window)
Window window;
{ {
char s[32]; char s[32];
int width = (Width / 3); int width = (Width / 3);
@@ -430,10 +425,9 @@ Window window;
} }
static void static void
ClearWindow(w, event) ClearWindow(Widget w, XEvent *_event, String *_s, Cardinal *_n)
Widget w;
XExposeEvent *event;
{ {
XExposeEvent *event = (XExposeEvent *)_event;
if (!XtIsRealized(w)) if (!XtIsRealized(w))
return; return;
XSetForeground(dpy, gc, Black); XSetForeground(dpy, gc, Black);
@@ -454,18 +448,15 @@ XExposeEvent *event;
} }
static void static void
Visibility(w, client_data, event) Visibility(Widget w, XtPointer client_data, XEvent *event, Boolean *_b)
Widget w;
XtPointer client_data;
XVisibilityEvent *event;
{ {
XRaiseWindow(dpy, XtWindow(w)); XRaiseWindow(dpy, XtWindow(w));
} }
static void static void
countdown(timeout) countdown(XtPointer _t, XtIntervalId *_d)
int *timeout;
{ {
int *timeout = _t;
char buf[16]; char buf[16];
if (--(*timeout) < 0) { if (--(*timeout) < 0) {
@@ -474,7 +465,7 @@ int *timeout;
state = IS_MOVING; state = IS_MOVING;
event.x = event.y = 0; event.x = event.y = 0;
event.width = Width, event.height = Height; event.width = Width, event.height = Height;
ClearWindow(widget, &event); ClearWindow(widget, (XEvent *)&event, 0, 0);
timeout_id = XtAppAddTimeOut(app, 200L, move, NULL); timeout_id = XtAppAddTimeOut(app, 200L, move, NULL);
return; return;
} }
@@ -485,10 +476,9 @@ int *timeout;
} }
static void static void
GetPasswd(w, event) GetPasswd(Widget w, XEvent *_event, String *_s, Cardinal *_n)
Widget w;
XKeyEvent *event;
{ {
XKeyEvent *event = (XKeyEvent *)_event;
static char passwd[MAX_PASSWD_LENGTH]; static char passwd[MAX_PASSWD_LENGTH];
static int cnt; static int cnt;
char c; char c;
@@ -507,7 +497,7 @@ XKeyEvent *event;
post_prompt_box(XtWindow(w)); post_prompt_box(XtWindow(w));
cnt = 0; cnt = 0;
time_left = 30; time_left = 30;
countdown(&time_left); countdown(&time_left, 0);
return; return;
} }
if (event->type != KeyPress) if (event->type != KeyPress)
@@ -593,7 +583,7 @@ XKeyEvent *event;
#include "nose.down" #include "nose.down"
static void static void
init_images() init_images(void)
{ {
static Pixmap *images[] = { static Pixmap *images[] = {
&left0, &left1, &right0, &right1, &left0, &left1, &right0, &right1,
@@ -614,14 +604,13 @@ init_images()
} }
static void static void
talk(force_erase) talk(int force_erase)
int force_erase;
{ {
int width = 0, height, Z, total = 0; int width = 0, height, Z, total = 0;
static int X, Y, talking; static int X, Y, talking;
static struct { int x, y, width, height; } s_rect; static struct { int x, y, width, height; } s_rect;
register char *p, *p2; register char *p, *p2;
char buf[BUFSIZ], *strcpy(), *index(), args[MAXLINES][256]; char buf[BUFSIZ], args[MAXLINES][256];
/* clear what we've written */ /* clear what we've written */
if (talking || force_erase) { if (talking || force_erase) {
@@ -732,7 +721,7 @@ int force_erase;
} }
static unsigned long static unsigned long
look() look(void)
{ {
if (rand() % 3) { if (rand() % 3) {
XCopyPlane(dpy, (rand() & 1)? down : front, XtWindow(widget), gc, XCopyPlane(dpy, (rand() & 1)? down : front, XtWindow(widget), gc,
@@ -754,9 +743,7 @@ look()
} }
int int
main (argc, argv) main (int argc, char **argv)
int argc;
char *argv[];
{ {
register int i; register int i;
int foo; int foo;