From: Keith Packard Date: Thu, 18 Oct 2007 15:58:14 +0000 (-0700) Subject: Place language name in constant array instead of pointer. X-Git-Tag: 2.4.91~24 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=e85789a99770dbd1a4abe9da3eadb355c19f5216;p=fontconfig.git 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. --- 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;