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 /geometry.c | |
parent | 64761ee9424f755b84ab0ce02d13eda32d215a14 (diff) |
Use C99 struct initializers
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'geometry.c')
-rw-r--r-- | geometry.c | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -315,12 +315,14 @@ InitKeyInfo(KeyInfo * key, RowInfo * row, GeometryInfo * info) else { bzero(key, sizeof(KeyInfo)); + *key = (KeyInfo) { + .defs.defined = _GK_Default, + .defs.fileID = info->fileID, + .defs.merge = info->merge, + .defs.next = NULL, + .row = row + }; strcpy(key->name, "default"); - key->defs.defined = _GK_Default; - key->defs.fileID = info->fileID; - key->defs.merge = info->merge; - key->defs.next = NULL; - key->row = row; } return; } @@ -3660,14 +3662,15 @@ CompileGeometry(XkbFile * file, XkbFileInfo * result, unsigned merge) if (info.errorCount == 0) { XkbGeometryPtr geom; - XkbGeometrySizesRec sizes; - bzero(&sizes, sizeof(sizes)); - sizes.which = XkbGeomAllMask; - sizes.num_properties = info.nProps; - sizes.num_colors = 8; - sizes.num_shapes = info.nShapes; - sizes.num_sections = info.nSections; - sizes.num_doodads = info.nDoodads; + XkbGeometrySizesRec sizes = { + .which = XkbGeomAllMask, + .num_properties = info.nProps, + .num_colors = 8, + .num_shapes = info.nShapes, + .num_sections = info.nSections, + .num_doodads = info.nDoodads + }; + if (XkbAllocGeometry(xkb, &sizes) != Success) { WSGO("Couldn't allocate GeometryRec\n"); |