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

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/* -
2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg -
3 * Copyright (C) 2006 Behdad Esfahbod -
4 * Copyright (C) 2007 Red Hat, Inc. -
5 * -
6 * This is part of HarfBuzz, an OpenType Layout engine library. -
7 * -
8 * Permission is hereby granted, without written agreement and without -
9 * license or royalty fees, to use, copy, modify, and distribute this -
10 * software and its documentation for any purpose, provided that the -
11 * above copyright notice and the following two paragraphs appear in -
12 * all copies of this software. -
13 * -
14 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR -
15 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES -
16 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN -
17 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -
18 * DAMAGE. -
19 * -
20 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, -
21 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -
22 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS -
23 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO -
24 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -
25 * -
26 * Red Hat Author(s): Behdad Esfahbod -
27 */ -
28 -
29#include "harfbuzz-impl.h" -
30#include "harfbuzz-gsub-private.h" -
31#include "harfbuzz-open-private.h" -
32#include "harfbuzz-gdef-private.h" -
33 -
34static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub, -
35 HB_UShort lookup_index, -
36 HB_Buffer buffer, -
37 HB_UShort context_length, -
38 int nesting_level ); -
39 -
40 -
41 -
42/********************** -
43 * Auxiliary functions -
44 **********************/ -
45 -
46 -
47 -
48HB_Error HB_Load_GSUB_Table( HB_Stream stream, -
49 HB_GSUBHeader** retptr, -
50 HB_GDEFHeader* gdef, -
51 HB_Stream gdefStream ) -
52{ -
53 HB_Error error = HB_Err_Ok;
executed (the execution status of this line is deduced): HB_Error error = HB_Err_Ok;
-
54 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
55 -
56 HB_GSUBHeader* gsub;
executed (the execution status of this line is deduced): HB_GSUBHeader* gsub;
-
57 -
58 if ( !retptr )
partially evaluated: !retptr
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
59 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
60 -
61 if ( GOTO_Table( TTAG_GSUB ) )
partially evaluated: (0)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
62 return error;
never executed: return error;
0
63 -
64 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
65 -
66 if ( ALLOC ( gsub, sizeof( *gsub ) ) )
partially evaluated: ( (gsub) = _hb_alloc( sizeof( *gsub ), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
67 return error;
never executed: return error;
0
68 -
69 -
70 /* skip version */ -
71 -
72 if ( FILE_Seek( base_offset + 4L ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, base_offset + 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
73 ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
74 goto Fail4;
never executed: goto Fail4;
0
75 -
76 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
77 -
78 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
79 -
80 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
81 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
82 ( error = _HB_OPEN_Load_ScriptList( &gsub->ScriptList,
partially evaluated: ( error = _HB_OPEN_Load_ScriptList( &gsub->ScriptList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
83 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_ScriptList( &gsub->ScriptList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
84 goto Fail4;
never executed: goto Fail4;
0
85 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
86 -
87 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
88 goto Fail3;
never executed: goto Fail3;
0
89 -
90 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
91 -
92 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
93 -
94 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
95 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
96 ( error = _HB_OPEN_Load_FeatureList( &gsub->FeatureList,
partially evaluated: ( error = _HB_OPEN_Load_FeatureList( &gsub->FeatureList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
97 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_FeatureList( &gsub->FeatureList, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
98 goto Fail3;
never executed: goto Fail3;
0
99 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
100 -
101 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
102 goto Fail2;
never executed: goto Fail2;
0
103 -
104 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
105 -
106 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
107 -
108 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
109 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
110 ( error = _HB_OPEN_Load_LookupList( &gsub->LookupList,
partially evaluated: ( error = _HB_OPEN_Load_LookupList( &gsub->LookupList, stream, HB_Type_GSUB ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
111 stream, HB_Type_GSUB ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_LookupList( &gsub->LookupList, stream, HB_Type_GSUB ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
112 goto Fail2;
never executed: goto Fail2;
0
113 -
114 gsub->gdef = gdef; /* can be NULL */
executed (the execution status of this line is deduced): gsub->gdef = gdef;
-
115 -
116 if ( ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream,
partially evaluated: ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream, gsub->LookupList.Lookup, gsub->LookupList.LookupCount ) )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
117 gsub->LookupList.Lookup,
partially evaluated: ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream, gsub->LookupList.Lookup, gsub->LookupList.LookupCount ) )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
118 gsub->LookupList.LookupCount ) ) )
partially evaluated: ( error = _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( gdef, gdefStream, gsub->LookupList.Lookup, gsub->LookupList.LookupCount ) )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:139
0-139
119 goto Fail1;
never executed: goto Fail1;
0
120 -
121 *retptr = gsub;
executed (the execution status of this line is deduced): *retptr = gsub;
-
122 -
123 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:139
139
124 -
125Fail1: -
126 _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
-
127 -
128Fail2:
code before this statement never executed: Fail2:
0
129 _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
-
130 -
131Fail3:
code before this statement never executed: Fail3:
0
132 _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
-
133 -
134Fail4:
code before this statement never executed: Fail4:
0
135 FREE ( gsub );
never executed: }
never executed: }
never evaluated: (gsub)
never evaluated: 0
0
136 -
137 -
138 return error;
never executed: return error;
0
139} -
140 -
141 -
142HB_Error HB_Done_GSUB_Table( HB_GSUBHeader* gsub ) -
143{ -
144 _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
executed (the execution status of this line is deduced): _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
-
145 _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
executed (the execution status of this line is deduced): _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
-
146 _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
executed (the execution status of this line is deduced): _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
-
147 -
148 FREE( gsub );
executed: }
Execution Count:132
executed: }
Execution Count:132
partially evaluated: (gsub)
TRUEFALSE
yes
Evaluation Count:132
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:132
0-132
149 -
150 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:132
132
151} -
152 -
153/***************************** -
154 * SubTable related functions -
155 *****************************/ -
156 -
157 -
158/* LookupType 1 */ -
159 -
160/* SingleSubstFormat1 */ -
161/* SingleSubstFormat2 */ -
162 -
163static HB_Error Load_SingleSubst( HB_GSUB_SubTable* st, -
164 HB_Stream stream ) -
165{ -
166 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
167 HB_SingleSubst* ss = &st->single;
executed (the execution status of this line is deduced): HB_SingleSubst* ss = &st->single;
-
168 -
169 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
170 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
171 -
172 HB_UShort* s;
executed (the execution status of this line is deduced): HB_UShort* s;
-
173 -
174 -
175 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
176 -
177 if ( ACCESS_Frame( 4L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2925
0-2925
178 return error;
never executed: return error;
0
179 -
180 ss->SubstFormat = GET_UShort();
executed (the execution status of this line is deduced): ss->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
181 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
182 -
183 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
184 -
185 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
186 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2925
0-2925
187 ( error = _HB_OPEN_Load_Coverage( &ss->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ss->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2925
0-2925
188 return error;
never executed: return error;
0
189 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
190 -
191 switch ( ss->SubstFormat ) -
192 { -
193 case 1: -
194 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1258
0-1258
195 goto Fail2;
never executed: goto Fail2;
0
196 -
197 ss->ssf.ssf1.DeltaGlyphID = GET_UShort();
executed (the execution status of this line is deduced): ss->ssf.ssf1.DeltaGlyphID = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
198 -
199 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
200 -
201 break;
executed: break;
Execution Count:1258
1258
202 -
203 case 2: -
204 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1667
0-1667
205 goto Fail2;
never executed: goto Fail2;
0
206 -
207 count = ss->ssf.ssf2.GlyphCount = GET_UShort();
executed (the execution status of this line is deduced): count = ss->ssf.ssf2.GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
208 -
209 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
210 -
211 ss->ssf.ssf2.Substitute = NULL;
executed (the execution status of this line is deduced): ss->ssf.ssf2.Substitute = ((void *)0);
-
212 -
213 if ( ALLOC_ARRAY( ss->ssf.ssf2.Substitute, count, HB_UShort ) )
partially evaluated: ( (ss->ssf.ssf2.Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1667
0-1667
214 goto Fail2;
never executed: goto Fail2;
0
215 -
216 s = ss->ssf.ssf2.Substitute;
executed (the execution status of this line is deduced): s = ss->ssf.ssf2.Substitute;
-
217 -
218 if ( ACCESS_Frame( count * 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1667
0-1667
219 goto Fail1;
never executed: goto Fail1;
0
220 -
221 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:53854
yes
Evaluation Count:1667
1667-53854
222 s[n] = GET_UShort();
executed: s[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:53854
53854
223 -
224 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
225 -
226 break;
executed: break;
Execution Count:1667
1667
227 -
228 default: -
229 return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
230 } -
231 -
232 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2925
2925
233 -
234Fail1: -
235 FREE( s );
never executed: }
never executed: }
never evaluated: (s)
never evaluated: 0
0
236 -
237Fail2:
code before this statement never executed: Fail2:
0
238 _HB_OPEN_Free_Coverage( &ss->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ss->Coverage );
-
239 return error;
never executed: return error;
0
240} -
241 -
242 -
243static void Free_SingleSubst( HB_GSUB_SubTable* st ) -
244{ -
245 HB_SingleSubst* ss = &st->single;
executed (the execution status of this line is deduced): HB_SingleSubst* ss = &st->single;
-
246 -
247 switch ( ss->SubstFormat ) -
248 { -
249 case 1: -
250 break;
executed: break;
Execution Count:1196
1196
251 -
252 case 2: -
253 FREE( ss->ssf.ssf2.Substitute );
executed: }
Execution Count:1584
executed: }
Execution Count:1584
partially evaluated: (ss->ssf.ssf2.Substitute)
TRUEFALSE
yes
Evaluation Count:1584
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1584
0-1584
254 break;
executed: break;
Execution Count:1584
1584
255 -
256 default: -
257 break;
never executed: break;
0
258 } -
259 -
260 _HB_OPEN_Free_Coverage( &ss->Coverage );
executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ss->Coverage );
-
261}
executed: }
Execution Count:2780
2780
262 -
263 -
264static HB_Error Lookup_SingleSubst( HB_GSUBHeader* gsub, -
265 HB_GSUB_SubTable* st, -
266 HB_Buffer buffer, -
267 HB_UShort flags, -
268 HB_UShort context_length, -
269 int nesting_level ) -
270{ -
271 HB_UShort index, value, property;
executed (the execution status of this line is deduced): HB_UShort index, value, property;
-
272 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
273 HB_SingleSubst* ss = &st->single;
executed (the execution status of this line is deduced): HB_SingleSubst* ss = &st->single;
-
274 HB_GDEFHeader* gdef = gsub->gdef;
executed (the execution status of this line is deduced): HB_GDEFHeader* gdef = gsub->gdef;
-
275 -
276 HB_UNUSED(nesting_level);
executed (the execution status of this line is deduced): ((nesting_level) = (nesting_level));
-
277 -
278 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
never evaluated: context_length < 1
0-130
279 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
280 -
281 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
282 return error;
never executed: return error;
0
283 -
284 error = _HB_OPEN_Coverage_Index( &ss->Coverage, IN_CURGLYPH(), &index );
executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &ss->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
285 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
286 return error;
never executed: return error;
0
287 -
288 switch ( ss->SubstFormat ) -
289 { -
290 case 1: -
291 value = ( IN_CURGLYPH() + ss->ssf.ssf1.DeltaGlyphID ) & 0xFFFF;
never executed (the execution status of this line is deduced): value = ( (buffer->in_string[buffer->in_pos].gindex) + ss->ssf.ssf1.DeltaGlyphID ) & 0xFFFF;
-
292 if ( REPLACE_Glyph( buffer, value, nesting_level ) )
never evaluated: ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok )
0
293 return error;
never executed: return error;
0
294 break;
never executed: break;
0
295 -
296 case 2: -
297 if ( index >= ss->ssf.ssf2.GlyphCount )
partially evaluated: index >= ss->ssf.ssf2.GlyphCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
298 return ERR(HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
299 value = ss->ssf.ssf2.Substitute[index];
executed (the execution status of this line is deduced): value = ss->ssf.ssf2.Substitute[index];
-
300 if ( REPLACE_Glyph( buffer, value, nesting_level ) )
partially evaluated: ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
301 return error;
never executed: return error;
0
302 break;
executed: break;
Execution Count:130
130
303 -
304 default: -
305 return ERR(HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
306 } -
307 -
308 if ( gdef && gdef->NewGlyphClasses )
partially evaluated: gdef
TRUEFALSE
yes
Evaluation Count:130
no
Evaluation Count:0
partially evaluated: gdef->NewGlyphClasses
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:130
0-130
309 { -
310 /* we inherit the old glyph class to the substituted glyph */ -
311 -
312 error = _HB_GDEF_Add_Glyph_Property( gdef, value, property );
never executed (the execution status of this line is deduced): error = _HB_GDEF_Add_Glyph_Property( gdef, value, property );
-
313 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
314 return error;
never executed: return error;
0
315 }
never executed: }
0
316 -
317 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:130
130
318} -
319 -
320 -
321/* LookupType 2 */ -
322 -
323/* Sequence */ -
324 -
325static HB_Error Load_Sequence( HB_Sequence* s, -
326 HB_Stream stream ) -
327{ -
328 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
329 -
330 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
331 HB_UShort* sub;
executed (the execution status of this line is deduced): HB_UShort* sub;
-
332 -
333 -
334 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
335 return error;
never executed: return error;
0
336 -
337 count = s->GlyphCount = GET_UShort();
executed (the execution status of this line is deduced): count = s->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
338 -
339 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
340 -
341 s->Substitute = NULL;
executed (the execution status of this line is deduced): s->Substitute = ((void *)0);
-
342 -
343 if ( count )
partially evaluated: count
TRUEFALSE
yes
Evaluation Count:135
no
Evaluation Count:0
0-135
344 { -
345 if ( ALLOC_ARRAY( s->Substitute, count, HB_UShort ) )
partially evaluated: ( (s->Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
346 return error;
never executed: return error;
0
347 -
348 sub = s->Substitute;
executed (the execution status of this line is deduced): sub = s->Substitute;
-
349 -
350 if ( ACCESS_Frame( count * 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
351 { -
352 FREE( sub );
never executed: }
never executed: }
never evaluated: (sub)
never evaluated: 0
0
353 return error;
never executed: return error;
0
354 } -
355 -
356 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:270
yes
Evaluation Count:135
135-270
357 sub[n] = GET_UShort();
executed: sub[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:270
270
358 -
359 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
360 }
executed: }
Execution Count:135
135
361 -
362 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:135
135
363} -
364 -
365 -
366static void Free_Sequence( HB_Sequence* s ) -
367{ -
368 FREE( s->Substitute );
executed: }
Execution Count:135
executed: }
Execution Count:135
partially evaluated: (s->Substitute)
TRUEFALSE
yes
Evaluation Count:135
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
369}
executed: }
Execution Count:135
135
370 -
371 -
372/* MultipleSubstFormat1 */ -
373 -
374static HB_Error Load_MultipleSubst( HB_GSUB_SubTable* st, -
375 HB_Stream stream ) -
376{ -
377 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
378 HB_MultipleSubst* ms = &st->multiple;
executed (the execution status of this line is deduced): HB_MultipleSubst* ms = &st->multiple;
-
379 -
380 HB_UShort n = 0, m, count;
executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
381 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
382 -
383 HB_Sequence* s;
executed (the execution status of this line is deduced): HB_Sequence* s;
-
384 -
385 -
386 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
387 -
388 if ( ACCESS_Frame( 4L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
389 return error;
never executed: return error;
0
390 -
391 ms->SubstFormat = GET_UShort(); /* should be 1 */
executed (the execution status of this line is deduced): ms->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
392 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
393 -
394 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
395 -
396 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
397 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
398 ( error = _HB_OPEN_Load_Coverage( &ms->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ms->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
399 return error;
never executed: return error;
0
400 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
401 -
402 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
403 goto Fail2;
never executed: goto Fail2;
0
404 -
405 count = ms->SequenceCount = GET_UShort();
executed (the execution status of this line is deduced): count = ms->SequenceCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
406 -
407 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
408 -
409 ms->Sequence = NULL;
executed (the execution status of this line is deduced): ms->Sequence = ((void *)0);
-
410 -
411 if ( ALLOC_ARRAY( ms->Sequence, count, HB_Sequence ) )
partially evaluated: ( (ms->Sequence) = _hb_alloc( (count)*sizeof(HB_Sequence), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
412 goto Fail2;
never executed: goto Fail2;
0
413 -
414 s = ms->Sequence;
executed (the execution status of this line is deduced): s = ms->Sequence;
-
415 -
416 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:135
yes
Evaluation Count:8
8-135
417 { -
418 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
419 goto Fail1;
never executed: goto Fail1;
0
420 -
421 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
422 -
423 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
424 -
425 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
426 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
427 ( error = Load_Sequence( &s[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Sequence( &s[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:135
0-135
428 goto Fail1;
never executed: goto Fail1;
0
429 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
430 }
executed: }
Execution Count:135
135
431 -
432 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:8
8
433 -
434Fail1: -
435 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
436 Free_Sequence( &s[m] );
never executed: Free_Sequence( &s[m] );
0
437 -
438 FREE( s );
never executed: }
never executed: }
never evaluated: (s)
never evaluated: 0
0
439 -
440Fail2:
code before this statement never executed: Fail2:
0
441 _HB_OPEN_Free_Coverage( &ms->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ms->Coverage );
-
442 return error;
never executed: return error;
0
443} -
444 -
445 -
446static void Free_MultipleSubst( HB_GSUB_SubTable* st ) -
447{ -
448 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
449 HB_MultipleSubst* ms = &st->multiple;
executed (the execution status of this line is deduced): HB_MultipleSubst* ms = &st->multiple;
-
450 -
451 HB_Sequence* s;
executed (the execution status of this line is deduced): HB_Sequence* s;
-
452 -
453 -
454 if ( ms->Sequence )
partially evaluated: ms->Sequence
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
0-8
455 { -
456 count = ms->SequenceCount;
executed (the execution status of this line is deduced): count = ms->SequenceCount;
-
457 s = ms->Sequence;
executed (the execution status of this line is deduced): s = ms->Sequence;
-
458 -
459 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:135
yes
Evaluation Count:8
8-135
460 Free_Sequence( &s[n] );
executed: Free_Sequence( &s[n] );
Execution Count:135
135
461 -
462 FREE( s );
executed: }
Execution Count:8
executed: }
Execution Count:8
partially evaluated: (s)
TRUEFALSE
yes
Evaluation Count:8
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
463 }
executed: }
Execution Count:8
8
464 -
465 _HB_OPEN_Free_Coverage( &ms->Coverage );
executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ms->Coverage );
-
466}
executed: }
Execution Count:8
8
467 -
468 -
469static HB_Error Lookup_MultipleSubst( HB_GSUBHeader* gsub, -
470 HB_GSUB_SubTable* st, -
471 HB_Buffer buffer, -
472 HB_UShort flags, -
473 HB_UShort context_length, -
474 int nesting_level ) -
475{ -
476 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
477 HB_UShort index, property, n, count;
executed (the execution status of this line is deduced): HB_UShort index, property, n, count;
-
478 HB_UShort*s;
executed (the execution status of this line is deduced): HB_UShort*s;
-
479 HB_MultipleSubst* ms = &st->multiple;
executed (the execution status of this line is deduced): HB_MultipleSubst* ms = &st->multiple;
-
480 HB_GDEFHeader* gdef = gsub->gdef;
executed (the execution status of this line is deduced): HB_GDEFHeader* gdef = gsub->gdef;
-
481 -
482 HB_UNUSED(nesting_level);
executed (the execution status of this line is deduced): ((nesting_level) = (nesting_level));
-
483 -
484 if ( context_length != 0xFFFF && context_length < 1 )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:411685
never evaluated: context_length < 1
0-411685
485 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
486 -
487 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:411685
0-411685
488 return error;
never executed: return error;
0
489 -
490 error = _HB_OPEN_Coverage_Index( &ms->Coverage, IN_CURGLYPH(), &index );
executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &ms->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
491 if ( error )
partially evaluated: error
TRUEFALSE
yes
Evaluation Count:411685
no
Evaluation Count:0
0-411685
492 return error;
executed: return error;
Execution Count:411685
411685
493 -
494 if ( index >= ms->SequenceCount )
never evaluated: index >= ms->SequenceCount
0
495 return ERR(HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
496 -
497 count = ms->Sequence[index].GlyphCount;
never executed (the execution status of this line is deduced): count = ms->Sequence[index].GlyphCount;
-
498 s = ms->Sequence[index].Substitute;
never executed (the execution status of this line is deduced): s = ms->Sequence[index].Substitute;
-
499 -
500 if ( ADD_String( buffer, 1, count, s, 0xFFFF, 0xFFFF ) )
never evaluated: ( ( error = _hb_buffer_add_output_glyphs( (buffer), (1), (count), (s), (0xFFFF), (0xFFFF) ) ) != HB_Err_Ok )
0
501 return error;
never executed: return error;
0
502 -
503 if ( gdef && gdef->NewGlyphClasses )
never evaluated: gdef
never evaluated: gdef->NewGlyphClasses
0
504 { -
505 /* this is a guess only ... */ -
506 -
507 if ( property == HB_GDEF_LIGATURE )
never evaluated: property == 0x0004
0
508 property = HB_GDEF_BASE_GLYPH;
never executed: property = 0x0002;
0
509 -
510 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
511 { -
512 error = _HB_GDEF_Add_Glyph_Property( gdef, s[n], property );
never executed (the execution status of this line is deduced): error = _HB_GDEF_Add_Glyph_Property( gdef, s[n], property );
-
513 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
514 return error;
never executed: return error;
0
515 }
never executed: }
0
516 }
never executed: }
0
517 -
518 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
519} -
520 -
521 -
522/* LookupType 3 */ -
523 -
524/* AlternateSet */ -
525 -
526static HB_Error Load_AlternateSet( HB_AlternateSet* as, -
527 HB_Stream stream ) -
528{ -
529 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
530 -
531 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
532 HB_UShort* a;
executed (the execution status of this line is deduced): HB_UShort* a;
-
533 -
534 -
535 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
536 return error;
never executed: return error;
0
537 -
538 count = as->GlyphCount = GET_UShort();
executed (the execution status of this line is deduced): count = as->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
539 -
540 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
541 -
542 as->Alternate = NULL;
executed (the execution status of this line is deduced): as->Alternate = ((void *)0);
-
543 -
544 if ( ALLOC_ARRAY( as->Alternate, count, HB_UShort ) )
partially evaluated: ( (as->Alternate) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
545 return error;
never executed: return error;
0
546 -
547 a = as->Alternate;
executed (the execution status of this line is deduced): a = as->Alternate;
-
548 -
549 if ( ACCESS_Frame( count * 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
550 { -
551 FREE( a );
never executed: }
never executed: }
never evaluated: (a)
never evaluated: 0
0
552 return error;
never executed: return error;
0
553 } -
554 -
555 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:733
yes
Evaluation Count:733
733
556 a[n] = GET_UShort();
executed: a[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:733
733
557 -
558 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
559 -
560 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:733
733
561} -
562 -
563 -
564static void Free_AlternateSet( HB_AlternateSet* as ) -
565{ -
566 FREE( as->Alternate );
executed: }
Execution Count:697
executed: }
Execution Count:697
partially evaluated: (as->Alternate)
TRUEFALSE
yes
Evaluation Count:697
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:697
0-697
567}
executed: }
Execution Count:697
697
568 -
569 -
570/* AlternateSubstFormat1 */ -
571 -
572static HB_Error Load_AlternateSubst( HB_GSUB_SubTable* st, -
573 HB_Stream stream ) -
574{ -
575 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
576 HB_AlternateSubst* as = &st->alternate;
executed (the execution status of this line is deduced): HB_AlternateSubst* as = &st->alternate;
-
577 -
578 HB_UShort n = 0, m, count;
executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
579 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
580 -
581 HB_AlternateSet* aset;
executed (the execution status of this line is deduced): HB_AlternateSet* aset;
-
582 -
583 -
584 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
585 -
586 if ( ACCESS_Frame( 4L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
587 return error;
never executed: return error;
0
588 -
589 as->SubstFormat = GET_UShort(); /* should be 1 */
executed (the execution status of this line is deduced): as->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
590 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
591 -
592 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
593 -
594 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
595 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
596 ( error = _HB_OPEN_Load_Coverage( &as->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &as->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
597 return error;
never executed: return error;
0
598 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
599 -
600 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
601 goto Fail2;
never executed: goto Fail2;
0
602 -
603 count = as->AlternateSetCount = GET_UShort();
executed (the execution status of this line is deduced): count = as->AlternateSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
604 -
605 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
606 -
607 as->AlternateSet = NULL;
executed (the execution status of this line is deduced): as->AlternateSet = ((void *)0);
-
608 -
609 if ( ALLOC_ARRAY( as->AlternateSet, count, HB_AlternateSet ) )
partially evaluated: ( (as->AlternateSet) = _hb_alloc( (count)*sizeof(HB_AlternateSet), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:123
0-123
610 goto Fail2;
never executed: goto Fail2;
0
611 -
612 aset = as->AlternateSet;
executed (the execution status of this line is deduced): aset = as->AlternateSet;
-
613 -
614 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:733
yes
Evaluation Count:123
123-733
615 { -
616 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
617 goto Fail1;
never executed: goto Fail1;
0
618 -
619 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
620 -
621 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
622 -
623 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
624 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
625 ( error = Load_AlternateSet( &aset[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_AlternateSet( &aset[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:733
0-733
626 goto Fail1;
never executed: goto Fail1;
0
627 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
628 }
executed: }
Execution Count:733
733
629 -
630 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:123
123
631 -
632Fail1: -
633 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
634 Free_AlternateSet( &aset[m] );
never executed: Free_AlternateSet( &aset[m] );
0
635 -
636 FREE( aset );
never executed: }
never executed: }
never evaluated: (aset)
never evaluated: 0
0
637 -
638Fail2:
code before this statement never executed: Fail2:
0
639 _HB_OPEN_Free_Coverage( &as->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &as->Coverage );
-
640 return error;
never executed: return error;
0
641} -
642 -
643 -
644static void Free_AlternateSubst( HB_GSUB_SubTable* st ) -
645{ -
646 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
647 HB_AlternateSubst* as = &st->alternate;
executed (the execution status of this line is deduced): HB_AlternateSubst* as = &st->alternate;
-
648 -
649 HB_AlternateSet* aset;
executed (the execution status of this line is deduced): HB_AlternateSet* aset;
-
650 -
651 -
652 if ( as->AlternateSet )
partially evaluated: as->AlternateSet
TRUEFALSE
yes
Evaluation Count:117
no
Evaluation Count:0
0-117
653 { -
654 count = as->AlternateSetCount;
executed (the execution status of this line is deduced): count = as->AlternateSetCount;
-
655 aset = as->AlternateSet;
executed (the execution status of this line is deduced): aset = as->AlternateSet;
-
656 -
657 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:697
yes
Evaluation Count:117
117-697
658 Free_AlternateSet( &aset[n] );
executed: Free_AlternateSet( &aset[n] );
Execution Count:697
697
659 -
660 FREE( aset );
executed: }
Execution Count:117
executed: }
Execution Count:117
partially evaluated: (aset)
TRUEFALSE
yes
Evaluation Count:117
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:117
0-117
661 }
executed: }
Execution Count:117
117
662 -
663 _HB_OPEN_Free_Coverage( &as->Coverage );
executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &as->Coverage );
-
664}
executed: }
Execution Count:117
117
665 -
666 -
667static HB_Error Lookup_AlternateSubst( HB_GSUBHeader* gsub, -
668 HB_GSUB_SubTable* st, -
669 HB_Buffer buffer, -
670 HB_UShort flags, -
671 HB_UShort context_length, -
672 int nesting_level ) -
673{ -
674 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
675 HB_UShort index, value, alt_index, property;
never executed (the execution status of this line is deduced): HB_UShort index, value, alt_index, property;
-
676 HB_AlternateSubst* as = &st->alternate;
never executed (the execution status of this line is deduced): HB_AlternateSubst* as = &st->alternate;
-
677 HB_GDEFHeader* gdef = gsub->gdef;
never executed (the execution status of this line is deduced): HB_GDEFHeader* gdef = gsub->gdef;
-
678 HB_AlternateSet aset;
never executed (the execution status of this line is deduced): HB_AlternateSet aset;
-
679 -
680 HB_UNUSED(nesting_level);
never executed (the execution status of this line is deduced): ((nesting_level) = (nesting_level));
-
681 -
682 if ( context_length != 0xFFFF && context_length < 1 )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < 1
0
683 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
684 -
685 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
686 return error;
never executed: return error;
0
687 -
688 error = _HB_OPEN_Coverage_Index( &as->Coverage, IN_CURGLYPH(), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &as->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
689 if ( error )
never evaluated: error
0
690 return error;
never executed: return error;
0
691 -
692 aset = as->AlternateSet[index];
never executed (the execution status of this line is deduced): aset = as->AlternateSet[index];
-
693 -
694 /* we use a user-defined callback function to get the alternate index */ -
695 -
696 if ( gsub->altfunc )
never evaluated: gsub->altfunc
0
697 alt_index = (gsub->altfunc)( buffer->out_pos, IN_CURGLYPH(),
never executed: alt_index = (gsub->altfunc)( buffer->out_pos, (buffer->in_string[buffer->in_pos].gindex), aset.GlyphCount, aset.Alternate, gsub->data );
0
698 aset.GlyphCount, aset.Alternate,
never executed: alt_index = (gsub->altfunc)( buffer->out_pos, (buffer->in_string[buffer->in_pos].gindex), aset.GlyphCount, aset.Alternate, gsub->data );
0
699 gsub->data );
never executed: alt_index = (gsub->altfunc)( buffer->out_pos, (buffer->in_string[buffer->in_pos].gindex), aset.GlyphCount, aset.Alternate, gsub->data );
0
700 else -
701 alt_index = 0;
never executed: alt_index = 0;
0
702 -
703 value = aset.Alternate[alt_index];
never executed (the execution status of this line is deduced): value = aset.Alternate[alt_index];
-
704 if ( REPLACE_Glyph( buffer, value, nesting_level ) )
never evaluated: ( ( error = _hb_buffer_replace_output_glyph( (buffer), (value), (nesting_level) == 1 ) ) != HB_Err_Ok )
0
705 return error;
never executed: return error;
0
706 -
707 if ( gdef && gdef->NewGlyphClasses )
never evaluated: gdef
never evaluated: gdef->NewGlyphClasses
0
708 { -
709 /* we inherit the old glyph class to the substituted glyph */ -
710 -
711 error = _HB_GDEF_Add_Glyph_Property( gdef, value, property );
never executed (the execution status of this line is deduced): error = _HB_GDEF_Add_Glyph_Property( gdef, value, property );
-
712 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
713 return error;
never executed: return error;
0
714 }
never executed: }
0
715 -
716 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
717} -
718 -
719 -
720/* LookupType 4 */ -
721 -
722/* Ligature */ -
723 -
724static HB_Error Load_Ligature( HB_Ligature* l, -
725 HB_Stream stream ) -
726{ -
727 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
728 -
729 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
730 HB_UShort* c;
executed (the execution status of this line is deduced): HB_UShort* c;
-
731 -
732 -
733 if ( ACCESS_Frame( 4L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
734 return error;
never executed: return error;
0
735 -
736 l->LigGlyph = GET_UShort();
executed (the execution status of this line is deduced): l->LigGlyph = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
737 l->ComponentCount = GET_UShort();
executed (the execution status of this line is deduced): l->ComponentCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
738 -
739 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
740 -
741 l->Component = NULL;
executed (the execution status of this line is deduced): l->Component = ((void *)0);
-
742 -
743 count = l->ComponentCount - 1; /* only ComponentCount - 1 elements */
executed (the execution status of this line is deduced): count = l->ComponentCount - 1;
-
744 -
745 if ( ALLOC_ARRAY( l->Component, count, HB_UShort ) )
partially evaluated: ( (l->Component) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
746 return error;
never executed: return error;
0
747 -
748 c = l->Component;
executed (the execution status of this line is deduced): c = l->Component;
-
749 -
750 if ( ACCESS_Frame( count * 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
751 { -
752 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
753 return error;
never executed: return error;
0
754 } -
755 -
756 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:19535
yes
Evaluation Count:17863
17863-19535
757 c[n] = GET_UShort();
executed: c[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:19535
19535
758 -
759 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
760 -
761 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:17863
17863
762} -
763 -
764 -
765static void Free_Ligature( HB_Ligature* l ) -
766{ -
767 FREE( l->Component );
executed: }
Execution Count:17229
executed: }
Execution Count:17229
partially evaluated: (l->Component)
TRUEFALSE
yes
Evaluation Count:17229
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17229
0-17229
768}
executed: }
Execution Count:17229
17229
769 -
770 -
771/* LigatureSet */ -
772 -
773static HB_Error Load_LigatureSet( HB_LigatureSet* ls, -
774 HB_Stream stream ) -
775{ -
776 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
777 -
778 HB_UShort n = 0, m, count;
executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
779 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
780 -
781 HB_Ligature* l;
executed (the execution status of this line is deduced): HB_Ligature* l;
-
782 -
783 -
784 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
785 -
786 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9759
0-9759
787 return error;
never executed: return error;
0
788 -
789 count = ls->LigatureCount = GET_UShort();
executed (the execution status of this line is deduced): count = ls->LigatureCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
790 -
791 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
792 -
793 ls->Ligature = NULL;
executed (the execution status of this line is deduced): ls->Ligature = ((void *)0);
-
794 -
795 if ( ALLOC_ARRAY( ls->Ligature, count, HB_Ligature ) )
partially evaluated: ( (ls->Ligature) = _hb_alloc( (count)*sizeof(HB_Ligature), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9759
0-9759
796 return error;
never executed: return error;
0
797 -
798 l = ls->Ligature;
executed (the execution status of this line is deduced): l = ls->Ligature;
-
799 -
800 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:17863
yes
Evaluation Count:9759
9759-17863
801 { -
802 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
803 goto Fail;
never executed: goto Fail;
0
804 -
805 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
806 -
807 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
808 -
809 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
810 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
811 ( error = Load_Ligature( &l[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Ligature( &l[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17863
0-17863
812 goto Fail;
never executed: goto Fail;
0
813 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
814 }
executed: }
Execution Count:17863
17863
815 -
816 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:9759
9759
817 -
818Fail: -
819 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
820 Free_Ligature( &l[m] );
never executed: Free_Ligature( &l[m] );
0
821 -
822 FREE( l );
never executed: }
never executed: }
never evaluated: (l)
never evaluated: 0
0
823 return error;
never executed: return error;
0
824} -
825 -
826 -
827static void Free_LigatureSet( HB_LigatureSet* ls ) -
828{ -
829 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
830 -
831 HB_Ligature* l;
executed (the execution status of this line is deduced): HB_Ligature* l;
-
832 -
833 -
834 if ( ls->Ligature )
partially evaluated: ls->Ligature
TRUEFALSE
yes
Evaluation Count:9406
no
Evaluation Count:0
0-9406
835 { -
836 count = ls->LigatureCount;
executed (the execution status of this line is deduced): count = ls->LigatureCount;
-
837 l = ls->Ligature;
executed (the execution status of this line is deduced): l = ls->Ligature;
-
838 -
839 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:17229
yes
Evaluation Count:9406
9406-17229
840 Free_Ligature( &l[n] );
executed: Free_Ligature( &l[n] );
Execution Count:17229
17229
841 -
842 FREE( l );
executed: }
Execution Count:9406
executed: }
Execution Count:9406
partially evaluated: (l)
TRUEFALSE
yes
Evaluation Count:9406
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9406
0-9406
843 }
executed: }
Execution Count:9406
9406
844}
executed: }
Execution Count:9406
9406
845 -
846 -
847/* LigatureSubstFormat1 */ -
848 -
849static HB_Error Load_LigatureSubst( HB_GSUB_SubTable* st, -
850 HB_Stream stream ) -
851{ -
852 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
853 HB_LigatureSubst* ls = &st->ligature;
executed (the execution status of this line is deduced): HB_LigatureSubst* ls = &st->ligature;
-
854 -
855 HB_UShort n = 0, m, count;
executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
856 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
857 -
858 HB_LigatureSet* lset;
executed (the execution status of this line is deduced): HB_LigatureSet* lset;
-
859 -
860 -
861 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
862 -
863 if ( ACCESS_Frame( 4L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1632
0-1632
864 return error;
never executed: return error;
0
865 -
866 ls->SubstFormat = GET_UShort(); /* should be 1 */
executed (the execution status of this line is deduced): ls->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
867 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
868 -
869 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
870 -
871 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
872 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1632
0-1632
873 ( error = _HB_OPEN_Load_Coverage( &ls->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ls->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1632
0-1632
874 return error;
never executed: return error;
0
875 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
876 -
877 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1632
0-1632
878 goto Fail2;
never executed: goto Fail2;
0
879 -
880 count = ls->LigatureSetCount = GET_UShort();
executed (the execution status of this line is deduced): count = ls->LigatureSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
881 -
882 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
883 -
884 ls->LigatureSet = NULL;
executed (the execution status of this line is deduced): ls->LigatureSet = ((void *)0);
-
885 -
886 if ( ALLOC_ARRAY( ls->LigatureSet, count, HB_LigatureSet ) )
partially evaluated: ( (ls->LigatureSet) = _hb_alloc( (count)*sizeof(HB_LigatureSet), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1632
0-1632
887 goto Fail2;
never executed: goto Fail2;
0
888 -
889 lset = ls->LigatureSet;
executed (the execution status of this line is deduced): lset = ls->LigatureSet;
-
890 -
891 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:9759
yes
Evaluation Count:1632
1632-9759
892 { -
893 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9759
0-9759
894 goto Fail1;
never executed: goto Fail1;
0
895 -
896 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
897 -
898 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
899 -
900 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
901 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9759
0-9759
902 ( error = Load_LigatureSet( &lset[n], stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LigatureSet( &lset[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9759
0-9759
903 goto Fail1;
never executed: goto Fail1;
0
904 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
905 }
executed: }
Execution Count:9759
9759
906 -
907 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1632
1632
908 -
909Fail1: -
910 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
911 Free_LigatureSet( &lset[m] );
never executed: Free_LigatureSet( &lset[m] );
0
912 -
913 FREE( lset );
never executed: }
never executed: }
never evaluated: (lset)
never evaluated: 0
0
914 -
915Fail2:
code before this statement never executed: Fail2:
0
916 _HB_OPEN_Free_Coverage( &ls->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ls->Coverage );
-
917 return error;
never executed: return error;
0
918} -
919 -
920 -
921static void Free_LigatureSubst( HB_GSUB_SubTable* st ) -
922{ -
923 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
924 HB_LigatureSubst* ls = &st->ligature;
executed (the execution status of this line is deduced): HB_LigatureSubst* ls = &st->ligature;
-
925 -
926 HB_LigatureSet* lset;
executed (the execution status of this line is deduced): HB_LigatureSet* lset;
-
927 -
928 -
929 if ( ls->LigatureSet )
partially evaluated: ls->LigatureSet
TRUEFALSE
yes
Evaluation Count:1557
no
Evaluation Count:0
0-1557
930 { -
931 count = ls->LigatureSetCount;
executed (the execution status of this line is deduced): count = ls->LigatureSetCount;
-
932 lset = ls->LigatureSet;
executed (the execution status of this line is deduced): lset = ls->LigatureSet;
-
933 -
934 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:9406
yes
Evaluation Count:1557
1557-9406
935 Free_LigatureSet( &lset[n] );
executed: Free_LigatureSet( &lset[n] );
Execution Count:9406
9406
936 -
937 FREE( lset );
executed: }
Execution Count:1557
executed: }
Execution Count:1557
partially evaluated: (lset)
TRUEFALSE
yes
Evaluation Count:1557
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1557
0-1557
938 }
executed: }
Execution Count:1557
1557
939 -
940 _HB_OPEN_Free_Coverage( &ls->Coverage );
executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ls->Coverage );
-
941}
executed: }
Execution Count:1557
1557
942 -
943 -
944static HB_Error Lookup_LigatureSubst( HB_GSUBHeader* gsub, -
945 HB_GSUB_SubTable* st, -
946 HB_Buffer buffer, -
947 HB_UShort flags, -
948 HB_UShort context_length, -
949 int nesting_level ) -
950{ -
951 HB_UShort index, property;
executed (the execution status of this line is deduced): HB_UShort index, property;
-
952 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
953 HB_UShort numlig, i, j, is_mark, first_is_mark = FALSE;
executed (the execution status of this line is deduced): HB_UShort numlig, i, j, is_mark, first_is_mark = 0;
-
954 HB_UShort* c;
executed (the execution status of this line is deduced): HB_UShort* c;
-
955 HB_LigatureSubst* ls = &st->ligature;
executed (the execution status of this line is deduced): HB_LigatureSubst* ls = &st->ligature;
-
956 HB_GDEFHeader* gdef = gsub->gdef;
executed (the execution status of this line is deduced): HB_GDEFHeader* gdef = gsub->gdef;
-
957 -
958 HB_Ligature* lig;
executed (the execution status of this line is deduced): HB_Ligature* lig;
-
959 -
960 HB_UNUSED(nesting_level);
executed (the execution status of this line is deduced): ((nesting_level) = (nesting_level));
-
961 -
962 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3316494
0-3316494
963 return error;
never executed: return error;
0
964 -
965 if ( property == HB_GDEF_MARK || property & HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS )
evaluated: property == 0x0008
TRUEFALSE
yes
Evaluation Count:204985
yes
Evaluation Count:3111509
partially evaluated: property & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3111509
0-3111509
966 first_is_mark = TRUE;
executed: first_is_mark = (!0);
Execution Count:204985
204985
967 -
968 error = _HB_OPEN_Coverage_Index( &ls->Coverage, IN_CURGLYPH(), &index );
executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &ls->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
969 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:3296699
yes
Evaluation Count:19795
19795-3296699
970 return error;
executed: return error;
Execution Count:3296699
3296699
971 -
972 if ( index >= ls->LigatureSetCount )
partially evaluated: index >= ls->LigatureSetCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19795
0-19795
973 return ERR(HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
974 -
975 lig = ls->LigatureSet[index].Ligature;
executed (the execution status of this line is deduced): lig = ls->LigatureSet[index].Ligature;
-
976 -
977 for ( numlig = ls->LigatureSet[index].LigatureCount;
executed (the execution status of this line is deduced): for ( numlig = ls->LigatureSet[index].LigatureCount;
-
978 numlig;
evaluated: numlig
TRUEFALSE
yes
Evaluation Count:87908
yes
Evaluation Count:9816
9816-87908
979 numlig--, lig++ )
executed (the execution status of this line is deduced): numlig--, lig++ )
-
980 { -
981 if ( buffer->in_pos + lig->ComponentCount > buffer->in_length )
evaluated: buffer->in_pos + lig->ComponentCount > buffer->in_length
TRUEFALSE
yes
Evaluation Count:3815
yes
Evaluation Count:84093
3815-84093
982 goto next_ligature; /* Not enough glyphs in input */
executed: goto next_ligature;
Execution Count:3815
3815
983 -
984 c = lig->Component;
executed (the execution status of this line is deduced): c = lig->Component;
-
985 -
986 is_mark = first_is_mark;
executed (the execution status of this line is deduced): is_mark = first_is_mark;
-
987 -
988 if ( context_length != 0xFFFF && context_length < lig->ComponentCount )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84093
never evaluated: context_length < lig->ComponentCount
0-84093
989 break;
never executed: break;
0
990 -
991 for ( i = 1, j = buffer->in_pos + 1; i < lig->ComponentCount; i++, j++ )
evaluated: i < lig->ComponentCount
TRUEFALSE
yes
Evaluation Count:84541
yes
Evaluation Count:9979
9979-84541
992 { -
993 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84541
0-84541
994 { -
995 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
996 return error;
never executed: return error;
0
997 -
998 if ( j + lig->ComponentCount - i == (HB_Int)buffer->in_length )
never evaluated: j + lig->ComponentCount - i == (HB_Int)buffer->in_length
0
999 goto next_ligature;
never executed: goto next_ligature;
0
1000 j++;
never executed (the execution status of this line is deduced): j++;
-
1001 }
never executed: }
0
1002 -
1003 if ( !( property == HB_GDEF_MARK || property & HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS ) )
partially evaluated: property == 0x0008
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84541
partially evaluated: property & 0xFF00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:84541
0-84541
1004 is_mark = FALSE;
executed: is_mark = 0;
Execution Count:84541
84541
1005 -
1006 if ( IN_GLYPH( j ) != c[i - 1] )
evaluated: (buffer->in_string[(j)].gindex) != c[i - 1]
TRUEFALSE
yes
Evaluation Count:74114
yes
Evaluation Count:10427
10427-74114
1007 goto next_ligature;
executed: goto next_ligature;
Execution Count:74114
74114
1008 }
executed: }
Execution Count:10427
10427
1009 -
1010 if ( gdef && gdef->NewGlyphClasses )
partially evaluated: gdef
TRUEFALSE
yes
Evaluation Count:9979
no
Evaluation Count:0
partially evaluated: gdef->NewGlyphClasses
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
1011 { -
1012 /* this is just a guess ... */ -
1013 -
1014 error = _HB_GDEF_Add_Glyph_Property( gdef, lig->LigGlyph,
never executed (the execution status of this line is deduced): error = _HB_GDEF_Add_Glyph_Property( gdef, lig->LigGlyph,
-
1015 is_mark ? HB_GDEF_MARK : HB_GDEF_LIGATURE );
never executed (the execution status of this line is deduced): is_mark ? 0x0008 : 0x0004 );
-
1016 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1017 return error;
never executed: return error;
0
1018 }
never executed: }
0
1019 -
1020 if ( j == buffer->in_pos + i ) /* No input glyphs skipped */
partially evaluated: j == buffer->in_pos + i
TRUEFALSE
yes
Evaluation Count:9979
no
Evaluation Count:0
0-9979
1021 { -
1022 /* We don't use a new ligature ID if there are no skipped -
1023 glyphs and the ligature already has an ID. */ -
1024 -
1025 if ( IN_LIGID( buffer->in_pos ) )
partially evaluated: (buffer->in_string[(buffer->in_pos)].ligID)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
1026 { -
1027 if ( ADD_String( buffer, i, 1, &lig->LigGlyph,
never evaluated: ( ( error = _hb_buffer_add_output_glyphs( (buffer), (i), (1), (&lig->LigGlyph), (0xFFFF), (0xFFFF) ) ) != HB_Err_Ok )
0
1028 0xFFFF, 0xFFFF ) ) -
1029 return error;
never executed: return error;
0
1030 }
never executed: }
0
1031 else -
1032 { -
1033 HB_UShort ligID = _hb_buffer_allocate_ligid( buffer );
executed (the execution status of this line is deduced): HB_UShort ligID = _hb_buffer_allocate_ligid( buffer );
-
1034 if ( ADD_String( buffer, i, 1, &lig->LigGlyph,
partially evaluated: ( ( error = _hb_buffer_add_output_glyphs( (buffer), (i), (1), (&lig->LigGlyph), (0xFFFF), (ligID) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9979
0-9979
1035 0xFFFF, ligID ) ) -
1036 return error;
never executed: return error;
0
1037 }
executed: }
Execution Count:9979
9979
1038 } -
1039 else -
1040 { -
1041 HB_UShort ligID = _hb_buffer_allocate_ligid( buffer );
never executed (the execution status of this line is deduced): HB_UShort ligID = _hb_buffer_allocate_ligid( buffer );
-
1042 if ( ADD_Glyph( buffer, lig->LigGlyph, 0xFFFF, ligID ) )
never evaluated: ( ( error = _hb_buffer_add_output_glyph( (buffer), (lig->LigGlyph), (0xFFFF), (ligID) ) ) != HB_Err_Ok )
0
1043 return error;
never executed: return error;
0
1044 -
1045 /* Now we must do a second loop to copy the skipped glyphs to -
1046 `out' and assign component values to it. We start with the -
1047 glyph after the first component. Glyphs between component -
1048 i and i+1 belong to component i. Together with the ligID -
1049 value it is later possible to check whether a specific -
1050 component value really belongs to a given ligature. */ -
1051 -
1052 for ( i = 0; i < lig->ComponentCount - 1; i++ )
never evaluated: i < lig->ComponentCount - 1
0
1053 { -
1054 while ( CHECK_Property( gdef, IN_CURITEM(),
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
1055 flags, &property ) ) -
1056 if ( ADD_Glyph( buffer, IN_CURGLYPH(), i, ligID ) )
never evaluated: ( ( error = _hb_buffer_add_output_glyph( (buffer), ((buffer->in_string[buffer->in_pos].gindex)), (i), (ligID) ) ) != HB_Err_Ok )
0
1057 return error;
never executed: return error;
0
1058 -
1059 (buffer->in_pos)++;
never executed (the execution status of this line is deduced): (buffer->in_pos)++;
-
1060 }
never executed: }
0
1061 }
never executed: }
0
1062 -
1063 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:9979
9979
1064 -
1065 next_ligature: -
1066 ; -
1067 }
executed: }
Execution Count:77929
77929
1068 -
1069 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:9816
9816
1070} -
1071 -
1072 -
1073/* Do the actual substitution for a context substitution (either format -
1074 5 or 6). This is only called after we've determined that the input -
1075 matches the subrule. */ -
1076 -
1077static HB_Error Do_ContextSubst( HB_GSUBHeader* gsub, -
1078 HB_UShort GlyphCount, -
1079 HB_UShort SubstCount, -
1080 HB_SubstLookupRecord* subst, -
1081 HB_Buffer buffer, -
1082 int nesting_level ) -
1083{ -
1084 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1085 HB_UInt i, old_pos;
never executed (the execution status of this line is deduced): HB_UInt i, old_pos;
-
1086 -
1087 -
1088 i = 0;
never executed (the execution status of this line is deduced): i = 0;
-
1089 -
1090 while ( i < GlyphCount )
never evaluated: i < GlyphCount
0
1091 { -
1092 if ( SubstCount && i == subst->SequenceIndex )
never evaluated: SubstCount
never evaluated: i == subst->SequenceIndex
0
1093 { -
1094 old_pos = buffer->in_pos;
never executed (the execution status of this line is deduced): old_pos = buffer->in_pos;
-
1095 -
1096 /* Do a substitution */ -
1097 -
1098 error = GSUB_Do_Glyph_Lookup( gsub, subst->LookupListIndex, buffer,
never executed (the execution status of this line is deduced): error = GSUB_Do_Glyph_Lookup( gsub, subst->LookupListIndex, buffer,
-
1099 GlyphCount, nesting_level );
never executed (the execution status of this line is deduced): GlyphCount, nesting_level );
-
1100 -
1101 subst++;
never executed (the execution status of this line is deduced): subst++;
-
1102 SubstCount--;
never executed (the execution status of this line is deduced): SubstCount--;
-
1103 i += buffer->in_pos - old_pos;
never executed (the execution status of this line is deduced): i += buffer->in_pos - old_pos;
-
1104 -
1105 if ( error == HB_Err_Not_Covered )
never evaluated: error == HB_Err_Not_Covered
0
1106 { -
1107 if ( COPY_Glyph( buffer ) )
never evaluated: ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
0
1108 return error;
never executed: return error;
0
1109 i++;
never executed (the execution status of this line is deduced): i++;
-
1110 }
never executed: }
0
1111 else if ( error )
never evaluated: error
0
1112 return error;
never executed: return error;
0
1113 } -
1114 else -
1115 { -
1116 /* No substitution for this index */ -
1117 -
1118 if ( COPY_Glyph( buffer ) )
never evaluated: ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
0
1119 return error;
never executed: return error;
0
1120 i++;
never executed (the execution status of this line is deduced): i++;
-
1121 }
never executed: }
0
1122 } -
1123 -
1124 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1125} -
1126 -
1127 -
1128/* LookupType 5 */ -
1129 -
1130/* SubRule */ -
1131 -
1132static HB_Error Load_SubRule( HB_SubRule* sr, -
1133 HB_Stream stream ) -
1134{ -
1135 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1136 -
1137 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
1138 HB_UShort* i;
never executed (the execution status of this line is deduced): HB_UShort* i;
-
1139 -
1140 HB_SubstLookupRecord* slr;
never executed (the execution status of this line is deduced): HB_SubstLookupRecord* slr;
-
1141 -
1142 -
1143 if ( ACCESS_Frame( 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1144 return error;
never executed: return error;
0
1145 -
1146 sr->GlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): sr->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1147 sr->SubstCount = GET_UShort();
never executed (the execution status of this line is deduced): sr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1148 -
1149 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1150 -
1151 sr->Input = NULL;
never executed (the execution status of this line is deduced): sr->Input = ((void *)0);
-
1152 -
1153 count = sr->GlyphCount - 1; /* only GlyphCount - 1 elements */
never executed (the execution status of this line is deduced): count = sr->GlyphCount - 1;
-
1154 -
1155 if ( ALLOC_ARRAY( sr->Input, count, HB_UShort ) )
never evaluated: ( (sr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
1156 return error;
never executed: return error;
0
1157 -
1158 i = sr->Input;
never executed (the execution status of this line is deduced): i = sr->Input;
-
1159 -
1160 if ( ACCESS_Frame( count * 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
1161 goto Fail2;
never executed: goto Fail2;
0
1162 -
1163 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1164 i[n] = GET_UShort();
never executed: i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
1165 -
1166 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1167 -
1168 sr->SubstLookupRecord = NULL;
never executed (the execution status of this line is deduced): sr->SubstLookupRecord = ((void *)0);
-
1169 -
1170 count = sr->SubstCount;
never executed (the execution status of this line is deduced): count = sr->SubstCount;
-
1171 -
1172 if ( ALLOC_ARRAY( sr->SubstLookupRecord, count, HB_SubstLookupRecord ) )
never evaluated: ( (sr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
1173 goto Fail2;
never executed: goto Fail2;
0
1174 -
1175 slr = sr->SubstLookupRecord;
never executed (the execution status of this line is deduced): slr = sr->SubstLookupRecord;
-
1176 -
1177 if ( ACCESS_Frame( count * 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
1178 goto Fail1;
never executed: goto Fail1;
0
1179 -
1180 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1181 { -
1182 slr[n].SequenceIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1183 slr[n].LookupListIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1184 }
never executed: }
0
1185 -
1186 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1187 -
1188 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1189 -
1190Fail1: -
1191 FREE( slr );
never executed: }
never executed: }
never evaluated: (slr)
never evaluated: 0
0
1192 -
1193Fail2:
code before this statement never executed: Fail2:
0
1194 FREE( i );
never executed: }
never executed: }
never evaluated: (i)
never evaluated: 0
0
1195 return error;
never executed: return error;
0
1196} -
1197 -
1198 -
1199static void Free_SubRule( HB_SubRule* sr ) -
1200{ -
1201 FREE( sr->SubstLookupRecord );
never executed: }
never executed: }
never evaluated: (sr->SubstLookupRecord)
never evaluated: 0
0
1202 FREE( sr->Input );
never executed: }
never executed: }
never evaluated: (sr->Input)
never evaluated: 0
0
1203}
never executed: }
0
1204 -
1205 -
1206/* SubRuleSet */ -
1207 -
1208static HB_Error Load_SubRuleSet( HB_SubRuleSet* srs, -
1209 HB_Stream stream ) -
1210{ -
1211 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1212 -
1213 HB_UShort n = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
1214 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
1215 -
1216 HB_SubRule* sr;
never executed (the execution status of this line is deduced): HB_SubRule* sr;
-
1217 -
1218 -
1219 base_offset = FILE_Pos();
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
1220 -
1221 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1222 return error;
never executed: return error;
0
1223 -
1224 count = srs->SubRuleCount = GET_UShort();
never executed (the execution status of this line is deduced): count = srs->SubRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1225 -
1226 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1227 -
1228 srs->SubRule = NULL;
never executed (the execution status of this line is deduced): srs->SubRule = ((void *)0);
-
1229 -
1230 if ( ALLOC_ARRAY( srs->SubRule, count, HB_SubRule ) )
never evaluated: ( (srs->SubRule) = _hb_alloc( (count)*sizeof(HB_SubRule), &error ), error != 0 )
0
1231 return error;
never executed: return error;
0
1232 -
1233 sr = srs->SubRule;
never executed (the execution status of this line is deduced): sr = srs->SubRule;
-
1234 -
1235 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1236 { -
1237 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1238 goto Fail;
never executed: goto Fail;
0
1239 -
1240 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1241 -
1242 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1243 -
1244 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1245 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1246 ( error = Load_SubRule( &sr[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubRule( &sr[n], stream ) ) != HB_Err_Ok
0
1247 goto Fail;
never executed: goto Fail;
0
1248 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1249 }
never executed: }
0
1250 -
1251 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1252 -
1253Fail: -
1254 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1255 Free_SubRule( &sr[m] );
never executed: Free_SubRule( &sr[m] );
0
1256 -
1257 FREE( sr );
never executed: }
never executed: }
never evaluated: (sr)
never evaluated: 0
0
1258 return error;
never executed: return error;
0
1259} -
1260 -
1261 -
1262static void Free_SubRuleSet( HB_SubRuleSet* srs ) -
1263{ -
1264 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
1265 -
1266 HB_SubRule* sr;
never executed (the execution status of this line is deduced): HB_SubRule* sr;
-
1267 -
1268 -
1269 if ( srs->SubRule )
never evaluated: srs->SubRule
0
1270 { -
1271 count = srs->SubRuleCount;
never executed (the execution status of this line is deduced): count = srs->SubRuleCount;
-
1272 sr = srs->SubRule;
never executed (the execution status of this line is deduced): sr = srs->SubRule;
-
1273 -
1274 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1275 Free_SubRule( &sr[n] );
never executed: Free_SubRule( &sr[n] );
0
1276 -
1277 FREE( sr );
never executed: }
never executed: }
never evaluated: (sr)
never evaluated: 0
0
1278 }
never executed: }
0
1279}
never executed: }
0
1280 -
1281 -
1282/* ContextSubstFormat1 */ -
1283 -
1284static HB_Error Load_ContextSubst1( HB_ContextSubstFormat1* csf1, -
1285 HB_Stream stream ) -
1286{ -
1287 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1288 -
1289 HB_UShort n = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
1290 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
1291 -
1292 HB_SubRuleSet* srs;
never executed (the execution status of this line is deduced): HB_SubRuleSet* srs;
-
1293 -
1294 -
1295 base_offset = FILE_Pos() - 2L;
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream ) - 2L;
-
1296 -
1297 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1298 return error;
never executed: return error;
0
1299 -
1300 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1301 -
1302 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1303 -
1304 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1305 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1306 ( error = _HB_OPEN_Load_Coverage( &csf1->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &csf1->Coverage, stream ) ) != HB_Err_Ok
0
1307 return error;
never executed: return error;
0
1308 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1309 -
1310 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1311 goto Fail2;
never executed: goto Fail2;
0
1312 -
1313 count = csf1->SubRuleSetCount = GET_UShort();
never executed (the execution status of this line is deduced): count = csf1->SubRuleSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1314 -
1315 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1316 -
1317 csf1->SubRuleSet = NULL;
never executed (the execution status of this line is deduced): csf1->SubRuleSet = ((void *)0);
-
1318 -
1319 if ( ALLOC_ARRAY( csf1->SubRuleSet, count, HB_SubRuleSet ) )
never evaluated: ( (csf1->SubRuleSet) = _hb_alloc( (count)*sizeof(HB_SubRuleSet), &error ), error != 0 )
0
1320 goto Fail2;
never executed: goto Fail2;
0
1321 -
1322 srs = csf1->SubRuleSet;
never executed (the execution status of this line is deduced): srs = csf1->SubRuleSet;
-
1323 -
1324 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1325 { -
1326 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1327 goto Fail1;
never executed: goto Fail1;
0
1328 -
1329 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1330 -
1331 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1332 -
1333 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1334 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1335 ( error = Load_SubRuleSet( &srs[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubRuleSet( &srs[n], stream ) ) != HB_Err_Ok
0
1336 goto Fail1;
never executed: goto Fail1;
0
1337 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1338 }
never executed: }
0
1339 -
1340 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1341 -
1342Fail1: -
1343 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1344 Free_SubRuleSet( &srs[m] );
never executed: Free_SubRuleSet( &srs[m] );
0
1345 -
1346 FREE( srs );
never executed: }
never executed: }
never evaluated: (srs)
never evaluated: 0
0
1347 -
1348Fail2:
code before this statement never executed: Fail2:
0
1349 _HB_OPEN_Free_Coverage( &csf1->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &csf1->Coverage );
-
1350 return error;
never executed: return error;
0
1351} -
1352 -
1353 -
1354static void Free_ContextSubst1( HB_ContextSubstFormat1* csf1 ) -
1355{ -
1356 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
1357 -
1358 HB_SubRuleSet* srs;
never executed (the execution status of this line is deduced): HB_SubRuleSet* srs;
-
1359 -
1360 -
1361 if ( csf1->SubRuleSet )
never evaluated: csf1->SubRuleSet
0
1362 { -
1363 count = csf1->SubRuleSetCount;
never executed (the execution status of this line is deduced): count = csf1->SubRuleSetCount;
-
1364 srs = csf1->SubRuleSet;
never executed (the execution status of this line is deduced): srs = csf1->SubRuleSet;
-
1365 -
1366 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1367 Free_SubRuleSet( &srs[n] );
never executed: Free_SubRuleSet( &srs[n] );
0
1368 -
1369 FREE( srs );
never executed: }
never executed: }
never evaluated: (srs)
never evaluated: 0
0
1370 }
never executed: }
0
1371 -
1372 _HB_OPEN_Free_Coverage( &csf1->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &csf1->Coverage );
-
1373}
never executed: }
0
1374 -
1375 -
1376/* SubClassRule */ -
1377 -
1378static HB_Error Load_SubClassRule( HB_ContextSubstFormat2* csf2, -
1379 HB_SubClassRule* scr, -
1380 HB_Stream stream ) -
1381{ -
1382 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1383 -
1384 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
1385 -
1386 HB_UShort* c;
never executed (the execution status of this line is deduced): HB_UShort* c;
-
1387 HB_SubstLookupRecord* slr;
never executed (the execution status of this line is deduced): HB_SubstLookupRecord* slr;
-
1388 -
1389 -
1390 if ( ACCESS_Frame( 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1391 return error;
never executed: return error;
0
1392 -
1393 scr->GlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): scr->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1394 scr->SubstCount = GET_UShort();
never executed (the execution status of this line is deduced): scr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1395 -
1396 if ( scr->GlyphCount > csf2->MaxContextLength )
never evaluated: scr->GlyphCount > csf2->MaxContextLength
0
1397 csf2->MaxContextLength = scr->GlyphCount;
never executed: csf2->MaxContextLength = scr->GlyphCount;
0
1398 -
1399 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1400 -
1401 scr->Class = NULL;
never executed (the execution status of this line is deduced): scr->Class = ((void *)0);
-
1402 -
1403 count = scr->GlyphCount - 1; /* only GlyphCount - 1 elements */
never executed (the execution status of this line is deduced): count = scr->GlyphCount - 1;
-
1404 -
1405 if ( ALLOC_ARRAY( scr->Class, count, HB_UShort ) )
never evaluated: ( (scr->Class) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
1406 return error;
never executed: return error;
0
1407 -
1408 c = scr->Class;
never executed (the execution status of this line is deduced): c = scr->Class;
-
1409 -
1410 if ( ACCESS_Frame( count * 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
1411 goto Fail2;
never executed: goto Fail2;
0
1412 -
1413 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1414 c[n] = GET_UShort();
never executed: c[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
1415 -
1416 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1417 -
1418 scr->SubstLookupRecord = NULL;
never executed (the execution status of this line is deduced): scr->SubstLookupRecord = ((void *)0);
-
1419 -
1420 count = scr->SubstCount;
never executed (the execution status of this line is deduced): count = scr->SubstCount;
-
1421 -
1422 if ( ALLOC_ARRAY( scr->SubstLookupRecord, count, HB_SubstLookupRecord ) )
never evaluated: ( (scr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
1423 goto Fail2;
never executed: goto Fail2;
0
1424 -
1425 slr = scr->SubstLookupRecord;
never executed (the execution status of this line is deduced): slr = scr->SubstLookupRecord;
-
1426 -
1427 if ( ACCESS_Frame( count * 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
1428 goto Fail1;
never executed: goto Fail1;
0
1429 -
1430 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1431 { -
1432 slr[n].SequenceIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1433 slr[n].LookupListIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1434 }
never executed: }
0
1435 -
1436 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1437 -
1438 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1439 -
1440Fail1: -
1441 FREE( slr );
never executed: }
never executed: }
never evaluated: (slr)
never evaluated: 0
0
1442 -
1443Fail2:
code before this statement never executed: Fail2:
0
1444 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
1445 return error;
never executed: return error;
0
1446} -
1447 -
1448 -
1449static void Free_SubClassRule( HB_SubClassRule* scr ) -
1450{ -
1451 FREE( scr->SubstLookupRecord );
never executed: }
never executed: }
never evaluated: (scr->SubstLookupRecord)
never evaluated: 0
0
1452 FREE( scr->Class );
never executed: }
never executed: }
never evaluated: (scr->Class)
never evaluated: 0
0
1453}
never executed: }
0
1454 -
1455 -
1456/* SubClassSet */ -
1457 -
1458static HB_Error Load_SubClassSet( HB_ContextSubstFormat2* csf2, -
1459 HB_SubClassSet* scs, -
1460 HB_Stream stream ) -
1461{ -
1462 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1463 -
1464 HB_UShort n = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
1465 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
1466 -
1467 HB_SubClassRule* scr;
never executed (the execution status of this line is deduced): HB_SubClassRule* scr;
-
1468 -
1469 -
1470 base_offset = FILE_Pos();
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
1471 -
1472 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1473 return error;
never executed: return error;
0
1474 -
1475 count = scs->SubClassRuleCount = GET_UShort();
never executed (the execution status of this line is deduced): count = scs->SubClassRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1476 -
1477 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1478 -
1479 scs->SubClassRule = NULL;
never executed (the execution status of this line is deduced): scs->SubClassRule = ((void *)0);
-
1480 -
1481 if ( ALLOC_ARRAY( scs->SubClassRule, count, HB_SubClassRule ) )
never evaluated: ( (scs->SubClassRule) = _hb_alloc( (count)*sizeof(HB_SubClassRule), &error ), error != 0 )
0
1482 return error;
never executed: return error;
0
1483 -
1484 scr = scs->SubClassRule;
never executed (the execution status of this line is deduced): scr = scs->SubClassRule;
-
1485 -
1486 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1487 { -
1488 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1489 goto Fail;
never executed: goto Fail;
0
1490 -
1491 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1492 -
1493 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1494 -
1495 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1496 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1497 ( error = Load_SubClassRule( csf2, &scr[n],
never evaluated: ( error = Load_SubClassRule( csf2, &scr[n], stream ) ) != HB_Err_Ok
0
1498 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubClassRule( csf2, &scr[n], stream ) ) != HB_Err_Ok
0
1499 goto Fail;
never executed: goto Fail;
0
1500 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1501 }
never executed: }
0
1502 -
1503 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1504 -
1505Fail: -
1506 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1507 Free_SubClassRule( &scr[m] );
never executed: Free_SubClassRule( &scr[m] );
0
1508 -
1509 FREE( scr );
never executed: }
never executed: }
never evaluated: (scr)
never evaluated: 0
0
1510 return error;
never executed: return error;
0
1511} -
1512 -
1513 -
1514static void Free_SubClassSet( HB_SubClassSet* scs ) -
1515{ -
1516 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
1517 -
1518 HB_SubClassRule* scr;
never executed (the execution status of this line is deduced): HB_SubClassRule* scr;
-
1519 -
1520 -
1521 if ( scs->SubClassRule )
never evaluated: scs->SubClassRule
0
1522 { -
1523 count = scs->SubClassRuleCount;
never executed (the execution status of this line is deduced): count = scs->SubClassRuleCount;
-
1524 scr = scs->SubClassRule;
never executed (the execution status of this line is deduced): scr = scs->SubClassRule;
-
1525 -
1526 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1527 Free_SubClassRule( &scr[n] );
never executed: Free_SubClassRule( &scr[n] );
0
1528 -
1529 FREE( scr );
never executed: }
never executed: }
never evaluated: (scr)
never evaluated: 0
0
1530 }
never executed: }
0
1531}
never executed: }
0
1532 -
1533 -
1534/* ContextSubstFormat2 */ -
1535 -
1536static HB_Error Load_ContextSubst2( HB_ContextSubstFormat2* csf2, -
1537 HB_Stream stream ) -
1538{ -
1539 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1540 -
1541 HB_UShort n = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
1542 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
1543 -
1544 HB_SubClassSet* scs;
never executed (the execution status of this line is deduced): HB_SubClassSet* scs;
-
1545 -
1546 -
1547 base_offset = FILE_Pos() - 2;
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream ) - 2;
-
1548 -
1549 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1550 return error;
never executed: return error;
0
1551 -
1552 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1553 -
1554 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1555 -
1556 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1557 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1558 ( error = _HB_OPEN_Load_Coverage( &csf2->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &csf2->Coverage, stream ) ) != HB_Err_Ok
0
1559 return error;
never executed: return error;
0
1560 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1561 -
1562 if ( ACCESS_Frame( 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1563 goto Fail3;
never executed: goto Fail3;
0
1564 -
1565 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1566 -
1567 /* `SubClassSetCount' is the upper limit for class values, thus we -
1568 read it now to make an additional safety check. */ -
1569 -
1570 count = csf2->SubClassSetCount = GET_UShort();
never executed (the execution status of this line is deduced): count = csf2->SubClassSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1571 -
1572 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1573 -
1574 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1575 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1576 ( error = _HB_OPEN_Load_ClassDefinition( &csf2->ClassDef, count,
never evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &csf2->ClassDef, count, stream ) ) != HB_Err_Ok
0
1577 stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_ClassDefinition( &csf2->ClassDef, count, stream ) ) != HB_Err_Ok
0
1578 goto Fail3;
never executed: goto Fail3;
0
1579 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1580 -
1581 csf2->SubClassSet = NULL;
never executed (the execution status of this line is deduced): csf2->SubClassSet = ((void *)0);
-
1582 csf2->MaxContextLength = 0;
never executed (the execution status of this line is deduced): csf2->MaxContextLength = 0;
-
1583 -
1584 if ( ALLOC_ARRAY( csf2->SubClassSet, count, HB_SubClassSet ) )
never evaluated: ( (csf2->SubClassSet) = _hb_alloc( (count)*sizeof(HB_SubClassSet), &error ), error != 0 )
0
1585 goto Fail2;
never executed: goto Fail2;
0
1586 -
1587 scs = csf2->SubClassSet;
never executed (the execution status of this line is deduced): scs = csf2->SubClassSet;
-
1588 -
1589 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1590 { -
1591 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1592 goto Fail1;
never executed: goto Fail1;
0
1593 -
1594 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1595 -
1596 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1597 -
1598 if ( new_offset != base_offset ) /* not a NULL offset */
never evaluated: new_offset != base_offset
0
1599 { -
1600 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1601 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1602 ( error = Load_SubClassSet( csf2, &scs[n],
never evaluated: ( error = Load_SubClassSet( csf2, &scs[n], stream ) ) != HB_Err_Ok
0
1603 stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_SubClassSet( csf2, &scs[n], stream ) ) != HB_Err_Ok
0
1604 goto Fail1;
never executed: goto Fail1;
0
1605 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1606 }
never executed: }
0
1607 else -
1608 { -
1609 /* we create a SubClassSet table with no entries */ -
1610 -
1611 csf2->SubClassSet[n].SubClassRuleCount = 0;
never executed (the execution status of this line is deduced): csf2->SubClassSet[n].SubClassRuleCount = 0;
-
1612 csf2->SubClassSet[n].SubClassRule = NULL;
never executed (the execution status of this line is deduced): csf2->SubClassSet[n].SubClassRule = ((void *)0);
-
1613 }
never executed: }
0
1614 } -
1615 -
1616 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1617 -
1618Fail1: -
1619 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1620 Free_SubClassSet( &scs[m] );
never executed: Free_SubClassSet( &scs[m] );
0
1621 -
1622 FREE( scs );
never executed: }
never executed: }
never evaluated: (scs)
never evaluated: 0
0
1623 -
1624Fail2:
code before this statement never executed: Fail2:
0
1625 _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef );
-
1626 -
1627Fail3:
code before this statement never executed: Fail3:
0
1628 _HB_OPEN_Free_Coverage( &csf2->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &csf2->Coverage );
-
1629 return error;
never executed: return error;
0
1630} -
1631 -
1632 -
1633static void Free_ContextSubst2( HB_ContextSubstFormat2* csf2 ) -
1634{ -
1635 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
1636 -
1637 HB_SubClassSet* scs;
never executed (the execution status of this line is deduced): HB_SubClassSet* scs;
-
1638 -
1639 -
1640 if ( csf2->SubClassSet )
never evaluated: csf2->SubClassSet
0
1641 { -
1642 count = csf2->SubClassSetCount;
never executed (the execution status of this line is deduced): count = csf2->SubClassSetCount;
-
1643 scs = csf2->SubClassSet;
never executed (the execution status of this line is deduced): scs = csf2->SubClassSet;
-
1644 -
1645 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1646 Free_SubClassSet( &scs[n] );
never executed: Free_SubClassSet( &scs[n] );
0
1647 -
1648 FREE( scs );
never executed: }
never executed: }
never evaluated: (scs)
never evaluated: 0
0
1649 }
never executed: }
0
1650 -
1651 _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef );
-
1652 _HB_OPEN_Free_Coverage( &csf2->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &csf2->Coverage );
-
1653}
never executed: }
0
1654 -
1655 -
1656/* ContextSubstFormat3 */ -
1657 -
1658static HB_Error Load_ContextSubst3( HB_ContextSubstFormat3* csf3, -
1659 HB_Stream stream ) -
1660{ -
1661 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1662 -
1663 HB_UShort n = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
1664 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
1665 -
1666 HB_Coverage* c;
never executed (the execution status of this line is deduced): HB_Coverage* c;
-
1667 HB_SubstLookupRecord* slr;
never executed (the execution status of this line is deduced): HB_SubstLookupRecord* slr;
-
1668 -
1669 -
1670 base_offset = FILE_Pos() - 2L;
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream ) - 2L;
-
1671 -
1672 if ( ACCESS_Frame( 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
0
1673 return error;
never executed: return error;
0
1674 -
1675 csf3->GlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): csf3->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1676 csf3->SubstCount = GET_UShort();
never executed (the execution status of this line is deduced): csf3->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1677 -
1678 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1679 -
1680 csf3->Coverage = NULL;
never executed (the execution status of this line is deduced): csf3->Coverage = ((void *)0);
-
1681 -
1682 count = csf3->GlyphCount;
never executed (the execution status of this line is deduced): count = csf3->GlyphCount;
-
1683 -
1684 if ( ALLOC_ARRAY( csf3->Coverage, count, HB_Coverage ) )
never evaluated: ( (csf3->Coverage) = _hb_alloc( (count)*sizeof(HB_Coverage), &error ), error != 0 )
0
1685 return error;
never executed: return error;
0
1686 -
1687 c = csf3->Coverage;
never executed (the execution status of this line is deduced): c = csf3->Coverage;
-
1688 -
1689 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1690 { -
1691 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1692 goto Fail2;
never executed: goto Fail2;
0
1693 -
1694 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
1695 -
1696 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1697 -
1698 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
1699 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
1700 ( error = _HB_OPEN_Load_Coverage( &c[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &c[n], stream ) ) != HB_Err_Ok
0
1701 goto Fail2;
never executed: goto Fail2;
0
1702 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
1703 }
never executed: }
0
1704 -
1705 csf3->SubstLookupRecord = NULL;
never executed (the execution status of this line is deduced): csf3->SubstLookupRecord = ((void *)0);
-
1706 -
1707 count = csf3->SubstCount;
never executed (the execution status of this line is deduced): count = csf3->SubstCount;
-
1708 -
1709 if ( ALLOC_ARRAY( csf3->SubstLookupRecord, count,
never evaluated: ( (csf3->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
1710 HB_SubstLookupRecord ) ) -
1711 goto Fail2;
never executed: goto Fail2;
0
1712 -
1713 slr = csf3->SubstLookupRecord;
never executed (the execution status of this line is deduced): slr = csf3->SubstLookupRecord;
-
1714 -
1715 if ( ACCESS_Frame( count * 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
1716 goto Fail1;
never executed: goto Fail1;
0
1717 -
1718 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1719 { -
1720 slr[n].SequenceIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1721 slr[n].LookupListIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1722 }
never executed: }
0
1723 -
1724 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1725 -
1726 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1727 -
1728Fail1: -
1729 FREE( slr );
never executed: }
never executed: }
never evaluated: (slr)
never evaluated: 0
0
1730 -
1731Fail2:
code before this statement never executed: Fail2:
0
1732 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
1733 _HB_OPEN_Free_Coverage( &c[m] );
never executed: _HB_OPEN_Free_Coverage( &c[m] );
0
1734 -
1735 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
1736 return error;
never executed: return error;
0
1737} -
1738 -
1739 -
1740static void Free_ContextSubst3( HB_ContextSubstFormat3* csf3 ) -
1741{ -
1742 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
1743 -
1744 HB_Coverage* c;
never executed (the execution status of this line is deduced): HB_Coverage* c;
-
1745 -
1746 -
1747 FREE( csf3->SubstLookupRecord );
never executed: }
never executed: }
never evaluated: (csf3->SubstLookupRecord)
never evaluated: 0
0
1748 -
1749 if ( csf3->Coverage )
never evaluated: csf3->Coverage
0
1750 { -
1751 count = csf3->GlyphCount;
never executed (the execution status of this line is deduced): count = csf3->GlyphCount;
-
1752 c = csf3->Coverage;
never executed (the execution status of this line is deduced): c = csf3->Coverage;
-
1753 -
1754 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
1755 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
1756 -
1757 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
1758 }
never executed: }
0
1759}
never executed: }
0
1760 -
1761 -
1762/* ContextSubst */ -
1763 -
1764static HB_Error Load_ContextSubst( HB_GSUB_SubTable* st, -
1765 HB_Stream stream ) -
1766{ -
1767 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1768 HB_ContextSubst* cs = &st->context;
never executed (the execution status of this line is deduced): HB_ContextSubst* cs = &st->context;
-
1769 -
1770 -
1771 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
1772 return error;
never executed: return error;
0
1773 -
1774 cs->SubstFormat = GET_UShort();
never executed (the execution status of this line is deduced): cs->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
1775 -
1776 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
1777 -
1778 switch ( cs->SubstFormat ) -
1779 { -
1780 case 1: return Load_ContextSubst1( &cs->csf.csf1, stream );
never executed: return Load_ContextSubst1( &cs->csf.csf1, stream );
0
1781 case 2: return Load_ContextSubst2( &cs->csf.csf2, stream );
never executed: return Load_ContextSubst2( &cs->csf.csf2, stream );
0
1782 case 3: return Load_ContextSubst3( &cs->csf.csf3, stream );
never executed: return Load_ContextSubst3( &cs->csf.csf3, stream );
0
1783 default: return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
1784 } -
1785 -
1786 return HB_Err_Ok; /* never reached */
never executed: return HB_Err_Ok;
0
1787} -
1788 -
1789 -
1790static void Free_ContextSubst( HB_GSUB_SubTable* st ) -
1791{ -
1792 HB_ContextSubst* cs = &st->context;
never executed (the execution status of this line is deduced): HB_ContextSubst* cs = &st->context;
-
1793 -
1794 switch ( cs->SubstFormat ) -
1795 { -
1796 case 1: Free_ContextSubst1( &cs->csf.csf1 ); break;
never executed: break;
0
1797 case 2: Free_ContextSubst2( &cs->csf.csf2 ); break;
never executed: break;
0
1798 case 3: Free_ContextSubst3( &cs->csf.csf3 ); break;
never executed: break;
0
1799 default: break;
never executed: break;
0
1800 } -
1801}
never executed: }
0
1802 -
1803 -
1804static HB_Error Lookup_ContextSubst1( HB_GSUBHeader* gsub, -
1805 HB_ContextSubstFormat1* csf1, -
1806 HB_Buffer buffer, -
1807 HB_UShort flags, -
1808 HB_UShort context_length, -
1809 int nesting_level ) -
1810{ -
1811 HB_UShort index, property;
never executed (the execution status of this line is deduced): HB_UShort index, property;
-
1812 HB_UShort i, j, k, numsr;
never executed (the execution status of this line is deduced): HB_UShort i, j, k, numsr;
-
1813 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1814 -
1815 HB_SubRule* sr;
never executed (the execution status of this line is deduced): HB_SubRule* sr;
-
1816 HB_GDEFHeader* gdef;
never executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
1817 -
1818 -
1819 gdef = gsub->gdef;
never executed (the execution status of this line is deduced): gdef = gsub->gdef;
-
1820 -
1821 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
1822 return error;
never executed: return error;
0
1823 -
1824 error = _HB_OPEN_Coverage_Index( &csf1->Coverage, IN_CURGLYPH(), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &csf1->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
1825 if ( error )
never evaluated: error
0
1826 return error;
never executed: return error;
0
1827 -
1828 sr = csf1->SubRuleSet[index].SubRule;
never executed (the execution status of this line is deduced): sr = csf1->SubRuleSet[index].SubRule;
-
1829 numsr = csf1->SubRuleSet[index].SubRuleCount;
never executed (the execution status of this line is deduced): numsr = csf1->SubRuleSet[index].SubRuleCount;
-
1830 -
1831 for ( k = 0; k < numsr; k++ )
never evaluated: k < numsr
0
1832 { -
1833 if ( context_length != 0xFFFF && context_length < sr[k].GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < sr[k].GlyphCount
0
1834 goto next_subrule;
never executed: goto next_subrule;
0
1835 -
1836 if ( buffer->in_pos + sr[k].GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + sr[k].GlyphCount > buffer->in_length
0
1837 goto next_subrule; /* context is too long */
never executed: goto next_subrule;
0
1838 -
1839 for ( i = 1, j = buffer->in_pos + 1; i < sr[k].GlyphCount; i++, j++ )
never evaluated: i < sr[k].GlyphCount
0
1840 { -
1841 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
1842 { -
1843 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1844 return error;
never executed: return error;
0
1845 -
1846 if ( j + sr[k].GlyphCount - i == (HB_Int)buffer->in_length )
never evaluated: j + sr[k].GlyphCount - i == (HB_Int)buffer->in_length
0
1847 goto next_subrule;
never executed: goto next_subrule;
0
1848 j++;
never executed (the execution status of this line is deduced): j++;
-
1849 }
never executed: }
0
1850 -
1851 if ( IN_GLYPH( j ) != sr[k].Input[i - 1] )
never evaluated: (buffer->in_string[(j)].gindex) != sr[k].Input[i - 1]
0
1852 goto next_subrule;
never executed: goto next_subrule;
0
1853 }
never executed: }
0
1854 -
1855 return Do_ContextSubst( gsub, sr[k].GlyphCount,
never executed: return Do_ContextSubst( gsub, sr[k].GlyphCount, sr[k].SubstCount, sr[k].SubstLookupRecord, buffer, nesting_level );
0
1856 sr[k].SubstCount, sr[k].SubstLookupRecord,
never executed: return Do_ContextSubst( gsub, sr[k].GlyphCount, sr[k].SubstCount, sr[k].SubstLookupRecord, buffer, nesting_level );
0
1857 buffer,
never executed: return Do_ContextSubst( gsub, sr[k].GlyphCount, sr[k].SubstCount, sr[k].SubstLookupRecord, buffer, nesting_level );
0
1858 nesting_level );
never executed: return Do_ContextSubst( gsub, sr[k].GlyphCount, sr[k].SubstCount, sr[k].SubstLookupRecord, buffer, nesting_level );
0
1859 next_subrule: -
1860 ; -
1861 }
never executed: }
0
1862 -
1863 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1864} -
1865 -
1866 -
1867static HB_Error Lookup_ContextSubst2( HB_GSUBHeader* gsub, -
1868 HB_ContextSubstFormat2* csf2, -
1869 HB_Buffer buffer, -
1870 HB_UShort flags, -
1871 HB_UShort context_length, -
1872 int nesting_level ) -
1873{ -
1874 HB_UShort index, property;
never executed (the execution status of this line is deduced): HB_UShort index, property;
-
1875 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1876 HB_UShort i, j, k, known_classes;
never executed (the execution status of this line is deduced): HB_UShort i, j, k, known_classes;
-
1877 -
1878 HB_UShort* classes;
never executed (the execution status of this line is deduced): HB_UShort* classes;
-
1879 HB_UShort* cl;
never executed (the execution status of this line is deduced): HB_UShort* cl;
-
1880 -
1881 HB_SubClassSet* scs;
never executed (the execution status of this line is deduced): HB_SubClassSet* scs;
-
1882 HB_SubClassRule* sr;
never executed (the execution status of this line is deduced): HB_SubClassRule* sr;
-
1883 HB_GDEFHeader* gdef;
never executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
1884 -
1885 -
1886 gdef = gsub->gdef;
never executed (the execution status of this line is deduced): gdef = gsub->gdef;
-
1887 -
1888 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
1889 return error;
never executed: return error;
0
1890 -
1891 /* Note: The coverage table in format 2 doesn't give an index into -
1892 anything. It just lets us know whether or not we need to -
1893 do any lookup at all. */ -
1894 -
1895 error = _HB_OPEN_Coverage_Index( &csf2->Coverage, IN_CURGLYPH(), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &csf2->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
1896 if ( error )
never evaluated: error
0
1897 return error;
never executed: return error;
0
1898 -
1899 if (csf2->MaxContextLength < 1)
never evaluated: csf2->MaxContextLength < 1
0
1900 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1901 -
1902 if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, HB_UShort ) )
never evaluated: ( (classes) = _hb_alloc( (csf2->MaxContextLength)*sizeof(HB_UShort), &error ), error != 0 )
0
1903 return error;
never executed: return error;
0
1904 -
1905 error = _HB_OPEN_Get_Class( &csf2->ClassDef, IN_CURGLYPH(),
never executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &csf2->ClassDef, (buffer->in_string[buffer->in_pos].gindex),
-
1906 &classes[0], NULL );
never executed (the execution status of this line is deduced): &classes[0], ((void *)0) );
-
1907 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1908 goto End;
never executed: goto End;
0
1909 known_classes = 0;
never executed (the execution status of this line is deduced): known_classes = 0;
-
1910 -
1911 scs = &csf2->SubClassSet[classes[0]];
never executed (the execution status of this line is deduced): scs = &csf2->SubClassSet[classes[0]];
-
1912 if ( !scs )
never evaluated: !scs
0
1913 { -
1914 error = ERR(HB_Err_Invalid_SubTable);
never executed (the execution status of this line is deduced): error = _hb_err (HB_Err_Invalid_SubTable);
-
1915 goto End;
never executed: goto End;
0
1916 } -
1917 -
1918 for ( k = 0; k < scs->SubClassRuleCount; k++ )
never evaluated: k < scs->SubClassRuleCount
0
1919 { -
1920 sr = &scs->SubClassRule[k];
never executed (the execution status of this line is deduced): sr = &scs->SubClassRule[k];
-
1921 -
1922 if ( context_length != 0xFFFF && context_length < sr->GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < sr->GlyphCount
0
1923 goto next_subclassrule;
never executed: goto next_subclassrule;
0
1924 -
1925 if ( buffer->in_pos + sr->GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + sr->GlyphCount > buffer->in_length
0
1926 goto next_subclassrule; /* context is too long */
never executed: goto next_subclassrule;
0
1927 -
1928 cl = sr->Class;
never executed (the execution status of this line is deduced): cl = sr->Class;
-
1929 -
1930 /* Start at 1 because [0] is implied */ -
1931 -
1932 for ( i = 1, j = buffer->in_pos + 1; i < sr->GlyphCount; i++, j++ )
never evaluated: i < sr->GlyphCount
0
1933 { -
1934 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
1935 { -
1936 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1937 goto End;
never executed: goto End;
0
1938 -
1939 if ( j + sr->GlyphCount - i < (HB_Int)buffer->in_length )
never evaluated: j + sr->GlyphCount - i < (HB_Int)buffer->in_length
0
1940 goto next_subclassrule;
never executed: goto next_subclassrule;
0
1941 j++;
never executed (the execution status of this line is deduced): j++;
-
1942 }
never executed: }
0
1943 -
1944 if ( i > known_classes )
never evaluated: i > known_classes
0
1945 { -
1946 /* Keeps us from having to do this for each rule */ -
1947 -
1948 error = _HB_OPEN_Get_Class( &csf2->ClassDef, IN_GLYPH( j ), &classes[i], NULL );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &csf2->ClassDef, (buffer->in_string[(j)].gindex), &classes[i], ((void *)0) );
-
1949 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
1950 goto End;
never executed: goto End;
0
1951 known_classes = i;
never executed (the execution status of this line is deduced): known_classes = i;
-
1952 }
never executed: }
0
1953 -
1954 if ( cl[i - 1] != classes[i] )
never evaluated: cl[i - 1] != classes[i]
0
1955 goto next_subclassrule;
never executed: goto next_subclassrule;
0
1956 }
never executed: }
0
1957 -
1958 error = Do_ContextSubst( gsub, sr->GlyphCount,
never executed (the execution status of this line is deduced): error = Do_ContextSubst( gsub, sr->GlyphCount,
-
1959 sr->SubstCount, sr->SubstLookupRecord,
never executed (the execution status of this line is deduced): sr->SubstCount, sr->SubstLookupRecord,
-
1960 buffer,
never executed (the execution status of this line is deduced): buffer,
-
1961 nesting_level );
never executed (the execution status of this line is deduced): nesting_level );
-
1962 goto End;
never executed: goto End;
0
1963 -
1964 next_subclassrule: -
1965 ; -
1966 }
never executed: }
0
1967 -
1968 error = HB_Err_Not_Covered;
never executed (the execution status of this line is deduced): error = HB_Err_Not_Covered;
-
1969 -
1970End:
code before this statement never executed: End:
0
1971 FREE( classes );
never executed: }
never executed: }
never evaluated: (classes)
never evaluated: 0
0
1972 return error;
never executed: return error;
0
1973} -
1974 -
1975 -
1976static HB_Error Lookup_ContextSubst3( HB_GSUBHeader* gsub, -
1977 HB_ContextSubstFormat3* csf3, -
1978 HB_Buffer buffer, -
1979 HB_UShort flags, -
1980 HB_UShort context_length, -
1981 int nesting_level ) -
1982{ -
1983 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
1984 HB_UShort index, i, j, property;
never executed (the execution status of this line is deduced): HB_UShort index, i, j, property;
-
1985 -
1986 HB_Coverage* c;
never executed (the execution status of this line is deduced): HB_Coverage* c;
-
1987 HB_GDEFHeader* gdef;
never executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
1988 -
1989 -
1990 gdef = gsub->gdef;
never executed (the execution status of this line is deduced): gdef = gsub->gdef;
-
1991 -
1992 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
1993 return error;
never executed: return error;
0
1994 -
1995 if ( context_length != 0xFFFF && context_length < csf3->GlyphCount )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < csf3->GlyphCount
0
1996 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1997 -
1998 if ( buffer->in_pos + csf3->GlyphCount > buffer->in_length )
never evaluated: buffer->in_pos + csf3->GlyphCount > buffer->in_length
0
1999 return HB_Err_Not_Covered; /* context is too long */
never executed: return HB_Err_Not_Covered;
0
2000 -
2001 c = csf3->Coverage;
never executed (the execution status of this line is deduced): c = csf3->Coverage;
-
2002 -
2003 for ( i = 1, j = buffer->in_pos + 1; i < csf3->GlyphCount; i++, j++ )
never evaluated: i < csf3->GlyphCount
0
2004 { -
2005 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
2006 { -
2007 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
2008 return error;
never executed: return error;
0
2009 -
2010 if ( j + csf3->GlyphCount - i == (HB_Int)buffer->in_length )
never evaluated: j + csf3->GlyphCount - i == (HB_Int)buffer->in_length
0
2011 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
2012 j++;
never executed (the execution status of this line is deduced): j++;
-
2013 }
never executed: }
0
2014 -
2015 error = _HB_OPEN_Coverage_Index( &c[i], IN_GLYPH( j ), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &c[i], (buffer->in_string[(j)].gindex), &index );
-
2016 if ( error )
never evaluated: error
0
2017 return error;
never executed: return error;
0
2018 }
never executed: }
0
2019 -
2020 return Do_ContextSubst( gsub, csf3->GlyphCount,
never executed: return Do_ContextSubst( gsub, csf3->GlyphCount, csf3->SubstCount, csf3->SubstLookupRecord, buffer, nesting_level );
0
2021 csf3->SubstCount, csf3->SubstLookupRecord,
never executed: return Do_ContextSubst( gsub, csf3->GlyphCount, csf3->SubstCount, csf3->SubstLookupRecord, buffer, nesting_level );
0
2022 buffer,
never executed: return Do_ContextSubst( gsub, csf3->GlyphCount, csf3->SubstCount, csf3->SubstLookupRecord, buffer, nesting_level );
0
2023 nesting_level );
never executed: return Do_ContextSubst( gsub, csf3->GlyphCount, csf3->SubstCount, csf3->SubstLookupRecord, buffer, nesting_level );
0
2024} -
2025 -
2026 -
2027static HB_Error Lookup_ContextSubst( HB_GSUBHeader* gsub, -
2028 HB_GSUB_SubTable* st, -
2029 HB_Buffer buffer, -
2030 HB_UShort flags, -
2031 HB_UShort context_length, -
2032 int nesting_level ) -
2033{ -
2034 HB_ContextSubst* cs = &st->context;
never executed (the execution status of this line is deduced): HB_ContextSubst* cs = &st->context;
-
2035 -
2036 switch ( cs->SubstFormat ) -
2037 { -
2038 case 1: return Lookup_ContextSubst1( gsub, &cs->csf.csf1, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ContextSubst1( gsub, &cs->csf.csf1, buffer, flags, context_length, nesting_level );
0
2039 case 2: return Lookup_ContextSubst2( gsub, &cs->csf.csf2, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ContextSubst2( gsub, &cs->csf.csf2, buffer, flags, context_length, nesting_level );
0
2040 case 3: return Lookup_ContextSubst3( gsub, &cs->csf.csf3, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ContextSubst3( gsub, &cs->csf.csf3, buffer, flags, context_length, nesting_level );
0
2041 default: return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
2042 } -
2043 -
2044 return HB_Err_Ok; /* never reached */
never executed: return HB_Err_Ok;
0
2045} -
2046 -
2047 -
2048/* LookupType 6 */ -
2049 -
2050/* ChainSubRule */ -
2051 -
2052static HB_Error Load_ChainSubRule( HB_ChainSubRule* csr, -
2053 HB_Stream stream ) -
2054{ -
2055 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
2056 -
2057 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
2058 HB_UShort* b;
never executed (the execution status of this line is deduced): HB_UShort* b;
-
2059 HB_UShort* i;
never executed (the execution status of this line is deduced): HB_UShort* i;
-
2060 HB_UShort* l;
never executed (the execution status of this line is deduced): HB_UShort* l;
-
2061 -
2062 HB_SubstLookupRecord* slr;
never executed (the execution status of this line is deduced): HB_SubstLookupRecord* slr;
-
2063 -
2064 -
2065 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2066 return error;
never executed: return error;
0
2067 -
2068 csr->BacktrackGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): csr->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2069 -
2070 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2071 -
2072 csr->Backtrack = NULL;
never executed (the execution status of this line is deduced): csr->Backtrack = ((void *)0);
-
2073 -
2074 count = csr->BacktrackGlyphCount;
never executed (the execution status of this line is deduced): count = csr->BacktrackGlyphCount;
-
2075 -
2076 if ( ALLOC_ARRAY( csr->Backtrack, count, HB_UShort ) )
never evaluated: ( (csr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
2077 return error;
never executed: return error;
0
2078 -
2079 b = csr->Backtrack;
never executed (the execution status of this line is deduced): b = csr->Backtrack;
-
2080 -
2081 if ( ACCESS_Frame( count * 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
2082 goto Fail4;
never executed: goto Fail4;
0
2083 -
2084 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2085 b[n] = GET_UShort();
never executed: b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
2086 -
2087 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2088 -
2089 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2090 goto Fail4;
never executed: goto Fail4;
0
2091 -
2092 csr->InputGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): csr->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2093 -
2094 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2095 -
2096 csr->Input = NULL;
never executed (the execution status of this line is deduced): csr->Input = ((void *)0);
-
2097 -
2098 count = csr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */
never executed (the execution status of this line is deduced): count = csr->InputGlyphCount - 1;
-
2099 -
2100 if ( ALLOC_ARRAY( csr->Input, count, HB_UShort ) )
never evaluated: ( (csr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
2101 goto Fail4;
never executed: goto Fail4;
0
2102 -
2103 i = csr->Input;
never executed (the execution status of this line is deduced): i = csr->Input;
-
2104 -
2105 if ( ACCESS_Frame( count * 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
2106 goto Fail3;
never executed: goto Fail3;
0
2107 -
2108 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2109 i[n] = GET_UShort();
never executed: i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
2110 -
2111 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2112 -
2113 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2114 goto Fail3;
never executed: goto Fail3;
0
2115 -
2116 csr->LookaheadGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): csr->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2117 -
2118 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2119 -
2120 csr->Lookahead = NULL;
never executed (the execution status of this line is deduced): csr->Lookahead = ((void *)0);
-
2121 -
2122 count = csr->LookaheadGlyphCount;
never executed (the execution status of this line is deduced): count = csr->LookaheadGlyphCount;
-
2123 -
2124 if ( ALLOC_ARRAY( csr->Lookahead, count, HB_UShort ) )
never evaluated: ( (csr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
2125 goto Fail3;
never executed: goto Fail3;
0
2126 -
2127 l = csr->Lookahead;
never executed (the execution status of this line is deduced): l = csr->Lookahead;
-
2128 -
2129 if ( ACCESS_Frame( count * 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
2130 goto Fail2;
never executed: goto Fail2;
0
2131 -
2132 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2133 l[n] = GET_UShort();
never executed: l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
2134 -
2135 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2136 -
2137 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2138 goto Fail2;
never executed: goto Fail2;
0
2139 -
2140 csr->SubstCount = GET_UShort();
never executed (the execution status of this line is deduced): csr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2141 -
2142 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2143 -
2144 csr->SubstLookupRecord = NULL;
never executed (the execution status of this line is deduced): csr->SubstLookupRecord = ((void *)0);
-
2145 -
2146 count = csr->SubstCount;
never executed (the execution status of this line is deduced): count = csr->SubstCount;
-
2147 -
2148 if ( ALLOC_ARRAY( csr->SubstLookupRecord, count, HB_SubstLookupRecord ) )
never evaluated: ( (csr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
2149 goto Fail2;
never executed: goto Fail2;
0
2150 -
2151 slr = csr->SubstLookupRecord;
never executed (the execution status of this line is deduced): slr = csr->SubstLookupRecord;
-
2152 -
2153 if ( ACCESS_Frame( count * 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
2154 goto Fail1;
never executed: goto Fail1;
0
2155 -
2156 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2157 { -
2158 slr[n].SequenceIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2159 slr[n].LookupListIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2160 }
never executed: }
0
2161 -
2162 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2163 -
2164 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2165 -
2166Fail1: -
2167 FREE( slr );
never executed: }
never executed: }
never evaluated: (slr)
never evaluated: 0
0
2168 -
2169Fail2:
code before this statement never executed: Fail2:
0
2170 FREE( l );
never executed: }
never executed: }
never evaluated: (l)
never evaluated: 0
0
2171 -
2172Fail3:
code before this statement never executed: Fail3:
0
2173 FREE( i );
never executed: }
never executed: }
never evaluated: (i)
never evaluated: 0
0
2174 -
2175Fail4:
code before this statement never executed: Fail4:
0
2176 FREE( b );
never executed: }
never executed: }
never evaluated: (b)
never evaluated: 0
0
2177 return error;
never executed: return error;
0
2178} -
2179 -
2180 -
2181static void Free_ChainSubRule( HB_ChainSubRule* csr ) -
2182{ -
2183 FREE( csr->SubstLookupRecord );
never executed: }
never executed: }
never evaluated: (csr->SubstLookupRecord)
never evaluated: 0
0
2184 FREE( csr->Lookahead );
never executed: }
never executed: }
never evaluated: (csr->Lookahead)
never evaluated: 0
0
2185 FREE( csr->Input );
never executed: }
never executed: }
never evaluated: (csr->Input)
never evaluated: 0
0
2186 FREE( csr->Backtrack );
never executed: }
never executed: }
never evaluated: (csr->Backtrack)
never evaluated: 0
0
2187}
never executed: }
0
2188 -
2189 -
2190/* ChainSubRuleSet */ -
2191 -
2192static HB_Error Load_ChainSubRuleSet( HB_ChainSubRuleSet* csrs, -
2193 HB_Stream stream ) -
2194{ -
2195 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
2196 -
2197 HB_UShort n = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
2198 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
2199 -
2200 HB_ChainSubRule* csr;
never executed (the execution status of this line is deduced): HB_ChainSubRule* csr;
-
2201 -
2202 -
2203 base_offset = FILE_Pos();
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
2204 -
2205 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2206 return error;
never executed: return error;
0
2207 -
2208 count = csrs->ChainSubRuleCount = GET_UShort();
never executed (the execution status of this line is deduced): count = csrs->ChainSubRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2209 -
2210 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2211 -
2212 csrs->ChainSubRule = NULL;
never executed (the execution status of this line is deduced): csrs->ChainSubRule = ((void *)0);
-
2213 -
2214 if ( ALLOC_ARRAY( csrs->ChainSubRule, count, HB_ChainSubRule ) )
never evaluated: ( (csrs->ChainSubRule) = _hb_alloc( (count)*sizeof(HB_ChainSubRule), &error ), error != 0 )
0
2215 return error;
never executed: return error;
0
2216 -
2217 csr = csrs->ChainSubRule;
never executed (the execution status of this line is deduced): csr = csrs->ChainSubRule;
-
2218 -
2219 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2220 { -
2221 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2222 goto Fail;
never executed: goto Fail;
0
2223 -
2224 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2225 -
2226 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2227 -
2228 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2229 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2230 ( error = Load_ChainSubRule( &csr[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainSubRule( &csr[n], stream ) ) != HB_Err_Ok
0
2231 goto Fail;
never executed: goto Fail;
0
2232 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2233 }
never executed: }
0
2234 -
2235 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2236 -
2237Fail: -
2238 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2239 Free_ChainSubRule( &csr[m] );
never executed: Free_ChainSubRule( &csr[m] );
0
2240 -
2241 FREE( csr );
never executed: }
never executed: }
never evaluated: (csr)
never evaluated: 0
0
2242 return error;
never executed: return error;
0
2243} -
2244 -
2245 -
2246static void Free_ChainSubRuleSet( HB_ChainSubRuleSet* csrs ) -
2247{ -
2248 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
2249 -
2250 HB_ChainSubRule* csr;
never executed (the execution status of this line is deduced): HB_ChainSubRule* csr;
-
2251 -
2252 -
2253 if ( csrs->ChainSubRule )
never evaluated: csrs->ChainSubRule
0
2254 { -
2255 count = csrs->ChainSubRuleCount;
never executed (the execution status of this line is deduced): count = csrs->ChainSubRuleCount;
-
2256 csr = csrs->ChainSubRule;
never executed (the execution status of this line is deduced): csr = csrs->ChainSubRule;
-
2257 -
2258 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2259 Free_ChainSubRule( &csr[n] );
never executed: Free_ChainSubRule( &csr[n] );
0
2260 -
2261 FREE( csr );
never executed: }
never executed: }
never evaluated: (csr)
never evaluated: 0
0
2262 }
never executed: }
0
2263}
never executed: }
0
2264 -
2265 -
2266/* ChainContextSubstFormat1 */ -
2267 -
2268static HB_Error Load_ChainContextSubst1( -
2269 HB_ChainContextSubstFormat1* ccsf1, -
2270 HB_Stream stream ) -
2271{ -
2272 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
2273 -
2274 HB_UShort n = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
2275 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
2276 -
2277 HB_ChainSubRuleSet* csrs;
never executed (the execution status of this line is deduced): HB_ChainSubRuleSet* csrs;
-
2278 -
2279 -
2280 base_offset = FILE_Pos() - 2L;
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream ) - 2L;
-
2281 -
2282 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2283 return error;
never executed: return error;
0
2284 -
2285 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2286 -
2287 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2288 -
2289 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2290 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2291 ( error = _HB_OPEN_Load_Coverage( &ccsf1->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &ccsf1->Coverage, stream ) ) != HB_Err_Ok
0
2292 return error;
never executed: return error;
0
2293 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2294 -
2295 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2296 goto Fail2;
never executed: goto Fail2;
0
2297 -
2298 count = ccsf1->ChainSubRuleSetCount = GET_UShort();
never executed (the execution status of this line is deduced): count = ccsf1->ChainSubRuleSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2299 -
2300 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2301 -
2302 ccsf1->ChainSubRuleSet = NULL;
never executed (the execution status of this line is deduced): ccsf1->ChainSubRuleSet = ((void *)0);
-
2303 -
2304 if ( ALLOC_ARRAY( ccsf1->ChainSubRuleSet, count, HB_ChainSubRuleSet ) )
never evaluated: ( (ccsf1->ChainSubRuleSet) = _hb_alloc( (count)*sizeof(HB_ChainSubRuleSet), &error ), error != 0 )
0
2305 goto Fail2;
never executed: goto Fail2;
0
2306 -
2307 csrs = ccsf1->ChainSubRuleSet;
never executed (the execution status of this line is deduced): csrs = ccsf1->ChainSubRuleSet;
-
2308 -
2309 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2310 { -
2311 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2312 goto Fail1;
never executed: goto Fail1;
0
2313 -
2314 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2315 -
2316 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2317 -
2318 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2319 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2320 ( error = Load_ChainSubRuleSet( &csrs[n], stream ) ) != HB_Err_Ok )
never evaluated: ( error = Load_ChainSubRuleSet( &csrs[n], stream ) ) != HB_Err_Ok
0
2321 goto Fail1;
never executed: goto Fail1;
0
2322 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2323 }
never executed: }
0
2324 -
2325 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2326 -
2327Fail1: -
2328 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2329 Free_ChainSubRuleSet( &csrs[m] );
never executed: Free_ChainSubRuleSet( &csrs[m] );
0
2330 -
2331 FREE( csrs );
never executed: }
never executed: }
never evaluated: (csrs)
never evaluated: 0
0
2332 -
2333Fail2:
code before this statement never executed: Fail2:
0
2334 _HB_OPEN_Free_Coverage( &ccsf1->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ccsf1->Coverage );
-
2335 return error;
never executed: return error;
0
2336} -
2337 -
2338 -
2339static void Free_ChainContextSubst1( HB_ChainContextSubstFormat1* ccsf1 ) -
2340{ -
2341 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
2342 -
2343 HB_ChainSubRuleSet* csrs;
never executed (the execution status of this line is deduced): HB_ChainSubRuleSet* csrs;
-
2344 -
2345 -
2346 if ( ccsf1->ChainSubRuleSet )
never evaluated: ccsf1->ChainSubRuleSet
0
2347 { -
2348 count = ccsf1->ChainSubRuleSetCount;
never executed (the execution status of this line is deduced): count = ccsf1->ChainSubRuleSetCount;
-
2349 csrs = ccsf1->ChainSubRuleSet;
never executed (the execution status of this line is deduced): csrs = ccsf1->ChainSubRuleSet;
-
2350 -
2351 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2352 Free_ChainSubRuleSet( &csrs[n] );
never executed: Free_ChainSubRuleSet( &csrs[n] );
0
2353 -
2354 FREE( csrs );
never executed: }
never executed: }
never evaluated: (csrs)
never evaluated: 0
0
2355 }
never executed: }
0
2356 -
2357 _HB_OPEN_Free_Coverage( &ccsf1->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ccsf1->Coverage );
-
2358}
never executed: }
0
2359 -
2360 -
2361/* ChainSubClassRule */ -
2362 -
2363static HB_Error Load_ChainSubClassRule( -
2364 HB_ChainContextSubstFormat2* ccsf2, -
2365 HB_ChainSubClassRule* cscr, -
2366 HB_Stream stream ) -
2367{ -
2368 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
2369 -
2370 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
2371 -
2372 HB_UShort* b;
executed (the execution status of this line is deduced): HB_UShort* b;
-
2373 HB_UShort* i;
executed (the execution status of this line is deduced): HB_UShort* i;
-
2374 HB_UShort* l;
executed (the execution status of this line is deduced): HB_UShort* l;
-
2375 HB_SubstLookupRecord* slr;
executed (the execution status of this line is deduced): HB_SubstLookupRecord* slr;
-
2376 -
2377 -
2378 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2379 return error;
never executed: return error;
0
2380 -
2381 cscr->BacktrackGlyphCount = GET_UShort();
executed (the execution status of this line is deduced): cscr->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2382 -
2383 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2384 -
2385 if ( cscr->BacktrackGlyphCount > ccsf2->MaxBacktrackLength )
evaluated: cscr->BacktrackGlyphCount > ccsf2->MaxBacktrackLength
TRUEFALSE
yes
Evaluation Count:981
yes
Evaluation Count:1728
981-1728
2386 ccsf2->MaxBacktrackLength = cscr->BacktrackGlyphCount;
executed: ccsf2->MaxBacktrackLength = cscr->BacktrackGlyphCount;
Execution Count:981
981
2387 -
2388 cscr->Backtrack = NULL;
executed (the execution status of this line is deduced): cscr->Backtrack = ((void *)0);
-
2389 -
2390 count = cscr->BacktrackGlyphCount;
executed (the execution status of this line is deduced): count = cscr->BacktrackGlyphCount;
-
2391 -
2392 if ( ALLOC_ARRAY( cscr->Backtrack, count, HB_UShort ) )
partially evaluated: ( (cscr->Backtrack) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2393 return error;
never executed: return error;
0
2394 -
2395 b = cscr->Backtrack;
executed (the execution status of this line is deduced): b = cscr->Backtrack;
-
2396 -
2397 if ( ACCESS_Frame( count * 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2398 goto Fail4;
never executed: goto Fail4;
0
2399 -
2400 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:1347
yes
Evaluation Count:2709
1347-2709
2401 b[n] = GET_UShort();
executed: b[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:1347
1347
2402 -
2403 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2404 -
2405 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2406 goto Fail4;
never executed: goto Fail4;
0
2407 -
2408 cscr->InputGlyphCount = GET_UShort();
executed (the execution status of this line is deduced): cscr->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2409 -
2410 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2411 -
2412 if ( cscr->InputGlyphCount > ccsf2->MaxInputLength )
evaluated: cscr->InputGlyphCount > ccsf2->MaxInputLength
TRUEFALSE
yes
Evaluation Count:1475
yes
Evaluation Count:1234
1234-1475
2413 ccsf2->MaxInputLength = cscr->InputGlyphCount;
executed: ccsf2->MaxInputLength = cscr->InputGlyphCount;
Execution Count:1475
1475
2414 -
2415 cscr->Input = NULL;
executed (the execution status of this line is deduced): cscr->Input = ((void *)0);
-
2416 -
2417 count = cscr->InputGlyphCount - 1; /* only InputGlyphCount - 1 elements */
executed (the execution status of this line is deduced): count = cscr->InputGlyphCount - 1;
-
2418 -
2419 if ( ALLOC_ARRAY( cscr->Input, count, HB_UShort ) )
partially evaluated: ( (cscr->Input) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2420 goto Fail4;
never executed: goto Fail4;
0
2421 -
2422 i = cscr->Input;
executed (the execution status of this line is deduced): i = cscr->Input;
-
2423 -
2424 if ( ACCESS_Frame( count * 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2425 goto Fail3;
never executed: goto Fail3;
0
2426 -
2427 for ( n = 0; n < count; n++ )
partially evaluated: n < count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2428 i[n] = GET_UShort();
never executed: i[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
2429 -
2430 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2431 -
2432 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2433 goto Fail3;
never executed: goto Fail3;
0
2434 -
2435 cscr->LookaheadGlyphCount = GET_UShort();
executed (the execution status of this line is deduced): cscr->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2436 -
2437 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2438 -
2439 if ( cscr->LookaheadGlyphCount > ccsf2->MaxLookaheadLength )
evaluated: cscr->LookaheadGlyphCount > ccsf2->MaxLookaheadLength
TRUEFALSE
yes
Evaluation Count:1118
yes
Evaluation Count:1591
1118-1591
2440 ccsf2->MaxLookaheadLength = cscr->LookaheadGlyphCount;
executed: ccsf2->MaxLookaheadLength = cscr->LookaheadGlyphCount;
Execution Count:1118
1118
2441 -
2442 cscr->Lookahead = NULL;
executed (the execution status of this line is deduced): cscr->Lookahead = ((void *)0);
-
2443 -
2444 count = cscr->LookaheadGlyphCount;
executed (the execution status of this line is deduced): count = cscr->LookaheadGlyphCount;
-
2445 -
2446 if ( ALLOC_ARRAY( cscr->Lookahead, count, HB_UShort ) )
partially evaluated: ( (cscr->Lookahead) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2447 goto Fail3;
never executed: goto Fail3;
0
2448 -
2449 l = cscr->Lookahead;
executed (the execution status of this line is deduced): l = cscr->Lookahead;
-
2450 -
2451 if ( ACCESS_Frame( count * 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2452 goto Fail2;
never executed: goto Fail2;
0
2453 -
2454 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2112
yes
Evaluation Count:2709
2112-2709
2455 l[n] = GET_UShort();
executed: l[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:2112
2112
2456 -
2457 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2458 -
2459 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2460 goto Fail2;
never executed: goto Fail2;
0
2461 -
2462 cscr->SubstCount = GET_UShort();
executed (the execution status of this line is deduced): cscr->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2463 -
2464 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2465 -
2466 cscr->SubstLookupRecord = NULL;
executed (the execution status of this line is deduced): cscr->SubstLookupRecord = ((void *)0);
-
2467 -
2468 count = cscr->SubstCount;
executed (the execution status of this line is deduced): count = cscr->SubstCount;
-
2469 -
2470 if ( ALLOC_ARRAY( cscr->SubstLookupRecord, count,
partially evaluated: ( (cscr->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2471 HB_SubstLookupRecord ) ) -
2472 goto Fail2;
never executed: goto Fail2;
0
2473 -
2474 slr = cscr->SubstLookupRecord;
executed (the execution status of this line is deduced): slr = cscr->SubstLookupRecord;
-
2475 -
2476 if ( ACCESS_Frame( count * 4L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2477 goto Fail1;
never executed: goto Fail1;
0
2478 -
2479 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2709
yes
Evaluation Count:2709
2709
2480 { -
2481 slr[n].SequenceIndex = GET_UShort();
executed (the execution status of this line is deduced): slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2482 slr[n].LookupListIndex = GET_UShort();
executed (the execution status of this line is deduced): slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2483 }
executed: }
Execution Count:2709
2709
2484 -
2485 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2486 -
2487 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2709
2709
2488 -
2489Fail1: -
2490 FREE( slr );
never executed: }
never executed: }
never evaluated: (slr)
never evaluated: 0
0
2491 -
2492Fail2:
code before this statement never executed: Fail2:
0
2493 FREE( l );
never executed: }
never executed: }
never evaluated: (l)
never evaluated: 0
0
2494 -
2495Fail3:
code before this statement never executed: Fail3:
0
2496 FREE( i );
never executed: }
never executed: }
never evaluated: (i)
never evaluated: 0
0
2497 -
2498Fail4:
code before this statement never executed: Fail4:
0
2499 FREE( b );
never executed: }
never executed: }
never evaluated: (b)
never evaluated: 0
0
2500 return error;
never executed: return error;
0
2501} -
2502 -
2503 -
2504static void Free_ChainSubClassRule( HB_ChainSubClassRule* cscr ) -
2505{ -
2506 FREE( cscr->SubstLookupRecord );
executed: }
Execution Count:2574
executed: }
Execution Count:2574
partially evaluated: (cscr->SubstLookupRecord)
TRUEFALSE
yes
Evaluation Count:2574
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
0-2574
2507 FREE( cscr->Lookahead );
executed: }
Execution Count:1641
executed: }
Execution Count:2574
evaluated: (cscr->Lookahead)
TRUEFALSE
yes
Evaluation Count:1641
yes
Evaluation Count:933
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
0-2574
2508 FREE( cscr->Input );
never executed: }
executed: }
Execution Count:2574
partially evaluated: (cscr->Input)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
0-2574
2509 FREE( cscr->Backtrack );
executed: }
Execution Count:933
executed: }
Execution Count:2574
evaluated: (cscr->Backtrack)
TRUEFALSE
yes
Evaluation Count:933
yes
Evaluation Count:1641
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2574
0-2574
2510}
executed: }
Execution Count:2574
2574
2511 -
2512 -
2513/* SubClassSet */ -
2514 -
2515static HB_Error Load_ChainSubClassSet( -
2516 HB_ChainContextSubstFormat2* ccsf2, -
2517 HB_ChainSubClassSet* cscs, -
2518 HB_Stream stream ) -
2519{ -
2520 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
2521 -
2522 HB_UShort n = 0, m, count;
executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
2523 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
2524 -
2525 HB_ChainSubClassRule* cscr;
executed (the execution status of this line is deduced): HB_ChainSubClassRule* cscr;
-
2526 -
2527 -
2528 base_offset = FILE_Pos();
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
2529 -
2530 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2209
0-2209
2531 return error;
never executed: return error;
0
2532 -
2533 count = cscs->ChainSubClassRuleCount = GET_UShort();
executed (the execution status of this line is deduced): count = cscs->ChainSubClassRuleCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2534 -
2535 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2536 -
2537 cscs->ChainSubClassRule = NULL;
executed (the execution status of this line is deduced): cscs->ChainSubClassRule = ((void *)0);
-
2538 -
2539 if ( ALLOC_ARRAY( cscs->ChainSubClassRule, count,
partially evaluated: ( (cscs->ChainSubClassRule) = _hb_alloc( (count)*sizeof(HB_ChainSubClassRule), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2209
0-2209
2540 HB_ChainSubClassRule ) ) -
2541 return error;
never executed: return error;
0
2542 -
2543 cscr = cscs->ChainSubClassRule;
executed (the execution status of this line is deduced): cscr = cscs->ChainSubClassRule;
-
2544 -
2545 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2709
yes
Evaluation Count:2209
2209-2709
2546 { -
2547 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2548 goto Fail;
never executed: goto Fail;
0
2549 -
2550 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2551 -
2552 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2553 -
2554 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2555 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2556 ( error = Load_ChainSubClassRule( ccsf2, &cscr[n],
partially evaluated: ( error = Load_ChainSubClassRule( ccsf2, &cscr[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2557 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_ChainSubClassRule( ccsf2, &cscr[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2709
0-2709
2558 goto Fail;
never executed: goto Fail;
0
2559 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2560 }
executed: }
Execution Count:2709
2709
2561 -
2562 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2209
2209
2563 -
2564Fail: -
2565 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2566 Free_ChainSubClassRule( &cscr[m] );
never executed: Free_ChainSubClassRule( &cscr[m] );
0
2567 -
2568 FREE( cscr );
never executed: }
never executed: }
never evaluated: (cscr)
never evaluated: 0
0
2569 return error;
never executed: return error;
0
2570} -
2571 -
2572 -
2573static void Free_ChainSubClassSet( HB_ChainSubClassSet* cscs ) -
2574{ -
2575 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
2576 -
2577 HB_ChainSubClassRule* cscr;
executed (the execution status of this line is deduced): HB_ChainSubClassRule* cscr;
-
2578 -
2579 -
2580 if ( cscs->ChainSubClassRule )
evaluated: cscs->ChainSubClassRule
TRUEFALSE
yes
Evaluation Count:2100
yes
Evaluation Count:2339
2100-2339
2581 { -
2582 count = cscs->ChainSubClassRuleCount;
executed (the execution status of this line is deduced): count = cscs->ChainSubClassRuleCount;
-
2583 cscr = cscs->ChainSubClassRule;
executed (the execution status of this line is deduced): cscr = cscs->ChainSubClassRule;
-
2584 -
2585 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:2574
yes
Evaluation Count:2100
2100-2574
2586 Free_ChainSubClassRule( &cscr[n] );
executed: Free_ChainSubClassRule( &cscr[n] );
Execution Count:2574
2574
2587 -
2588 FREE( cscr );
executed: }
Execution Count:2100
executed: }
Execution Count:2100
partially evaluated: (cscr)
TRUEFALSE
yes
Evaluation Count:2100
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2100
0-2100
2589 }
executed: }
Execution Count:2100
2100
2590}
executed: }
Execution Count:4439
4439
2591 -
2592 -
2593/* ChainContextSubstFormat2 */ -
2594 -
2595static HB_Error Load_ChainContextSubst2( -
2596 HB_ChainContextSubstFormat2* ccsf2, -
2597 HB_Stream stream ) -
2598{ -
2599 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
2600 -
2601 HB_UShort n = 0, m, count;
executed (the execution status of this line is deduced): HB_UShort n = 0, m, count;
-
2602 HB_UInt cur_offset, new_offset, base_offset;
executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
2603 HB_UInt backtrack_offset, input_offset, lookahead_offset;
executed (the execution status of this line is deduced): HB_UInt backtrack_offset, input_offset, lookahead_offset;
-
2604 -
2605 HB_ChainSubClassSet* cscs;
executed (the execution status of this line is deduced): HB_ChainSubClassSet* cscs;
-
2606 -
2607 -
2608 base_offset = FILE_Pos() - 2;
executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream ) - 2;
-
2609 -
2610 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2611 return error;
never executed: return error;
0
2612 -
2613 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2614 -
2615 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2616 -
2617 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2618 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2619 ( error = _HB_OPEN_Load_Coverage( &ccsf2->Coverage, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_Coverage( &ccsf2->Coverage, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2620 return error;
never executed: return error;
0
2621 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2622 -
2623 if ( ACCESS_Frame( 8L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2624 goto Fail5;
never executed: goto Fail5;
0
2625 -
2626 backtrack_offset = GET_UShort();
executed (the execution status of this line is deduced): backtrack_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2627 input_offset = GET_UShort();
executed (the execution status of this line is deduced): input_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2628 lookahead_offset = GET_UShort();
executed (the execution status of this line is deduced): lookahead_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2629 -
2630 /* `ChainSubClassSetCount' is the upper limit for input class values, -
2631 thus we read it now to make an additional safety check. No limit -
2632 is known or needed for the other two class definitions */ -
2633 -
2634 count = ccsf2->ChainSubClassSetCount = GET_UShort();
executed (the execution status of this line is deduced): count = ccsf2->ChainSubClassSetCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2635 -
2636 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2637 -
2638 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535,
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535, backtrack_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2639 backtrack_offset, base_offset,
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535, backtrack_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2640 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535, backtrack_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2641 goto Fail5;
never executed: goto Fail5;
0
2642 -
2643 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count,
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count, input_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2644 input_offset, base_offset,
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count, input_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2645 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count, input_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2646 goto Fail4;
never executed: goto Fail4;
0
2647 if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535,
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535, lookahead_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2648 lookahead_offset, base_offset,
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535, lookahead_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2649 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535, lookahead_offset, base_offset, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2650 goto Fail3;
never executed: goto Fail3;
0
2651 -
2652 ccsf2->ChainSubClassSet = NULL;
executed (the execution status of this line is deduced): ccsf2->ChainSubClassSet = ((void *)0);
-
2653 ccsf2->MaxBacktrackLength = 0;
executed (the execution status of this line is deduced): ccsf2->MaxBacktrackLength = 0;
-
2654 ccsf2->MaxInputLength = 0;
executed (the execution status of this line is deduced): ccsf2->MaxInputLength = 0;
-
2655 ccsf2->MaxLookaheadLength = 0;
executed (the execution status of this line is deduced): ccsf2->MaxLookaheadLength = 0;
-
2656 -
2657 if ( ALLOC_ARRAY( ccsf2->ChainSubClassSet, count, HB_ChainSubClassSet ) )
partially evaluated: ( (ccsf2->ChainSubClassSet) = _hb_alloc( (count)*sizeof(HB_ChainSubClassSet), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2658 goto Fail2;
never executed: goto Fail2;
0
2659 -
2660 cscs = ccsf2->ChainSubClassSet;
executed (the execution status of this line is deduced): cscs = ccsf2->ChainSubClassSet;
-
2661 -
2662 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:4671
yes
Evaluation Count:1475
1475-4671
2663 { -
2664 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4671
0-4671
2665 goto Fail1;
never executed: goto Fail1;
0
2666 -
2667 new_offset = GET_UShort() + base_offset;
executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2668 -
2669 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2670 -
2671 if ( new_offset != base_offset ) /* not a NULL offset */
evaluated: new_offset != base_offset
TRUEFALSE
yes
Evaluation Count:2209
yes
Evaluation Count:2462
2209-2462
2672 { -
2673 cur_offset = FILE_Pos();
executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2674 if ( FILE_Seek( new_offset ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2209
0-2209
2675 ( error = Load_ChainSubClassSet( ccsf2, &cscs[n],
partially evaluated: ( error = Load_ChainSubClassSet( ccsf2, &cscs[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2209
0-2209
2676 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_ChainSubClassSet( ccsf2, &cscs[n], stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2209
0-2209
2677 goto Fail1;
never executed: goto Fail1;
0
2678 (void)FILE_Seek( cur_offset );
executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2679 }
executed: }
Execution Count:2209
2209
2680 else -
2681 { -
2682 /* we create a ChainSubClassSet table with no entries */ -
2683 -
2684 ccsf2->ChainSubClassSet[n].ChainSubClassRuleCount = 0;
executed (the execution status of this line is deduced): ccsf2->ChainSubClassSet[n].ChainSubClassRuleCount = 0;
-
2685 ccsf2->ChainSubClassSet[n].ChainSubClassRule = NULL;
executed (the execution status of this line is deduced): ccsf2->ChainSubClassSet[n].ChainSubClassRule = ((void *)0);
-
2686 }
executed: }
Execution Count:2462
2462
2687 } -
2688 -
2689 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:1475
1475
2690 -
2691Fail1: -
2692 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
2693 Free_ChainSubClassSet( &cscs[m] );
never executed: Free_ChainSubClassSet( &cscs[m] );
0
2694 -
2695 FREE( cscs );
never executed: }
never executed: }
never evaluated: (cscs)
never evaluated: 0
0
2696 -
2697Fail2:
code before this statement never executed: Fail2:
0
2698 _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef );
-
2699 -
2700Fail3:
code before this statement never executed: Fail3:
0
2701 _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef );
-
2702 -
2703Fail4:
code before this statement never executed: Fail4:
0
2704 _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef );
-
2705 -
2706Fail5:
code before this statement never executed: Fail5:
0
2707 _HB_OPEN_Free_Coverage( &ccsf2->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ccsf2->Coverage );
-
2708 return error;
never executed: return error;
0
2709} -
2710 -
2711 -
2712static void Free_ChainContextSubst2( HB_ChainContextSubstFormat2* ccsf2 ) -
2713{ -
2714 HB_UShort n, count;
executed (the execution status of this line is deduced): HB_UShort n, count;
-
2715 -
2716 HB_ChainSubClassSet* cscs;
executed (the execution status of this line is deduced): HB_ChainSubClassSet* cscs;
-
2717 -
2718 -
2719 if ( ccsf2->ChainSubClassSet )
partially evaluated: ccsf2->ChainSubClassSet
TRUEFALSE
yes
Evaluation Count:1402
no
Evaluation Count:0
0-1402
2720 { -
2721 count = ccsf2->ChainSubClassSetCount;
executed (the execution status of this line is deduced): count = ccsf2->ChainSubClassSetCount;
-
2722 cscs = ccsf2->ChainSubClassSet;
executed (the execution status of this line is deduced): cscs = ccsf2->ChainSubClassSet;
-
2723 -
2724 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:4439
yes
Evaluation Count:1402
1402-4439
2725 Free_ChainSubClassSet( &cscs[n] );
executed: Free_ChainSubClassSet( &cscs[n] );
Execution Count:4439
4439
2726 -
2727 FREE( cscs );
executed: }
Execution Count:1402
executed: }
Execution Count:1402
partially evaluated: (cscs)
TRUEFALSE
yes
Evaluation Count:1402
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1402
0-1402
2728 }
executed: }
Execution Count:1402
1402
2729 -
2730 _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef );
executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef );
-
2731 _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef );
executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef );
-
2732 _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef );
executed (the execution status of this line is deduced): _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef );
-
2733 -
2734 _HB_OPEN_Free_Coverage( &ccsf2->Coverage );
executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &ccsf2->Coverage );
-
2735}
executed: }
Execution Count:1402
1402
2736 -
2737 -
2738/* ChainContextSubstFormat3 */ -
2739 -
2740static HB_Error Load_ChainContextSubst3( -
2741 HB_ChainContextSubstFormat3* ccsf3, -
2742 HB_Stream stream ) -
2743{ -
2744 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
2745 -
2746 HB_UShort n, nb = 0, ni =0, nl = 0, m, count;
never executed (the execution status of this line is deduced): HB_UShort n, nb = 0, ni =0, nl = 0, m, count;
-
2747 HB_UShort backtrack_count, input_count, lookahead_count;
never executed (the execution status of this line is deduced): HB_UShort backtrack_count, input_count, lookahead_count;
-
2748 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
2749 -
2750 HB_Coverage* b;
never executed (the execution status of this line is deduced): HB_Coverage* b;
-
2751 HB_Coverage* i;
never executed (the execution status of this line is deduced): HB_Coverage* i;
-
2752 HB_Coverage* l;
never executed (the execution status of this line is deduced): HB_Coverage* l;
-
2753 HB_SubstLookupRecord* slr;
never executed (the execution status of this line is deduced): HB_SubstLookupRecord* slr;
-
2754 -
2755 -
2756 base_offset = FILE_Pos() - 2L;
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream ) - 2L;
-
2757 -
2758 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2759 return error;
never executed: return error;
0
2760 -
2761 ccsf3->BacktrackGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): ccsf3->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2762 -
2763 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2764 -
2765 ccsf3->BacktrackCoverage = NULL;
never executed (the execution status of this line is deduced): ccsf3->BacktrackCoverage = ((void *)0);
-
2766 -
2767 backtrack_count = ccsf3->BacktrackGlyphCount;
never executed (the execution status of this line is deduced): backtrack_count = ccsf3->BacktrackGlyphCount;
-
2768 -
2769 if ( ALLOC_ARRAY( ccsf3->BacktrackCoverage, backtrack_count,
never evaluated: ( (ccsf3->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
2770 HB_Coverage ) ) -
2771 return error;
never executed: return error;
0
2772 -
2773 b = ccsf3->BacktrackCoverage;
never executed (the execution status of this line is deduced): b = ccsf3->BacktrackCoverage;
-
2774 -
2775 for ( nb = 0; nb < backtrack_count; nb++ )
never evaluated: nb < backtrack_count
0
2776 { -
2777 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2778 goto Fail4;
never executed: goto Fail4;
0
2779 -
2780 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2781 -
2782 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2783 -
2784 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2785 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2786 ( error = _HB_OPEN_Load_Coverage( &b[nb], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &b[nb], stream ) ) != HB_Err_Ok
0
2787 goto Fail4;
never executed: goto Fail4;
0
2788 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2789 }
never executed: }
0
2790 -
2791 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2792 goto Fail4;
never executed: goto Fail4;
0
2793 -
2794 ccsf3->InputGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): ccsf3->InputGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2795 -
2796 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2797 -
2798 ccsf3->InputCoverage = NULL;
never executed (the execution status of this line is deduced): ccsf3->InputCoverage = ((void *)0);
-
2799 -
2800 input_count = ccsf3->InputGlyphCount;
never executed (the execution status of this line is deduced): input_count = ccsf3->InputGlyphCount;
-
2801 -
2802 if ( ALLOC_ARRAY( ccsf3->InputCoverage, input_count, HB_Coverage ) )
never evaluated: ( (ccsf3->InputCoverage) = _hb_alloc( (input_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
2803 goto Fail4;
never executed: goto Fail4;
0
2804 -
2805 i = ccsf3->InputCoverage;
never executed (the execution status of this line is deduced): i = ccsf3->InputCoverage;
-
2806 -
2807 for ( ni = 0; ni < input_count; ni++ )
never evaluated: ni < input_count
0
2808 { -
2809 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2810 goto Fail3;
never executed: goto Fail3;
0
2811 -
2812 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2813 -
2814 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2815 -
2816 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2817 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2818 ( error = _HB_OPEN_Load_Coverage( &i[ni], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &i[ni], stream ) ) != HB_Err_Ok
0
2819 goto Fail3;
never executed: goto Fail3;
0
2820 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2821 }
never executed: }
0
2822 -
2823 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2824 goto Fail3;
never executed: goto Fail3;
0
2825 -
2826 ccsf3->LookaheadGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): ccsf3->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2827 -
2828 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2829 -
2830 ccsf3->LookaheadCoverage = NULL;
never executed (the execution status of this line is deduced): ccsf3->LookaheadCoverage = ((void *)0);
-
2831 -
2832 lookahead_count = ccsf3->LookaheadGlyphCount;
never executed (the execution status of this line is deduced): lookahead_count = ccsf3->LookaheadGlyphCount;
-
2833 -
2834 if ( ALLOC_ARRAY( ccsf3->LookaheadCoverage, lookahead_count,
never evaluated: ( (ccsf3->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
2835 HB_Coverage ) ) -
2836 goto Fail3;
never executed: goto Fail3;
0
2837 -
2838 l = ccsf3->LookaheadCoverage;
never executed (the execution status of this line is deduced): l = ccsf3->LookaheadCoverage;
-
2839 -
2840 for ( nl = 0; nl < lookahead_count; nl++ )
never evaluated: nl < lookahead_count
0
2841 { -
2842 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2843 goto Fail2;
never executed: goto Fail2;
0
2844 -
2845 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
2846 -
2847 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2848 -
2849 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
2850 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
2851 ( error = _HB_OPEN_Load_Coverage( &l[nl], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &l[nl], stream ) ) != HB_Err_Ok
0
2852 goto Fail2;
never executed: goto Fail2;
0
2853 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
2854 }
never executed: }
0
2855 -
2856 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
2857 goto Fail2;
never executed: goto Fail2;
0
2858 -
2859 ccsf3->SubstCount = GET_UShort();
never executed (the execution status of this line is deduced): ccsf3->SubstCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2860 -
2861 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2862 -
2863 ccsf3->SubstLookupRecord = NULL;
never executed (the execution status of this line is deduced): ccsf3->SubstLookupRecord = ((void *)0);
-
2864 -
2865 count = ccsf3->SubstCount;
never executed (the execution status of this line is deduced): count = ccsf3->SubstCount;
-
2866 -
2867 if ( ALLOC_ARRAY( ccsf3->SubstLookupRecord, count,
never evaluated: ( (ccsf3->SubstLookupRecord) = _hb_alloc( (count)*sizeof(HB_SubstLookupRecord), &error ), error != 0 )
0
2868 HB_SubstLookupRecord ) ) -
2869 goto Fail2;
never executed: goto Fail2;
0
2870 -
2871 slr = ccsf3->SubstLookupRecord;
never executed (the execution status of this line is deduced): slr = ccsf3->SubstLookupRecord;
-
2872 -
2873 if ( ACCESS_Frame( count * 4L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 4L ))) != 0 )
0
2874 goto Fail1;
never executed: goto Fail1;
0
2875 -
2876 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2877 { -
2878 slr[n].SequenceIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].SequenceIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2879 slr[n].LookupListIndex = GET_UShort();
never executed (the execution status of this line is deduced): slr[n].LookupListIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2880 }
never executed: }
0
2881 -
2882 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2883 -
2884 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
2885 -
2886Fail1: -
2887 FREE( slr );
never executed: }
never executed: }
never evaluated: (slr)
never evaluated: 0
0
2888 -
2889Fail2:
code before this statement never executed: Fail2:
0
2890 for ( m = 0; m < nl; m++ )
never evaluated: m < nl
0
2891 _HB_OPEN_Free_Coverage( &l[m] );
never executed: _HB_OPEN_Free_Coverage( &l[m] );
0
2892 -
2893 FREE( l );
never executed: }
never executed: }
never evaluated: (l)
never evaluated: 0
0
2894 -
2895Fail3:
code before this statement never executed: Fail3:
0
2896 for ( m = 0; m < ni; m++ )
never evaluated: m < ni
0
2897 _HB_OPEN_Free_Coverage( &i[m] );
never executed: _HB_OPEN_Free_Coverage( &i[m] );
0
2898 -
2899 FREE( i );
never executed: }
never executed: }
never evaluated: (i)
never evaluated: 0
0
2900 -
2901Fail4:
code before this statement never executed: Fail4:
0
2902 for ( m = 0; m < nb; m++ )
never evaluated: m < nb
0
2903 _HB_OPEN_Free_Coverage( &b[m] );
never executed: _HB_OPEN_Free_Coverage( &b[m] );
0
2904 -
2905 FREE( b );
never executed: }
never executed: }
never evaluated: (b)
never evaluated: 0
0
2906 return error;
never executed: return error;
0
2907} -
2908 -
2909 -
2910static void Free_ChainContextSubst3( HB_ChainContextSubstFormat3* ccsf3 ) -
2911{ -
2912 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
2913 -
2914 HB_Coverage* c;
never executed (the execution status of this line is deduced): HB_Coverage* c;
-
2915 -
2916 -
2917 FREE( ccsf3->SubstLookupRecord );
never executed: }
never executed: }
never evaluated: (ccsf3->SubstLookupRecord)
never evaluated: 0
0
2918 -
2919 if ( ccsf3->LookaheadCoverage )
never evaluated: ccsf3->LookaheadCoverage
0
2920 { -
2921 count = ccsf3->LookaheadGlyphCount;
never executed (the execution status of this line is deduced): count = ccsf3->LookaheadGlyphCount;
-
2922 c = ccsf3->LookaheadCoverage;
never executed (the execution status of this line is deduced): c = ccsf3->LookaheadCoverage;
-
2923 -
2924 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2925 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
2926 -
2927 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
2928 }
never executed: }
0
2929 -
2930 if ( ccsf3->InputCoverage )
never evaluated: ccsf3->InputCoverage
0
2931 { -
2932 count = ccsf3->InputGlyphCount;
never executed (the execution status of this line is deduced): count = ccsf3->InputGlyphCount;
-
2933 c = ccsf3->InputCoverage;
never executed (the execution status of this line is deduced): c = ccsf3->InputCoverage;
-
2934 -
2935 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2936 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
2937 -
2938 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
2939 }
never executed: }
0
2940 -
2941 if ( ccsf3->BacktrackCoverage )
never evaluated: ccsf3->BacktrackCoverage
0
2942 { -
2943 count = ccsf3->BacktrackGlyphCount;
never executed (the execution status of this line is deduced): count = ccsf3->BacktrackGlyphCount;
-
2944 c = ccsf3->BacktrackCoverage;
never executed (the execution status of this line is deduced): c = ccsf3->BacktrackCoverage;
-
2945 -
2946 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
2947 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
2948 -
2949 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
2950 }
never executed: }
0
2951}
never executed: }
0
2952 -
2953 -
2954/* ChainContextSubst */ -
2955 -
2956static HB_Error Load_ChainContextSubst( HB_GSUB_SubTable* st, -
2957 HB_Stream stream ) -
2958{ -
2959 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
2960 HB_ChainContextSubst* ccs = &st->chain;
executed (the execution status of this line is deduced): HB_ChainContextSubst* ccs = &st->chain;
-
2961 -
2962 if ( ACCESS_Frame( 2L ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1475
0-1475
2963 return error;
never executed: return error;
0
2964 -
2965 ccs->SubstFormat = GET_UShort();
executed (the execution status of this line is deduced): ccs->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
2966 -
2967 FORGET_Frame();
executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
2968 -
2969 switch ( ccs->SubstFormat ) { -
2970 case 1: return Load_ChainContextSubst1( &ccs->ccsf.ccsf1, stream );
never executed: return Load_ChainContextSubst1( &ccs->ccsf.ccsf1, stream );
0
2971 case 2: return Load_ChainContextSubst2( &ccs->ccsf.ccsf2, stream );
executed: return Load_ChainContextSubst2( &ccs->ccsf.ccsf2, stream );
Execution Count:1475
1475
2972 case 3: return Load_ChainContextSubst3( &ccs->ccsf.ccsf3, stream );
never executed: return Load_ChainContextSubst3( &ccs->ccsf.ccsf3, stream );
0
2973 default: return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
2974 } -
2975 -
2976 return HB_Err_Ok; /* never reached */
never executed: return HB_Err_Ok;
0
2977} -
2978 -
2979 -
2980static void Free_ChainContextSubst( HB_GSUB_SubTable* st ) -
2981{ -
2982 HB_ChainContextSubst* ccs = &st->chain;
executed (the execution status of this line is deduced): HB_ChainContextSubst* ccs = &st->chain;
-
2983 -
2984 switch ( ccs->SubstFormat ) { -
2985 case 1: Free_ChainContextSubst1( &ccs->ccsf.ccsf1 ); break;
never executed: break;
0
2986 case 2: Free_ChainContextSubst2( &ccs->ccsf.ccsf2 ); break;
executed: break;
Execution Count:1402
1402
2987 case 3: Free_ChainContextSubst3( &ccs->ccsf.ccsf3 ); break;
never executed: break;
0
2988 default: break;
never executed: break;
0
2989 } -
2990}
executed: }
Execution Count:1402
1402
2991 -
2992 -
2993static HB_Error Lookup_ChainContextSubst1( HB_GSUBHeader* gsub, -
2994 HB_ChainContextSubstFormat1* ccsf1, -
2995 HB_Buffer buffer, -
2996 HB_UShort flags, -
2997 HB_UShort context_length, -
2998 int nesting_level ) -
2999{ -
3000 HB_UShort index, property;
never executed (the execution status of this line is deduced): HB_UShort index, property;
-
3001 HB_UShort i, j, k, num_csr;
never executed (the execution status of this line is deduced): HB_UShort i, j, k, num_csr;
-
3002 HB_UShort bgc, igc, lgc;
never executed (the execution status of this line is deduced): HB_UShort bgc, igc, lgc;
-
3003 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
3004 -
3005 HB_ChainSubRule* csr;
never executed (the execution status of this line is deduced): HB_ChainSubRule* csr;
-
3006 HB_ChainSubRule curr_csr;
never executed (the execution status of this line is deduced): HB_ChainSubRule curr_csr;
-
3007 HB_GDEFHeader* gdef;
never executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
3008 -
3009 -
3010 gdef = gsub->gdef;
never executed (the execution status of this line is deduced): gdef = gsub->gdef;
-
3011 -
3012 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
3013 return error;
never executed: return error;
0
3014 -
3015 error = _HB_OPEN_Coverage_Index( &ccsf1->Coverage, IN_CURGLYPH(), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &ccsf1->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
3016 if ( error )
never evaluated: error
0
3017 return error;
never executed: return error;
0
3018 -
3019 csr = ccsf1->ChainSubRuleSet[index].ChainSubRule;
never executed (the execution status of this line is deduced): csr = ccsf1->ChainSubRuleSet[index].ChainSubRule;
-
3020 num_csr = ccsf1->ChainSubRuleSet[index].ChainSubRuleCount;
never executed (the execution status of this line is deduced): num_csr = ccsf1->ChainSubRuleSet[index].ChainSubRuleCount;
-
3021 -
3022 for ( k = 0; k < num_csr; k++ )
never evaluated: k < num_csr
0
3023 { -
3024 curr_csr = csr[k];
never executed (the execution status of this line is deduced): curr_csr = csr[k];
-
3025 bgc = curr_csr.BacktrackGlyphCount;
never executed (the execution status of this line is deduced): bgc = curr_csr.BacktrackGlyphCount;
-
3026 igc = curr_csr.InputGlyphCount;
never executed (the execution status of this line is deduced): igc = curr_csr.InputGlyphCount;
-
3027 lgc = curr_csr.LookaheadGlyphCount;
never executed (the execution status of this line is deduced): lgc = curr_csr.LookaheadGlyphCount;
-
3028 -
3029 if ( context_length != 0xFFFF && context_length < igc )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < igc
0
3030 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3031 -
3032 /* check whether context is too long; it is a first guess only */ -
3033 -
3034 if ( bgc > buffer->out_pos || buffer->in_pos + igc + lgc > buffer->in_length )
never evaluated: bgc > buffer->out_pos
never evaluated: buffer->in_pos + igc + lgc > buffer->in_length
0
3035 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3036 -
3037 if ( bgc )
never evaluated: bgc
0
3038 { -
3039 /* since we don't know in advance the number of glyphs to inspect, -
3040 we search backwards for matches in the backtrack glyph array */ -
3041 -
3042 for ( i = 0, j = buffer->out_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
3043 { -
3044 while ( CHECK_Property( gdef, OUT_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3045 { -
3046 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3047 return error;
never executed: return error;
0
3048 -
3049 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
3050 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3051 j--;
never executed (the execution status of this line is deduced): j--;
-
3052 }
never executed: }
0
3053 -
3054 /* In OpenType 1.3, it is undefined whether the offsets of -
3055 backtrack glyphs is in logical order or not. Version 1.4 -
3056 will clarify this: -
3057 -
3058 Logical order - a b c d e f g h i j -
3059 i -
3060 Input offsets - 0 1 -
3061 Backtrack offsets - 3 2 1 0 -
3062 Lookahead offsets - 0 1 2 3 */ -
3063 -
3064 if ( OUT_GLYPH( j ) != curr_csr.Backtrack[i] )
never evaluated: (buffer->out_string[(j)].gindex) != curr_csr.Backtrack[i]
0
3065 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3066 }
never executed: }
0
3067 }
never executed: }
0
3068 -
3069 /* Start at 1 because [0] is implied */ -
3070 -
3071 for ( i = 1, j = buffer->in_pos + 1; i < igc; i++, j++ )
never evaluated: i < igc
0
3072 { -
3073 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3074 { -
3075 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3076 return error;
never executed: return error;
0
3077 -
3078 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
3079 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3080 j++;
never executed (the execution status of this line is deduced): j++;
-
3081 }
never executed: }
0
3082 -
3083 if ( IN_GLYPH( j ) != curr_csr.Input[i - 1] )
never evaluated: (buffer->in_string[(j)].gindex) != curr_csr.Input[i - 1]
0
3084 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3085 }
never executed: }
0
3086 -
3087 /* we are starting to check for lookahead glyphs right after the -
3088 last context glyph */ -
3089 -
3090 for ( i = 0; i < lgc; i++, j++ )
never evaluated: i < lgc
0
3091 { -
3092 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3093 { -
3094 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3095 return error;
never executed: return error;
0
3096 -
3097 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3098 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3099 j++;
never executed (the execution status of this line is deduced): j++;
-
3100 }
never executed: }
0
3101 -
3102 if ( IN_GLYPH( j ) != curr_csr.Lookahead[i] )
never evaluated: (buffer->in_string[(j)].gindex) != curr_csr.Lookahead[i]
0
3103 goto next_chainsubrule;
never executed: goto next_chainsubrule;
0
3104 }
never executed: }
0
3105 -
3106 return Do_ContextSubst( gsub, igc,
never executed: return Do_ContextSubst( gsub, igc, curr_csr.SubstCount, curr_csr.SubstLookupRecord, buffer, nesting_level );
0
3107 curr_csr.SubstCount,
never executed: return Do_ContextSubst( gsub, igc, curr_csr.SubstCount, curr_csr.SubstLookupRecord, buffer, nesting_level );
0
3108 curr_csr.SubstLookupRecord,
never executed: return Do_ContextSubst( gsub, igc, curr_csr.SubstCount, curr_csr.SubstLookupRecord, buffer, nesting_level );
0
3109 buffer,
never executed: return Do_ContextSubst( gsub, igc, curr_csr.SubstCount, curr_csr.SubstLookupRecord, buffer, nesting_level );
0
3110 nesting_level );
never executed: return Do_ContextSubst( gsub, igc, curr_csr.SubstCount, curr_csr.SubstLookupRecord, buffer, nesting_level );
0
3111 -
3112 next_chainsubrule: -
3113 ; -
3114 }
never executed: }
0
3115 -
3116 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3117} -
3118 -
3119 -
3120static HB_Error Lookup_ChainContextSubst2( HB_GSUBHeader* gsub, -
3121 HB_ChainContextSubstFormat2* ccsf2, -
3122 HB_Buffer buffer, -
3123 HB_UShort flags, -
3124 HB_UShort context_length, -
3125 int nesting_level ) -
3126{ -
3127 HB_UShort index, property;
executed (the execution status of this line is deduced): HB_UShort index, property;
-
3128 HB_Error error;
executed (the execution status of this line is deduced): HB_Error error;
-
3129 HB_UShort i, j, k;
executed (the execution status of this line is deduced): HB_UShort i, j, k;
-
3130 HB_UShort bgc, igc, lgc;
executed (the execution status of this line is deduced): HB_UShort bgc, igc, lgc;
-
3131 HB_UShort known_backtrack_classes,
executed (the execution status of this line is deduced): HB_UShort known_backtrack_classes,
-
3132 known_input_classes,
executed (the execution status of this line is deduced): known_input_classes,
-
3133 known_lookahead_classes;
executed (the execution status of this line is deduced): known_lookahead_classes;
-
3134 -
3135 HB_UShort* backtrack_classes;
executed (the execution status of this line is deduced): HB_UShort* backtrack_classes;
-
3136 HB_UShort* input_classes;
executed (the execution status of this line is deduced): HB_UShort* input_classes;
-
3137 HB_UShort* lookahead_classes;
executed (the execution status of this line is deduced): HB_UShort* lookahead_classes;
-
3138 -
3139 HB_UShort* bc;
executed (the execution status of this line is deduced): HB_UShort* bc;
-
3140 HB_UShort* ic;
executed (the execution status of this line is deduced): HB_UShort* ic;
-
3141 HB_UShort* lc;
executed (the execution status of this line is deduced): HB_UShort* lc;
-
3142 -
3143 HB_ChainSubClassSet* cscs;
executed (the execution status of this line is deduced): HB_ChainSubClassSet* cscs;
-
3144 HB_ChainSubClassRule ccsr;
executed (the execution status of this line is deduced): HB_ChainSubClassRule ccsr;
-
3145 HB_GDEFHeader* gdef;
executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
3146 -
3147 -
3148 gdef = gsub->gdef;
executed (the execution status of this line is deduced): gdef = gsub->gdef;
-
3149 -
3150 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32060924
0-32060924
3151 return error;
never executed: return error;
0
3152 -
3153 /* Note: The coverage table in format 2 doesn't give an index into -
3154 anything. It just lets us know whether or not we need to -
3155 do any lookup at all. */ -
3156 -
3157 error = _HB_OPEN_Coverage_Index( &ccsf2->Coverage, IN_CURGLYPH(), &index );
executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &ccsf2->Coverage, (buffer->in_string[buffer->in_pos].gindex), &index );
-
3158 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:31960937
yes
Evaluation Count:99987
99987-31960937
3159 return error;
executed: return error;
Execution Count:31960937
31960937
3160 -
3161 if ( ALLOC_ARRAY( backtrack_classes, ccsf2->MaxBacktrackLength, HB_UShort ) )
partially evaluated: ( (backtrack_classes) = _hb_alloc( (ccsf2->MaxBacktrackLength)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3162 return error;
never executed: return error;
0
3163 known_backtrack_classes = 0;
executed (the execution status of this line is deduced): known_backtrack_classes = 0;
-
3164 -
3165 if (ccsf2->MaxInputLength < 1)
partially evaluated: ccsf2->MaxInputLength < 1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3166 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3167 -
3168 if ( ALLOC_ARRAY( input_classes, ccsf2->MaxInputLength, HB_UShort ) )
partially evaluated: ( (input_classes) = _hb_alloc( (ccsf2->MaxInputLength)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3169 goto End3;
never executed: goto End3;
0
3170 known_input_classes = 1;
executed (the execution status of this line is deduced): known_input_classes = 1;
-
3171 -
3172 if ( ALLOC_ARRAY( lookahead_classes, ccsf2->MaxLookaheadLength, HB_UShort ) )
partially evaluated: ( (lookahead_classes) = _hb_alloc( (ccsf2->MaxLookaheadLength)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3173 goto End2;
never executed: goto End2;
0
3174 known_lookahead_classes = 0;
executed (the execution status of this line is deduced): known_lookahead_classes = 0;
-
3175 -
3176 error = _HB_OPEN_Get_Class( &ccsf2->InputClassDef, IN_CURGLYPH(),
executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &ccsf2->InputClassDef, (buffer->in_string[buffer->in_pos].gindex),
-
3177 &input_classes[0], NULL );
executed (the execution status of this line is deduced): &input_classes[0], ((void *)0) );
-
3178 if ( error && error != HB_Err_Not_Covered )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
never evaluated: error != HB_Err_Not_Covered
0-99987
3179 goto End1;
never executed: goto End1;
0
3180 -
3181 cscs = &ccsf2->ChainSubClassSet[input_classes[0]];
executed (the execution status of this line is deduced): cscs = &ccsf2->ChainSubClassSet[input_classes[0]];
-
3182 if ( !cscs )
partially evaluated: !cscs
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3183 { -
3184 error = ERR(HB_Err_Invalid_SubTable);
never executed (the execution status of this line is deduced): error = _hb_err (HB_Err_Invalid_SubTable);
-
3185 goto End1;
never executed: goto End1;
0
3186 } -
3187 -
3188 for ( k = 0; k < cscs->ChainSubClassRuleCount; k++ )
evaluated: k < cscs->ChainSubClassRuleCount
TRUEFALSE
yes
Evaluation Count:299959
yes
Evaluation Count:99987
99987-299959
3189 { -
3190 ccsr = cscs->ChainSubClassRule[k];
executed (the execution status of this line is deduced): ccsr = cscs->ChainSubClassRule[k];
-
3191 bgc = ccsr.BacktrackGlyphCount;
executed (the execution status of this line is deduced): bgc = ccsr.BacktrackGlyphCount;
-
3192 igc = ccsr.InputGlyphCount;
executed (the execution status of this line is deduced): igc = ccsr.InputGlyphCount;
-
3193 lgc = ccsr.LookaheadGlyphCount;
executed (the execution status of this line is deduced): lgc = ccsr.LookaheadGlyphCount;
-
3194 -
3195 if ( context_length != 0xFFFF && context_length < igc )
partially evaluated: context_length != 0xFFFF
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:299959
never evaluated: context_length < igc
0-299959
3196 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3197 -
3198 /* check whether context is too long; it is a first guess only */ -
3199 -
3200 if ( bgc > buffer->out_pos || buffer->in_pos + igc + lgc > buffer->in_length )
partially evaluated: bgc > buffer->out_pos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:299959
evaluated: buffer->in_pos + igc + lgc > buffer->in_length
TRUEFALSE
yes
Evaluation Count:13203
yes
Evaluation Count:286756
0-299959
3201 goto next_chainsubclassrule;
executed: goto next_chainsubclassrule;
Execution Count:13203
13203
3202 -
3203 if ( bgc )
partially evaluated: bgc
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:286756
0-286756
3204 { -
3205 /* Since we don't know in advance the number of glyphs to inspect, -
3206 we search backwards for matches in the backtrack glyph array. -
3207 Note that `known_backtrack_classes' starts at index 0. */ -
3208 -
3209 bc = ccsr.Backtrack;
never executed (the execution status of this line is deduced): bc = ccsr.Backtrack;
-
3210 -
3211 for ( i = 0, j = buffer->out_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
3212 { -
3213 while ( CHECK_Property( gdef, OUT_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3214 { -
3215 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3216 goto End1;
never executed: goto End1;
0
3217 -
3218 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
3219 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3220 j--;
never executed (the execution status of this line is deduced): j--;
-
3221 }
never executed: }
0
3222 -
3223 if ( i >= known_backtrack_classes )
never evaluated: i >= known_backtrack_classes
0
3224 { -
3225 /* Keeps us from having to do this for each rule */ -
3226 -
3227 error = _HB_OPEN_Get_Class( &ccsf2->BacktrackClassDef, OUT_GLYPH( j ),
never executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &ccsf2->BacktrackClassDef, (buffer->out_string[(j)].gindex),
-
3228 &backtrack_classes[i], NULL );
never executed (the execution status of this line is deduced): &backtrack_classes[i], ((void *)0) );
-
3229 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3230 goto End1;
never executed: goto End1;
0
3231 known_backtrack_classes = i;
never executed (the execution status of this line is deduced): known_backtrack_classes = i;
-
3232 }
never executed: }
0
3233 -
3234 if ( bc[i] != backtrack_classes[i] )
never evaluated: bc[i] != backtrack_classes[i]
0
3235 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3236 }
never executed: }
0
3237 }
never executed: }
0
3238 -
3239 ic = ccsr.Input;
executed (the execution status of this line is deduced): ic = ccsr.Input;
-
3240 -
3241 /* Start at 1 because [0] is implied */ -
3242 -
3243 for ( i = 1, j = buffer->in_pos + 1; i < igc; i++, j++ )
partially evaluated: i < igc
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:286756
0-286756
3244 { -
3245 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3246 { -
3247 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3248 goto End1;
never executed: goto End1;
0
3249 -
3250 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
3251 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3252 j++;
never executed (the execution status of this line is deduced): j++;
-
3253 }
never executed: }
0
3254 -
3255 if ( i >= known_input_classes )
never evaluated: i >= known_input_classes
0
3256 { -
3257 error = _HB_OPEN_Get_Class( &ccsf2->InputClassDef, IN_GLYPH( j ),
never executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &ccsf2->InputClassDef, (buffer->in_string[(j)].gindex),
-
3258 &input_classes[i], NULL );
never executed (the execution status of this line is deduced): &input_classes[i], ((void *)0) );
-
3259 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3260 goto End1;
never executed: goto End1;
0
3261 known_input_classes = i;
never executed (the execution status of this line is deduced): known_input_classes = i;
-
3262 }
never executed: }
0
3263 -
3264 if ( ic[i - 1] != input_classes[i] )
never evaluated: ic[i - 1] != input_classes[i]
0
3265 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3266 }
never executed: }
0
3267 -
3268 /* we are starting to check for lookahead glyphs right after the -
3269 last context glyph */ -
3270 -
3271 lc = ccsr.Lookahead;
executed (the execution status of this line is deduced): lc = ccsr.Lookahead;
-
3272 -
3273 for ( i = 0; i < lgc; i++, j++ )
partially evaluated: i < lgc
TRUEFALSE
yes
Evaluation Count:286756
no
Evaluation Count:0
0-286756
3274 { -
3275 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
partially evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:286756
0-286756
3276 { -
3277 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3278 goto End1;
never executed: goto End1;
0
3279 -
3280 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3281 goto next_chainsubclassrule;
never executed: goto next_chainsubclassrule;
0
3282 j++;
never executed (the execution status of this line is deduced): j++;
-
3283 }
never executed: }
0
3284 -
3285 if ( i >= known_lookahead_classes )
partially evaluated: i >= known_lookahead_classes
TRUEFALSE
yes
Evaluation Count:286756
no
Evaluation Count:0
0-286756
3286 { -
3287 error = _HB_OPEN_Get_Class( &ccsf2->LookaheadClassDef, IN_GLYPH( j ),
executed (the execution status of this line is deduced): error = _HB_OPEN_Get_Class( &ccsf2->LookaheadClassDef, (buffer->in_string[(j)].gindex),
-
3288 &lookahead_classes[i], NULL );
executed (the execution status of this line is deduced): &lookahead_classes[i], ((void *)0) );
-
3289 if ( error && error != HB_Err_Not_Covered )
evaluated: error
TRUEFALSE
yes
Evaluation Count:159774
yes
Evaluation Count:126982
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:159774
0-159774
3290 goto End1;
never executed: goto End1;
0
3291 known_lookahead_classes = i;
executed (the execution status of this line is deduced): known_lookahead_classes = i;
-
3292 }
executed: }
Execution Count:286756
286756
3293 -
3294 if ( lc[i] != lookahead_classes[i] )
partially evaluated: lc[i] != lookahead_classes[i]
TRUEFALSE
yes
Evaluation Count:286756
no
Evaluation Count:0
0-286756
3295 goto next_chainsubclassrule;
executed: goto next_chainsubclassrule;
Execution Count:286756
286756
3296 }
never executed: }
0
3297 -
3298 error = Do_ContextSubst( gsub, igc,
never executed (the execution status of this line is deduced): error = Do_ContextSubst( gsub, igc,
-
3299 ccsr.SubstCount,
never executed (the execution status of this line is deduced): ccsr.SubstCount,
-
3300 ccsr.SubstLookupRecord,
never executed (the execution status of this line is deduced): ccsr.SubstLookupRecord,
-
3301 buffer,
never executed (the execution status of this line is deduced): buffer,
-
3302 nesting_level );
never executed (the execution status of this line is deduced): nesting_level );
-
3303 goto End1;
never executed: goto End1;
0
3304 -
3305 next_chainsubclassrule: -
3306 ; -
3307 }
executed: }
Execution Count:299959
299959
3308 -
3309 error = HB_Err_Not_Covered;
executed (the execution status of this line is deduced): error = HB_Err_Not_Covered;
-
3310 -
3311End1:
code before this statement executed: End1:
Execution Count:99987
99987
3312 FREE( lookahead_classes );
executed: }
Execution Count:99987
executed: }
Execution Count:99987
partially evaluated: (lookahead_classes)
TRUEFALSE
yes
Evaluation Count:99987
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3313 -
3314End2:
code before this statement executed: End2:
Execution Count:99987
99987
3315 FREE( input_classes );
executed: }
Execution Count:99987
executed: }
Execution Count:99987
partially evaluated: (input_classes)
TRUEFALSE
yes
Evaluation Count:99987
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3316 -
3317End3:
code before this statement executed: End3:
Execution Count:99987
99987
3318 FREE( backtrack_classes );
executed: }
Execution Count:99986
executed: }
Execution Count:99987
evaluated: (backtrack_classes)
TRUEFALSE
yes
Evaluation Count:99986
yes
Evaluation Count:1
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:99987
0-99987
3319 return error;
executed: return error;
Execution Count:99987
99987
3320} -
3321 -
3322 -
3323static HB_Error Lookup_ChainContextSubst3( HB_GSUBHeader* gsub, -
3324 HB_ChainContextSubstFormat3* ccsf3, -
3325 HB_Buffer buffer, -
3326 HB_UShort flags, -
3327 HB_UShort context_length, -
3328 int nesting_level ) -
3329{ -
3330 HB_UShort index, i, j, property;
never executed (the execution status of this line is deduced): HB_UShort index, i, j, property;
-
3331 HB_UShort bgc, igc, lgc;
never executed (the execution status of this line is deduced): HB_UShort bgc, igc, lgc;
-
3332 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
3333 -
3334 HB_Coverage* bc;
never executed (the execution status of this line is deduced): HB_Coverage* bc;
-
3335 HB_Coverage* ic;
never executed (the execution status of this line is deduced): HB_Coverage* ic;
-
3336 HB_Coverage* lc;
never executed (the execution status of this line is deduced): HB_Coverage* lc;
-
3337 HB_GDEFHeader* gdef;
never executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
3338 -
3339 -
3340 gdef = gsub->gdef;
never executed (the execution status of this line is deduced): gdef = gsub->gdef;
-
3341 -
3342 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
3343 return error;
never executed: return error;
0
3344 -
3345 bgc = ccsf3->BacktrackGlyphCount;
never executed (the execution status of this line is deduced): bgc = ccsf3->BacktrackGlyphCount;
-
3346 igc = ccsf3->InputGlyphCount;
never executed (the execution status of this line is deduced): igc = ccsf3->InputGlyphCount;
-
3347 lgc = ccsf3->LookaheadGlyphCount;
never executed (the execution status of this line is deduced): lgc = ccsf3->LookaheadGlyphCount;
-
3348 -
3349 if ( context_length != 0xFFFF && context_length < igc )
never evaluated: context_length != 0xFFFF
never evaluated: context_length < igc
0
3350 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3351 -
3352 /* check whether context is too long; it is a first guess only */ -
3353 -
3354 if ( bgc > buffer->out_pos || buffer->in_pos + igc + lgc > buffer->in_length )
never evaluated: bgc > buffer->out_pos
never evaluated: buffer->in_pos + igc + lgc > buffer->in_length
0
3355 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3356 -
3357 if ( bgc )
never evaluated: bgc
0
3358 { -
3359 /* Since we don't know in advance the number of glyphs to inspect, -
3360 we search backwards for matches in the backtrack glyph array */ -
3361 -
3362 bc = ccsf3->BacktrackCoverage;
never executed (the execution status of this line is deduced): bc = ccsf3->BacktrackCoverage;
-
3363 -
3364 for ( i = 0, j = buffer->out_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
3365 { -
3366 while ( CHECK_Property( gdef, OUT_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->out_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3367 { -
3368 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3369 return error;
never executed: return error;
0
3370 -
3371 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
3372 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3373 j--;
never executed (the execution status of this line is deduced): j--;
-
3374 }
never executed: }
0
3375 -
3376 error = _HB_OPEN_Coverage_Index( &bc[i], OUT_GLYPH( j ), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &bc[i], (buffer->out_string[(j)].gindex), &index );
-
3377 if ( error )
never evaluated: error
0
3378 return error;
never executed: return error;
0
3379 }
never executed: }
0
3380 }
never executed: }
0
3381 -
3382 ic = ccsf3->InputCoverage;
never executed (the execution status of this line is deduced): ic = ccsf3->InputCoverage;
-
3383 -
3384 for ( i = 0, j = buffer->in_pos; i < igc; i++, j++ )
never evaluated: i < igc
0
3385 { -
3386 /* We already called CHECK_Property for IN_GLYPH( buffer->in_pos ) */ -
3387 while ( j > buffer->in_pos && CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: j > buffer->in_pos
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3388 { -
3389 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3390 return error;
never executed: return error;
0
3391 -
3392 if ( j + igc - i + lgc == (HB_Int)buffer->in_length )
never evaluated: j + igc - i + lgc == (HB_Int)buffer->in_length
0
3393 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3394 j++;
never executed (the execution status of this line is deduced): j++;
-
3395 }
never executed: }
0
3396 -
3397 error = _HB_OPEN_Coverage_Index( &ic[i], IN_GLYPH( j ), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &ic[i], (buffer->in_string[(j)].gindex), &index );
-
3398 if ( error )
never evaluated: error
0
3399 return error;
never executed: return error;
0
3400 }
never executed: }
0
3401 -
3402 /* we are starting for lookahead glyphs right after the last context -
3403 glyph */ -
3404 -
3405 lc = ccsf3->LookaheadCoverage;
never executed (the execution status of this line is deduced): lc = ccsf3->LookaheadCoverage;
-
3406 -
3407 for ( i = 0; i < lgc; i++, j++ )
never evaluated: i < lgc
0
3408 { -
3409 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3410 { -
3411 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3412 return error;
never executed: return error;
0
3413 -
3414 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3415 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3416 j++;
never executed (the execution status of this line is deduced): j++;
-
3417 }
never executed: }
0
3418 -
3419 error = _HB_OPEN_Coverage_Index( &lc[i], IN_GLYPH( j ), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &lc[i], (buffer->in_string[(j)].gindex), &index );
-
3420 if ( error )
never evaluated: error
0
3421 return error;
never executed: return error;
0
3422 }
never executed: }
0
3423 -
3424 return Do_ContextSubst( gsub, igc,
never executed: return Do_ContextSubst( gsub, igc, ccsf3->SubstCount, ccsf3->SubstLookupRecord, buffer, nesting_level );
0
3425 ccsf3->SubstCount,
never executed: return Do_ContextSubst( gsub, igc, ccsf3->SubstCount, ccsf3->SubstLookupRecord, buffer, nesting_level );
0
3426 ccsf3->SubstLookupRecord,
never executed: return Do_ContextSubst( gsub, igc, ccsf3->SubstCount, ccsf3->SubstLookupRecord, buffer, nesting_level );
0
3427 buffer,
never executed: return Do_ContextSubst( gsub, igc, ccsf3->SubstCount, ccsf3->SubstLookupRecord, buffer, nesting_level );
0
3428 nesting_level );
never executed: return Do_ContextSubst( gsub, igc, ccsf3->SubstCount, ccsf3->SubstLookupRecord, buffer, nesting_level );
0
3429} -
3430 -
3431 -
3432static HB_Error Lookup_ChainContextSubst( HB_GSUBHeader* gsub, -
3433 HB_GSUB_SubTable* st, -
3434 HB_Buffer buffer, -
3435 HB_UShort flags, -
3436 HB_UShort context_length, -
3437 int nesting_level ) -
3438{ -
3439 HB_ChainContextSubst* ccs = &st->chain;
executed (the execution status of this line is deduced): HB_ChainContextSubst* ccs = &st->chain;
-
3440 -
3441 switch ( ccs->SubstFormat ) { -
3442 case 1: return Lookup_ChainContextSubst1( gsub, &ccs->ccsf.ccsf1, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ChainContextSubst1( gsub, &ccs->ccsf.ccsf1, buffer, flags, context_length, nesting_level );
0
3443 case 2: return Lookup_ChainContextSubst2( gsub, &ccs->ccsf.ccsf2, buffer, flags, context_length, nesting_level );
executed: return Lookup_ChainContextSubst2( gsub, &ccs->ccsf.ccsf2, buffer, flags, context_length, nesting_level );
Execution Count:32060924
32060924
3444 case 3: return Lookup_ChainContextSubst3( gsub, &ccs->ccsf.ccsf3, buffer, flags, context_length, nesting_level );
never executed: return Lookup_ChainContextSubst3( gsub, &ccs->ccsf.ccsf3, buffer, flags, context_length, nesting_level );
0
3445 default: return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3446 } -
3447}
never executed: }
0
3448 -
3449 -
3450static HB_Error Load_ReverseChainContextSubst( HB_GSUB_SubTable* st, -
3451 HB_Stream stream ) -
3452{ -
3453 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
3454 HB_ReverseChainContextSubst* rccs = &st->reverse;
never executed (the execution status of this line is deduced): HB_ReverseChainContextSubst* rccs = &st->reverse;
-
3455 -
3456 HB_UShort m, count;
never executed (the execution status of this line is deduced): HB_UShort m, count;
-
3457 -
3458 HB_UShort nb = 0, nl = 0, n;
never executed (the execution status of this line is deduced): HB_UShort nb = 0, nl = 0, n;
-
3459 HB_UShort backtrack_count, lookahead_count;
never executed (the execution status of this line is deduced): HB_UShort backtrack_count, lookahead_count;
-
3460 HB_UInt cur_offset, new_offset, base_offset;
never executed (the execution status of this line is deduced): HB_UInt cur_offset, new_offset, base_offset;
-
3461 -
3462 HB_Coverage* b;
never executed (the execution status of this line is deduced): HB_Coverage* b;
-
3463 HB_Coverage* l;
never executed (the execution status of this line is deduced): HB_Coverage* l;
-
3464 HB_UShort* sub;
never executed (the execution status of this line is deduced): HB_UShort* sub;
-
3465 -
3466 base_offset = FILE_Pos();
never executed (the execution status of this line is deduced): base_offset = _hb_stream_pos( stream );
-
3467 -
3468 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3469 return error;
never executed: return error;
0
3470 -
3471 rccs->SubstFormat = GET_UShort();
never executed (the execution status of this line is deduced): rccs->SubstFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
3472 -
3473 if ( rccs->SubstFormat != 1 )
never evaluated: rccs->SubstFormat != 1
0
3474 return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3475 -
3476 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3477 -
3478 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3479 return error;
never executed: return error;
0
3480 -
3481 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
3482 -
3483 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3484 -
3485 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
3486 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3487 ( error = _HB_OPEN_Load_Coverage( &rccs->Coverage, stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &rccs->Coverage, stream ) ) != HB_Err_Ok
0
3488 return error;
never executed: return error;
0
3489 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
3490 -
3491 -
3492 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3493 goto Fail4;
never executed: goto Fail4;
0
3494 -
3495 rccs->BacktrackGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): rccs->BacktrackGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
3496 -
3497 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3498 -
3499 rccs->BacktrackCoverage = NULL;
never executed (the execution status of this line is deduced): rccs->BacktrackCoverage = ((void *)0);
-
3500 -
3501 backtrack_count = rccs->BacktrackGlyphCount;
never executed (the execution status of this line is deduced): backtrack_count = rccs->BacktrackGlyphCount;
-
3502 -
3503 if ( ALLOC_ARRAY( rccs->BacktrackCoverage, backtrack_count,
never evaluated: ( (rccs->BacktrackCoverage) = _hb_alloc( (backtrack_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
3504 HB_Coverage ) ) -
3505 goto Fail4;
never executed: goto Fail4;
0
3506 -
3507 b = rccs->BacktrackCoverage;
never executed (the execution status of this line is deduced): b = rccs->BacktrackCoverage;
-
3508 -
3509 for ( nb = 0; nb < backtrack_count; nb++ )
never evaluated: nb < backtrack_count
0
3510 { -
3511 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3512 goto Fail3;
never executed: goto Fail3;
0
3513 -
3514 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
3515 -
3516 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3517 -
3518 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
3519 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3520 ( error = _HB_OPEN_Load_Coverage( &b[nb], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &b[nb], stream ) ) != HB_Err_Ok
0
3521 goto Fail3;
never executed: goto Fail3;
0
3522 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
3523 }
never executed: }
0
3524 -
3525 -
3526 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3527 goto Fail3;
never executed: goto Fail3;
0
3528 -
3529 rccs->LookaheadGlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): rccs->LookaheadGlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
3530 -
3531 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3532 -
3533 rccs->LookaheadCoverage = NULL;
never executed (the execution status of this line is deduced): rccs->LookaheadCoverage = ((void *)0);
-
3534 -
3535 lookahead_count = rccs->LookaheadGlyphCount;
never executed (the execution status of this line is deduced): lookahead_count = rccs->LookaheadGlyphCount;
-
3536 -
3537 if ( ALLOC_ARRAY( rccs->LookaheadCoverage, lookahead_count,
never evaluated: ( (rccs->LookaheadCoverage) = _hb_alloc( (lookahead_count)*sizeof(HB_Coverage), &error ), error != 0 )
0
3538 HB_Coverage ) ) -
3539 goto Fail3;
never executed: goto Fail3;
0
3540 -
3541 l = rccs->LookaheadCoverage;
never executed (the execution status of this line is deduced): l = rccs->LookaheadCoverage;
-
3542 -
3543 for ( nl = 0; nl < lookahead_count; nl++ )
never evaluated: nl < lookahead_count
0
3544 { -
3545 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3546 goto Fail2;
never executed: goto Fail2;
0
3547 -
3548 new_offset = GET_UShort() + base_offset;
never executed (the execution status of this line is deduced): new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset;
-
3549 -
3550 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3551 -
3552 cur_offset = FILE_Pos();
never executed (the execution status of this line is deduced): cur_offset = _hb_stream_pos( stream );
-
3553 if ( FILE_Seek( new_offset ) ||
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
0
3554 ( error = _HB_OPEN_Load_Coverage( &l[nl], stream ) ) != HB_Err_Ok )
never evaluated: ( error = _HB_OPEN_Load_Coverage( &l[nl], stream ) ) != HB_Err_Ok
0
3555 goto Fail2;
never executed: goto Fail2;
0
3556 (void)FILE_Seek( cur_offset );
never executed (the execution status of this line is deduced): (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
-
3557 }
never executed: }
0
3558 -
3559 if ( ACCESS_Frame( 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
0
3560 goto Fail2;
never executed: goto Fail2;
0
3561 -
3562 rccs->GlyphCount = GET_UShort();
never executed (the execution status of this line is deduced): rccs->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
-
3563 -
3564 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3565 -
3566 rccs->Substitute = NULL;
never executed (the execution status of this line is deduced): rccs->Substitute = ((void *)0);
-
3567 -
3568 count = rccs->GlyphCount;
never executed (the execution status of this line is deduced): count = rccs->GlyphCount;
-
3569 -
3570 if ( ALLOC_ARRAY( rccs->Substitute, count,
never evaluated: ( (rccs->Substitute) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
0
3571 HB_UShort ) ) -
3572 goto Fail2;
never executed: goto Fail2;
0
3573 -
3574 sub = rccs->Substitute;
never executed (the execution status of this line is deduced): sub = rccs->Substitute;
-
3575 -
3576 if ( ACCESS_Frame( count * 2L ) )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
0
3577 goto Fail1;
never executed: goto Fail1;
0
3578 -
3579 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3580 sub[n] = GET_UShort();
never executed: sub[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
0
3581 -
3582 FORGET_Frame();
never executed (the execution status of this line is deduced): _hb_stream_frame_exit( stream );
-
3583 -
3584 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3585 -
3586Fail1: -
3587 FREE( sub );
never executed: }
never executed: }
never evaluated: (sub)
never evaluated: 0
0
3588 -
3589Fail2:
code before this statement never executed: Fail2:
0
3590 for ( m = 0; m < nl; m++ )
never evaluated: m < nl
0
3591 _HB_OPEN_Free_Coverage( &l[m] );
never executed: _HB_OPEN_Free_Coverage( &l[m] );
0
3592 -
3593 FREE( l );
never executed: }
never executed: }
never evaluated: (l)
never evaluated: 0
0
3594 -
3595Fail3:
code before this statement never executed: Fail3:
0
3596 for ( m = 0; m < nb; m++ )
never evaluated: m < nb
0
3597 _HB_OPEN_Free_Coverage( &b[m] );
never executed: _HB_OPEN_Free_Coverage( &b[m] );
0
3598 -
3599 FREE( b );
never executed: }
never executed: }
never evaluated: (b)
never evaluated: 0
0
3600 -
3601Fail4:
code before this statement never executed: Fail4:
0
3602 _HB_OPEN_Free_Coverage( &rccs->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &rccs->Coverage );
-
3603 return error;
never executed: return error;
0
3604} -
3605 -
3606 -
3607static void Free_ReverseChainContextSubst( HB_GSUB_SubTable* st ) -
3608{ -
3609 HB_UShort n, count;
never executed (the execution status of this line is deduced): HB_UShort n, count;
-
3610 HB_ReverseChainContextSubst* rccs = &st->reverse;
never executed (the execution status of this line is deduced): HB_ReverseChainContextSubst* rccs = &st->reverse;
-
3611 -
3612 HB_Coverage* c;
never executed (the execution status of this line is deduced): HB_Coverage* c;
-
3613 -
3614 _HB_OPEN_Free_Coverage( &rccs->Coverage );
never executed (the execution status of this line is deduced): _HB_OPEN_Free_Coverage( &rccs->Coverage );
-
3615 -
3616 if ( rccs->LookaheadCoverage )
never evaluated: rccs->LookaheadCoverage
0
3617 { -
3618 count = rccs->LookaheadGlyphCount;
never executed (the execution status of this line is deduced): count = rccs->LookaheadGlyphCount;
-
3619 c = rccs->LookaheadCoverage;
never executed (the execution status of this line is deduced): c = rccs->LookaheadCoverage;
-
3620 -
3621 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3622 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
3623 -
3624 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
3625 }
never executed: }
0
3626 -
3627 if ( rccs->BacktrackCoverage )
never evaluated: rccs->BacktrackCoverage
0
3628 { -
3629 count = rccs->BacktrackGlyphCount;
never executed (the execution status of this line is deduced): count = rccs->BacktrackGlyphCount;
-
3630 c = rccs->BacktrackCoverage;
never executed (the execution status of this line is deduced): c = rccs->BacktrackCoverage;
-
3631 -
3632 for ( n = 0; n < count; n++ )
never evaluated: n < count
0
3633 _HB_OPEN_Free_Coverage( &c[n] );
never executed: _HB_OPEN_Free_Coverage( &c[n] );
0
3634 -
3635 FREE( c );
never executed: }
never executed: }
never evaluated: (c)
never evaluated: 0
0
3636 }
never executed: }
0
3637 -
3638 FREE ( rccs->Substitute );
never executed: }
never executed: }
never evaluated: (rccs->Substitute)
never evaluated: 0
0
3639}
never executed: }
0
3640 -
3641 -
3642static HB_Error Lookup_ReverseChainContextSubst( HB_GSUBHeader* gsub, -
3643 HB_GSUB_SubTable* st, -
3644 HB_Buffer buffer, -
3645 HB_UShort flags, -
3646 HB_UShort context_length, -
3647 int nesting_level ) -
3648{ -
3649 HB_UShort index, input_index, i, j, property;
never executed (the execution status of this line is deduced): HB_UShort index, input_index, i, j, property;
-
3650 HB_UShort bgc, lgc;
never executed (the execution status of this line is deduced): HB_UShort bgc, lgc;
-
3651 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
3652 -
3653 HB_ReverseChainContextSubst* rccs = &st->reverse;
never executed (the execution status of this line is deduced): HB_ReverseChainContextSubst* rccs = &st->reverse;
-
3654 HB_Coverage* bc;
never executed (the execution status of this line is deduced): HB_Coverage* bc;
-
3655 HB_Coverage* lc;
never executed (the execution status of this line is deduced): HB_Coverage* lc;
-
3656 HB_GDEFHeader* gdef;
never executed (the execution status of this line is deduced): HB_GDEFHeader* gdef;
-
3657 -
3658 if ( nesting_level != 1 || context_length != 0xFFFF )
never evaluated: nesting_level != 1
never evaluated: context_length != 0xFFFF
0
3659 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3660 -
3661 gdef = gsub->gdef;
never executed (the execution status of this line is deduced): gdef = gsub->gdef;
-
3662 -
3663 if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[buffer->in_pos])), (flags), (&property) ) ) != HB_Err_Ok )
0
3664 return error;
never executed: return error;
0
3665 -
3666 bgc = rccs->BacktrackGlyphCount;
never executed (the execution status of this line is deduced): bgc = rccs->BacktrackGlyphCount;
-
3667 lgc = rccs->LookaheadGlyphCount;
never executed (the execution status of this line is deduced): lgc = rccs->LookaheadGlyphCount;
-
3668 -
3669 /* check whether context is too long; it is a first guess only */ -
3670 -
3671 if ( bgc > buffer->in_pos || buffer->in_pos + 1 + lgc > buffer->in_length )
never evaluated: bgc > buffer->in_pos
never evaluated: buffer->in_pos + 1 + lgc > buffer->in_length
0
3672 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3673 -
3674 if ( bgc )
never evaluated: bgc
0
3675 { -
3676 /* Since we don't know in advance the number of glyphs to inspect, -
3677 we search backwards for matches in the backtrack glyph array */ -
3678 -
3679 bc = rccs->BacktrackCoverage;
never executed (the execution status of this line is deduced): bc = rccs->BacktrackCoverage;
-
3680 -
3681 for ( i = 0, j = buffer->in_pos - 1; i < bgc; i++, j-- )
never evaluated: i < bgc
0
3682 { -
3683 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3684 { -
3685 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3686 return error;
never executed: return error;
0
3687 -
3688 if ( j + 1 == bgc - i )
never evaluated: j + 1 == bgc - i
0
3689 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3690 j--;
never executed (the execution status of this line is deduced): j--;
-
3691 }
never executed: }
0
3692 -
3693 error = _HB_OPEN_Coverage_Index( &bc[i], IN_GLYPH( j ), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &bc[i], (buffer->in_string[(j)].gindex), &index );
-
3694 if ( error )
never evaluated: error
0
3695 return error;
never executed: return error;
0
3696 }
never executed: }
0
3697 }
never executed: }
0
3698 -
3699 j = buffer->in_pos;
never executed (the execution status of this line is deduced): j = buffer->in_pos;
-
3700 -
3701 error = _HB_OPEN_Coverage_Index( &rccs->Coverage, IN_GLYPH( j ), &input_index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &rccs->Coverage, (buffer->in_string[(j)].gindex), &input_index );
-
3702 if ( error )
never evaluated: error
0
3703 return error;
never executed: return error;
0
3704 -
3705 lc = rccs->LookaheadCoverage;
never executed (the execution status of this line is deduced): lc = rccs->LookaheadCoverage;
-
3706 -
3707 for ( i = 0, j = buffer->in_pos + 1; i < lgc; i++, j++ )
never evaluated: i < lgc
0
3708 { -
3709 while ( CHECK_Property( gdef, IN_ITEM( j ), flags, &property ) )
never evaluated: ( ( error = _HB_GDEF_Check_Property( (gdef), ((&buffer->in_string[(j)])), (flags), (&property) ) ) != HB_Err_Ok )
0
3710 { -
3711 if ( error && error != HB_Err_Not_Covered )
never evaluated: error
never evaluated: error != HB_Err_Not_Covered
0
3712 return error;
never executed: return error;
0
3713 -
3714 if ( j + lgc - i == (HB_Int)buffer->in_length )
never evaluated: j + lgc - i == (HB_Int)buffer->in_length
0
3715 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3716 j++;
never executed (the execution status of this line is deduced): j++;
-
3717 }
never executed: }
0
3718 -
3719 error = _HB_OPEN_Coverage_Index( &lc[i], IN_GLYPH( j ), &index );
never executed (the execution status of this line is deduced): error = _HB_OPEN_Coverage_Index( &lc[i], (buffer->in_string[(j)].gindex), &index );
-
3720 if ( error )
never evaluated: error
0
3721 return error;
never executed: return error;
0
3722 }
never executed: }
0
3723 -
3724 IN_CURGLYPH() = rccs->Substitute[input_index];
never executed (the execution status of this line is deduced): (buffer->in_string[buffer->in_pos].gindex) = rccs->Substitute[input_index];
-
3725 buffer->in_pos--; /* Reverse! */
never executed (the execution status of this line is deduced): buffer->in_pos--;
-
3726 -
3727 return error;
never executed: return error;
0
3728} -
3729 -
3730 -
3731 -
3732/*********** -
3733 * GSUB API -
3734 ***********/ -
3735 -
3736 -
3737 -
3738HB_Error HB_GSUB_Select_Script( HB_GSUBHeader* gsub, -
3739 HB_UInt script_tag, -
3740 HB_UShort* script_index ) -
3741{ -
3742 HB_UShort n;
executed (the execution status of this line is deduced): HB_UShort n;
-
3743 -
3744 HB_ScriptList* sl;
executed (the execution status of this line is deduced): HB_ScriptList* sl;
-
3745 HB_ScriptRecord* sr;
executed (the execution status of this line is deduced): HB_ScriptRecord* sr;
-
3746 -
3747 -
3748 if ( !gsub || !script_index )
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5658
partially evaluated: !script_index
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5658
0-5658
3749 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3750 -
3751 sl = &gsub->ScriptList;
executed (the execution status of this line is deduced): sl = &gsub->ScriptList;
-
3752 sr = sl->ScriptRecord;
executed (the execution status of this line is deduced): sr = sl->ScriptRecord;
-
3753 -
3754 for ( n = 0; n < sl->ScriptCount; n++ )
evaluated: n < sl->ScriptCount
TRUEFALSE
yes
Evaluation Count:56643
yes
Evaluation Count:2504
2504-56643
3755 if ( script_tag == sr[n].ScriptTag )
evaluated: script_tag == sr[n].ScriptTag
TRUEFALSE
yes
Evaluation Count:3154
yes
Evaluation Count:53489
3154-53489
3756 { -
3757 *script_index = n;
executed (the execution status of this line is deduced): *script_index = n;
-
3758 -
3759 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:3154
3154
3760 } -
3761 -
3762 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:2504
2504
3763} -
3764 -
3765 -
3766 -
3767HB_Error HB_GSUB_Select_Language( HB_GSUBHeader* gsub, -
3768 HB_UInt language_tag, -
3769 HB_UShort script_index, -
3770 HB_UShort* language_index, -
3771 HB_UShort* req_feature_index ) -
3772{ -
3773 HB_UShort n;
never executed (the execution status of this line is deduced): HB_UShort n;
-
3774 -
3775 HB_ScriptList* sl;
never executed (the execution status of this line is deduced): HB_ScriptList* sl;
-
3776 HB_ScriptRecord* sr;
never executed (the execution status of this line is deduced): HB_ScriptRecord* sr;
-
3777 HB_ScriptTable* s;
never executed (the execution status of this line is deduced): HB_ScriptTable* s;
-
3778 HB_LangSysRecord* lsr;
never executed (the execution status of this line is deduced): HB_LangSysRecord* lsr;
-
3779 -
3780 -
3781 if ( !gsub || !language_index || !req_feature_index )
never evaluated: !gsub
never evaluated: !language_index
never evaluated: !req_feature_index
0
3782 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3783 -
3784 sl = &gsub->ScriptList;
never executed (the execution status of this line is deduced): sl = &gsub->ScriptList;
-
3785 sr = sl->ScriptRecord;
never executed (the execution status of this line is deduced): sr = sl->ScriptRecord;
-
3786 -
3787 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
3788 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3789 -
3790 s = &sr[script_index].Script;
never executed (the execution status of this line is deduced): s = &sr[script_index].Script;
-
3791 lsr = s->LangSysRecord;
never executed (the execution status of this line is deduced): lsr = s->LangSysRecord;
-
3792 -
3793 for ( n = 0; n < s->LangSysCount; n++ )
never evaluated: n < s->LangSysCount
0
3794 if ( language_tag == lsr[n].LangSysTag )
never evaluated: language_tag == lsr[n].LangSysTag
0
3795 { -
3796 *language_index = n;
never executed (the execution status of this line is deduced): *language_index = n;
-
3797 *req_feature_index = lsr[n].LangSys.ReqFeatureIndex;
never executed (the execution status of this line is deduced): *req_feature_index = lsr[n].LangSys.ReqFeatureIndex;
-
3798 -
3799 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3800 } -
3801 -
3802 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
3803} -
3804 -
3805 -
3806/* selecting 0xFFFF for language_index asks for the values of the -
3807 default language (DefaultLangSys) */ -
3808 -
3809 -
3810HB_Error HB_GSUB_Select_Feature( HB_GSUBHeader* gsub, -
3811 HB_UInt feature_tag, -
3812 HB_UShort script_index, -
3813 HB_UShort language_index, -
3814 HB_UShort* feature_index ) -
3815{ -
3816 HB_UShort n;
executed (the execution status of this line is deduced): HB_UShort n;
-
3817 -
3818 HB_ScriptList* sl;
executed (the execution status of this line is deduced): HB_ScriptList* sl;
-
3819 HB_ScriptRecord* sr;
executed (the execution status of this line is deduced): HB_ScriptRecord* sr;
-
3820 HB_ScriptTable* s;
executed (the execution status of this line is deduced): HB_ScriptTable* s;
-
3821 HB_LangSysRecord* lsr;
executed (the execution status of this line is deduced): HB_LangSysRecord* lsr;
-
3822 HB_LangSys* ls;
executed (the execution status of this line is deduced): HB_LangSys* ls;
-
3823 HB_UShort* fi;
executed (the execution status of this line is deduced): HB_UShort* fi;
-
3824 -
3825 HB_FeatureList* fl;
executed (the execution status of this line is deduced): HB_FeatureList* fl;
-
3826 HB_FeatureRecord* fr;
executed (the execution status of this line is deduced): HB_FeatureRecord* fr;
-
3827 -
3828 -
3829 if ( !gsub || !feature_index )
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1205
partially evaluated: !feature_index
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1205
0-1205
3830 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3831 -
3832 sl = &gsub->ScriptList;
executed (the execution status of this line is deduced): sl = &gsub->ScriptList;
-
3833 sr = sl->ScriptRecord;
executed (the execution status of this line is deduced): sr = sl->ScriptRecord;
-
3834 -
3835 fl = &gsub->FeatureList;
executed (the execution status of this line is deduced): fl = &gsub->FeatureList;
-
3836 fr = fl->FeatureRecord;
executed (the execution status of this line is deduced): fr = fl->FeatureRecord;
-
3837 -
3838 if ( script_index >= sl->ScriptCount )
partially evaluated: script_index >= sl->ScriptCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1205
0-1205
3839 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3840 -
3841 s = &sr[script_index].Script;
executed (the execution status of this line is deduced): s = &sr[script_index].Script;
-
3842 lsr = s->LangSysRecord;
executed (the execution status of this line is deduced): lsr = s->LangSysRecord;
-
3843 -
3844 if ( language_index == 0xFFFF )
partially evaluated: language_index == 0xFFFF
TRUEFALSE
yes
Evaluation Count:1205
no
Evaluation Count:0
0-1205
3845 ls = &s->DefaultLangSys;
executed: ls = &s->DefaultLangSys;
Execution Count:1205
1205
3846 else -
3847 { -
3848 if ( language_index >= s->LangSysCount )
never evaluated: language_index >= s->LangSysCount
0
3849 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3850 -
3851 ls = &lsr[language_index].LangSys;
never executed (the execution status of this line is deduced): ls = &lsr[language_index].LangSys;
-
3852 }
never executed: }
0
3853 -
3854 fi = ls->FeatureIndex;
executed (the execution status of this line is deduced): fi = ls->FeatureIndex;
-
3855 -
3856 for ( n = 0; n < ls->FeatureCount; n++ )
evaluated: n < ls->FeatureCount
TRUEFALSE
yes
Evaluation Count:4521
yes
Evaluation Count:446
446-4521
3857 { -
3858 if ( fi[n] >= fl->FeatureCount )
partially evaluated: fi[n] >= fl->FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4521
0-4521
3859 return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
3860 -
3861 if ( feature_tag == fr[fi[n]].FeatureTag )
evaluated: feature_tag == fr[fi[n]].FeatureTag
TRUEFALSE
yes
Evaluation Count:759
yes
Evaluation Count:3762
759-3762
3862 { -
3863 *feature_index = fi[n];
executed (the execution status of this line is deduced): *feature_index = fi[n];
-
3864 -
3865 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:759
759
3866 } -
3867 }
executed: }
Execution Count:3762
3762
3868 -
3869 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:446
446
3870} -
3871 -
3872 -
3873/* The next three functions return a null-terminated list */ -
3874 -
3875 -
3876HB_Error HB_GSUB_Query_Scripts( HB_GSUBHeader* gsub, -
3877 HB_UInt** script_tag_list ) -
3878{ -
3879 HB_UShort n;
never executed (the execution status of this line is deduced): HB_UShort n;
-
3880 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
3881 HB_UInt* stl;
never executed (the execution status of this line is deduced): HB_UInt* stl;
-
3882 -
3883 HB_ScriptList* sl;
never executed (the execution status of this line is deduced): HB_ScriptList* sl;
-
3884 HB_ScriptRecord* sr;
never executed (the execution status of this line is deduced): HB_ScriptRecord* sr;
-
3885 -
3886 -
3887 if ( !gsub || !script_tag_list )
never evaluated: !gsub
never evaluated: !script_tag_list
0
3888 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3889 -
3890 sl = &gsub->ScriptList;
never executed (the execution status of this line is deduced): sl = &gsub->ScriptList;
-
3891 sr = sl->ScriptRecord;
never executed (the execution status of this line is deduced): sr = sl->ScriptRecord;
-
3892 -
3893 if ( ALLOC_ARRAY( stl, sl->ScriptCount + 1, HB_UInt ) )
never evaluated: ( (stl) = _hb_alloc( (sl->ScriptCount + 1)*sizeof(HB_UInt), &error ), error != 0 )
0
3894 return error;
never executed: return error;
0
3895 -
3896 for ( n = 0; n < sl->ScriptCount; n++ )
never evaluated: n < sl->ScriptCount
0
3897 stl[n] = sr[n].ScriptTag;
never executed: stl[n] = sr[n].ScriptTag;
0
3898 stl[n] = 0;
never executed (the execution status of this line is deduced): stl[n] = 0;
-
3899 -
3900 *script_tag_list = stl;
never executed (the execution status of this line is deduced): *script_tag_list = stl;
-
3901 -
3902 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3903} -
3904 -
3905 -
3906 -
3907HB_Error HB_GSUB_Query_Languages( HB_GSUBHeader* gsub, -
3908 HB_UShort script_index, -
3909 HB_UInt** language_tag_list ) -
3910{ -
3911 HB_UShort n;
never executed (the execution status of this line is deduced): HB_UShort n;
-
3912 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
3913 HB_UInt* ltl;
never executed (the execution status of this line is deduced): HB_UInt* ltl;
-
3914 -
3915 HB_ScriptList* sl;
never executed (the execution status of this line is deduced): HB_ScriptList* sl;
-
3916 HB_ScriptRecord* sr;
never executed (the execution status of this line is deduced): HB_ScriptRecord* sr;
-
3917 HB_ScriptTable* s;
never executed (the execution status of this line is deduced): HB_ScriptTable* s;
-
3918 HB_LangSysRecord* lsr;
never executed (the execution status of this line is deduced): HB_LangSysRecord* lsr;
-
3919 -
3920 -
3921 if ( !gsub || !language_tag_list )
never evaluated: !gsub
never evaluated: !language_tag_list
0
3922 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3923 -
3924 sl = &gsub->ScriptList;
never executed (the execution status of this line is deduced): sl = &gsub->ScriptList;
-
3925 sr = sl->ScriptRecord;
never executed (the execution status of this line is deduced): sr = sl->ScriptRecord;
-
3926 -
3927 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
3928 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3929 -
3930 s = &sr[script_index].Script;
never executed (the execution status of this line is deduced): s = &sr[script_index].Script;
-
3931 lsr = s->LangSysRecord;
never executed (the execution status of this line is deduced): lsr = s->LangSysRecord;
-
3932 -
3933 if ( ALLOC_ARRAY( ltl, s->LangSysCount + 1, HB_UInt ) )
never evaluated: ( (ltl) = _hb_alloc( (s->LangSysCount + 1)*sizeof(HB_UInt), &error ), error != 0 )
0
3934 return error;
never executed: return error;
0
3935 -
3936 for ( n = 0; n < s->LangSysCount; n++ )
never evaluated: n < s->LangSysCount
0
3937 ltl[n] = lsr[n].LangSysTag;
never executed: ltl[n] = lsr[n].LangSysTag;
0
3938 ltl[n] = 0;
never executed (the execution status of this line is deduced): ltl[n] = 0;
-
3939 -
3940 *language_tag_list = ltl;
never executed (the execution status of this line is deduced): *language_tag_list = ltl;
-
3941 -
3942 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
3943} -
3944 -
3945 -
3946/* selecting 0xFFFF for language_index asks for the values of the -
3947 default language (DefaultLangSys) */ -
3948 -
3949 -
3950HB_Error HB_GSUB_Query_Features( HB_GSUBHeader* gsub, -
3951 HB_UShort script_index, -
3952 HB_UShort language_index, -
3953 HB_UInt** feature_tag_list ) -
3954{ -
3955 HB_UShort n;
never executed (the execution status of this line is deduced): HB_UShort n;
-
3956 HB_Error error;
never executed (the execution status of this line is deduced): HB_Error error;
-
3957 HB_UInt* ftl;
never executed (the execution status of this line is deduced): HB_UInt* ftl;
-
3958 -
3959 HB_ScriptList* sl;
never executed (the execution status of this line is deduced): HB_ScriptList* sl;
-
3960 HB_ScriptRecord* sr;
never executed (the execution status of this line is deduced): HB_ScriptRecord* sr;
-
3961 HB_ScriptTable* s;
never executed (the execution status of this line is deduced): HB_ScriptTable* s;
-
3962 HB_LangSysRecord* lsr;
never executed (the execution status of this line is deduced): HB_LangSysRecord* lsr;
-
3963 HB_LangSys* ls;
never executed (the execution status of this line is deduced): HB_LangSys* ls;
-
3964 HB_UShort* fi;
never executed (the execution status of this line is deduced): HB_UShort* fi;
-
3965 -
3966 HB_FeatureList* fl;
never executed (the execution status of this line is deduced): HB_FeatureList* fl;
-
3967 HB_FeatureRecord* fr;
never executed (the execution status of this line is deduced): HB_FeatureRecord* fr;
-
3968 -
3969 -
3970 if ( !gsub || !feature_tag_list )
never evaluated: !gsub
never evaluated: !feature_tag_list
0
3971 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3972 -
3973 sl = &gsub->ScriptList;
never executed (the execution status of this line is deduced): sl = &gsub->ScriptList;
-
3974 sr = sl->ScriptRecord;
never executed (the execution status of this line is deduced): sr = sl->ScriptRecord;
-
3975 -
3976 fl = &gsub->FeatureList;
never executed (the execution status of this line is deduced): fl = &gsub->FeatureList;
-
3977 fr = fl->FeatureRecord;
never executed (the execution status of this line is deduced): fr = fl->FeatureRecord;
-
3978 -
3979 if ( script_index >= sl->ScriptCount )
never evaluated: script_index >= sl->ScriptCount
0
3980 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3981 -
3982 s = &sr[script_index].Script;
never executed (the execution status of this line is deduced): s = &sr[script_index].Script;
-
3983 lsr = s->LangSysRecord;
never executed (the execution status of this line is deduced): lsr = s->LangSysRecord;
-
3984 -
3985 if ( language_index == 0xFFFF )
never evaluated: language_index == 0xFFFF
0
3986 ls = &s->DefaultLangSys;
never executed: ls = &s->DefaultLangSys;
0
3987 else -
3988 { -
3989 if ( language_index >= s->LangSysCount )
never evaluated: language_index >= s->LangSysCount
0
3990 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
3991 -
3992 ls = &lsr[language_index].LangSys;
never executed (the execution status of this line is deduced): ls = &lsr[language_index].LangSys;
-
3993 }
never executed: }
0
3994 -
3995 fi = ls->FeatureIndex;
never executed (the execution status of this line is deduced): fi = ls->FeatureIndex;
-
3996 -
3997 if ( ALLOC_ARRAY( ftl, ls->FeatureCount + 1, HB_UInt ) )
never evaluated: ( (ftl) = _hb_alloc( (ls->FeatureCount + 1)*sizeof(HB_UInt), &error ), error != 0 )
0
3998 return error;
never executed: return error;
0
3999 -
4000 for ( n = 0; n < ls->FeatureCount; n++ )
never evaluated: n < ls->FeatureCount
0
4001 { -
4002 if ( fi[n] >= fl->FeatureCount )
never evaluated: fi[n] >= fl->FeatureCount
0
4003 { -
4004 FREE( ftl );
never executed: }
never executed: }
never evaluated: (ftl)
never evaluated: 0
0
4005 return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
4006 } -
4007 ftl[n] = fr[fi[n]].FeatureTag;
never executed (the execution status of this line is deduced): ftl[n] = fr[fi[n]].FeatureTag;
-
4008 }
never executed: }
0
4009 ftl[n] = 0;
never executed (the execution status of this line is deduced): ftl[n] = 0;
-
4010 -
4011 *feature_tag_list = ftl;
never executed (the execution status of this line is deduced): *feature_tag_list = ftl;
-
4012 -
4013 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4014} -
4015 -
4016 -
4017/* Do an individual subtable lookup. Returns HB_Err_Ok if substitution -
4018 has been done, or HB_Err_Not_Covered if not. */ -
4019static HB_Error GSUB_Do_Glyph_Lookup( HB_GSUBHeader* gsub, -
4020 HB_UShort lookup_index, -
4021 HB_Buffer buffer, -
4022 HB_UShort context_length, -
4023 int nesting_level ) -
4024{ -
4025 HB_Error error = HB_Err_Not_Covered;
executed (the execution status of this line is deduced): HB_Error error = HB_Err_Not_Covered;
-
4026 HB_UShort i, flags, lookup_count;
executed (the execution status of this line is deduced): HB_UShort i, flags, lookup_count;
-
4027 HB_Lookup* lo;
executed (the execution status of this line is deduced): HB_Lookup* lo;
-
4028 int lookup_type;
executed (the execution status of this line is deduced): int lookup_type;
-
4029 -
4030 nesting_level++;
executed (the execution status of this line is deduced): nesting_level++;
-
4031 -
4032 if ( nesting_level > HB_MAX_NESTING_LEVEL )
partially evaluated: nesting_level > 100
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9557590
0-9557590
4033 return ERR(HB_Err_Not_Covered); /* ERR() call intended */
never executed: return _hb_err (HB_Err_Not_Covered);
0
4034 -
4035 lookup_count = gsub->LookupList.LookupCount;
executed (the execution status of this line is deduced): lookup_count = gsub->LookupList.LookupCount;
-
4036 if (lookup_index >= lookup_count)
partially evaluated: lookup_index >= lookup_count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9557590
0-9557590
4037 return error;
never executed: return error;
0
4038 -
4039 lo = &gsub->LookupList.Lookup[lookup_index];
executed (the execution status of this line is deduced): lo = &gsub->LookupList.Lookup[lookup_index];
-
4040 flags = lo->LookupFlag;
executed (the execution status of this line is deduced): flags = lo->LookupFlag;
-
4041 lookup_type = lo->LookupType;
executed (the execution status of this line is deduced): lookup_type = lo->LookupType;
-
4042 -
4043 for ( i = 0; i < lo->SubTableCount; i++ )
evaluated: i < lo->SubTableCount
TRUEFALSE
yes
Evaluation Count:35789233
yes
Evaluation Count:9547481
9547481-35789233
4044 { -
4045 HB_GSUB_SubTable *st = &lo->SubTable[i].st.gsub;
executed (the execution status of this line is deduced): HB_GSUB_SubTable *st = &lo->SubTable[i].st.gsub;
-
4046 -
4047 switch (lookup_type) { -
4048 case HB_GSUB_LOOKUP_SINGLE: -
4049 error = Lookup_SingleSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:130
130
4050 case HB_GSUB_LOOKUP_MULTIPLE: -
4051 error = Lookup_MultipleSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:411685
411685
4052 case HB_GSUB_LOOKUP_ALTERNATE: -
4053 error = Lookup_AlternateSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
4054 case HB_GSUB_LOOKUP_LIGATURE: -
4055 error = Lookup_LigatureSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:3316494
3316494
4056 case HB_GSUB_LOOKUP_CONTEXT: -
4057 error = Lookup_ContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
4058 case HB_GSUB_LOOKUP_CHAIN: -
4059 error = Lookup_ChainContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
executed: break;
Execution Count:32060924
32060924
4060 /*case HB_GSUB_LOOKUP_EXTENSION: -
4061 error = Lookup_ExtensionSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;*/ -
4062 case HB_GSUB_LOOKUP_REVERSE_CHAIN: -
4063 error = Lookup_ReverseChainContextSubst ( gsub, st, buffer, flags, context_length, nesting_level ); break;
never executed: break;
0
4064 default: -
4065 error = HB_Err_Not_Covered;
never executed (the execution status of this line is deduced): error = HB_Err_Not_Covered;
-
4066 };
never executed: }
0
4067 -
4068 /* Check whether we have a successful substitution or an error other -
4069 than HB_Err_Not_Covered */ -
4070 if ( error != HB_Err_Not_Covered )
evaluated: error != HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:10109
yes
Evaluation Count:35779124
10109-35779124
4071 return error;
executed: return error;
Execution Count:10109
10109
4072 }
executed: }
Execution Count:35779124
35779124
4073 -
4074 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:9547481
9547481
4075} -
4076 -
4077 -
4078HB_INTERNAL HB_Error -
4079_HB_GSUB_Load_SubTable( HB_GSUB_SubTable* st, -
4080 HB_Stream stream, -
4081 HB_UShort lookup_type ) -
4082{ -
4083 switch (lookup_type) { -
4084 case HB_GSUB_LOOKUP_SINGLE: return Load_SingleSubst ( st, stream );
executed: return Load_SingleSubst ( st, stream );
Execution Count:2925
2925
4085 case HB_GSUB_LOOKUP_MULTIPLE: return Load_MultipleSubst ( st, stream );
executed: return Load_MultipleSubst ( st, stream );
Execution Count:8
8
4086 case HB_GSUB_LOOKUP_ALTERNATE: return Load_AlternateSubst ( st, stream );
executed: return Load_AlternateSubst ( st, stream );
Execution Count:123
123
4087 case HB_GSUB_LOOKUP_LIGATURE: return Load_LigatureSubst ( st, stream );
executed: return Load_LigatureSubst ( st, stream );
Execution Count:1632
1632
4088 case HB_GSUB_LOOKUP_CONTEXT: return Load_ContextSubst ( st, stream );
never executed: return Load_ContextSubst ( st, stream );
0
4089 case HB_GSUB_LOOKUP_CHAIN: return Load_ChainContextSubst ( st, stream );
executed: return Load_ChainContextSubst ( st, stream );
Execution Count:1475
1475
4090 /*case HB_GSUB_LOOKUP_EXTENSION: return Load_ExtensionSubst ( st, stream );*/ -
4091 case HB_GSUB_LOOKUP_REVERSE_CHAIN: return Load_ReverseChainContextSubst ( st, stream );
never executed: return Load_ReverseChainContextSubst ( st, stream );
0
4092 default: return ERR(HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
4093 }; -
4094}
never executed: }
0
4095 -
4096 -
4097HB_INTERNAL void -
4098_HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st, -
4099 HB_UShort lookup_type ) -
4100{ -
4101 switch ( lookup_type ) { -
4102 case HB_GSUB_LOOKUP_SINGLE: Free_SingleSubst ( st ); return;
executed: return;
Execution Count:2780
2780
4103 case HB_GSUB_LOOKUP_MULTIPLE: Free_MultipleSubst ( st ); return;
executed: return;
Execution Count:8
8
4104 case HB_GSUB_LOOKUP_ALTERNATE: Free_AlternateSubst ( st ); return;
executed: return;
Execution Count:117
117
4105 case HB_GSUB_LOOKUP_LIGATURE: Free_LigatureSubst ( st ); return;
executed: return;
Execution Count:1557
1557
4106 case HB_GSUB_LOOKUP_CONTEXT: Free_ContextSubst ( st ); return;
never executed: return;
0
4107 case HB_GSUB_LOOKUP_CHAIN: Free_ChainContextSubst ( st ); return;
executed: return;
Execution Count:1402
1402
4108 /*case HB_GSUB_LOOKUP_EXTENSION: Free_ExtensionSubst ( st ); return;*/ -
4109 case HB_GSUB_LOOKUP_REVERSE_CHAIN: Free_ReverseChainContextSubst ( st ); return;
never executed: return;
0
4110 default: return;
never executed: return;
0
4111 }; -
4112}
never executed: }
0
4113 -
4114 -
4115 -
4116/* apply one lookup to the input string object */ -
4117 -
4118static HB_Error GSUB_Do_String_Lookup( HB_GSUBHeader* gsub, -
4119 HB_UShort lookup_index, -
4120 HB_Buffer buffer ) -
4121{ -
4122 HB_Error error, retError = HB_Err_Not_Covered;
executed (the execution status of this line is deduced): HB_Error error, retError = HB_Err_Not_Covered;
-
4123 -
4124 HB_UInt* properties = gsub->LookupList.Properties;
executed (the execution status of this line is deduced): HB_UInt* properties = gsub->LookupList.Properties;
-
4125 int lookup_type = gsub->LookupList.Lookup[lookup_index].LookupType;
executed (the execution status of this line is deduced): int lookup_type = gsub->LookupList.Lookup[lookup_index].LookupType;
-
4126 -
4127 const int nesting_level = 0;
executed (the execution status of this line is deduced): const int nesting_level = 0;
-
4128 /* 0xFFFF indicates that we don't have a context length yet */ -
4129 const HB_UShort context_length = 0xFFFF;
executed (the execution status of this line is deduced): const HB_UShort context_length = 0xFFFF;
-
4130 -
4131 switch (lookup_type) { -
4132 -
4133 case HB_GSUB_LOOKUP_SINGLE: -
4134 case HB_GSUB_LOOKUP_MULTIPLE: -
4135 case HB_GSUB_LOOKUP_ALTERNATE: -
4136 case HB_GSUB_LOOKUP_LIGATURE: -
4137 case HB_GSUB_LOOKUP_CONTEXT: -
4138 case HB_GSUB_LOOKUP_CHAIN: -
4139 /* in/out forward substitution (implemented lazy) */ -
4140 -
4141 _hb_buffer_clear_output ( buffer );
executed (the execution status of this line is deduced): _hb_buffer_clear_output ( buffer );
-
4142 buffer->in_pos = 0;
executed (the execution status of this line is deduced): buffer->in_pos = 0;
-
4143 while ( buffer->in_pos < buffer->in_length )
evaluated: buffer->in_pos < buffer->in_length
TRUEFALSE
yes
Evaluation Count:9558033
yes
Evaluation Count:744297
744297-9558033
4144 { -
4145 if ( ~IN_PROPERTIES( buffer->in_pos ) & properties[lookup_index] )
evaluated: ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index]
TRUEFALSE
yes
Evaluation Count:9557590
yes
Evaluation Count:443
443-9557590
4146 { -
4147 error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level );
executed (the execution status of this line is deduced): error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level );
-
4148 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:9547481
yes
Evaluation Count:10109
10109-9547481
4149 { -
4150 if ( error != HB_Err_Not_Covered )
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9547481
0-9547481
4151 return error;
never executed: return error;
0
4152 }
executed: }
Execution Count:9547481
9547481
4153 else -
4154 retError = error;
executed: retError = error;
Execution Count:10109
10109
4155 } -
4156 else -
4157 error = HB_Err_Not_Covered;
executed: error = HB_Err_Not_Covered;
Execution Count:443
443
4158 -
4159 if ( error == HB_Err_Not_Covered )
evaluated: error == HB_Err_Not_Covered
TRUEFALSE
yes
Evaluation Count:9547924
yes
Evaluation Count:10109
10109-9547924
4160 if ( COPY_Glyph ( buffer ) )
partially evaluated: ( (error = _hb_buffer_copy_output_glyph ( buffer ) ) != HB_Err_Ok )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9547924
0-9547924
4161 return error;
never executed: return error;
0
4162 }
executed: }
Execution Count:9558033
9558033
4163 /* we shouldn't swap if error occurred. -
4164 * -
4165 * also don't swap if nothing changed (ie HB_Err_Not_Covered). -
4166 * shouldn't matter in that case though. -
4167 */ -
4168 if ( retError == HB_Err_Ok )
evaluated: retError == HB_Err_Ok
TRUEFALSE
yes
Evaluation Count:9970
yes
Evaluation Count:734327
9970-734327
4169 _hb_buffer_swap( buffer );
executed: _hb_buffer_swap( buffer );
Execution Count:9970
9970
4170 -
4171 return retError;
executed: return retError;
Execution Count:744297
744297
4172 -
4173 case HB_GSUB_LOOKUP_REVERSE_CHAIN: -
4174 /* in-place backward substitution */ -
4175 -
4176 buffer->in_pos = buffer->in_length - 1;
never executed (the execution status of this line is deduced): buffer->in_pos = buffer->in_length - 1;
-
4177 do -
4178 { -
4179 if ( ~IN_PROPERTIES( buffer->in_pos ) & properties[lookup_index] )
never evaluated: ~(buffer->in_string[(buffer->in_pos)].properties) & properties[lookup_index]
0
4180 { -
4181 error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level );
never executed (the execution status of this line is deduced): error = GSUB_Do_Glyph_Lookup( gsub, lookup_index, buffer, context_length, nesting_level );
-
4182 if ( error )
never evaluated: error
0
4183 { -
4184 if ( error != HB_Err_Not_Covered )
never evaluated: error != HB_Err_Not_Covered
0
4185 return error;
never executed: return error;
0
4186 }
never executed: }
0
4187 else -
4188 retError = error;
never executed: retError = error;
0
4189 } -
4190 else -
4191 error = HB_Err_Not_Covered;
never executed: error = HB_Err_Not_Covered;
0
4192 -
4193 if ( error == HB_Err_Not_Covered )
never evaluated: error == HB_Err_Not_Covered
0
4194 buffer->in_pos--;
never executed: buffer->in_pos--;
0
4195 }
never executed: }
0
4196 while ((HB_Int) buffer->in_pos >= 0);
never evaluated: (HB_Int) buffer->in_pos >= 0
0
4197 -
4198 return retError;
never executed: return retError;
0
4199 -
4200 /*case HB_GSUB_LOOKUP_EXTENSION:*/ -
4201 default: -
4202 return retError;
never executed: return retError;
0
4203 }; -
4204}
never executed: }
0
4205 -
4206 -
4207HB_Error HB_GSUB_Add_Feature( HB_GSUBHeader* gsub, -
4208 HB_UShort feature_index, -
4209 HB_UInt property ) -
4210{ -
4211 HB_UShort i;
executed (the execution status of this line is deduced): HB_UShort i;
-
4212 -
4213 HB_Feature feature;
executed (the execution status of this line is deduced): HB_Feature feature;
-
4214 HB_UInt* properties;
executed (the execution status of this line is deduced): HB_UInt* properties;
-
4215 HB_UShort* index;
executed (the execution status of this line is deduced): HB_UShort* index;
-
4216 HB_UShort lookup_count;
executed (the execution status of this line is deduced): HB_UShort lookup_count;
-
4217 -
4218 /* Each feature can only be added once */ -
4219 -
4220 if ( !gsub ||
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:759
0-759
4221 feature_index >= gsub->FeatureList.FeatureCount ||
partially evaluated: feature_index >= gsub->FeatureList.FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:759
0-759
4222 gsub->FeatureList.ApplyCount == gsub->FeatureList.FeatureCount )
partially evaluated: gsub->FeatureList.ApplyCount == gsub->FeatureList.FeatureCount
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:759
0-759
4223 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4224 -
4225 gsub->FeatureList.ApplyOrder[gsub->FeatureList.ApplyCount++] = feature_index;
executed (the execution status of this line is deduced): gsub->FeatureList.ApplyOrder[gsub->FeatureList.ApplyCount++] = feature_index;
-
4226 -
4227 properties = gsub->LookupList.Properties;
executed (the execution status of this line is deduced): properties = gsub->LookupList.Properties;
-
4228 -
4229 feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
executed (the execution status of this line is deduced): feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
-
4230 index = feature.LookupListIndex;
executed (the execution status of this line is deduced): index = feature.LookupListIndex;
-
4231 lookup_count = gsub->LookupList.LookupCount;
executed (the execution status of this line is deduced): lookup_count = gsub->LookupList.LookupCount;
-
4232 -
4233 for ( i = 0; i < feature.LookupListCount; i++ )
evaluated: i < feature.LookupListCount
TRUEFALSE
yes
Evaluation Count:1306
yes
Evaluation Count:759
759-1306
4234 { -
4235 HB_UShort lookup_index = index[i];
executed (the execution status of this line is deduced): HB_UShort lookup_index = index[i];
-
4236 if (lookup_index < lookup_count)
partially evaluated: lookup_index < lookup_count
TRUEFALSE
yes
Evaluation Count:1306
no
Evaluation Count:0
0-1306
4237 properties[lookup_index] |= property;
executed: properties[lookup_index] |= property;
Execution Count:1306
1306
4238 }
executed: }
Execution Count:1306
1306
4239 -
4240 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:759
759
4241} -
4242 -
4243 -
4244 -
4245HB_Error HB_GSUB_Clear_Features( HB_GSUBHeader* gsub ) -
4246{ -
4247 HB_UShort i;
executed (the execution status of this line is deduced): HB_UShort i;
-
4248 -
4249 HB_UInt* properties;
executed (the execution status of this line is deduced): HB_UInt* properties;
-
4250 -
4251 -
4252 if ( !gsub )
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:460
0-460
4253 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4254 -
4255 gsub->FeatureList.ApplyCount = 0;
executed (the execution status of this line is deduced): gsub->FeatureList.ApplyCount = 0;
-
4256 -
4257 properties = gsub->LookupList.Properties;
executed (the execution status of this line is deduced): properties = gsub->LookupList.Properties;
-
4258 -
4259 for ( i = 0; i < gsub->LookupList.LookupCount; i++ )
evaluated: i < gsub->LookupList.LookupCount
TRUEFALSE
yes
Evaluation Count:17584
yes
Evaluation Count:460
460-17584
4260 properties[i] = 0;
executed: properties[i] = 0;
Execution Count:17584
17584
4261 -
4262 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:460
460
4263} -
4264 -
4265 -
4266 -
4267HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub, -
4268 HB_AltFunction altfunc, -
4269 void* data ) -
4270{ -
4271 if ( !gsub )
never evaluated: !gsub
0
4272 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4273 -
4274 gsub->altfunc = altfunc;
never executed (the execution status of this line is deduced): gsub->altfunc = altfunc;
-
4275 gsub->data = data;
never executed (the execution status of this line is deduced): gsub->data = data;
-
4276 -
4277 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
4278} -
4279 -
4280/* returns error if one happened, otherwise returns HB_Err_Not_Covered if no -
4281 * feature were applied, or HB_Err_Ok otherwise. -
4282 */ -
4283HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub, -
4284 HB_Buffer buffer ) -
4285{ -
4286 HB_Error error, retError = HB_Err_Not_Covered;
executed (the execution status of this line is deduced): HB_Error error, retError = HB_Err_Not_Covered;
-
4287 int i, j, lookup_count, num_features;
executed (the execution status of this line is deduced): int i, j, lookup_count, num_features;
-
4288 -
4289 if ( !gsub ||
partially evaluated: !gsub
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
4290 !buffer)
partially evaluated: !buffer
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
4291 return ERR(HB_Err_Invalid_Argument);
never executed: return _hb_err (HB_Err_Invalid_Argument);
0
4292 -
4293 if ( buffer->in_length == 0 )
partially evaluated: buffer->in_length == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:248113
0-248113
4294 return retError;
never executed: return retError;
0
4295 -
4296 lookup_count = gsub->LookupList.LookupCount;
executed (the execution status of this line is deduced): lookup_count = gsub->LookupList.LookupCount;
-
4297 num_features = gsub->FeatureList.ApplyCount;
executed (the execution status of this line is deduced): num_features = gsub->FeatureList.ApplyCount;
-
4298 -
4299 for ( i = 0; i < num_features; i++)
evaluated: i < num_features
TRUEFALSE
yes
Evaluation Count:496205
yes
Evaluation Count:248113
248113-496205
4300 { -
4301 HB_UShort feature_index = gsub->FeatureList.ApplyOrder[i];
executed (the execution status of this line is deduced): HB_UShort feature_index = gsub->FeatureList.ApplyOrder[i];
-
4302 HB_Feature feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
executed (the execution status of this line is deduced): HB_Feature feature = gsub->FeatureList.FeatureRecord[feature_index].Feature;
-
4303 -
4304 for ( j = 0; j < feature.LookupListCount; j++ )
evaluated: j < feature.LookupListCount
TRUEFALSE
yes
Evaluation Count:744297
yes
Evaluation Count:496205
496205-744297
4305 { -
4306 HB_UShort lookup_index = feature.LookupListIndex[j];
executed (the execution status of this line is deduced): HB_UShort lookup_index = feature.LookupListIndex[j];
-
4307 -
4308 /* Skip nonexistant lookups */ -
4309 if (lookup_index >= lookup_count)
partially evaluated: lookup_index >= lookup_count
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:744297
0-744297
4310 continue;
never executed: continue;
0
4311 -
4312 error = GSUB_Do_String_Lookup( gsub, lookup_index, buffer );
executed (the execution status of this line is deduced): error = GSUB_Do_String_Lookup( gsub, lookup_index, buffer );
-
4313 if ( error )
evaluated: error
TRUEFALSE
yes
Evaluation Count:734327
yes
Evaluation Count:9970
9970-734327
4314 { -
4315 if ( error != HB_Err_Not_Covered )
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:734327
0-734327
4316 return error;
never executed: return error;
0
4317 }
executed: }
Execution Count:734327
734327
4318 else -
4319 retError = error;
executed: retError = error;
Execution Count:9970
9970
4320 } -
4321 }
executed: }
Execution Count:496205
496205
4322 -
4323 error = retError;
executed (the execution status of this line is deduced): error = retError;
-
4324 -
4325 return error;
executed: return error;
Execution Count:248113
248113
4326} -
4327 -
4328 -
4329/* END */ -
4330 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial