From 21696e5bf08b67b57155e5b12e054456fd2b03e2 Mon Sep 17 00:00:00 2001 From: Patrick Lam Date: Fri, 14 Oct 2005 21:02:31 +0000 Subject: [PATCH] Add consts to variables so as to move arrays into .rodata. reviewed by: plam --- ChangeLog | 8 ++++++++ fc-glyphname/fc-glyphname.c | 4 ++-- src/fclang.c | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd2585e..10a3d46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-10-14 Ross Burton + reviewed by: plam + + * fc-glyphname/fc-glyphname.c: + * src/fclang.c: + + Add consts to variables so as to move arrays into .rodata. + 2005-10-14 Mike Fabian reviewed by: plam diff --git a/fc-glyphname/fc-glyphname.c b/fc-glyphname/fc-glyphname.c index 05a22ae..47d86e3 100644 --- a/fc-glyphname/fc-glyphname.c +++ b/fc-glyphname/fc-glyphname.c @@ -219,7 +219,7 @@ dump (FcGlyphName * const *table, const char *name) { int i; - printf ("static FcGlyphName *%s[%d] = {\n", name, hash); + printf ("static const FcGlyphName *%s[%d] = {\n", name, hash); for (i = 0; i < hash; i++) if (table[i]) @@ -289,7 +289,7 @@ main (int argc, char **argv) */ for (i = 0; i < nraw; i++) - printf ("static struct { FcChar32 ucs; FcChar8 name[%d]; }" + printf ("static const struct { const FcChar32 ucs; const FcChar8 name[%d]; }" " glyph%d = { 0x%lx, \"%s\" };\n", (int) strlen ((char *) raw[i]->name) + 1, i, (unsigned long) raw[i]->ucs, raw[i]->name); diff --git a/src/fclang.c b/src/fclang.c index 711cdc7..a10641e 100644 --- a/src/fclang.c +++ b/src/fclang.c @@ -25,8 +25,8 @@ #include "fcint.h" typedef struct { - FcChar8 *lang; - FcCharSet charset; + const FcChar8 *lang; + const FcCharSet charset; } FcLangCharSet; typedef struct {