From e85789a99770dbd1a4abe9da3eadb355c19f5216 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 18 Oct 2007 08:58:14 -0700 Subject: [PATCH] Place language name in constant array instead of pointer. Constant char array of 8 bytes is the same size as a pointer plus a short string, so this actually saves memory and eliminates a pile of relocations. --- fc-lang/fc-lang.c | 2 +- src/fclang.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fc-lang/fc-lang.c b/fc-lang/fc-lang.c index 92a62ce..989a823 100644 --- a/fc-lang/fc-lang.c +++ b/fc-lang/fc-lang.c @@ -377,7 +377,7 @@ main (int argc, char **argv) if (j < 0) j = i; - printf (" { (FcChar8 *) \"%s\", " + printf (" { \"%s\", " " { FC_REF_CONSTANT, %d, OFF(%d,%d), NUM(%d,%d) } }, /* %d */\n", langs[i], sets[j]->num, i, off[j], i, off[j], i); diff --git a/src/fclang.c b/src/fclang.c index de08622..13f0ca2 100644 --- a/src/fclang.c +++ b/src/fclang.c @@ -25,7 +25,7 @@ #include "fcint.h" typedef struct { - const FcChar8 *lang; + const FcChar8 lang[8]; const FcCharSet charset; } FcLangCharSet; -- 2.39.2