]> git.wh0rd.org - fontconfig.git/commitdiff
Place language name in constant array instead of pointer.
authorKeith Packard <keithp@koto.keithp.com>
Thu, 18 Oct 2007 15:58:14 +0000 (08:58 -0700)
committerKeith Packard <keithp@koto.keithp.com>
Thu, 18 Oct 2007 15:58:14 +0000 (08:58 -0700)
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
src/fclang.c

index 92a62ce631b27c447750b4896766a647529f917e..989a823b41d9a3f8e584c4d9b92e8a271c2eecb8 100644 (file)
@@ -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);
index de0862215d435b071df5d12c574e21dacd1247f5..13f0ca21fb932c232c58a4eecc5ec17b6e769072 100644 (file)
@@ -25,7 +25,7 @@
 #include "fcint.h"
 
 typedef struct {
-    const FcChar8      *lang;
+    const FcChar8      lang[8];
     const FcCharSet    charset;
 } FcLangCharSet;