summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter Harms <xt4ever@web.de>2023-04-07 11:57:37 +0200
committerWalter Harms <xt4ever@web.de>2023-04-07 11:57:37 +0200
commit16df4dd92868ebc9663aae575df7dc3ce6e73797 (patch)
treed10a02f013594f9fbf7e00479480f7903e0b9258
parente15440c5456c798e2ba5368afcd3b17c752cc44c (diff)
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.
-rw-r--r--actions.c26
1 files 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];