diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-13 10:41:14 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-11-13 14:18:15 -0800 |
commit | da0bcc8b8746cd3eb93f20d61145edc6a1040dda (patch) | |
tree | f7e66be154151fd3b51a566f32690c114912fbc8 | |
parent | 0ac060079060419bdfc4e54ba1a8643cffa1d7d3 (diff) |
Use C99 struct initialization
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | xrdb.c | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -400,10 +400,11 @@ static void GetEntriesString(Entries *entries, char *str) { if (str && *str) { - Buffer buff; + Buffer buff = { + .buff = str, + .used = strlen(str) + }; - buff.buff = str; - buff.used = strlen(str); GetEntries(entries, &buff, 1); } } @@ -701,15 +702,17 @@ DoScreenDefines(Display *display, int scrno, String *defs) static Entry * FindEntry(Entries *db, Buffer *b) { - Entries phoney; - Entry entry; + Entry entry = { + .usable = False, + .tag = NULL, + .value = NULL + }; + Entries phoney = { + .used = 0, + .room = 1, + .entry = &entry + }; - entry.usable = False; - entry.tag = NULL; - entry.value = NULL; - phoney.used = 0; - phoney.room = 1; - phoney.entry = &entry; GetEntries(&phoney, b, 1); if (phoney.used < 1) return NULL; |