From 16df4dd92868ebc9663aae575df7dc3ce6e73797 Mon Sep 17 00:00:00 2001 From: Walter Harms Date: Fri, 7 Apr 2023 11:57:37 +0200 Subject: FIX const warning getting a bunch of warnings make i had to see the import ones. So reduce the warnings by adding a few "const" no problem for internals. For externals function add some casts. --- actions.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/actions.c b/actions.c index ad5cfcc..c603b3a 100644 --- a/actions.c +++ b/actions.c @@ -41,11 +41,17 @@ in this Software without prior written authorization from The Open Group. * Private data. */ +//struct ActionValues { +// String name; +// int type; +//}; + struct ActionValues { - String name; - int type; + const char * name; + int type; }; + static struct ActionValues select_values[] = { { "widget", (int) SelectWidget }, { "all", (int) SelectAll }, @@ -76,7 +82,7 @@ static void PopdownFileDialogAction ( Widget w, XEvent *event, static void ActionQuit ( Widget w, XEvent *event, String *params, Cardinal *num_params ); static WNode * FindTreeNodeFromWidget ( Widget w ); -static Boolean CheckAndFindEntry ( String action_name, +static Boolean CheckAndFindEntry ( const char *action_name, String * params, Cardinal num_params, struct ActionValues * table, Cardinal num_table, int * type ); @@ -245,12 +251,12 @@ ActionQuit(Widget w, XEvent *event, String *params, Cardinal *num_params) */ static XtActionsRec actions[] = { - {"EnableGetVal", EnableGetVal}, - {"Select", SelectAction}, - {"SVActiveEntry", ModifySVEntry}, - {"Relabel", RelabelAction}, - {"PopdownFileDialog", PopdownFileDialogAction}, - {"quit", ActionQuit} + {(String)"EnableGetVal", EnableGetVal}, + {(String)"Select", SelectAction}, + {(String)"SVActiveEntry", ModifySVEntry}, + {(String)"Relabel", RelabelAction}, + {(String)"PopdownFileDialog", PopdownFileDialogAction}, + {(String)"quit", ActionQuit} }; void @@ -279,7 +285,7 @@ SetApplicationActions(XtAppContext app_con) */ static Boolean -CheckAndFindEntry(String action_name, String *params, Cardinal num_params, +CheckAndFindEntry(const char *action_name, String *params, Cardinal num_params, struct ActionValues *table, Cardinal num_table, int *type) { char buf[BUFSIZ]; -- cgit v1.2.3