Commit be2a75ec authored by Alan Coopersmith's avatar Alan Coopersmith
Browse files

Clean up variable scoping in GetFontNames()



Gets rid of gcc warning:
xfontsel.c: In function ‘GetFontNames’:
xfontsel.c:498:16: warning: declaration of ‘f’ shadows a previous local [-Wshadow]
  int maxField, f;
                ^
xfontsel.c:446:9: note: shadowed declaration is here
     int f, field, count;
         ^

Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 93112d07
......@@ -443,17 +443,21 @@ void GetFontNames(XtPointer closure)
{
Display *dpy = (Display*)closure;
ParseRec *parseRec;
int f, field, count;
int count;
char **fontNames;
Boolean *b;
int work_priority = 0;
fontNames = XListFonts(dpy, AppRes.pattern, 32767, &numFonts);
fonts = (FontValues*)XtMalloc( numFonts*sizeof(FontValues) );
fontInSet = (Boolean*)XtMalloc( numFonts*sizeof(Boolean) );
for (f = numFonts, b = fontInSet; f; f--, b++) *b = True;
for (field = 0; field < FIELD_COUNT; field++) {
{
int f;
Boolean *b;
for (f = numFonts, b = fontInSet; f; f--, b++)
*b = True;
}
for (int field = 0; field < FIELD_COUNT; field++) {
fieldValues[field] = (FieldValueList*)XtMalloc(sizeof(FieldValueList));
fieldValues[field]->allocated = 1;
fieldValues[field]->count = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment