Fix build with gcc 15 --- a/Xc/BarGraf.c +++ b/Xc/BarGraf.c @@ -37,19 +37,28 @@ /* Declare widget methods */ static void ClassInitialize(); -static void Initialize(); -static void Redisplay(); -static void Destroy(); -static void Resize(); -static XtGeometryResult QueryGeometry(); -static Boolean SetValues(); +static void Initialize(Widget request, Widget new, ArgList, Cardinal*); +static void Redisplay(Widget w, XEvent* event, Region); +static void Destroy(Widget w); +static void Resize(Widget w); +static XtGeometryResult QueryGeometry( + Widget w, + XtWidgetGeometry *proposed, XtWidgetGeometry *answer); +static Boolean SetValues(Widget cur, Widget req, Widget new, ArgList, Cardinal*); /* Declare functions and variables private to this widget */ -static void Update_value(); -static void Draw_display(); -static void Get_value(); -static void Print_bounds(); +static void Draw_display( + BarGraphWidget w, + Display *display, + Drawable drawable, + GC gc); +static void Get_value( + XtPointer cdata, + XtIntervalId *id); /* unused */ +static void Print_bounds( + BarGraphWidget w, + char *upper, char *lower); @@ -221,9 +230,9 @@ method is called by Xt when the application calls XtCreateWidget(). *******************************************************************/ -static void Initialize(request, new) -BarGraphWidget request, new; -{ +static void Initialize(Widget request_arg, Widget new_arg, ArgList arg_list, Cardinal* cardinal) { + BarGraphWidget request = (BarGraphWidget)request_arg; + BarGraphWidget new = (BarGraphWidget)new_arg; /* Local variables */ Display *display = XtDisplay(new); @@ -244,7 +253,7 @@ DPRINTF(("BarGraph: executing Initialize...\n")); if (new->barGraph.interval >0) { new->barGraph.interval_id = - XtAppAddTimeOut(XtWidgetToApplicationContext(new), + XtAppAddTimeOut(XtWidgetToApplicationContext(new_arg), new->barGraph.interval, Get_value, new); } @@ -277,7 +286,7 @@ DPRINTF(("BarGraph: executing Initialize...\n")); /* Initialize private instance variables. */ /* Set the initial geometry of the BarGraph elements. */ - Resize(new); + Resize(new_arg); DPRINTF(("BarGraph: done Initialize\n")); @@ -298,10 +307,9 @@ and the Scale. All drawing takes place within the widget's window *******************************************************************/ -static void Redisplay(w, event) -BarGraphWidget w; -XExposeEvent *event; -{ +static void Redisplay(Widget ww, XEvent* xevent, Region r) { +BarGraphWidget w = (BarGraphWidget) w; +XExposeEvent *event = (XExposeEvent*) xevent; /* Local variables */ int j; char upper[30], lower[30]; @@ -311,14 +319,14 @@ char upper[30], lower[30]; * draw into a window that is not mapped. Realizing a widget doesn't * mean its mapped, but this call will work for most Window Managers. */ - if (!XtIsRealized(w)) + if (!XtIsRealized(ww)) return; DPRINTF(("BarGraph: executing Redisplay\n")); /* Draw the 3D rectangle background for the BarGraph. */ XSetClipMask(XtDisplay(w), w->control.gc, None); - Rect3d(w, XtDisplay(w), XtWindow(w), w->control.gc, + Rect3d((ControlWidget)w, XtDisplay(w), XtWindow(w), w->control.gc, 0, 0, w->core.width, w->core.height, RAISED); /* Draw the Label string. */ @@ -389,7 +397,7 @@ DPRINTF(("BarGraph: executing Redisplay\n")); /* Draw the Bar indicator border */ - Rect3d(w, XtDisplay(w), XtWindow(w), w->control.gc, + Rect3d((ControlWidget)w, XtDisplay(w), XtWindow(w), w->control.gc, w->barGraph.bar.x - w->control.shade_depth, w->barGraph.bar.y - w->control.shade_depth, w->barGraph.bar.width + (2 * w->control.shade_depth), @@ -397,7 +405,7 @@ DPRINTF(("BarGraph: executing Redisplay\n")); /* Draw the Value Box */ if (w->barGraph.value_visible == True) - Rect3d(w, XtDisplay(w), XtWindow(w), w->control.gc, + Rect3d((ControlWidget)w, XtDisplay(w), XtWindow(w), w->control.gc, w->value.value_box.x - w->control.shade_depth, w->value.value_box.y - w->control.shade_depth, w->value.value_box.width + (2 * w->control.shade_depth), @@ -425,9 +433,11 @@ require re-drawing the widget, return True. *******************************************************************/ -static Boolean SetValues(cur, req, new) -BarGraphWidget cur, req, new; -{ +static Boolean SetValues(Widget cur_arg, Widget req_arg, + Widget new_arg, ArgList arg_list, Cardinal* c) { + BarGraphWidget cur = (BarGraphWidget) cur_arg; + BarGraphWidget req = (BarGraphWidget) req_arg; + BarGraphWidget new = (BarGraphWidget) new_arg; /* Local variables */ Boolean do_redisplay = False; @@ -460,7 +470,7 @@ DPRINTF(("BarGraph: executing SetValues \n")); XtRemoveTimeOut (cur->barGraph.interval_id); if (new->barGraph.interval > 0) new->barGraph.interval_id = - XtAppAddTimeOut(XtWidgetToApplicationContext(new), + XtAppAddTimeOut(XtWidgetToApplicationContext(new_arg), new->barGraph.interval, Get_value, new); } @@ -519,9 +529,8 @@ window. *******************************************************************/ -static void Resize(w) -BarGraphWidget w; -{ +static void Resize(Widget ww) { +BarGraphWidget w = (BarGraphWidget) ww; /* Local variables */ int j; int seg_spacing; @@ -563,7 +572,7 @@ DPRINTF(("BarGraph: executing Resize\n")); } /* Set the position of the displayed value within the Value Box. */ - Position_val(w); + Position_val((ValueWidget)w); /* Set the new label location. */ w->barGraph.lbl.x = (w->core.width / 2 + 0.5) - @@ -695,10 +704,11 @@ size. *******************************************************************/ -static XtGeometryResult QueryGeometry(w, proposed, answer) -BarGraphWidget w; -XtWidgetGeometry *proposed, *answer; +static XtGeometryResult QueryGeometry( +Widget ww, +XtWidgetGeometry *proposed, XtWidgetGeometry *answer) { + BarGraphWidget w = (BarGraphWidget) ww; /* Set the request mode mask for the returned answer. */ answer->request_mode = CWWidth | CWHeight; @@ -734,9 +744,9 @@ any server resources acquired during the life of the widget. *******************************************************************/ -static void Destroy(w) -BarGraphWidget w; +static void Destroy(Widget ww) { + BarGraphWidget w = (BarGraphWidget)ww; if (w->barGraph.interval > 0) XtRemoveTimeOut (w->barGraph.interval_id); @@ -758,10 +768,11 @@ get the latest value and updates the BarGraph display accordingly. *******************************************************************/ -static void Get_value(client_data, id) -caddr_t client_data; -XtIntervalId *id; /* unused */ +static void Get_value( + XtPointer cdata, + XtIntervalId *id) /* unused */ { +caddr_t client_data = (caddr_t) cdata; /* Local variables */ static XcCallData call_data; BarGraphWidget w = (BarGraphWidget)client_data; @@ -800,7 +811,7 @@ BarGraphWidget w = (BarGraphWidget)client_data; w->value.val.fval = call_data.value.fval; } - if (XtIsRealized(w)) + if (XtIsRealized((Widget)w)) Draw_display(w, XtDisplay(w), XtWindow(w), w->control.gc); @@ -818,9 +829,9 @@ The application passes the new value to be updated with. *******************************************************************/ -void XcBGUpdateValue(w, value) -BarGraphWidget w; -XcVType *value; +void XcBGUpdateValue( + BarGraphWidget w, + XcVType *value) { /* Local variables */ @@ -840,7 +851,7 @@ XcVType *value; w->value.val.fval = value->fval; } - if (XtIsRealized(w)) + if (XtIsRealized((Widget)w)) Draw_display(w, XtDisplay(w), XtWindow(w), w->control.gc); } @@ -858,11 +869,11 @@ Value Box. *******************************************************************/ -static void Draw_display( w, display, drawable, gc) -BarGraphWidget w; -Display *display; -Drawable drawable; -GC gc; +static void Draw_display( + BarGraphWidget w, + Display *display, + Drawable drawable, + GC gc) { /* Local variables */ char *temp; @@ -922,7 +933,7 @@ float range, dim; temp = Print_value(w->value.datatype, &w->value.val, w->value.decimals); - Position_val(w); + Position_val((ValueWidget)w); XDrawString(display, drawable, gc, w->value.vp.x, w->value.vp.y, temp, strlen(temp)); @@ -945,9 +956,9 @@ purposes. *******************************************************************/ -static void Print_bounds(w, upper, lower) -BarGraphWidget w; -char *upper, *lower; +static void Print_bounds( +BarGraphWidget w, +char *upper, char *lower) { if (w->value.datatype == XcLval) --- a/Xc/BarGraf.h +++ b/Xc/BarGraf.h @@ -16,6 +16,7 @@ /* Superclass header */ #include +#include "Xc.h" /* @@ -40,7 +41,9 @@ typedef struct _BarGraphRec *BarGraphWidget; /* Widget functions */ -extern void XcBGUpdateValue(); +extern void XcBGUpdateValue( + BarGraphWidget w, + XcVType *value); #endif --- a/Xc/Control.c +++ b/Xc/Control.c @@ -45,9 +45,9 @@ static char shade_bits[] = { 0x02, 0x01}; /* Declare widget methods */ -static void Initialize(); -static void Destroy(); -static Boolean SetValues(); +static void Initialize(Widget request, Widget new, ArgList, Cardinal*); +static void Destroy(Widget w); +static Boolean SetValues(Widget cur, Widget req, Widget new, ArgList, Cardinal*); @@ -164,9 +164,9 @@ method is called by Xt when the application calls XtCreateWidget(). *******************************************************************/ -static void Initialize(request, new) -ControlWidget request, new; -{ +static void Initialize(Widget request_arg, Widget new_arg, ArgList arg_list, Cardinal* cardinal) { + ControlWidget request = (ControlWidget)request_arg; + ControlWidget new = (ControlWidget)new_arg; /* Local variables */ XColor bg, exact; Display *display = XtDisplay(new); @@ -280,9 +280,11 @@ require re-drawing the widget, return True. *******************************************************************/ -static Boolean SetValues(cur, req, new) -ControlWidget cur, req, new; -{ +static Boolean SetValues(Widget cur_arg, Widget req_arg, + Widget new_arg, ArgList arg_list, Cardinal* c) { + ControlWidget cur = (ControlWidget) cur_arg; + ControlWidget req = (ControlWidget) req_arg; + ControlWidget new = (ControlWidget) new_arg; /* Local variables */ Boolean do_redisplay = False; @@ -331,9 +333,8 @@ any server resources acquired during the life of the widget. *******************************************************************/ -static void Destroy(w) -ControlWidget w; -{ +static void Destroy(Widget ww) { + ControlWidget w = (ControlWidget)ww; if (w->control.gc) XFreeGC(XtDisplay(w), w->control.gc); @@ -360,24 +361,18 @@ Boolean Point_In_Rect( /* RETURN: True or False; identifies whether * rectangle. */ - x, /* INPUT: The x coordinate of the point */ + int x, /* INPUT: The x coordinate of the point */ - y, /* INPUT: The y coordinate of the point */ + int y, /* INPUT: The y coordinate of the point */ - rect_x, /* INPUT: The x coordinate of the rectangle */ + int rect_x, /* INPUT: The x coordinate of the rectangle */ - rect_y, /* INPUT: The y coordinate of the rectangle */ + int rect_y, /* INPUT: The y coordinate of the rectangle */ - width, /* INPUT: The rectangle's width */ + int width, /* INPUT: The rectangle's width */ - height) /* INPUT: The rectangle's height */ + int height) /* INPUT: The rectangle's height */ -int x, - y, - rect_x, - rect_y, - width, - height; { /* Check x coordinate first */ if ((x < rect_x) || (x > (rect_x + width))) @@ -406,14 +401,14 @@ derived shades (calculated in the Initialize method) to produce the *******************************************************************/ -void Rect3d(w, display, drawable, gc, x, y, width, height, type) -ControlWidget w; -Display *display; -Drawable drawable; -GC gc; -int x, y; -unsigned int width, height; -Type3d type; +void Rect3d( + ControlWidget w, + Display *display, + Drawable drawable, + GC gc, + int x, int y, + unsigned int width, unsigned int height, + Type3d type) { int j; unsigned long shade1, shade2; @@ -471,15 +466,15 @@ derived shades (calculated in the Initialize method) to produce the *******************************************************************/ -void VarRect3d(w, display, drawable, gc, x, y, width, height, type, depth) -ControlWidget w; -Display *display; -Drawable drawable; -GC gc; -int x, y; -unsigned int width, height; -Type3d type; -int depth; +void VarRect3d( + ControlWidget w, + Display *display, + Drawable drawable, + GC gc, + int x, int y, + unsigned int width, unsigned int height, + Type3d type, + int depth) { int j = ((depth < 1) ? 1 : depth); unsigned long shade1, shade2; @@ -533,8 +528,8 @@ resource string conversion routines. *******************************************************************/ -void ToLower(source, dest) -char *source, *dest; +void +ToLower (char *source, char *dest) { /* Local variables */ char ch; @@ -562,11 +557,13 @@ XcROrient representation type. *******************************************************************/ -void CvtStringToOrient(args, num_args, fromVal, toVal) -XrmValuePtr args; /* unused */ -Cardinal *num_args; /* unused */ -XrmValuePtr fromVal; -XrmValuePtr toVal; +void +CvtStringToOrient ( + XrmValuePtr args, /* unused */ + Cardinal *num_args, /* unused */ + XrmValuePtr fromVal, + XrmValuePtr toVal +) { /* Local variables */ static XcOrient orient; @@ -614,14 +611,14 @@ derived shades (calculated in Control's Initialize method) to produce the *******************************************************************/ -void Arrow3d(w, display, drawable, gc, bounds, orientation, type) -ControlWidget w; -Display *display; -Drawable drawable; -GC gc; -XRectangle *bounds; -ArrowType orientation; -Type3d type; +void Arrow3d( + ControlWidget w, + Display *display, + Drawable drawable, + GC gc, + XRectangle *bounds, + ArrowType orientation, + Type3d type) { /* Local variables */ int i, j, adjustment = w->control.shade_depth+1; --- a/Xc/Control.h +++ b/Xc/Control.h @@ -62,12 +62,42 @@ typedef struct _ControlRec *ControlWidget; /* Declaration of widget class functions */ -extern Boolean Point_In_Rect(); -extern void Rect3d(); -extern void VarRect3d(); -extern void Arrow3d(); -extern void ToLower(); -extern void CvtStringToOrient(); +extern Boolean Point_In_Rect( + int x, /* INPUT: The x coordinate of the point */ + int y, /* INPUT: The y coordinate of the point */ + int rect_x, /* INPUT: The x coordinate of the rectangle */ + int rect_y, /* INPUT: The y coordinate of the rectangle */ + int width, /* INPUT: The rectangle's width */ + int height); /* INPUT: The rectangle's height */ +extern void Rect3d(ControlWidget w, + Display *display, + Drawable drawable, + GC gc, + int x, int y, + unsigned int width, unsigned int height, + Type3d type); +extern void VarRect3d(ControlWidget w, + Display *display, + Drawable drawable, + GC gc, + int x, int y, + unsigned int width, unsigned int height, + Type3d type, + int depth); +extern void Arrow3d(ControlWidget w, + Display *display, + Drawable drawable, + GC gc, + XRectangle *bounds, + ArrowType orientation, + Type3d type); +extern void ToLower (char *source, char *dest); +extern void CvtStringToOrient( + XrmValuePtr args, /* unused */ + Cardinal *num_args, /* unused */ + XrmValuePtr fromVal, + XrmValuePtr toVal + ); #endif /* CONTROL_H */ --- a/Xc/Value.c +++ b/Xc/Value.c @@ -35,13 +35,25 @@ /* Declare widget methods */ static void ClassInitialize(); -static void Initialize(); -static Boolean SetValues(); +static void Initialize(Widget request, Widget new, ArgList, Cardinal*); +static Boolean SetValues(Widget cur, Widget req, Widget new, ArgList, Cardinal*); /* Declare widget class functions */ -static void CvtStringToDType(); -static void CvtStringToVType(); -static void CvtStringToValueJustify(); +static void CvtStringToDType( + XrmValuePtr args, /* unused */ + Cardinal *num_args, /* unused */ + XrmValuePtr fromVal, + XrmValuePtr toVal); +static void CvtStringToVType( + XrmValuePtr args, /* unused */ + Cardinal *num_args, /* unused */ + XrmValuePtr fromVal, + XrmValuePtr toVal); +static void CvtStringToValueJustify( + XrmValuePtr args, /* unused */ + Cardinal *num_args, /* unused */ + XrmValuePtr fromVal, + XrmValuePtr toVal); @@ -224,9 +236,9 @@ widget variables and structures. *******************************************************************/ -static void Initialize(request, new) -ValueWidget request, new; -{ +static void Initialize(Widget request_arg, Widget new_arg, ArgList arg_list, Cardinal* cardinal) { + ValueWidget request = (ValueWidget)request_arg; + ValueWidget new = (ValueWidget)new_arg; DPRINTF(("Value: executing Initialize \n")); /* @@ -324,10 +336,11 @@ settings set with XtSetValues. If a resource is changed that would require re-drawing the widget, return True. *******************************************************************/ - -static Boolean SetValues(cur, req, new) -ValueWidget cur, req, new; -{ +static Boolean SetValues(Widget cur_arg, Widget req_arg, + Widget new_arg, ArgList arg_list, Cardinal* c) { + ValueWidget cur = (ValueWidget) cur_arg; + ValueWidget req = (ValueWidget) req_arg; + ValueWidget new = (ValueWidget) new_arg; /* Local variables */ Boolean do_redisplay = False; @@ -454,11 +467,11 @@ XtRDType representation type. *******************************************************************/ -static void CvtStringToDType(args, num_args, fromVal, toVal) -XrmValuePtr args; /* unused */ -Cardinal *num_args; /* unused */ -XrmValuePtr fromVal; -XrmValuePtr toVal; +static void CvtStringToDType( +XrmValuePtr args, /* unused */ +Cardinal *num_args, /* unused */ +XrmValuePtr fromVal, +XrmValuePtr toVal) { /* Local variables */ static XcDType datatype; @@ -510,11 +523,11 @@ XtRVType representation type. *******************************************************************/ -static void CvtStringToVType(args, num_args, fromVal, toVal) -XrmValuePtr args; /* unused */ -Cardinal *num_args; /* unused */ -XrmValuePtr fromVal; -XrmValuePtr toVal; +static void CvtStringToVType( +XrmValuePtr args, /* unused */ +Cardinal *num_args, /* unused */ +XrmValuePtr fromVal, +XrmValuePtr toVal) { /* Local variables */ long num; @@ -564,11 +577,11 @@ XcRValueJustify representation type. *******************************************************************/ -static void CvtStringToValueJustify(args, num_args, fromVal, toVal) -XrmValuePtr args; /* unused */ -Cardinal *num_args; /* unused */ -XrmValuePtr fromVal; -XrmValuePtr toVal; +static void CvtStringToValueJustify( +XrmValuePtr args, /* unused */ +Cardinal *num_args, /* unused */ +XrmValuePtr fromVal, +XrmValuePtr toVal) { /* Local variables */ static XcValueJustify val_justify; @@ -618,8 +631,7 @@ correlates it to the destination range, returning the correlated value. *******************************************************************/ -float Correlate(from_val, from_range, to_range) -float from_val, from_range, to_range; +float Correlate(float from_val, float from_range, float to_range) { /* Local variables */ float percent, result; @@ -642,10 +654,10 @@ datatype and returns a pointer to it. *********************************************************************/ -char *Print_value(datatype, value, decimals) -XcDType datatype; -XcVType *value; -int decimals; +char *Print_value( + XcDType datatype, + XcVType *value, + int decimals) { static char string[40]; @@ -671,8 +683,7 @@ on the XcNvalueJustify resource setting. *********************************************************************/ -void Position_val(w) -ValueWidget w; +void Position_val(ValueWidget w) { /* Local variables */ char *val_string; --- a/Xc/Value.h +++ b/Xc/Value.h @@ -14,7 +14,7 @@ #ifndef VALUE_H #define VALUE_H - +#include "Xc.h" /* Class record declarations */ @@ -26,9 +26,12 @@ typedef struct _ValueRec *ValueWidget; /* Widget class functions. */ -extern float Correlate(); -extern char *Print_value(); -extern void Position_val(); +extern float Correlate(float from_val, float from_range, float to_range); +extern char *Print_value( + XcDType datatype, + XcVType *value, + int decimals); +extern void Position_val(ValueWidget w); #endif /* VALUE_H */ --- a/src/display.c +++ b/src/display.c @@ -122,7 +122,7 @@ void TilesLeft() } /* for the timer */ -void Click() +void Click(XtPointer a, XtIntervalId* b) { if (!finished_go) { @@ -201,7 +201,7 @@ void MessageOne(int ply,char *mess) XtVaSetValues(message[ply],XtNlabel,mess,NULL); } -void EndDelay() +void EndDelay(XtPointer a, XtIntervalId* b) { waiting=False; } @@ -224,9 +224,12 @@ void ProcessEvent() XtAppProcessEvent(app_context,msk); } +#include "../Xc/Xc.h" void UpdateComp(int perc) { /* on computer's move, update Xc widget with % completed */ /* printf("Update value = %i\n",perc);*/ - XcBGUpdateValue(compw[curr_player],&perc); + XcVType x; + x.lval = perc; + XcBGUpdateValue((BarGraphWidget)compw[curr_player],&x); } --- a/src/globals.h +++ b/src/globals.h @@ -2,6 +2,9 @@ globals.h - external variables */ +#ifndef GLOBALS_H +#define GLOBALS_H + #include "xglobals.h" extern int pauseflag; @@ -78,3 +81,5 @@ extern void findv_blank(int numblanks,char word[16],int xpos,int ypos, extern void checkh_words(int x, int y,char best[16],int *bestscore,int numlett); extern void checkv_words(int x, int y,char best[16],int *bestscore,int numlett); extern void comp_move(int *compscore,int level); + +#endif --- a/src/mess.c +++ b/src/mess.c @@ -26,7 +26,7 @@ Widget messmain[MAXPLAYERS],messentry[MAXPLAYERS],messf[MAXPLAYERS]; Widget messdismiss[MAXPLAYERS],ping[MAXPLAYERS]; XawTextPosition pos=0; -void KeyRedirect(Widget w, XEvent *event,String *params,Cardinal num_params) +void KeyRedirectM(Widget w, XEvent *event,String *params,Cardinal* num_params) { int dnum; @@ -48,8 +48,8 @@ void AddChar(Widget w, char *c) XawTextSetInsertionPoint(w,pos); } -void DoMessage(Widget w,XExposeEvent *event,String *params,Cardinal *num_params) -{ +void DoMessage(Widget w, XEvent *even, String *params, Cardinal *num_params) { + XExposeEvent* event = (XExposeEvent*)even; String line; int dnum,i; @@ -99,7 +99,7 @@ void CreateMess(int dnum) { static XtActionsRec actions[] = { {"DoMessage", DoMessage}, - {"KeyRedirect", KeyRedirect}, + {"KeyRedirect", KeyRedirectM}, }; String trans1 = "#override\n\ : KeyRedirect()"; --- a/src/popup.c +++ b/src/popup.c @@ -167,7 +167,7 @@ void RulesPopup(int dnum) * Showbag Popup * *****************/ -void ShowBagUpdate(Widget w) +void ShowBagUpdate(Widget w, XtPointer a, XtPointer b) { char numletters[30]; @@ -240,7 +240,7 @@ void ShowBagPopup(int dnum) XtUnmapWidget(showbagtop[dnum]); else { - ShowBagUpdate(showbagupdate[dnum]); + ShowBagUpdate(showbagupdate[dnum], NULL, NULL); XtMapWidget(showbagtop[dnum]); } } @@ -249,7 +249,7 @@ void ShowBagPopup(int dnum) * Selectbag Popup * *******************/ -void SelectBagUpdate(Widget w) +void SelectBagUpdate(Widget w, XtPointer a, XtPointer b) { char numletters[30]; @@ -322,7 +322,7 @@ void SelectBagPopup(int dnum) XtUnmapWidget(selectbagtop[dnum]); else { - SelectBagUpdate(selectbagupdate[dnum]); + SelectBagUpdate(selectbagupdate[dnum], NULL, NULL); XtMapWidget(selectbagtop[dnum]); } } @@ -331,7 +331,7 @@ void SelectBagPopup(int dnum) * Checkword Popup * *******************/ -void CheckwordUpdate(Widget w) +void CheckwordUpdate(Widget w, XtPointer a, XtPointer b) { int dnum, i; char *word; @@ -348,7 +348,7 @@ void CheckwordUpdate(Widget w) wordsearch(upword)? PROMPT[VALIDWORD] : PROMPT[INVALIDWORD], NULL); } -void CheckwordReset(Widget w) +void CheckwordReset(Widget w, XtPointer a, XtPointer b) { int dnum; char *word; @@ -376,7 +376,7 @@ void CheckwordReset(Widget w) if (ret) { XtVaSetValues(checkwordmain[dnum], XtNstring, newword, NULL); - CheckwordUpdate(checkwordupdate[dnum]); + CheckwordUpdate(checkwordupdate[dnum], NULL, NULL); } } @@ -449,7 +449,7 @@ void CheckwordPopup(int dnum) * Placeword Popup * *******************/ -void PlacewordUpdate(Widget w) +void PlacewordUpdate(Widget w, XtPointer a, XtPointer b) { } @@ -498,7 +498,7 @@ void PlacewordPopup(int dnum) XtUnmapWidget(placewordtop[dnum]); else { - PlacewordUpdate(placewordupdate[dnum]); + PlacewordUpdate(placewordupdate[dnum], NULL, NULL); XtMapWidget(placewordtop[dnum]); } } @@ -507,7 +507,7 @@ void PlacewordPopup(int dnum) * Listword Popup * ******************/ -void ListwordUpdate(Widget w) +void ListwordUpdate(Widget w, XtPointer a, XtPointer b) { } @@ -556,7 +556,7 @@ void ListwordPopup(int dnum) XtUnmapWidget(listwordtop[dnum]); else { - ListwordUpdate(listwordupdate[dnum]); + ListwordUpdate(listwordupdate[dnum], NULL, NULL); XtMapWidget(listwordtop[dnum]); } } @@ -566,7 +566,7 @@ void ListwordPopup(int dnum) * Suggestion Popup * ********************/ -void SuggestionUpdate(Widget w) +void SuggestionUpdate(Widget w, XtPointer a, XtPointer b) { } @@ -615,7 +615,7 @@ void SuggestionPopup(int dnum) XtUnmapWidget(suggestiontop[dnum]); else { - SuggestionUpdate(suggestionupdate[dnum]); + SuggestionUpdate(suggestionupdate[dnum], NULL, NULL); XtMapWidget(suggestiontop[dnum]); } } --- a/src/setup.c +++ b/src/setup.c @@ -16,6 +16,7 @@ #include "scrab.h" #include "globals.h" +#include "xglobals.h" #include "slate_green.xpm" #define TIME_INTS 7 @@ -27,12 +28,11 @@ static char * helpstring = Dan R. Greening, Didier Tallot, Phill Everson, and Martyn Shortley.\n\ \n"; -void ShowHelp(); +void ShowHelp(Widget w, XtPointer client_data, XtPointer csetup_data); void Mode(); -void Start(); -void Quit(); -void Tog_vis(); -void Cycle(); +void Start(Widget w, XtPointer client_data, XtPointer csetup_data); +void Tog_vis(Widget w, XtPointer client_data, XtPointer csetup_data); +void Cycle(Widget w, XtPointer client_data, XtPointer csetup_data); char app_def_file[256]="XScrabble"; @@ -63,7 +63,12 @@ static String other_trans = "#override\n\ char lang_str[80] = ""; -void Quit() +void Quit(Widget w, XEvent* e, String* s, Cardinal* c) +{ + XtDestroyApplicationContext(app_context); + exit(0); +} +void Quit4(Widget w, XtPointer a, XtPointer b) { XtDestroyApplicationContext(app_context); exit(0); @@ -103,7 +108,7 @@ void MakeCurrent() XawTextDisplayCaret(curr_entry,True); } -void KeyRedirect(Widget w, XEvent *event,String *params,Cardinal num_params) +void KeyRedirect(Widget w, XEvent *event,String *params,Cardinal* num_params) { if (w!=curr_entry) { @@ -112,7 +117,7 @@ void KeyRedirect(Widget w, XEvent *event,String *params,Cardinal num_params) } } -void Move(Widget w, XEvent *event,String *params,Cardinal num_params) +void Move(Widget w, XEvent *event,String *params,Cardinal* num_params) { int wnum=0,i,isname=True; Boolean istab = (params[0][0] == 't'); @@ -337,7 +342,7 @@ void main(int argc,char **argv) XtAddCallback(help,XtNcallback,ShowHelp,topLevel); XtAddCallback(start,XtNcallback,Start,topLevel); XtAddCallback(sload,XtNcallback,Start,topLevel); - XtAddCallback(quit,XtNcallback,Quit,topLevel); + XtAddCallback(quit,XtNcallback,Quit4,topLevel); for (ply=0; ply