From: Ben Harris Date: Mon, 31 Jul 2017 15:18:06 +0000 (+0100) Subject: Make nglyphs and nparams global. X-Git-Tag: bedstead-002.000~118 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=00193c98de586ba0a026dd6f2addc59337341b9b;p=bedstead.git Make nglyphs and nparams global. nglyphs was used in two functions, and there seems no reason to localise these. --- diff --git a/bedstead.c b/bedstead.c index e11b258..c984bc1 100644 --- a/bedstead.c +++ b/bedstead.c @@ -171,6 +171,8 @@ struct param const params[] = { 7, /* ttfwidth */ }, }; +static int const nparams = sizeof(params) / sizeof(params[0]); + struct param const *param = ¶ms[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);