summaryrefslogtreecommitdiff
path: root/mkfontscale.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-11-04 10:39:54 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-11-06 14:18:58 -0800
commit568f31aefd6e060779572c1fe593519714f0d50b (patch)
tree531316d1776a40ca4a9524716946527e1c636eaf /mkfontscale.c
parentfa682decde0b4513f5ce6084df590107359158f5 (diff)
mkfontscale.c: handle -Wshadow warnings from gcc
mkfontscale.c: In function ‘doDirectory’: mkfontscale.c:810:66: warning: declaration of ‘encodingsToDo’ shadows a global declaration [-Wshadow] 810 | doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo) | ~~~~~~~~^~~~~~~~~~~~~ mkfontscale.c:117:16: note: shadowed declaration is here 117 | static ListPtr encodingsToDo; | ^~~~~~~~~~~~~ mkfontscale.c: In function ‘readEncodings’: mkfontscale.c:1353:23: warning: declaration of ‘encodings’ shadows a global declaration [-Wshadow] 1353 | readEncodings(ListPtr encodings, char *dirname) | ~~~~~~~~^~~~~~~~~ mkfontscale.c:93:21: note: shadowed declaration is here 93 | static ConstListPtr encodings, extra_encodings; | ^~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'mkfontscale.c')
-rw-r--r--mkfontscale.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mkfontscale.c b/mkfontscale.c
index 2b07c67..09599d0 100644
--- a/mkfontscale.c
+++ b/mkfontscale.c
@@ -104,7 +104,7 @@ static const char *notice_foundry(const char *notice);
static const char *vendor_foundry(const signed char *vendor);
static int readFontScale(HashTablePtr entries, char *dirname);
ListPtr makeXLFD(char *filename, FT_Face face, int);
-static int readEncodings(ListPtr encodings, char *dirname);
+static int readEncodings(ListPtr *encodingsToDo, char *dirname);
static FT_Library ft_library;
static float bigEncodingFuzz = 0.02;
@@ -114,7 +114,6 @@ static int doScalable;
static int doBitmaps;
static int doISO10646_1_encoding;
static int onlyEncodings;
-static ListPtr encodingsToDo;
static int reencodeLegacy;
static char *encodingPrefix;
static char *exclusionSuffix;
@@ -144,6 +143,7 @@ main(int argc, char **argv)
int argn;
FT_Error ftrc;
int rc, ll = 0;
+ ListPtr encodingsToDo;
char prefix[NPREFIX];
ProgramName = argv[0];
@@ -213,7 +213,7 @@ main(int argc, char **argv)
if (argn >= argc - 1) {
missing_arg("-e");
}
- rc = readEncodings(encodingsToDo, argv[argn + 1]);
+ rc = readEncodings(&encodingsToDo, argv[argn + 1]);
if (rc < 0)
exit(1);
argn += 2;
@@ -1350,7 +1350,7 @@ vendor_foundry(const signed char *vendor)
}
static int
-readEncodings(ListPtr encodings, char *dirname)
+readEncodings(ListPtr *encodingsToDo, char *dirname)
{
char *fullname;
DIR *dirp;
@@ -1388,14 +1388,14 @@ readEncodings(ListPtr encodings, char *dirname)
closedir(dirp);
return -1;
}
- encodingsToDo = listConsF(encodingsToDo, "%s %s", *name, n);
+ *encodingsToDo = listConsF(*encodingsToDo, "%s %s", *name, n);
free(n);
}
else {
- encodingsToDo =
- listConsF(encodingsToDo, "%s %s", *name, fullname);
+ *encodingsToDo =
+ listConsF(*encodingsToDo, "%s %s", *name, fullname);
}
- if (encodingsToDo == NULL) {
+ if (*encodingsToDo == NULL) {
fprintf(stderr, "Couldn't allocate encodings\n");
closedir(dirp);
return -1;