From 8de6cf335b27e89866d9b443f7f44f33ace8fad9 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 25 Jan 2013 13:42:28 -0800 Subject: Use C99 struct initializer for parseRec in GetFontNames() Signed-off-by: Alan Coopersmith --- xfontsel.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xfontsel.c b/xfontsel.c index c9aa68b..9ab33d1 100644 --- a/xfontsel.c +++ b/xfontsel.c @@ -462,13 +462,16 @@ void GetFontNames(XtPointer closure) SetNoFonts(); return; } + count = matchingFontCount = numFonts; numBadFonts = 0; parseRec = XtNew(ParseRec); - parseRec->fontNames = fontNames; - parseRec->fonts = fonts; - parseRec->num_fonts = count = matchingFontCount = numFonts; - parseRec->fieldValues = fieldValues; - parseRec->start = 0; + *parseRec = (ParseRec) { + .fontNames = fontNames, + .num_fonts = count, + .start = 0, + .fonts = fonts, + .fieldValues = fieldValues + }; /* this is bogus; the task should be responsible for quantizing...*/ while (count > PARSE_QUANTUM) { ParseRec *prevRec = parseRec; -- cgit v1.2.3