diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-05-08 21:15:08 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-05-18 06:41:36 -0400 |
commit | 91f1119528b57f94d178f0cfb12efafd0c90bbc9 (patch) | |
tree | b98c68ebf25eb4c477fa99c2548d2c8a4804a4c0 /src/TMaction.c | |
parent | 43a65ae23370e0f7fb427e96c6d9037d8fa1af35 (diff) |
fixes cppcheck "style" warnings (mostly variable-scope)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/TMaction.c')
-rw-r--r-- | src/TMaction.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/TMaction.c b/src/TMaction.c index a462e2c..5dd380b 100644 --- a/src/TMaction.c +++ b/src/TMaction.c @@ -164,7 +164,6 @@ static void ReportUnboundActions( Cardinal num_params = 1; char* message; char messagebuf[1000]; - String params[1]; register Cardinal num_chars = 0; register Cardinal i, j; XtActionProc *procs; @@ -190,6 +189,8 @@ static void ReportUnboundActions( return; message = XtStackAlloc (num_chars + 1, messagebuf); if (message != NULL) { + String params[1]; + *message = '\0'; num_unbound = 0; stateTree = (TMSimpleStateTree)xlations->stateTreeTbl[0]; @@ -225,12 +226,12 @@ static CompiledAction *SearchActionTable( CompiledActionTable actionTable, Cardinal numActions) { - register int i, left, right; + int left, right; left = 0; right = (int)numActions - 1; while (left <= right) { - i = (left + right) >> 1; + int i = (left + right) >> 1; if (signature < actionTable[i].signature) right = i - 1; else if (signature > actionTable[i].signature) @@ -785,9 +786,7 @@ void XtGetActionList( XtActionList* actions_return, Cardinal* num_actions_return) { - XtActionList list; CompiledActionTable table; - int i; *actions_return = NULL; *num_actions_return = 0; @@ -803,10 +802,13 @@ void XtGetActionList( } *num_actions_return = widget_class->core_class.num_actions; if (*num_actions_return) { - list = *actions_return = (XtActionList) + XtActionList list = *actions_return = (XtActionList) __XtMalloc((Cardinal)((size_t)*num_actions_return * sizeof(XtActionsRec))); + table = GetClassActions(widget_class); + if (table != NULL) { + int i; for (i= (int)(*num_actions_return); --i >= 0; list++, table++) { list->string = XrmQuarkToString(table->signature); list->proc = table->proc; |