diff options
author | Thomas Kuehne <thomas@kuehne.cn> | 2021-12-05 13:16:35 +0100 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-10 08:46:47 -0700 |
commit | 57f670195bb1854edbea97b672ae966343965bb7 (patch) | |
tree | 94b8be777d923df4e5cb9ece093a797f2c5562aa | |
parent | 6ef6ff13da2adc354eeca629d2fc523cbe3aab42 (diff) |
Fixed -Wshadow declaration warnings
-rw-r--r-- | xfontsel.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -535,7 +535,7 @@ void ParseFontNames(XtPointer closure) ParseRec *parseRec = (ParseRec*)closure; char **fontNames = parseRec->fontNames; int num_fonts = parseRec->end; - FieldValueList **fieldValues = parseRec->fieldValues; + FieldValueList **fValues = parseRec->fieldValues; FontValues *fontValues = parseRec->fonts - numBadFonts; int i, font; @@ -562,7 +562,7 @@ void ParseFontNames(XtPointer closure) while (*p && *++p != DELIM); len = p - fieldP; } - for (i=fieldValues[f]->count,v=fieldValues[f]->value; i;i--,v++) { + for (i=fValues[f]->count,v=fValues[f]->value; i;i--,v++) { if (len == 0) { if (v->string == NULL) break; } @@ -573,15 +573,15 @@ void ParseFontNames(XtPointer closure) break; } if (i == 0) { - int count = fieldValues[f]->count++; - if (count == fieldValues[f]->allocated) { - int allocated = (fieldValues[f]->allocated += 10); - fieldValues[f] = (FieldValueList*) - XtRealloc( (char *) fieldValues[f], + int count = fValues[f]->count++; + if (count == fValues[f]->allocated) { + int allocated = (fValues[f]->allocated += 10); + fValues[f] = (FieldValueList*) + XtRealloc( (char *) fValues[f], sizeof(FieldValueList) + (allocated-1) * sizeof(FieldValue) ); } - v = &fieldValues[f]->value[count]; + v = &fValues[f]->value[count]; v->field = f; if (len == 0) v->string = NULL; @@ -597,7 +597,7 @@ void ParseFontNames(XtPointer closure) v->enable = True; i = 1; } - fontValues->value_index[f] = fieldValues[f]->count - i; + fontValues->value_index[f] = fValues[f]->count - i; if ((i = v->count++) == v->allocated) { int allocated = (v->allocated += 10); v->font = (int*)XtRealloc( (char *) v->font, @@ -623,13 +623,13 @@ static void AddScalables(int f) FieldValue *fval = fieldValues[f]->value; for (i = 0; i < max; i++, fval++) { - int *oofonts, *ofonts, *nfonts, *fonts; + int *oofonts, *ofonts, *nfonts, *sfonts; int ocount, ncount, count; if (fval->string && !strcmp(fval->string, "0")) continue; count = numScaledFonts; - fonts = scaledFonts; + sfonts = scaledFonts; ocount = fval->count; ncount = ocount + count; nfonts = (int *)XtMalloc( ncount * sizeof(int) ); @@ -638,11 +638,11 @@ static void AddScalables(int f) fval->count = ncount; fval->allocated = ncount; while (count && ocount) { - if (*fonts < *ofonts) { - *nfonts++ = *fonts++; + if (*sfonts < *ofonts) { + *nfonts++ = *sfonts++; count--; - } else if (*fonts == *ofonts) { - *nfonts++ = *fonts++; + } else if (*sfonts == *ofonts) { + *nfonts++ = *sfonts++; count--; ofonts++; ocount--; @@ -657,7 +657,7 @@ static void AddScalables(int f) ocount--; } while (count) { - *nfonts++ = *fonts++; + *nfonts++ = *sfonts++; count--; } XtFree((char *)oofonts); |