../3rdparty/harfbuzz/src/harfbuzz-buffer.c

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/* -
2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg -
3 * Copyright (C) 2004,2007 Red Hat, Inc. -
4 * -
5 * This is part of HarfBuzz, an OpenType Layout engine library. -
6 * -
7 * Permission is hereby granted, without written agreement and without -
8 * license or royalty fees, to use, copy, modify, and distribute this -
9 * software and its documentation for any purpose, provided that the -
10 * above copyright notice and the following two paragraphs appear in -
11 * all copies of this software. -
12 * -
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -
17 * DAMAGE. -
18 * -
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -
24 * -
25 * Red Hat Author(s): Owen Taylor, Behdad Esfahbod -
26 */ -
27 -
28#include "harfbuzz-impl.h" -
29#include "harfbuzz-buffer-private.h" -
30#include "harfbuzz-gsub-private.h" -
31#include "harfbuzz-gpos-private.h" -
32 -
33/* Here is how the buffer works internally: -
34 * -
35 * There are two string pointers: in_string and out_string. They -
36 * always have same allocated size, but different length and positions. -
37 * -
38 * As an optimization, both in_string and out_string may point to the -
39 * same piece of memory, which is owned by in_string. This remains the -
40 * case as long as: -
41 * -
42 * - copy_glyph() is called -
43 * - replace_glyph() is called with inplace=TRUE -
44 * - add_output_glyph() and add_output_glyphs() are not called -
45 * -
46 * In that case swap(), and copy_glyph(), and replace_glyph() are all -
47 * mostly no-op. -
48 * -
49 * As soon an add_output_glyph[s]() or replace_glyph() with inplace=FALSE is -
50 * called, out_string is moved over to an alternate buffer (alt_string), and -
51 * its current contents (out_length entries) are copied to the alt buffer. -
52 * This should all remain transparent to the user. swap() then switches -
53 * in_string and alt_string. alt_string is not allocated until its needed, -
54 * but after that it's grown with in_string unconditionally. -
55 * -
56 * The buffer->separate_out boolean keeps status of whether out_string points -
57 * to in_string (FALSE) or alt_string (TRUE). -
58 */ -
59 -
60/* Internal API */ -
61 -
62static HB_Error -
63hb_buffer_ensure( HB_Buffer buffer, -
64 HB_UInt size ) -
65{ -
66 HB_UInt new_allocated = buffer->allocated;
executed (the execution status of this line is deduced): HB_UInt new_allocated = buffer->allocated;
-
67 -
68 if (size > new_allocated)
evaluated: size > new_allocated
TRUEFALSE
yes
Evaluation Count:365
yes
Evaluation Count:12884254
365-12884254
69 { -
70 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
71 -
72 while (size > new_allocated)
evaluated: size > new_allocated
TRUEFALSE
yes
Evaluation Count:365
yes
Evaluation Count:365
365
73 new_allocated += (new_allocated >> 1) + 8;
executed: new_allocated += (new_allocated >> 1) + 8;
Execution Count:365
365
74 -
75 if ( buffer->positions )
evaluated: buffer->positions
TRUEFALSE
yes
Evaluation Count:182
yes
Evaluation Count:183
182-183
76 { -
77 if ( REALLOC_ARRAY( buffer->positions, new_allocated, HB_PositionRec ) )
partially evaluated: ( (buffer->positions) = _hb_realloc( (buffer->positions), ((new_allocated)*sizeof(HB_PositionRec)), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:182
0-182
78 return error;
never executed: return error;
0
79 }
executed: }
Execution Count:182
182
80 -
81 if ( REALLOC_ARRAY( buffer->in_string, new_allocated, HB_GlyphItemRec ) )
partially evaluated: ( (buffer->in_string) = _hb_realloc( (buffer->in_string), ((new_allocated)*sizeof(HB_GlyphItemRec)), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:365
0-365
82 return error;
never executed: return error;
0
83 -
84 if ( buffer->separate_out )
partially evaluated: buffer->separate_out
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:365
0-365
85 { -
86 if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) )
never evaluated: ( (buffer->alt_string) = _hb_realloc( (buffer->alt_string), ((new_allocated)*sizeof(HB_GlyphItemRec)), &error ), error != 0 )
0
87 return error;
never executed: return error;
0
88 -
89 buffer->out_string = buffer->alt_string;
never executed (the execution status of this line is deduced): buffer->out_string = buffer->alt_string;
-
90 }
never executed: }
0
91 else -
92 { -
93 buffer->out_string = buffer->in_string;
executed (the execution status of this line is deduced): buffer->out_string = buffer->in_string;
-
94 -
95 if ( buffer->alt_string )
evaluated: buffer->alt_string
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:340
25-340
96 { -
97 if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) )
partially evaluated: ( (buffer->alt_string) = _hb_realloc( (buffer->alt_string), ((new_allocated)*sizeof(HB_GlyphItemRec)), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
0-25
98 return error;
never executed: return error;
0
99 }
executed: }
Execution Count:25
25
100 }
executed: }
Execution Count:365
365
101 -
102 buffer->allocated = new_allocated;
executed (the execution status of this line is deduced): buffer->allocated = new_allocated;
-
103 }
executed: }
Execution Count:365
365
104 -
105 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:12884619
12884619
106} -
107 -
108static HB_Error -
109hb_buffer_duplicate_out_buffer( HB_Buffer buffer ) -
110{ -
111 if ( !buffer->alt_string )
evaluated: !buffer->alt_string
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:9851
25-9851
112 { -
113 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
114 -
115 if ( ALLOC_ARRAY( buffer->alt_string, buffer->allocated, HB_GlyphItemRec ) )
partially evaluated: ( (buffer->alt_string) = _hb_alloc( (buffer->allocated)*sizeof(HB_GlyphItemRec), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:25
0-25
116 return error;
never executed: return error;
0
117 }
executed: }
Execution Count:25
25
118 -
119 buffer->out_string = buffer->alt_string;
executed (the execution status of this line is deduced): buffer->out_string = buffer->alt_string;
-
120 memcpy( buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0]) );
executed (the execution status of this line is deduced): memcpy( buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0]) );
-
121 buffer->separate_out = TRUE;
executed (the execution status of this line is deduced): buffer->separate_out = (!0);
-
122 -
123 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:9876
9876
124} -
125 -
126/* Public API */ -
127 -
128HB_Error -
129hb_buffer_new( HB_Buffer *pbuffer ) -
130{ -
131 HB_Buffer buffer;
executed (the execution status of this line is deduced): HB_Buffer buffer;
-
132 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
133 -
134 if ( ALLOC( buffer, sizeof( HB_BufferRec ) ) )
partially evaluated: ( (buffer) = _hb_alloc( sizeof( HB_BufferRec ), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:218
0-218
135 return error;
never executed: return error;
0
136 -
137 buffer->allocated = 0;
executed (the execution status of this line is deduced): buffer->allocated = 0;
-
138 buffer->in_string = NULL;
executed (the execution status of this line is deduced): buffer->in_string = ((void *)0);
-
139 buffer->alt_string = NULL;
executed (the execution status of this line is deduced): buffer->alt_string = ((void *)0);
-
140 buffer->positions = NULL;
executed (the execution status of this line is deduced): buffer->positions = ((void *)0);
-
141 -
142 hb_buffer_clear( buffer );
executed (the execution status of this line is deduced): hb_buffer_clear( buffer );
-
143 -
144 *pbuffer = buffer;
executed (the execution status of this line is deduced): *pbuffer = buffer;
-
145 -
146 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:218
218
147} -
148 -
149void -
150hb_buffer_free( HB_Buffer buffer ) -
151{ -
152 FREE( buffer->in_string );
executed: }
Execution Count:132
executed: }
Execution Count:208
evaluated: (buffer->in_string)
TRUEFALSE
yes
Evaluation Count:132
yes
Evaluation Count:76
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:208
0-208
153 FREE( buffer->alt_string );
executed: }
Execution Count:22
executed: }
Execution Count:208
evaluated: (buffer->alt_string)
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:186
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:208
0-208
154 buffer->out_string = NULL;
executed (the execution status of this line is deduced): buffer->out_string = ((void *)0);
-
155 FREE( buffer->positions );
executed: }
Execution Count:131
executed: }
Execution Count:208
evaluated: (buffer->positions)
TRUEFALSE
yes
Evaluation Count:131
yes
Evaluation Count:77
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:208
0-208
156 FREE( buffer );
executed: }
Execution Count:208
executed: }
Execution Count:208
partially evaluated: (buffer)
TRUEFALSE
yes
Evaluation Count:208
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:208
0-208
157}
executed: }
Execution Count:208
208
158 -
159void -
160hb_buffer_clear( HB_Buffer buffer ) -
161{ -
162 buffer->in_length = 0;
executed (the execution status of this line is deduced): buffer->in_length = 0;
-
163 buffer->out_length = 0;
executed (the execution status of this line is deduced): buffer->out_length = 0;
-
164 buffer->in_pos = 0;
executed (the execution status of this line is deduced): buffer->in_pos = 0;
-
165 buffer->out_pos = 0;
executed (the execution status of this line is deduced): buffer->out_pos = 0;
-
166 buffer->out_string = buffer->in_string;
executed (the execution status of this line is deduced): buffer->out_string = buffer->in_string;
-
167 buffer->separate_out = FALSE;
executed (the execution status of this line is deduced): buffer->separate_out = 0;
-
168 buffer->max_ligID = 0;
executed (the execution status of this line is deduced): buffer->max_ligID = 0;
-
169}
executed: }
Execution Count:248331
248331
170 -
171HB_Error -
172hb_buffer_add_glyph( HB_Buffer buffer, -
173 HB_UInt glyph_index, -
174 HB_UInt properties, -
175 HB_UInt cluster ) -
176{ -
177 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
178 HB_GlyphItem glyph;
executed (the execution status of this line is deduced): HB_GlyphItem glyph;
-
179 -
180 error = hb_buffer_ensure( buffer, buffer->in_length + 1 );
executed (the execution status of this line is deduced): error = hb_buffer_ensure( buffer, buffer->in_length + 1 );
-
181 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3326586
0-3326586
182 return error;
never executed: return error;
0
183 -
184 glyph = &buffer->in_string[buffer->in_length];
executed (the execution status of this line is deduced): glyph = &buffer->in_string[buffer->in_length];
-
185 glyph->gindex = glyph_index;
executed (the execution status of this line is deduced): glyph->gindex = glyph_index;
-
186 glyph->properties = properties;
executed (the execution status of this line is deduced): glyph->properties = properties;
-
187 glyph->cluster = cluster;
executed (the execution status of this line is deduced): glyph->cluster = cluster;
-
188 glyph->component = 0;
executed (the execution status of this line is deduced): glyph->component = 0;
-
189 glyph->ligID = 0;
executed (the execution status of this line is deduced): glyph->ligID = 0;
-
190 glyph->gproperties = HB_GLYPH_PROPERTIES_UNKNOWN;
executed (the execution status of this line is deduced): glyph->gproperties = 0xFFFF;
-
191 -
192 buffer->in_length++;
executed (the execution status of this line is deduced): buffer->in_length++;
-
193 -
194 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:3326586
3326586
195} -
196 -
197/* HarfBuzz-Internal API */ -
198 -
199HB_INTERNAL void -
200_hb_buffer_clear_output( HB_Buffer buffer ) -
201{ -
202 buffer->out_length = 0;
executed (the execution status of this line is deduced): buffer->out_length = 0;
-
203 buffer->out_pos = 0;
executed (the execution status of this line is deduced): buffer->out_pos = 0;
-
204 buffer->out_string = buffer->in_string;
executed (the execution status of this line is deduced): buffer->out_string = buffer->in_string;
-
205 buffer->separate_out = FALSE;
executed (the execution status of this line is deduced): buffer->separate_out = 0;
-
206}
executed: }
Execution Count:744297
744297
207 -
208HB_INTERNAL HB_Error -
209_hb_buffer_clear_positions( HB_Buffer buffer ) -
210{ -
211 if ( !buffer->positions )
evaluated: !buffer->positions
TRUEFALSE
yes
Evaluation Count:138
yes
Evaluation Count:247974
138-247974
212 { -
213 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
214 -
215 if ( ALLOC_ARRAY( buffer->positions, buffer->allocated, HB_PositionRec ) )
partially evaluated: ( (buffer->positions) = _hb_alloc( (buffer->allocated)*sizeof(HB_PositionRec), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:138
0-138
216 return error;
never executed: return error;
0
217 }
executed: }
Execution Count:138
138
218 -
219 memset (buffer->positions, 0, sizeof (buffer->positions[0]) * buffer->in_length);
executed (the execution status of this line is deduced): memset (buffer->positions, 0, sizeof (buffer->positions[0]) * buffer->in_length);
-
220 -
221 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:248112
248112
222} -
223 -
224HB_INTERNAL void -
225_hb_buffer_swap( HB_Buffer buffer ) -
226{ -
227 HB_GlyphItem tmp_string;
executed (the execution status of this line is deduced): HB_GlyphItem tmp_string;
-
228 int tmp_length;
executed (the execution status of this line is deduced): int tmp_length;
-
229 int tmp_pos;
executed (the execution status of this line is deduced): int tmp_pos;
-
230 -
231 if ( buffer->separate_out )
evaluated: buffer->separate_out
TRUEFALSE
yes
Evaluation Count:9876
yes
Evaluation Count:94
94-9876
232 { -
233 tmp_string = buffer->in_string;
executed (the execution status of this line is deduced): tmp_string = buffer->in_string;
-
234 buffer->in_string = buffer->out_string;
executed (the execution status of this line is deduced): buffer->in_string = buffer->out_string;
-
235 buffer->out_string = tmp_string;
executed (the execution status of this line is deduced): buffer->out_string = tmp_string;
-
236 buffer->alt_string = buffer->out_string;
executed (the execution status of this line is deduced): buffer->alt_string = buffer->out_string;
-
237 }
executed: }
Execution Count:9876
9876
238 -
239 tmp_length = buffer->in_length;
executed (the execution status of this line is deduced): tmp_length = buffer->in_length;
-
240 buffer->in_length = buffer->out_length;
executed (the execution status of this line is deduced): buffer->in_length = buffer->out_length;
-
241 buffer->out_length = tmp_length;
executed (the execution status of this line is deduced): buffer->out_length = tmp_length;
-
242 -
243 tmp_pos = buffer->in_pos;
executed (the execution status of this line is deduced): tmp_pos = buffer->in_pos;
-
244 buffer->in_pos = buffer->out_pos;
executed (the execution status of this line is deduced): buffer->in_pos = buffer->out_pos;
-
245 buffer->out_pos = tmp_pos;
executed (the execution status of this line is deduced): buffer->out_pos = tmp_pos;
-
246}
executed: }
Execution Count:9970
9970
247 -
248/* The following function copies `num_out' elements from `glyph_data' -
249 to `buffer->out_string', advancing the in array pointer in the structure -
250 by `num_in' elements, and the out array pointer by `num_out' elements. -
251 Finally, it sets the `length' field of `out' equal to -
252 `pos' of the `out' structure. -
253 -
254 If `component' is 0xFFFF, the component value from buffer->in_pos -
255 will copied `num_out' times, otherwise `component' itself will -
256 be used to fill the `component' fields. -
257 -
258 If `ligID' is 0xFFFF, the ligID value from buffer->in_pos -
259 will copied `num_out' times, otherwise `ligID' itself will -
260 be used to fill the `ligID' fields. -
261 -
262 The properties for all replacement glyphs are taken -
263 from the glyph at position `buffer->in_pos'. -
264 -
265 The cluster value for the glyph at position buffer->in_pos is used -
266 for all replacement glyphs */ -
267HB_INTERNAL HB_Error -
268_hb_buffer_add_output_glyphs( HB_Buffer buffer, -
269 HB_UShort num_in, -
270 HB_UShort num_out, -
271 HB_UShort *glyph_data, -
272 HB_UShort component, -
273 HB_UShort ligID ) -
274{ -
275 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
276 HB_UShort i;
executed (the execution status of this line is deduced): HB_UShort i;
-
277 HB_UInt properties;
executed (the execution status of this line is deduced): HB_UInt properties;
-
278 HB_UInt cluster;
executed (the execution status of this line is deduced): HB_UInt cluster;
-
279 -
280 error = hb_buffer_ensure( buffer, buffer->out_pos + num_out );
executed (the execution status of this line is deduced): error = hb_buffer_ensure( buffer, buffer->out_pos + num_out );
-
281 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
282 return error;
never executed: return error;
0
283 -
284 if ( !buffer->separate_out )
evaluated: !buffer->separate_out
TRUEFALSE
yes
Evaluation Count:9876
yes
Evaluation Count:103
103-9876
285 { -
286 error = hb_buffer_duplicate_out_buffer( buffer );
executed (the execution status of this line is deduced): error = hb_buffer_duplicate_out_buffer( buffer );
-
287 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9876
0-9876
288 return error;
never executed: return error;
0
289 }
executed: }
Execution Count:9876
9876
290 -
291 properties = buffer->in_string[buffer->in_pos].properties;
executed (the execution status of this line is deduced): properties = buffer->in_string[buffer->in_pos].properties;
-
292 cluster = buffer->in_string[buffer->in_pos].cluster;
executed (the execution status of this line is deduced): cluster = buffer->in_string[buffer->in_pos].cluster;
-
293 if ( component == 0xFFFF )
partially evaluated: component == 0xFFFF
TRUEFALSE
yes
Evaluation Count:9979
no
Evaluation Count:0
0-9979
294 component = buffer->in_string[buffer->in_pos].component;
executed: component = buffer->in_string[buffer->in_pos].component;
Execution Count:9979
9979
295 if ( ligID == 0xFFFF )
partially evaluated: ligID == 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
296 ligID = buffer->in_string[buffer->in_pos].ligID;
never executed: ligID = buffer->in_string[buffer->in_pos].ligID;
0
297 -
298 for ( i = 0; i < num_out; i++ )
evaluated: i < num_out
TRUEFALSE
yes
Evaluation Count:9979
yes
Evaluation Count:9979
9979
299 { -
300 HB_GlyphItem item = &buffer->out_string[buffer->out_pos + i];
executed (the execution status of this line is deduced): HB_GlyphItem item = &buffer->out_string[buffer->out_pos + i];
-
301 -
302 item->gindex = glyph_data[i];
executed (the execution status of this line is deduced): item->gindex = glyph_data[i];
-
303 item->properties = properties;
executed (the execution status of this line is deduced): item->properties = properties;
-
304 item->cluster = cluster;
executed (the execution status of this line is deduced): item->cluster = cluster;
-
305 item->component = component;
executed (the execution status of this line is deduced): item->component = component;
-
306 item->ligID = ligID;
executed (the execution status of this line is deduced): item->ligID = ligID;
-
307 item->gproperties = HB_GLYPH_PROPERTIES_UNKNOWN;
executed (the execution status of this line is deduced): item->gproperties = 0xFFFF;
-
308 }
executed: }
Execution Count:9979
9979
309 -
310 buffer->in_pos += num_in;
executed (the execution status of this line is deduced): buffer->in_pos += num_in;
-
311 buffer->out_pos += num_out;
executed (the execution status of this line is deduced): buffer->out_pos += num_out;
-
312 -
313 buffer->out_length = buffer->out_pos;
executed (the execution status of this line is deduced): buffer->out_length = buffer->out_pos;
-
314 -
315 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:9979
9979
316} -
317 -
318HB_INTERNAL HB_Error -
319_hb_buffer_add_output_glyph( HB_Buffer buffer, -
320 HB_UInt glyph_index, -
321 HB_UShort component, -
322 HB_UShort ligID ) -
323{ -
324 HB_UShort glyph_data = glyph_index;
never executed (the execution status of this line is deduced): HB_UShort glyph_data = glyph_index;
-
325 -
326 return _hb_buffer_add_output_glyphs ( buffer, 1, 1,
never executed: return _hb_buffer_add_output_glyphs ( buffer, 1, 1, &glyph_data, component, ligID );
0
327 &glyph_data, component, ligID );
never executed: return _hb_buffer_add_output_glyphs ( buffer, 1, 1, &glyph_data, component, ligID );
0
328} -
329 -
330HB_INTERNAL HB_Error -
331_hb_buffer_copy_output_glyph ( HB_Buffer buffer ) -
332{ -
333 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
334 -
335 error = hb_buffer_ensure( buffer, buffer->out_pos + 1 );
executed (the execution status of this line is deduced): error = hb_buffer_ensure( buffer, buffer->out_pos + 1 );
-
336 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9548054
0-9548054
337 return error;
never executed: return error;
0
338 -
339 if ( buffer->separate_out )
evaluated: buffer->separate_out
TRUEFALSE
yes
Evaluation Count:89007
yes
Evaluation Count:9459047
89007-9459047
340 { -
341 buffer->out_string[buffer->out_pos] = buffer->in_string[buffer->in_pos];
executed (the execution status of this line is deduced): buffer->out_string[buffer->out_pos] = buffer->in_string[buffer->in_pos];
-
342 }
executed: }
Execution Count:89007
89007
343 -
344 buffer->in_pos++;
executed (the execution status of this line is deduced): buffer->in_pos++;
-
345 buffer->out_pos++;
executed (the execution status of this line is deduced): buffer->out_pos++;
-
346 buffer->out_length = buffer->out_pos;
executed (the execution status of this line is deduced): buffer->out_length = buffer->out_pos;
-
347 -
348 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:9548054
9548054
349} -
350 -
351HB_INTERNAL HB_Error -
352_hb_buffer_replace_output_glyph( HB_Buffer buffer, -
353 HB_UInt glyph_index, -
354 HB_Bool inplace ) -
355{ -
356 -
357 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
358 -
359 if ( inplace )
partially evaluated: inplace
TRUEFALSE
yes
Evaluation Count:130
no
Evaluation Count:0
0-130
360 { -
361 error = _hb_buffer_copy_output_glyph ( buffer );
executed (the execution status of this line is deduced): error = _hb_buffer_copy_output_glyph ( buffer );
-
362 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
363 return error;
never executed: return error;
0
364 -
365 buffer->out_string[buffer->out_pos-1].gindex = glyph_index;
executed (the execution status of this line is deduced): buffer->out_string[buffer->out_pos-1].gindex = glyph_index;
-
366 }
executed: }
Execution Count:130
130
367 else -
368 { -
369 return _hb_buffer_add_output_glyph( buffer, glyph_index, 0xFFFF, 0xFFFF );
never executed: return _hb_buffer_add_output_glyph( buffer, glyph_index, 0xFFFF, 0xFFFF );
0
370 } -
371 -
372 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:130
130
373} -
374 -
375HB_INTERNAL HB_UShort -
376_hb_buffer_allocate_ligid( HB_Buffer buffer ) -
377{ -
378 buffer->max_ligID++;
executed (the execution status of this line is deduced): buffer->max_ligID++;
-
379 if (HB_UNLIKELY (buffer->max_ligID == 0))
partially evaluated: (buffer->max_ligID == 0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
380 buffer->max_ligID++;
never executed: buffer->max_ligID++;
0
381 -
382 return buffer->max_ligID;
executed: return buffer->max_ligID;
Execution Count:9979
9979
383} -
384 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial