# DP: get prototypes for all functions at least

--- a/vroot.h
+++ b/vroot.h
@@ -66,8 +66,7 @@ static char vroot_rcsid[] = "$Id: vroot.
 #include <X11/Xlib.h>
 
 static Window
-VirtualRootWindowOfScreen(screen)
-	Screen *screen;
+VirtualRootWindowOfScreen(Screen *screen)
 {
 	static Screen *save_screen = (Screen *)0;
 	static Window root = (Window)0;
--- a/xlax.c
+++ b/xlax.c
@@ -51,21 +51,19 @@ XKeyEvent tmpevents[MAXEVENTS];
 int tmpeventindex;
 int tmpwindex;
   
-int 
+size_t
   WindowIndex;
 
 char *prefix="xlax:";
 char findname[16];
 
-void DoNothing() {
+static void DoNothing(Widget w, XEvent *event, String *params, Cardinal *num_params)
+{
   /* stupid, but used to override button click default actions */
   return;
 }
 
-int ErrorHandler(mydisp, myerr) 
-Display *mydisp;
-XErrorEvent *myerr;
-
+static int ErrorHandler(Display *mydisp, XErrorEvent *myerr)
 {
   char msg[80];
   XGetErrorText(mydisp, myerr->error_code, msg, 80);
@@ -82,13 +80,9 @@ XErrorEvent *myerr;
   } 
 }
 
-int main (argc, argv)
-int    argc;
-char **argv;
-
+int main(int argc, char **argv)
 {
   int i, find=0;
-  void DoNothing();
   static XtActionsRec TextActions[] = {
     {"DoNothing", DoNothing},
     {NULL, NULL}
@@ -334,8 +328,7 @@ int dofind;
  * (taken from dsimple.c from xwd)
  */
 
-Window Select_Window(dpy)
-     Display *dpy;
+static Window Select_Window(Display *dpy)
 {
   int status;
   Cursor cursor;
@@ -385,8 +378,8 @@ Window Select_Window(dpy)
 
 void findCB (w,client_data, call_data)
 Widget w;
-caddr_t  client_data;
-caddr_t  call_data;
+XtPointer  client_data;
+XtPointer  call_data;
 {
   Display *dpy = XtDisplay(w);
   Window root = RootWindow(dpy,DefaultScreen(dpy));
@@ -413,7 +406,7 @@ Window top;
 {
   Window *children, dummy;
   unsigned int i, nchildren;
-  int x;
+  size_t x;
   Window w=0;
   XClassHint class_hint;
 
@@ -444,13 +437,13 @@ Window top;
 void
 selectCB (w, client_data, call_data)
 Widget w;
-caddr_t  client_data;
-caddr_t  call_data;
+XtPointer  client_data;
+XtPointer  call_data;
 
 {
   Display *dpy;
   Window target;
-  int x, y;
+  size_t x;
 
   int cnt;
   Arg args[15];
@@ -567,7 +560,8 @@ int Remove_Window(w)
 Window w;
 {
   Widget  frame;
-  int x, length, removed=0;
+  size_t  x;
+  int     length, removed=0;
 
   Arg     args[10];
   int     cnt;
@@ -605,8 +599,8 @@ Window w;
 void
 killCB (w, client_data, call_data)
 Widget w;
-caddr_t  client_data;
-caddr_t  call_data;
+XtPointer  client_data;
+XtPointer  call_data;
 
 {
   Display *dpy;
@@ -650,20 +644,21 @@ fprintf(stderr,"t=%d, butt=%d, text=%d\n
 }
 
 void
-keyboardCB (w, client_data, event)
+keyboardCB (w, client_data, event, cp_)
 Widget w;
-caddr_t  client_data;
-XKeyEvent *event;
+XtPointer  client_data;
+XEvent *event;
+Boolean *cp_;
 
 {
-  int x;
+  size_t x;
 
   /* send the keys to every active window that's been selected */
   for (x = 0; x < WindowIndex; x++)
     {
       if (Windows[x].active == 1)
 	{
-	  event->window = Windows[x].wind;
+	  event->xkey.window = Windows[x].wind;
 	  XSendEvent(XtDisplay(w), Windows[x].wind, True, KeyPressMask, (XEvent *) event);
 	}
     }
@@ -833,10 +828,8 @@ long *m;
   }
 }
 
-KeyCode _old_CharToKeycodeMod(disp, c, m)
-Display *disp;
-unsigned char c;
-long *m;
+#if 0
+static KeyCode _old_CharToKeycodeMod(Display *disp, unsigned char c, long *m)
 {
   KeySym ks, ksr;
   KeyCode kc;
@@ -908,12 +901,13 @@ long *m;
     return(0);
   }
 }
+#endif
 
 void
 cancelCB (w, client_data, call_data)
 Widget w;
-caddr_t  client_data;
-caddr_t  call_data;
+XtPointer  client_data;
+XtPointer  call_data;
 {
   XtSetKeyboardFocus(Popup,None);
   XtPopdown(Popup);
@@ -922,10 +916,11 @@ caddr_t  call_data;
 void
 okCB (w, client_data, call_data)
 Widget w;
-caddr_t  client_data;
-caddr_t  call_data;
+XtPointer  client_data;
+XtPointer  call_data;
 {
-  int i, len, offset;
+  size_t i;
+  int  len, offset;
   char text[500];
   Arg     args[10];
   int     cnt;
@@ -949,8 +944,8 @@ caddr_t  call_data;
 void
 clearCB (w, client_data, call_data)
 Widget w;
-caddr_t  client_data;
-caddr_t  call_data;
+XtPointer  client_data;
+XtPointer  call_data;
 {
   Arg args[10];
   int cnt;
@@ -966,10 +961,11 @@ caddr_t  call_data;
 
 
 void
-stringinputCB (w, client_data, event)
+stringinputCB (w, client_data, event, cp_)
 Widget w;
-caddr_t  client_data;
-XKeyEvent *event;
+XtPointer  client_data;
+XEvent *event;
+Boolean *cp_;
 
 {
   if (tmpeventindex == MAXEVENTS) {
@@ -987,14 +983,17 @@ XKeyEvent *event;
 }
 
 void
-togglestringCB (w, index, event)
+togglestringCB (w, index_, event, cp_)
 Widget w;
-int  index;
-XButtonEvent *event;
+XtPointer index_;
+XEvent *event;
+Boolean *cp_;
 
 {
+  size_t index = (size_t)index_;
+  size_t i;
   Arg args[10];
-  int cnt, i, len, offset=0;
+  int cnt, len, offset=0;
   char text[500];
   Widget tmpw, lab;
 
@@ -1026,23 +1025,23 @@ XButtonEvent *event;
 void
 toggleCB (w, windex, state)
 Widget w;
-int  windex;
-int  state;
+XtPointer windex;
+XtPointer state;
 
 {
-  Windows[windex].active = state;
+  Windows[(size_t)windex].active = (size_t)state;
   return;
 }
 
 void 
 pasteCB (w, client_data, call_data)
 Widget w;		/* unused */
-caddr_t  client_data;	/* unused */
-caddr_t  call_data;	/* unused */
+XtPointer  client_data;	/* unused */
+XtPointer  call_data;	/* unused */
 
 {
-  int x, n;
-  size_t y;
+  int n;
+  size_t x, y;
   char *sel;
   XKeyEvent evt;
   long m;
@@ -1101,11 +1100,11 @@ caddr_t  call_data;	/* unused */
 void 
 senditCB (w, client_data, call_data)
 Widget w;		/* unused */
-caddr_t  client_data;	/* unused */
-caddr_t  call_data;	/* unused */
+XtPointer  client_data;	/* unused */
+XtPointer  call_data;	/* unused */
 
 {
-  int x, y;
+  size_t x, y;
 
   for (x = 0; x < WindowIndex; x++) {
     if (Windows[x].active == 1) {
@@ -1121,8 +1120,8 @@ caddr_t  call_data;	/* unused */
 void 
 quitCB (w, client_data, call_data)
 Widget w;		/* unused */
-caddr_t  client_data;	/* unused */
-caddr_t  call_data;	/* unused */
+XtPointer  client_data;	/* unused */
+XtPointer  call_data;	/* unused */
 
 {
   exit (0);
--- a/xlax.h
+++ b/xlax.h
@@ -67,9 +67,9 @@
 
 typedef struct {
   Window wind;
-  int    active;
+  size_t active;
   XKeyEvent events[MAXEVENTS];
-  int    eventindex;
+  size_t eventindex;
   Widget button;
   Widget text;
 } Windows_t;
@@ -78,26 +78,26 @@ typedef struct {
 /* GLOBALS   */
 /*************/
 
-void SetupInterface();
-void selectCB();
-void findCB();
-void killCB();
-void keyboardCB();
-void toggleCB();
-void quitCB();
-void pasteCB();
-void senditCB();
-void togglestringCB();
-void stringinputCB();
-void okCB();
-void clearCB();
-void cancelCB();
-void Find_Xlax();
-void Add_Window();
-void presetString();
-KeyCode CharToKeycodeMod();
-int Remove_Window();
-void BuildCharToKeyMap();
+void SetupInterface(int);
+void selectCB(Widget w, XtPointer client_data, XtPointer call_data);
+void findCB(Widget w, XtPointer client_data, XtPointer call_data);
+void killCB(Widget w, XtPointer client_data, XtPointer call_data);
+void keyboardCB(Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch);
+void toggleCB(Widget w, XtPointer client_data, XtPointer call_data);
+void quitCB(Widget w, XtPointer client_data, XtPointer call_data);
+void pasteCB(Widget w, XtPointer client_data, XtPointer call_data);
+void senditCB(Widget w, XtPointer client_data, XtPointer call_data);
+void togglestringCB(Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch);
+void stringinputCB(Widget w, XtPointer client_data, XEvent *event, Boolean *continue_to_dispatch);
+void okCB(Widget w, XtPointer client_data, XtPointer call_data);
+void clearCB(Widget w, XtPointer client_data, XtPointer call_data);
+void cancelCB(Widget w, XtPointer client_data, XtPointer call_data);
+void Find_Xlax(Display *, Window);
+void Add_Window(Display *, Window, char *);
+void presetString(Display *, int, char *);
+KeyCode CharToKeycodeMod(Display *, unsigned char, long *);
+int Remove_Window(Window);
+void BuildCharToKeyMap(Display *);
 
 int kcmap[256];
 int modmap[256];
