diff options
author | Walter Harms <xt4ever@web.de> | 2023-04-07 12:44:06 +0200 |
---|---|---|
committer | Walter Harms <xt4ever@web.de> | 2023-04-07 12:44:06 +0200 |
commit | d3409224807c5d779162f92465d58120c77b7840 (patch) | |
tree | 815d8637b48514303de6ba6cbb40027761242ee1 | |
parent | 07a58318ccd96c644b2748c57b285d5779fed0a8 (diff) |
stop const warnings
The warning occurs because XtSetArg() needs (String) aka char *
and the "string" is const char * these days.
-rw-r--r-- | widgets.c | 140 |
1 files changed, 70 insertions, 70 deletions
@@ -60,8 +60,8 @@ in this Software without prior written authorization from The Open Group. */ static Widget CreateTopArea ( Widget parent ); -static void CreateCommandMenu ( Widget parent, String toolkit ); -static void CreateTreeCommandMenu ( Widget parent, String toolkit ); +static void CreateCommandMenu ( Widget parent, const char *toolkit ); +static void CreateTreeCommandMenu ( Widget parent, const char *toolkit ); static void CreateResourceNameForm ( Widget parent, WNode * node ); static void SetToggleGroupLeaders ( WNode * node ); static void MakeBoxLookNice ( Widget dot, Widget star, Widget any, @@ -91,7 +91,7 @@ static Widget hPane = NULL; #define Offset(index) sizeof(String) * index #define res_entry(index, name, class) \ - {name, class, XtRString, sizeof(String), \ + {(String)name, (String)class, XtRString, sizeof(String), \ Offset(index), XtRString, (XtPointer)NULL} static XtResource resources[] = { @@ -259,7 +259,7 @@ static Boolean CM_set_insensitive = True; Widget CM_entries[NUM_CM_ENTRIES]; static void -CreateCommandMenu(Widget parent, String toolkit) +CreateCommandMenu(Widget parent, const char *toolkit) { Arg args[1]; @@ -269,7 +269,7 @@ CreateCommandMenu(Widget parent, String toolkit) parent, NULL, ZERO); /* set the menu name to the toolkit name */ - XtSetArg(args[0], XtNmenuName, toolkit); + XtSetArg(args[0], (String)XtNmenuName, toolkit); XtSetValues(cbutton, args, ONE); cmenu = XtCreatePopupShell(toolkit, simpleMenuWidgetClass, cbutton, @@ -338,7 +338,7 @@ static Boolean TM_set_insensitive = True; Widget TM_entries[NUM_TM_ENTRIES]; static void -CreateTreeCommandMenu(Widget parent, String toolkit) +CreateTreeCommandMenu(Widget parent, const char *toolkit) { int i, number; static struct tree_ops_menu tree_menu[] = { @@ -366,7 +366,7 @@ CreateTreeCommandMenu(Widget parent, String toolkit) tbutton = XtCreateManagedWidget("treeCommands", menuButtonWidgetClass, parent, NULL, ZERO); - XtSetArg(args[0], XtNmenuName, toolkit); + XtSetArg(args[0], (String)XtNmenuName, toolkit); XtSetValues(tbutton, args, ONE); tmenu = XtCreatePopupShell(toolkit, simpleMenuWidgetClass, tbutton, @@ -421,10 +421,10 @@ PrepareToLayoutTree(Widget tree) { Arg args[1]; - XtSetArg(args[0], XtNbackgroundPixmap, &old_pixmap); + XtSetArg(args[0], (String)XtNbackgroundPixmap, &old_pixmap); XtGetValues(XtParent(tree), args, ONE); - XtSetArg(args[0], XtNbackgroundPixmap, None); + XtSetArg(args[0], (String)XtNbackgroundPixmap, None); XtSetValues(XtParent(tree), args, ONE); XtUnmapWidget(tree); @@ -446,7 +446,7 @@ LayoutTree(Widget tree) XawTreeForceLayout(tree); XtMapWidget(tree); - XtSetArg(args[0], XtNbackgroundPixmap, old_pixmap); + XtSetArg(args[0], (String)XtNbackgroundPixmap, old_pixmap); XtSetValues(XtParent(tree), args, ONE); } @@ -567,18 +567,18 @@ CreateResourceNameForm(Widget parent, WNode *node) while (TRUE) { num_args = 0; - XtSetArg(args[num_args], XtNfromHoriz, name); num_args++; - XtSetArg(args[num_args], XtNradioData, "."); num_args++; + XtSetArg(args[num_args], (String)XtNfromHoriz, name); num_args++; + XtSetArg(args[num_args], (String)XtNradioData, "."); num_args++; dot = XtCreateManagedWidget("dot", toggleWidgetClass, form, args, num_args); XtAddCallback(dot, XtNcallback, ActivateWidgetsAndSetResourceString,(XtPointer) node); num_args = 0; - XtSetArg(args[num_args], XtNfromHoriz, class); num_args++; - XtSetArg(args[num_args], XtNfromVert, dot); num_args++; - XtSetArg(args[num_args], XtNradioGroup, dot); num_args++; - XtSetArg(args[num_args], XtNradioData, "*"); num_args++; + XtSetArg(args[num_args], (String)XtNfromHoriz, class); num_args++; + XtSetArg(args[num_args], (String)XtNfromVert, dot); num_args++; + XtSetArg(args[num_args], (String)XtNradioGroup, dot); num_args++; + XtSetArg(args[num_args], (String)XtNradioData, "*"); num_args++; star = XtCreateManagedWidget("star", toggleWidgetClass, form, args, num_args); XtAddCallback(star,XtNcallback, @@ -622,40 +622,40 @@ CreateResourceNameForm(Widget parent, WNode *node) old_info = new_info; num_args = 0; - XtSetArg(args[num_args], XtNfromHoriz, dot); num_args++; - XtSetArg(args[num_args], XtNlabel, names[i]); num_args++; - XtSetArg(args[num_args], XtNradioData, names[i]); num_args++; + XtSetArg(args[num_args], (String)XtNfromHoriz, dot); num_args++; + XtSetArg(args[num_args], (String)XtNlabel, names[i]); num_args++; + XtSetArg(args[num_args], (String)XtNradioData, names[i]); num_args++; name = XtCreateManagedWidget("name", toggleWidgetClass, form, args, num_args); XtAddCallback(name,XtNcallback, ActivateWidgetsAndSetResourceString,(XtPointer) node); num_args = 0; - XtSetArg(args[num_args], XtNfromHoriz, star); num_args++; - XtSetArg(args[num_args], XtNfromVert, name); num_args++; - XtSetArg(args[num_args], XtNlabel, classes[i]); num_args++; - XtSetArg(args[num_args], XtNradioGroup, name); num_args++; - XtSetArg(args[num_args], XtNradioData, classes[i]); num_args++; + XtSetArg(args[num_args], (String)XtNfromHoriz, star); num_args++; + XtSetArg(args[num_args], (String)XtNfromVert, name); num_args++; + XtSetArg(args[num_args], (String)XtNlabel, classes[i]); num_args++; + XtSetArg(args[num_args], (String)XtNradioGroup, name); num_args++; + XtSetArg(args[num_args], (String)XtNradioData, classes[i]); num_args++; class = XtCreateManagedWidget("class", toggleWidgetClass, form,args,num_args); XtAddCallback(class, XtNcallback, ActivateWidgetsAndSetResourceString,(XtPointer) node); num_args = 0; - XtSetArg(args[num_args], XtNfromHoriz, star); num_args++; - XtSetArg(args[num_args], XtNfromVert, class); num_args++; - XtSetArg(args[num_args], XtNradioData, "?"); num_args++; - XtSetArg(args[num_args], XtNradioGroup, name); num_args++; + XtSetArg(args[num_args], (String)XtNfromHoriz, star); num_args++; + XtSetArg(args[num_args], (String)XtNfromVert, class); num_args++; + XtSetArg(args[num_args], (String)XtNradioData, "?"); num_args++; + XtSetArg(args[num_args], (String)XtNradioGroup, name); num_args++; single = XtCreateManagedWidget("single", toggleWidgetClass, form, args, num_args); XtAddCallback(single,XtNcallback, ActivateWidgetsAndSetResourceString,(XtPointer) node); num_args = 0; - XtSetArg(args[num_args], XtNfromHoriz, any); num_args++; - XtSetArg(args[num_args], XtNfromVert, single); num_args++; - XtSetArg(args[num_args], XtNradioGroup, name); num_args++; - XtSetArg(args[num_args], XtNradioData, ANY_RADIO_DATA); num_args++; + XtSetArg(args[num_args], (String)XtNfromHoriz, any); num_args++; + XtSetArg(args[num_args], (String)XtNfromVert, single); num_args++; + XtSetArg(args[num_args], (String)XtNradioGroup, name); num_args++; + XtSetArg(args[num_args], (String)XtNradioData, ANY_RADIO_DATA); num_args++; any = XtCreateManagedWidget("any", toggleWidgetClass, form, args, num_args); @@ -686,7 +686,7 @@ SetToggleGroupLeaders(WNode *node) NameInfo *name; ResourceBoxInfo * res_box = node->resources->res_box; static Arg args[] = { - {XtNstate, (XtArgVal) TRUE} + {(String)XtNstate, (XtArgVal) TRUE} }; for (name = res_box->name_info; name != NULL; name = name->next) { @@ -727,18 +727,18 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single, */ num_args = 0; - XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[0])); num_args++; - XtSetArg(args[num_args], XtNwidth, &width_1); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, &(h_dist[0])); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, &width_1); num_args++; XtGetValues(dot, args, num_args); num_args = 0; - XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[1])); num_args++; - XtSetArg(args[num_args], XtNwidth, &width_2); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, &(h_dist[1])); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, &width_2); num_args++; XtGetValues(star, args, num_args); num_args = 0; - XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[2])); num_args++; - XtSetArg(args[num_args], XtNwidth, &any_width); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, &(h_dist[2])); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, &any_width); num_args++; XtGetValues(any, args, num_args); dot_star_width = (width_1 > width_2) ? width_1 : width_2; @@ -747,13 +747,13 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single, } num_args = 0; - XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, h_dist[0]); num_args++; XtSetValues(any, args, num_args); /* * Add a new arg, and continue... */ - XtSetArg(args[num_args], XtNwidth, dot_star_width); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, dot_star_width); num_args++; XtSetValues(star, args, num_args); XtSetValues(dot, args, num_args); @@ -765,21 +765,21 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single, */ num_args = 0; - XtSetArg(args[num_args], XtNwidth, &width_1); num_args++; - XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[0])); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, &width_1); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, &(h_dist[0])); num_args++; XtGetValues(name, args, num_args); num_args = 0; - XtSetArg(args[num_args], XtNwidth, &width_2); num_args++; - XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[1])); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, &width_2); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, &(h_dist[1])); num_args++; XtGetValues(class, args, num_args); if (width_2 > width_1) width_1 = width_2; if (h_dist[1] > h_dist[0]) h_dist[0] = h_dist[1]; num_args = 0; - XtSetArg(args[num_args], XtNwidth, &width_2); num_args++; - XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[1])); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, &width_2); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, &(h_dist[1])); num_args++; XtGetValues(single, args, num_args); name_class_width = (width_1 > width_2) ? width_1 : width_2; @@ -791,17 +791,17 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single, num_args = 0; if (endbox < 0) { any_width -= dot_star_width & 1; - XtSetArg(args[num_args], XtNhorizDistance, + XtSetArg(args[num_args], (String)XtNhorizDistance, h_dist[2] + (dot_star_width >> 1) + (dot_star_width & 1)); ++num_args; } - XtSetArg(args[num_args], XtNwidth, any_width); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, any_width); num_args++; XtSetValues(any, args, num_args); num_args = 0; - XtSetArg(args[num_args], XtNwidth, name_class_width); num_args++; - XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, name_class_width); num_args++; + XtSetArg(args[num_args], (String)XtNhorizDistance, h_dist[0]); num_args++; XtSetValues(name, args, num_args); XtSetValues(class, args, num_args); XtSetValues(single, args, num_args); @@ -836,11 +836,11 @@ CreateLists(Widget parent, WNode *node, char **names, char **cons_names) * list. */ if (!names) { - XtSetArg(args[num_args], XtNlist, noneList); num_args++; - XtSetArg(args[num_args], XtNnumberStrings, 1); num_args++; - XtSetArg(args[num_args], XtNsensitive, False); num_args++; + XtSetArg(args[num_args], (String)XtNlist, noneList); num_args++; + XtSetArg(args[num_args], (String)XtNnumberStrings, 1); num_args++; + XtSetArg(args[num_args], (String)XtNsensitive, False); num_args++; } - else { XtSetArg(args[num_args], XtNlist, names); num_args++; } + else { XtSetArg(args[num_args], (String)XtNlist, names); num_args++; } viewport = XtCreateManagedWidget("normalViewport", viewportWidgetClass, parent, NULL, 0); res_box->norm_list = XtCreateManagedWidget("namesList", listWidgetClass, @@ -855,7 +855,7 @@ CreateLists(Widget parent, WNode *node, char **names, char **cons_names) parent, NULL, ZERO); num_args = 0; - XtSetArg(args[num_args], XtNlist, cons_names); num_args++; + XtSetArg(args[num_args], (String)XtNlist, cons_names); num_args++; viewport = XtCreateManagedWidget("constraintViewport", viewportWidgetClass, parent, NULL, 0); res_box->cons_list = XtCreateManagedWidget("constraintList", @@ -889,19 +889,19 @@ CreateValueWidget(Widget parent, WNode *node) parent, NULL, ZERO); num_args = 0; - XtSetArg(args[num_args], XtNleft, XawChainLeft); num_args++; - XtSetArg(args[num_args], XtNright, XawChainLeft); num_args++; - XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++; - XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++; + XtSetArg(args[num_args], (String)XtNleft, XawChainLeft); num_args++; + XtSetArg(args[num_args], (String)XtNright, XawChainLeft); num_args++; + XtSetArg(args[num_args], (String)XtNtop, XawChainTop); num_args++; + XtSetArg(args[num_args], (String)XtNbottom, XawChainBottom); num_args++; label = XtCreateManagedWidget("valueLabel", labelWidgetClass, form, args, num_args); num_args = 0; - XtSetArg(args[num_args], XtNfromHoriz, label); num_args++; - XtSetArg(args[num_args], XtNleft, XawChainLeft); num_args++; - XtSetArg(args[num_args], XtNright, XawChainRight); num_args++; - XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++; - XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++; + XtSetArg(args[num_args], (String)XtNfromHoriz, label); num_args++; + XtSetArg(args[num_args], (String)XtNleft, XawChainLeft); num_args++; + XtSetArg(args[num_args], (String)XtNright, XawChainRight); num_args++; + XtSetArg(args[num_args], (String)XtNtop, XawChainTop); num_args++; + XtSetArg(args[num_args], (String)XtNbottom, XawChainBottom); num_args++; res_box->value_wid = XtCreateManagedWidget("valueText", asciiTextWidgetClass, form, args, num_args); @@ -929,9 +929,9 @@ PopupOnNode(WNode *node, Widget shell) Dimension width, height, bw; num_args = 0; - XtSetArg(args[num_args], XtNwidth, &width); num_args++; - XtSetArg(args[num_args], XtNheight, &height); num_args++; - XtSetArg(args[num_args], XtNborderWidth, &bw); num_args++; + XtSetArg(args[num_args], (String)XtNwidth, &width); num_args++; + XtSetArg(args[num_args], (String)XtNheight, &height); num_args++; + XtSetArg(args[num_args], (String)XtNborderWidth, &bw); num_args++; XtGetValues(node->widget, args, num_args); XtTranslateCoords(node->widget, (Position) (width/2 + bw), (Position) (height/2 + bw), @@ -962,8 +962,8 @@ PopupOnNode(WNode *node, Widget shell) y = 0; num_args = 0; - XtSetArg(args[num_args], XtNx, x); num_args++; - XtSetArg(args[num_args], XtNy, y); num_args++; + XtSetArg(args[num_args], (String)XtNx, x); num_args++; + XtSetArg(args[num_args], (String)XtNy, y); num_args++; XtSetValues(shell, args, num_args); XtPopup(shell, XtGrabNone); |