packages: move Xorg category to its own feed, move X-related packages as well
[openwrt/svn-archive/archive.git] / xorg / lib / qt4 / patches / 400-do-not-pack-structs.patch
1 commit 57ad39ec62175eeea023ca802448ebb1605dca23
2 Author: Andreas Kling <andreas.kling@nokia.com>
3 Date: Fri Nov 12 16:08:35 2010 +0100
4
5 Don't pack Harfbuzz structs, this causes unaligned access crashes.
6
7 The memory-greediest structs have been reordered anyway, so the gain
8 from forcibly packing them is mostly negligible.
9
10 Task-number: QTBUG-13395
11 Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
12
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
17 @@ -32,10 +32,6 @@
18
19 HB_BEGIN_HEADER
20
21 -#ifdef HB_USE_PACKED_STRUCTS
22 -#pragma pack(push, 1)
23 -#endif
24 -
25 typedef struct HB_GlyphItemRec_ {
26 HB_UInt gindex;
27 HB_UInt properties;
28 @@ -93,10 +89,6 @@ hb_buffer_add_glyph( HB_Buffer buffer,
29 HB_UInt properties,
30 HB_UInt cluster );
31
32 -#ifdef HB_USE_PACKED_STRUCTS
33 -#pragma pack(pop)
34 -#endif
35 -
36 HB_END_HEADER
37
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
43 @@ -33,11 +33,6 @@
44
45 HB_BEGIN_HEADER
46
47 -
48 -#ifdef HB_USE_PACKED_STRUCTS
49 -#pragma pack(push, 1)
50 -#endif
51 -
52 /* Attachment related structures */
53
54 struct HB_AttachPoint_
55 @@ -126,10 +121,6 @@ _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( HB_GDEFHeader* gdef,
56 HB_Lookup* lo,
57 HB_UShort num_lookups );
58
59 -#ifdef HB_USE_PACKED_STRUCTS
60 -#pragma pack(pop)
61 -#endif
62 -
63 HB_END_HEADER
64
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
70 @@ -31,10 +31,6 @@
71
72 HB_BEGIN_HEADER
73
74 -#ifdef HB_USE_PACKED_STRUCTS
75 -#pragma pack(push, 1)
76 -#endif
77 -
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 );
84
85 -#ifdef HB_USE_PACKED_STRUCTS
86 -#pragma pack(pop)
87 -#endif
88 -
89 HB_END_HEADER
90
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
96 @@ -39,10 +39,6 @@
97 #define HB_END_HEADER /* nothing */
98 #endif
99
100 -#if defined(__GNUC__) || defined(_MSC_VER)
101 -#define HB_USE_PACKED_STRUCTS
102 -#endif
103 -
104 HB_BEGIN_HEADER
105
106 #ifndef FALSE
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
111 @@ -32,10 +32,6 @@
112
113 HB_BEGIN_HEADER
114
115 -#ifdef HB_USE_PACKED_STRUCTS
116 -#pragma pack(push, 1)
117 -#endif
118 -
119 /* shared tables */
120
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 );
125
126 -#ifdef HB_USE_PACKED_STRUCTS
127 -#pragma pack(pop)
128 -#endif
129 -
130 HB_END_HEADER
131
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
137 @@ -32,10 +32,6 @@
138
139 HB_BEGIN_HEADER
140
141 -#ifdef HB_USE_PACKED_STRUCTS
142 -#pragma pack(push, 1)
143 -#endif
144 -
145 typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable;
146
147 /* LookupType 1 */
148 @@ -474,10 +470,6 @@ HB_INTERNAL void
149 _HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st,
150 HB_UShort lookup_type );
151
152 -#ifdef HB_USE_PACKED_STRUCTS
153 -#pragma pack(pop)
154 -#endif
155 -
156 HB_END_HEADER
157
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
163 @@ -31,11 +31,6 @@
164
165 HB_BEGIN_HEADER
166
167 -
168 -#ifdef HB_USE_PACKED_STRUCTS
169 -#pragma pack(push, 1)
170 -#endif
171 -
172 /* Lookup types for glyph substitution */
173
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,
177 HB_Buffer buffer );
178
179 -#ifdef HB_USE_PACKED_STRUCTS
180 -#pragma pack(pop)
181 -#endif
182 -
183 HB_END_HEADER
184
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
190 @@ -30,10 +30,6 @@
191
192 HB_BEGIN_HEADER
193
194 -#ifdef HB_USE_PACKED_STRUCTS
195 -#pragma pack(push, 1)
196 -#endif
197 -
198 /* Use this if a feature applies to all glyphs */
199 #define HB_ALL_GLYPHS 0xFFFF
200
201 @@ -279,10 +275,6 @@ enum HB_Type_
202
203 typedef enum HB_Type_ HB_Type;
204
205 -#ifdef HB_USE_PACKED_STRUCTS
206 -#pragma pack(pop)
207 -#endif
208 -
209 HB_END_HEADER
210
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
216 @@ -34,10 +34,6 @@
217
218 HB_BEGIN_HEADER
219
220 -#ifdef HB_USE_PACKED_STRUCTS
221 -#pragma pack(push, 1)
222 -#endif
223 -
224 /*
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_ {
228 void *userData;
229 } HB_FontRec;
230
231 -#ifdef HB_USE_PACKED_STRUCTS
232 -#pragma pack(pop)
233 -#endif
234 -
235 typedef struct HB_ShaperItem_ HB_ShaperItem;
236
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
242 @@ -30,10 +30,6 @@
243
244 HB_BEGIN_HEADER
245
246 -#ifdef HB_USE_PACKED_STRUCTS
247 -#pragma pack(push, 1)
248 -#endif
249 -
250 typedef struct HB_StreamRec_
251 {
252 HB_Byte* base;
253 @@ -42,10 +38,6 @@ typedef struct HB_StreamRec_
254 HB_UInt pos;
255 } HB_StreamRec;
256
257 -#ifdef HB_USE_PACKED_STRUCTS
258 -#pragma pack(pop)
259 -#endif
260 -
261 HB_END_HEADER
262
263 #endif