summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lam <plam@MIT.EDU>2005-10-14 21:02:31 +0000
committerPatrick Lam <plam@MIT.EDU>2005-10-14 21:02:31 +0000
commit21696e5bf08b67b57155e5b12e054456fd2b03e2 (patch)
tree8488f4bd5a151ff54ec1b175a1ee46fd517d5525
parent15d7bd0a16af189194b665e789331a8f8c86f20d (diff)
Add consts to variables so as to move arrays into .rodata.
reviewed by: plam
-rw-r--r--ChangeLog8
-rw-r--r--fc-glyphname/fc-glyphname.c4
-rw-r--r--src/fclang.c4
3 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index bd2585e3..10a3d46c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-14 Ross Burton <ross@burtonini.com>
+ 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 <mfabian@suse.de>
reviewed by: plam
diff --git a/fc-glyphname/fc-glyphname.c b/fc-glyphname/fc-glyphname.c
index 05a22ae3..47d86e39 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 711cdc75..a10641ed 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 {