From 8480c6f86327877fce729ebb01b52bd7a40ddfc5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 16 Nov 2009 17:38:40 -0500 Subject: [PATCH] [arch] Try to ensure proper FcLangSet alignment in arch --- fc-arch/fc-arch.c | 5 +++-- fc-arch/fcarch.tmpl.h | 16 ++++++++-------- src/fclang.c | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/fc-arch/fc-arch.c b/fc-arch/fc-arch.c index d0f5192..09a9d82 100644 --- a/fc-arch/fc-arch.c +++ b/fc-arch/fc-arch.c @@ -25,7 +25,7 @@ #include #define ENDIAN_TEST 0x12345678 -#define MACHINE_SIGNATURE_SIZE (9*22 + 1) +#define MACHINE_SIGNATURE_SIZE (9*23 + 1) static char * FcCacheMachineSignature (void) @@ -36,7 +36,7 @@ FcCacheMachineSignature (void) sprintf (buf, "%2x%2x%2x%2x_" "%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_" - "%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x", + "%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x_%08x", m[0], m[1], m[2], m[3], (unsigned int)sizeof (FcAlign), (unsigned int)sizeof (char), @@ -52,6 +52,7 @@ FcCacheMachineSignature (void) (unsigned int)sizeof (FcValue), (unsigned int)sizeof (FcValueBinding), (unsigned int)sizeof (struct FcValueList *), + (unsigned int)sizeof (FcStrSet *), /* For FcLangSet */ (unsigned int)sizeof (FcCharSet), (unsigned int)sizeof (FcCharLeaf **), (unsigned int)sizeof (FcChar16 *), diff --git a/fc-arch/fcarch.tmpl.h b/fc-arch/fcarch.tmpl.h index aac3bcf..09eccdc 100644 --- a/fc-arch/fcarch.tmpl.h +++ b/fc-arch/fcarch.tmpl.h @@ -28,11 +28,11 @@ @@@ name. Architecture names are used to construct file names, so @@@ use something reasonable and don't include any spaces @@@ -@@@ name endian FcAlign char char* int intptr_t Pattern EltPtr Elt * Elt ObjPtr VLPtr Value Binding VL * CharSet Leaf** Char16 * Char16 Leaf Char32 Cache -x86 78563412_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_0000000c_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 -x86-64 78563412_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038 -ppc 12345678_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_00000010_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 -ppc64 12345678_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038 -m68k 12345678_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_0000000c_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 -mipsel 78563412_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_00000010_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 -sparc64 12345678_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038 +@@@ name endian FcAlign char char* int intptr_t Pattern EltPtr Elt * Elt ObjPtr VLPtr Value Binding VL * StrSet * CharSet Leaf** Char16 * Char16 Leaf Char32 Cache +x86 78563412_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_0000000c_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 +x86-64 78563412_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038 +ppc 12345678_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_00000010_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 +ppc64 12345678_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038 +m68k 12345678_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_0000000c_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 +mipsel 78563412_00000008_00000001_00000004_00000004_00000004_00000010_00000004_00000004_00000008_00000004_00000004_00000010_00000004_00000004_00000004_00000010_00000004_00000004_00000002_00000020_00000004_00000020 +sparc64 12345678_00000008_00000001_00000008_00000004_00000008_00000018_00000008_00000008_00000010_00000004_00000008_00000010_00000004_00000008_00000008_00000018_00000008_00000008_00000002_00000020_00000004_00000038 diff --git a/src/fclang.c b/src/fclang.c index 0f2f963..61c4da6 100644 --- a/src/fclang.c +++ b/src/fclang.c @@ -39,7 +39,7 @@ typedef struct { struct _FcLangSet { FcStrSet *extra; - int map_size; + FcChar32 map_size; FcChar32 map[NUM_LANG_SET_MAP]; }; -- 2.39.5