summaryrefslogtreecommitdiff
path: root/x11-toolkits/pango/files/extra-patch-gcc
blob: d8a1cc957480f58170a2c0b7b01ee29ffaf36c45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
diff -ru ../pango-1.26.0/pango/opentype/hb-open-type-private.hh ./pango/opentype/hb-open-type-private.hh
--- pango/opentype/hb-open-type-private.hh	2009-08-28 17:15:12.000000000 -0400
+++ pango/opentype/hb-open-type-private.hh	2009-09-30 05:14:13.000000000 -0400
@@ -508,10 +508,10 @@
   inline const Type& operator [] (unsigned int i) const
   {
     if (HB_UNLIKELY (i >= len)) return Null(Type);
-    return array[i];
+    return _array(i);
   }
   inline unsigned int get_size () const
-  { return sizeof (len) + len * sizeof (array[0]); }
+  { return sizeof (len) + len * sizeof (Type); }
 
   inline bool sanitize (SANITIZE_ARG_DEF) {
     TRACE_SANITIZE ();
@@ -523,7 +523,7 @@
     return true;
     unsigned int count = len;
     for (unsigned int i = 0; i < count; i++)
-      if (!SANITIZE (array[i]))
+      if (!SANITIZE (_array(i)))
         return false;
     return true;
   }
@@ -532,7 +532,7 @@
     if (!SANITIZE_GET_SIZE()) return false;
     unsigned int count = len;
     for (unsigned int i = 0; i < count; i++)
-      if (!array[i].sanitize (SANITIZE_ARG, base))
+      if (!_array(i).sanitize (SANITIZE_ARG, base))
         return false;
     return true;
   }
@@ -541,7 +541,7 @@
     if (!SANITIZE_GET_SIZE()) return false;
     unsigned int count = len;
     for (unsigned int i = 0; i < count; i++)
-      if (!array[i].sanitize (SANITIZE_ARG, base, base2))
+      if (!_array(i).sanitize (SANITIZE_ARG, base, base2))
         return false;
     return true;
   }
@@ -550,15 +550,21 @@
     if (!SANITIZE_GET_SIZE()) return false;
     unsigned int count = len;
     for (unsigned int i = 0; i < count; i++)
-      if (!array[i].sanitize (SANITIZE_ARG, base, user_data))
+      if (!_array(i).sanitize (SANITIZE_ARG, base, user_data))
         return false;
     return true;
   }
 
   LenType len;
-  Type array[];
+  //Type array[];
+  Type& _array(unsigned int i) const
+  {
+    return *(Type*)(&len + 1);
+  }
 };
 
+#undef array
+
 /* An array with a USHORT number of elements. */
 template <typename Type>
 struct ArrayOf : GenericArrayOf<USHORT, Type> {};
@@ -586,7 +592,7 @@
   inline const Type& operator [] (unsigned int i) const
   {
     if (HB_UNLIKELY (i >= this->len)) return Null(Type);
-    return this+this->array[i];
+    return this+this->_array(i);
   }
 
   inline bool sanitize (SANITIZE_ARG_DEF) {
diff -ru ../pango-1.26.0/pango/opentype/hb-ot-layout-common-private.hh ./pango/opentype/hb-ot-layout-common-private.hh
--- ../pango-1.26.0/pango/opentype/hb-ot-layout-common-private.hh	2009-08-28 17:15:12.000000000 -0400
+++ ./pango/opentype/hb-ot-layout-common-private.hh	2009-09-30 05:15:25.000000000 -0400
@@ -67,14 +67,14 @@
   inline const Tag& get_tag (unsigned int i) const
   {
     if (HB_UNLIKELY (i >= this->len)) return Null(Tag);
-    return this->array[i].tag;
+    return this->_array(i).tag;
   }
   inline bool get_tags (unsigned int *record_count /* IN/OUT */,
 			hb_tag_t     *record_tags /* OUT */) const
   {
     unsigned int count = MIN (this->len, *record_count);
     for (unsigned int i = 0; i < count; i++)
-      record_tags[i] = this->array[i].tag;
+      record_tags[i] = this->_array(i).tag;
 
     *record_count = this->len;
     return !!this->len;
@@ -86,7 +86,7 @@
     unsigned int count = this->len;
     for (unsigned int i = 0; i < count; i++)
     {
-      if (t == this->array[i].tag)
+      if (t == this->_array(i).tag)
       {
         if (index) *index = i;
         return true;
@@ -116,14 +116,14 @@
   {
     if (HB_UNLIKELY (i >= this->len))
       return NO_INDEX;
-    return this->array[i];
+    return this->_array(i);
   }
   inline bool get_indexes (unsigned int *_count /* IN/OUT */,
 			   unsigned int *_indexes /* OUT */) const
   {
     unsigned int count = MIN (this->len, *_count);
     for (unsigned int i = 0; i < count; i++)
-      _indexes[i] = this->array[i];
+      _indexes[i] = this->_array(i);
 
     *_count = this->len;
     return !!this->len;
diff -ru ../pango-1.26.0/pango/opentype/hb-ot-layout-gsub-private.hh ./pango/opentype/hb-ot-layout-gsub-private.hh
--- ../pango-1.26.0/pango/opentype/hb-ot-layout-gsub-private.hh	2009-08-28 17:16:36.000000000 -0400
+++ ./pango/opentype/hb-ot-layout-gsub-private.hh	2009-09-30 05:28:53.000000000 -0400
@@ -160,7 +160,7 @@
       return false;
 
     _hb_buffer_add_output_glyphs (buffer, 1,
-				  substitute.len, (const uint16_t *) substitute.array,
+				  substitute.len, (const uint16_t *) &substitute._array(0),
 				  0xFFFF, 0xFFFF);
 
     /* This is a guess only ... */
@@ -285,7 +285,7 @@
     if (context->face->altfunc)
       alt_index = (context->face->altfunc)(context->layout, buffer,
 				    buffer->out_pos, glyph_id,
-				    alt_set.len, alt_set.array);
+				    alt_set.len, alt_set._array(0));
 				   */
 
     if (HB_UNLIKELY (alt_index >= alt_set.len))
@@ -601,10 +601,10 @@
     const ArrayOf<GlyphID> &substitute = CONST_NEXT (ArrayOf<GlyphID>, lookahead);
 
     if (match_backtrack (APPLY_ARG,
-			 backtrack.len, (USHORT *) backtrack.array,
+			 backtrack.len, (USHORT *) &backtrack._array(0),
 			 match_coverage, DECONST_CHARP(this)) &&
         match_lookahead (APPLY_ARG,
-			 lookahead.len, (USHORT *) lookahead.array,
+			 lookahead.len, (USHORT *) &lookahead._array(0),
 			 match_coverage, DECONST_CHARP(this),
 			 1))
     {
diff -ru ../pango-1.26.0/pango/opentype/hb-ot-layout-gsubgpos-private.hh ./pango/opentype/hb-ot-layout-gsubgpos-private.hh
--- ../pango-1.26.0/pango/opentype/hb-ot-layout-gsubgpos-private.hh	2009-09-21 13:58:54.000000000 -0400
+++ ./pango/opentype/hb-ot-layout-gsubgpos-private.hh	2009-09-30 05:33:03.000000000 -0400
@@ -572,10 +572,10 @@
     const ArrayOf<USHORT> &lookahead = CONST_NEXT (ArrayOf<USHORT>, input);
     const ArrayOf<LookupRecord> &lookup = CONST_NEXT (ArrayOf<LookupRecord>, lookahead);
     return chain_context_lookup (APPLY_ARG,
-				 backtrack.len, backtrack.array,
+				 backtrack.len, &backtrack._array(0),
 				 input.len, input.array,
-				 lookahead.len, lookahead.array,
-				 lookup.len, lookup.array,
+				 lookahead.len, &lookahead._array(0),
+				 lookup.len, &lookup._array(0),
 				 lookup_context);
     return false;
   }
@@ -754,10 +754,10 @@
       {DECONST_CHARP(this), DECONST_CHARP(this), DECONST_CHARP(this)}
     };
     return chain_context_lookup (APPLY_ARG,
-				 backtrack.len, (USHORT *) backtrack.array,
-				 input.len, (USHORT *) input.array + 1,
-				 lookahead.len, (USHORT *) lookahead.array,
-				 lookup.len, lookup.array,
+				 backtrack.len, (USHORT *) &backtrack._array(0),
+				 input.len, (USHORT *) &input._array(1),
+				 lookahead.len, (USHORT *) &lookahead._array(0),
+				 lookup.len, &lookup._array(0),
 				 lookup_context);
     return false;
   }