$NetBSD: patch-ed,v 1.3 2011/09/19 07:15:52 dholland Exp $

- use modern C
- terminate calls to XtVa[GS]etValues properly (caught by clang)
- declare functions not returning values as void (otherwise clang belches)

--- clients/xmtg/ui.c.orig	1998-04-01 23:55:00.000000000 +0000
+++ clients/xmtg/ui.c
@@ -22,10 +22,14 @@
  */
 /* next line is debugging...TODO */
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #ifdef __STDC__
+#include <stdint.h>
 #include <stdarg.h>
 #else
 #include <varargs.h>
+typedef long intptr_t; /* best guess... */
 #endif
 #include <X11/Xlib.h>
 
@@ -121,7 +125,7 @@ ui_create(top, floor, seat, view, gridp)
    **	Telepointer toggle
    */
    w = XtCreateManagedWidget("teleptr", toggleWidgetClass, parent, 0,0);
-   XtVaSetValues(w, XtNstate, True, 0);
+   XtVaSetValues(w, XtNstate, True, (void *)NULL);
    XtAddCallback(w, XtNcallback, teleptr_cb, 0);
 
    /*
@@ -186,9 +190,9 @@ ui_create_radio(name, parent, value, lea
    w = XtCreateManagedWidget(name, toggleWidgetClass, parent, 0, 0);
    
    if (leader)
-      XtVaSetValues(w, XtNradioData, value, XtNradioGroup, leader, 0);
+      XtVaSetValues(w, XtNradioData, value, XtNradioGroup, leader, (void *)NULL);
    else
-      XtVaSetValues(w, XtNradioData, value, 0);
+      XtVaSetValues(w, XtNradioData, value, (void *)NULL);
 
    if (buttonp)
       *buttonp = w;
@@ -202,6 +206,7 @@ blort(w, c, d)
 printf("BLORT!\n");
 }
 
+void
 ui_create_add_dialog(dp, parent, prompt, floor, seat, view)
    dialog_t *dp;
    Widget parent;
@@ -229,7 +234,7 @@ XtAddCallback(dp->enable, XtNcallback, b
       w = XtCreateManagedWidget("add_label", labelWidgetClass, dp->dialog,0,0);
       XtVaSetValues(w,	XtNlabel, prompt,
 			XtNborderWidth, 0,
-			0);
+			(void *)NULL);
 
       input = XtCreateManagedWidget(	"input",
 					asciiTextWidgetClass,
@@ -239,7 +244,7 @@ XtAddCallback(dp->enable, XtNcallback, b
       XtVaSetValues(input,	XtNeditType, XawtextEdit,
 				XtNpieceSize, 128,
 				XtNtype, XawAsciiString,
-				0);
+				(void *)NULL);
 
       /*
       **   Floor/Seat/View radio group
@@ -247,7 +252,7 @@ XtAddCallback(dp->enable, XtNcallback, b
       w = XtCreateManagedWidget("mode_label", labelWidgetClass,dp->dialog,0,0);
       XtVaSetValues(w,	XtNlabel, "Input mode:",
 			XtNborderWidth, 0,
-			0);
+			(void *)NULL);
       ui_create_radio("floor", dp->dialog, floor, 0, &radio);
       ui_create_radio("seat", dp->dialog, seat, radio, 0);
       ui_create_radio("view", dp->dialog, view, radio, 0);
@@ -261,6 +266,7 @@ XtAddCallback(dp->enable, XtNcallback, b
    }
 }
 
+void
 ui_create_drop_dialog(dp, parent, prompt)
    dialog_t *dp;
    Widget parent;
@@ -285,7 +291,7 @@ ui_create_drop_dialog(dp, parent, prompt
       w = XtCreateManagedWidget("drop_label", labelWidgetClass, dp->dialog,0,0);
       XtVaSetValues(w,	XtNlabel, prompt,
 			XtNborderWidth, 0,
-			0);
+			(void *)NULL);
 
       ui_create_dialog_dismiss("accept", dp, drop_cb, 0);
       ui_create_dialog_dismiss("cancel", dp, 0, 0);
@@ -333,7 +339,7 @@ ui_create_dialog(name, dp, parent, promp
 					dp->shell,
 					0,
 					0);
-      XtVaSetValues(dp->dialog, XtNlabel, prompt, XtNvalue, "", 0);
+      XtVaSetValues(dp->dialog, XtNlabel, prompt, XtNvalue, "", (void *)NULL);
       XtAddCallback(dp->enable, XtNcallback, center_popup, (XtPointer)dp);
       XtAddCallback(dp->enable,XtNcallback,XtCallbackNone,(XtPointer)dp->shell);
    }
@@ -427,7 +433,7 @@ ui_get_toggle_state(w)
 {
    Boolean state;
 
-   XtVaGetValues(w, XtNstate, &state, 0);
+   XtVaGetValues(w, XtNstate, &state, (void *)NULL);
 
    return (state == True);
 }
@@ -439,8 +445,8 @@ ui_get_add_info(adp, strp, modep)
    int *modep;
 {
    
-   XtVaGetValues(adp->input, XtNstring, strp, 0);
-   *modep = (int)XawToggleGetCurrent(adp->mode_radio);
+   XtVaGetValues(adp->input, XtNstring, strp, (void *)NULL);
+   *modep = (int)(intptr_t)XawToggleGetCurrent(adp->mode_radio);
 }
 
 void
@@ -531,8 +537,8 @@ center_popup(w, client_data, call_data)
    if (!XtIsRealized(dp->shell))
       XtRealizeWidget(dp->shell);
 
-   XtVaGetValues(dp->top, XtNwidth, &sw, XtNheight, &sh, 0);
-   XtVaGetValues(dp->shell, XtNwidth, &dw, XtNheight, &dh, 0);
+   XtVaGetValues(dp->top, XtNwidth, &sw, XtNheight, &sh, (void *)NULL);
+   XtVaGetValues(dp->shell, XtNwidth, &dw, XtNheight, &dh, (void *)NULL);
    x = (Position)(sw/2 - dw/2);
    y = (Position)(sh/2 - dh/2);
    XtTranslateCoords(dp->top, x, y, &x, &y);
@@ -542,7 +548,7 @@ center_popup(w, client_data, call_data)
 printf("center_popup: doing XtVaSetValues of x and y...");
 fflush(stdout);
 */
-   XtVaSetValues(dp->shell, XtNx, x, XtNy, y, 0);
+   XtVaSetValues(dp->shell, XtNx, x, XtNy, y, (void *)NULL);
 printf("done.\n");
 fflush(stdout);
 }
@@ -569,7 +575,7 @@ ui_error
 #endif
 
    vsprintf(buf, msg, pvar);
-   XtVaSetValues(errors->text, XtNstring, buf, 0);
+   XtVaSetValues(errors->text, XtNstring, buf, (void *)NULL);
 
    XtPopup(errors->shell, XtGrabNone);
 }
