summaryrefslogtreecommitdiff
path: root/geometry.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-10 13:26:39 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 14:35:34 -0800
commit77b1efa1c83ad64d49d1e9c085d2a496580ce6f9 (patch)
treec121541999a472231178f6d9244266a5e953341d /geometry.c
parent64761ee9424f755b84ab0ce02d13eda32d215a14 (diff)
Use C99 struct initializers
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'geometry.c')
-rw-r--r--geometry.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/geometry.c b/geometry.c
index 46c84f0..49ed6dd 100644
--- a/geometry.c
+++ b/geometry.c
@@ -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");