chiark / gitweb /
Make nglyphs and nparams global.
authorBen Harris <bjh21@bjh21.me.uk>
Mon, 31 Jul 2017 15:18:06 +0000 (16:18 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Mon, 31 Jul 2017 15:18:06 +0000 (16:18 +0100)
nglyphs was used in two functions, and there seems no reason to
localise these.

bedstead.c

index e11b2586e3fd21d1f6094af0add7fc3a1e2cb39c..c984bc122247315be0c61cf53533f06126d59ec5 100644 (file)
@@ -171,6 +171,8 @@ struct param const params[] = {
                7,              /* ttfwidth */
        },
 };
+static int const nparams = sizeof(params) / sizeof(params[0]);
+
 
 struct param const *param = &params[0];
 
@@ -1242,6 +1244,8 @@ struct glyph {
  {{000,000,016,021,022,021,026,000,000}, -1, "germandbls.sc" },
 };
 
+static int const nglyphs = sizeof(glyphs) / sizeof(glyphs[0]);
+
 static void dolookups(struct glyph const *);
 
 static int
@@ -1260,8 +1264,6 @@ int
 main(int argc, char **argv)
 {
        int i;
-       int const nglyphs = sizeof(glyphs) / sizeof(glyphs[0]);
-       int const nparams = sizeof(params) / sizeof(params[0]);
        int extraglyphs = 0;
        char *endptr;
 
@@ -1565,7 +1567,6 @@ dolookups(struct glyph const *g)
        char prefix[32];
        size_t plen;
        int i;
-       int const nglyphs = sizeof(glyphs) / sizeof(glyphs[0]);
 
        if (g->name)
                plen = sprintf(prefix, "%s.", g->name);