Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up symbolic key handling by initializing a passed-by-pointer variable #532

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions platforms/unix/vm-display-X11/sqUnixX11.c
Expand Up @@ -1869,22 +1869,17 @@ static int x2sqKeyCompositionInput(XKeyEvent *xevt, KeySym *symbolic)
{
case XLookupNone: /* still composing */
DCONV_PRINTERR("x2sqKey XLookupNone\n");
*symbolic= 0;
return -1;

case XLookupChars:
DCONV_PRINTERR("x2sqKey XLookupChars count %d\n", inputCount);
case XLookupBoth:
DCONV_PRINTERR("x2sqKey XLookupBoth count %d\n", inputCount);
if (inputCount == 0)
{
*symbolic= 0;
return lastKey= -1;
}
else if (inputCount == 1)
{
inputCount= 0;
*symbolic= 0;
return lastKey= inputBuf[0];
}
else
Expand All @@ -1906,7 +1901,6 @@ static int x2sqKeyCompositionInput(XKeyEvent *xevt, KeySym *symbolic)
lastKey= (inputCount > 0 ? inputBuf[inputCount - 1] : -1);
# endif

*symbolic= 0;
return -1; /* we've already recorded the key events */
}

Expand Down Expand Up @@ -3652,7 +3646,7 @@ handleEvent(XEvent *evt)
case KeyPress:
noteEventState(evt->xkey);
{
KeySym symbolic;
KeySym symbolic= 0;
int keyCode= x2sqKey(&evt->xkey, &symbolic);
int ucs4= xkeysym2ucs4(symbolic);
DCONV_PRINTERR("symbolic, keyCode, ucs4: %x, %d, %x\n", symbolic, keyCode, ucs4);
Expand Down