diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-10 13:26:39 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-11 14:35:34 -0800 |
commit | 77b1efa1c83ad64d49d1e9c085d2a496580ce6f9 (patch) | |
tree | c121541999a472231178f6d9244266a5e953341d /keytypes.c | |
parent | 64761ee9424f755b84ab0ce02d13eda32d215a14 (diff) |
Use C99 struct initializers
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'keytypes.c')
-rw-r--r-- | keytypes.c | 48 |
1 files changed, 24 insertions, 24 deletions
@@ -987,26 +987,24 @@ static int HandleKeyTypeDef(KeyTypeDef * def, XkbDescPtr xkb, unsigned merge, KeyTypesInfo * info) { - KeyTypeInfo type; - - if (def->merge != MergeDefault) - merge = def->merge; - - type.defs.defined = 0; - type.defs.fileID = info->fileID; - type.defs.merge = merge; - type.defs.next = NULL; - type.dpy = info->dpy; - type.name = def->name; - type.mask = info->dflt.mask; - type.vmask = info->dflt.vmask; - type.groupInfo = info->dflt.groupInfo; - type.numLevels = 1; - type.nEntries = type.szEntries = 0; - type.entries = NULL; - type.szNames = 0; - type.lvlNames = NULL; - type.preserve = NULL; + KeyTypeInfo type = { + .defs.defined = 0, + .defs.fileID = info->fileID, + .defs.merge = (def->merge != MergeDefault) ? def->merge : merge, + .defs.next = NULL, + .dpy = info->dpy, + .name = def->name, + .mask = info->dflt.mask, + .vmask = info->dflt.vmask, + .groupInfo = info->dflt.groupInfo, + .numLevels = 1, + .nEntries = 0, + .szEntries = 0, + .entries = NULL, + .preserve = NULL, + .szNames = 0, + .lvlNames = NULL + }; /* Parse the actual content. */ if (!HandleKeyTypeBody(def->body, xkb, &type, info)) @@ -1132,10 +1130,12 @@ CopyDefToKeyType(XkbDescPtr xkb, XkbKeyTypePtr type, KeyTypeInfo * def) pre = (PreserveInfo *) pre->defs.next) { XkbKTMapEntryPtr match; - XkbKTMapEntryRec tmp; - tmp.mods.real_mods = pre->indexMods; - tmp.mods.vmods = pre->indexVMods; - tmp.level = 0; + XkbKTMapEntryRec tmp = { + .mods.real_mods = pre->indexMods, + .mods.vmods = pre->indexVMods, + .level = 0 + }; + AddMapEntry(xkb, def, &tmp, False, False); match = FindMatchingMapEntry(def, pre->indexMods, pre->indexVMods); if (!match) |