Commit 34e9c6b0 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Keyboard.c: clean/unify formatting

parent 0a211b6b
......@@ -647,14 +647,15 @@ N/A
if (keymap64 == NULL)
{
XFreeModifiermap(modifier_keymap);
return -1;
}
len = (max_keycode - min_keycode + 1) * mapWidth;
keymap = (KeySym *)malloc(len * sizeof(KeySym));
for(i = 0; i < len; ++i)
{
keymap[i] = keymap64[i];
}
XFree(keymap64);
}
......@@ -668,7 +669,6 @@ N/A
if (keymap == NULL)
{
XFreeModifiermap(modifier_keymap);
return -1;
}
......@@ -682,18 +682,24 @@ N/A
memset(modmap, 0, sizeof(modmap));
for (j = 0; j < 8; j++)
for(i = 0; i < modifier_keymap->max_keypermod; i++) {
{
for(i = 0; i < modifier_keymap->max_keypermod; i++)
{
CARD8 keycode;
if ((keycode =
modifier_keymap->
modifiermap[j * modifier_keymap->max_keypermod + i]))
{
modmap[keycode] |= 1<<j;
}
if (keycode > 0)
{
nxagentCheckModifierMasks(keycode, j);
}
}
}
XFreeModifiermap(modifier_keymap);
modifier_keymap = NULL;
......@@ -747,9 +753,6 @@ XkbError:
#ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: Using XKB extension.\n");
#endif
#ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: nxagentKeyboard is [%s].\n", nxagentKeyboard ? nxagentKeyboard : "NULL");
#endif
......@@ -779,10 +782,9 @@ XkbError:
{
for (i = 0; nxagentKeyboard[i] != '/' && nxagentKeyboard[i] != 0; i++);
if(nxagentKeyboard[i] == 0 || nxagentKeyboard[i + 1] == 0 || i == 0)
if (nxagentKeyboard[i] == 0 || nxagentKeyboard[i + 1] == 0 || i == 0)
{
ErrorF("Warning: Wrong keyboard type: %s.\n", nxagentKeyboard);
goto XkbError;
}
......@@ -873,8 +875,10 @@ XkbError:
* instead of a file.
*/
if (nxagentX2go == 1)
{
nxagentWriteKeyboardDir();
}
}
else
{
nxagentKeycodeConversionSetup();
......@@ -891,9 +895,11 @@ XkbError:
* we can drop this here.
*/
if (nxagentX2go == 1)
{
nxagentWriteKeyboardFile(nxagentRemoteRules, nxagentRemoteModel, nxagentRemoteLayout, nxagentRemoteVariant, nxagentRemoteOptions);
}
}
}
#ifdef DEBUG
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment