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/TMkey.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/TMkey.c')
-rw-r--r-- | src/TMkey.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/TMkey.c b/src/TMkey.c index 4fd1eca..c1f8948 100644 --- a/src/TMkey.c +++ b/src/TMkey.c @@ -177,7 +177,6 @@ Boolean _XtComputeLateBindings( int i,j,ref; ModToKeysymTable* temp; XtPerDisplay perDisplay; - Boolean found; KeySym tempKeysym = NoSymbol; perDisplay = _XtGetPerDisplay(dpy); @@ -190,7 +189,7 @@ Boolean _XtComputeLateBindings( } _InitializeKeysymTables(dpy, perDisplay); for (ref=0; lateModifiers[ref].keysym; ref++) { - found = FALSE; + Boolean found = FALSE; for (i=0;i<8;i++) { temp = &(perDisplay->modsToKeysyms[i]); for (j=0;j<temp->count;j++){ @@ -250,13 +249,11 @@ Boolean _XtMatchUsingDontCareMods( Modifiers modifiers_return; KeySym keysym_return; Modifiers useful_mods; - int i, num_modbits; Modifiers computed = 0; Modifiers computedMask = 0; Boolean resolved = TRUE; Display *dpy = eventSeq->xev->xany.display; XtPerDisplay pd; - TMKeyContext tm_context; if (modMatch->lateModifiers != NULL) resolved = _XtComputeLateBindings(dpy, modMatch->lateModifiers, @@ -267,6 +264,9 @@ Boolean _XtMatchUsingDontCareMods( if ( (computed & computedMask) == (eventSeq->event.modifiers & computedMask) ) { + TMKeyContext tm_context; + int num_modbits; + int i; pd = _XtGetPerDisplay(dpy); tm_context = pd->tm_context; @@ -374,7 +374,6 @@ Boolean _XtMatchUsingStandardMods ( KeySym keysym_return; Modifiers computed= 0; Modifiers computedMask = 0; - Boolean resolved = TRUE; Display *dpy = eventSeq->xev->xany.display; XtPerDisplay pd = _XtGetPerDisplay(dpy); TMKeyContext tm_context = pd->tm_context; @@ -402,6 +401,8 @@ Boolean _XtMatchUsingStandardMods ( if ((typeMatch->eventCode & typeMatch->eventCodeMask) == (keysym_return & typeMatch->eventCodeMask)) { + Boolean resolved = TRUE; + if (modMatch->lateModifiers != NULL) resolved = _XtComputeLateBindings(dpy, modMatch->lateModifiers, &computed, &computedMask); @@ -671,7 +672,7 @@ void XtKeysymToKeycodeList( { XtPerDisplay pd; unsigned keycode; - int per, match; + int per; register KeySym *syms; register int i, j; KeySym lsym, usym; @@ -688,7 +689,7 @@ void XtKeysymToKeycodeList( for (syms = pd->keysyms, keycode = (unsigned) pd->min_keycode; (int)keycode <= pd->max_keycode; syms += per, keycode++) { - match = 0; + int match = 0; for (j = 0; j < per; j++) { if (syms[j] == keysym) { match = 1; |