diff options
Diffstat (limited to 'symbols.c')
-rw-r--r-- | symbols.c | 30 |
1 files changed, 10 insertions, 20 deletions
@@ -123,11 +123,9 @@ FreeKeyInfo(KeyInfo * info) { info->numLevels[i] = 0; info->types[i] = None; - if (info->syms[i] != NULL) - free(info->syms[i]); + free(info->syms[i]); info->syms[i] = NULL; - if (info->acts[i] != NULL) - free(info->acts[i]); + free(info->acts[i]); info->acts[i] = NULL; } info->dfltType = None; @@ -256,8 +254,7 @@ InitSymbolsInfo(SymbolsInfo * info, XkbDescPtr xkb) static void FreeSymbolsInfo(SymbolsInfo * info) { - if (info->name) - free(info->name); + free(info->name); info->name = NULL; if (info->keys) { @@ -475,10 +472,8 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from) { if (into->numLevels[i] != 0) { - if (into->syms[i]) - free(into->syms[i]); - if (into->acts[i]) - free(into->acts[i]); + free(into->syms[i]); + free(into->acts[i]); } } *into = *from; @@ -787,8 +782,7 @@ HandleIncludeSymbols(IncludeStmt * stmt, (*hndlr) (rtrn, xkb, MergeOverride, &included); if (stmt->stmt != NULL) { - if (included.name != NULL) - free(included.name); + free(included.name); included.name = stmt->stmt; stmt->stmt = NULL; } @@ -1533,11 +1527,9 @@ SetExplicitGroup(SymbolsInfo * info, KeyInfo * key) for (int i = 1; i < XkbNumKbdGroups; i++) { key->numLevels[i] = 0; - if (key->syms[i] != NULL) - free(key->syms[i]); + free(key->syms[i]); key->syms[i] = (KeySym *) NULL; - if (key->acts[i] != NULL) - free(key->acts[i]); + free(key->acts[i]); key->acts[i] = (XkbAction *) NULL; key->types[i] = (Atom) 0; } @@ -1923,11 +1915,9 @@ PrepareKeyDef(KeyInfo * key) for (i = lastGroup; i > 0; i--) { key->numLevels[i] = 0; - if (key->syms[i] != NULL) - free(key->syms[i]); + free(key->syms[i]); key->syms[i] = (KeySym *) NULL; - if (key->acts[i] != NULL) - free(key->acts[i]); + free(key->acts[i]); key->acts[i] = (XkbAction *) NULL; key->types[i] = (Atom) 0; } |