1 commit 57ad39ec62175eeea023ca802448ebb1605dca23
2 Author: Andreas Kling <andreas.kling@nokia.com>
3 Date: Fri Nov 12 16:08:35 2010 +0100
5 Don't pack Harfbuzz structs, this causes unaligned access crashes.
7 The memory-greediest structs have been reordered anyway, so the gain
8 from forcibly packing them is mostly negligible.
10 Task-number: QTBUG-13395
11 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
13 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h b/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h
14 index 0d7c2c2..0d631b2 100644
15 --- a/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h
16 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h
21 -#ifdef HB_USE_PACKED_STRUCTS
22 -#pragma pack(push, 1)
25 typedef struct HB_GlyphItemRec_ {
28 @@ -93,10 +89,6 @@ hb_buffer_add_glyph( HB_Buffer buffer,
32 -#ifdef HB_USE_PACKED_STRUCTS
38 #endif /* HARFBUZZ_BUFFER_H */
39 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h
40 index 2a6d958..94e9b43 100644
41 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h
42 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h
48 -#ifdef HB_USE_PACKED_STRUCTS
49 -#pragma pack(push, 1)
52 /* Attachment related structures */
54 struct HB_AttachPoint_
55 @@ -126,10 +121,6 @@ _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( HB_GDEFHeader* gdef,
57 HB_UShort num_lookups );
59 -#ifdef HB_USE_PACKED_STRUCTS
65 #endif /* HARFBUZZ_GDEF_PRIVATE_H */
66 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h b/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h
67 index f9a03dd..ccb6bf9 100644
68 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h
69 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h
74 -#ifdef HB_USE_PACKED_STRUCTS
75 -#pragma pack(push, 1)
78 /* GDEF glyph properties. Note that HB_GDEF_COMPONENT has no corresponding
79 * flag in the LookupFlag field. */
80 #define HB_GDEF_BASE_GLYPH 0x0002
81 @@ -131,10 +127,6 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
82 HB_UShort* glyph_array,
83 HB_UShort* class_array );
85 -#ifdef HB_USE_PACKED_STRUCTS
91 #endif /* HARFBUZZ_GDEF_H */
92 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
93 index bccd6a2..d4e6b46 100644
94 --- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
95 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
97 #define HB_END_HEADER /* nothing */
100 -#if defined(__GNUC__) || defined(_MSC_VER)
101 -#define HB_USE_PACKED_STRUCTS
107 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
108 index 39f3159..63ba907 100644
109 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
110 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
115 -#ifdef HB_USE_PACKED_STRUCTS
116 -#pragma pack(push, 1)
121 #define VR_X_PLACEMENT_DEVICE 0
122 @@ -720,10 +716,6 @@ HB_INTERNAL void
123 _HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
124 HB_UShort lookup_type );
126 -#ifdef HB_USE_PACKED_STRUCTS
132 #endif /* HARFBUZZ_GPOS_PRIVATE_H */
133 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h
134 index 7eb329e..df0c3f6 100644
135 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h
136 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h
141 -#ifdef HB_USE_PACKED_STRUCTS
142 -#pragma pack(push, 1)
145 typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable;
148 @@ -474,10 +470,6 @@ HB_INTERNAL void
149 _HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st,
150 HB_UShort lookup_type );
152 -#ifdef HB_USE_PACKED_STRUCTS
158 #endif /* HARFBUZZ_GSUB_PRIVATE_H */
159 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h b/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h
160 index b00df44..6e452bd 100644
161 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h
162 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h
168 -#ifdef HB_USE_PACKED_STRUCTS
169 -#pragma pack(push, 1)
172 /* Lookup types for glyph substitution */
174 #define HB_GSUB_LOOKUP_SINGLE 1
175 @@ -139,10 +134,6 @@ HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub,
176 HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub,
179 -#ifdef HB_USE_PACKED_STRUCTS
185 #endif /* HARFBUZZ_GSUB_H */
186 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.h b/src/3rdparty/harfbuzz/src/harfbuzz-open.h
187 index 4ba6cf5..9ad7c98 100644
188 --- a/src/3rdparty/harfbuzz/src/harfbuzz-open.h
189 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.h
194 -#ifdef HB_USE_PACKED_STRUCTS
195 -#pragma pack(push, 1)
198 /* Use this if a feature applies to all glyphs */
199 #define HB_ALL_GLYPHS 0xFFFF
201 @@ -279,10 +275,6 @@ enum HB_Type_
203 typedef enum HB_Type_ HB_Type;
205 -#ifdef HB_USE_PACKED_STRUCTS
211 #endif /* HARFBUZZ_OPEN_H */
212 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
213 index ab5c07a..470e27b 100644
214 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
215 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
220 -#ifdef HB_USE_PACKED_STRUCTS
221 -#pragma pack(push, 1)
225 using anything else than signed or unsigned for bitfields in C is non standard,
226 but accepted by almost all compilers. And it gives a significant reduction in
227 @@ -258,10 +254,6 @@ typedef struct HB_Font_ {
231 -#ifdef HB_USE_PACKED_STRUCTS
235 typedef struct HB_ShaperItem_ HB_ShaperItem;
237 struct HB_ShaperItem_ {
238 diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-stream.h b/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
239 index a155cc2..cfbfb1c 100644
240 --- a/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
241 +++ b/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
246 -#ifdef HB_USE_PACKED_STRUCTS
247 -#pragma pack(push, 1)
250 typedef struct HB_StreamRec_
253 @@ -42,10 +38,6 @@ typedef struct HB_StreamRec_
257 -#ifdef HB_USE_PACKED_STRUCTS