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

Switch to Source codePreprocessed file
LineSource CodeCoverage
1static HB_Error Load_LangSys( HB_LangSys* ls, -
2 HB_Stream stream ) -
3{ -
4 HB_Error error; -
5 HB_UShort n, count; -
6 HB_UShort* fi; -
7 -
8 -
9 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8484
0-8484
10 return error;
never executed: return error;
0
11 -
12 ls->LookupOrderOffset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
13 ls->ReqFeatureIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
14 count = ls->FeatureCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
15 -
16 _hb_stream_frame_exit( stream ); -
17 -
18 ls->FeatureIndex = ((void *)0); -
19 -
20 if ( ( (ls->FeatureIndex) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (ls->FeatureIndex) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8484
0-8484
21 return error;
never executed: return error;
0
22 -
23 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8484
0-8484
24 { -
25 do { if ( (ls->FeatureIndex) ) { _hb_free( ls->FeatureIndex ); ls->FeatureIndex = ((void *)0); } } while (0);
never executed: }
never evaluated: (ls->FeatureIndex)
never executed: }
never evaluated: 0
0
26 return error;
never executed: return error;
0
27 } -
28 -
29 fi = ls->FeatureIndex; -
30 -
31 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:24054
yes
Evaluation Count:8484
8484-24054
32 fi[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: fi[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:24054
24054
33 -
34 _hb_stream_frame_exit( stream ); -
35 -
36 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:8484
8484
37} -
38 -
39 -
40static void Free_LangSys( HB_LangSys* ls ) -
41{ -
42 do { if ( (ls->FeatureIndex) ) { _hb_free( ls->FeatureIndex ); ls->FeatureIndex = ((void *)0); } } while (0);
evaluated: (ls->FeatureIndex)
TRUEFALSE
yes
Evaluation Count:7959
yes
Evaluation Count:103
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8062
executed: }
Execution Count:7959
executed: }
Execution Count:8062
0-8062
43}
executed: }
Execution Count:8062
8062
44 -
45 -
46 -
47 -
48static HB_Error Load_Script( HB_ScriptTable* s, -
49 HB_Stream stream ) -
50{ -
51 HB_Error error; -
52 HB_UShort n, m, count; -
53 HB_UInt cur_offset, new_offset, base_offset; -
54 -
55 HB_LangSysRecord* lsr; -
56 -
57 -
58 base_offset = _hb_stream_pos( stream ); -
59 -
60 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5125
0-5125
61 return error;
never executed: return error;
0
62 -
63 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
64 -
65 _hb_stream_frame_exit( stream ); -
66 -
67 if ( new_offset != base_offset )
evaluated: new_offset != base_offset
TRUEFALSE
yes
Evaluation Count:5124
yes
Evaluation Count:1
1-5124
68 { -
69 cur_offset = _hb_stream_pos( stream ); -
70 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5124
0-5124
71 ( error = Load_LangSys( &s->DefaultLangSys, 0-5124
72 stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LangSys( &s->DefaultLangSys, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5124
0-5124
73 return error;
never executed: return error;
0
74 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
75 }
executed: }
Execution Count:5124
5124
76 else -
77 { -
78 -
79 -
80 s->DefaultLangSys.LookupOrderOffset = 0; -
81 s->DefaultLangSys.ReqFeatureIndex = 0xFFFF; -
82 s->DefaultLangSys.FeatureCount = 0; -
83 s->DefaultLangSys.FeatureIndex = ((void *)0); -
84 }
executed: }
Execution Count:1
1
85 -
86 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5125
0-5125
87 goto Fail2;
never executed: goto Fail2;
0
88 -
89 count = s->LangSysCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
90 -
91 -
92 -
93 -
94 if ( s->LangSysCount == 0 && s->DefaultLangSys.FeatureCount == 0 )
evaluated: s->LangSysCount == 0
TRUEFALSE
yes
Evaluation Count:4357
yes
Evaluation Count:768
evaluated: s->DefaultLangSys.FeatureCount == 0
TRUEFALSE
yes
Evaluation Count:102
yes
Evaluation Count:4255
102-4357
95 { -
96 error = HB_Err_Not_Covered; -
97 goto Fail2;
executed: goto Fail2;
Execution Count:102
102
98 } -
99 -
100 _hb_stream_frame_exit( stream ); -
101 -
102 s->LangSysRecord = ((void *)0); -
103 -
104 if ( ( (s->LangSysRecord) = _hb_alloc( (count)*sizeof(HB_LangSysRecord), &error ), error != 0 ) )
partially evaluated: ( (s->LangSysRecord) = _hb_alloc( (count)*sizeof(HB_LangSysRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5023
0-5023
105 goto Fail2;
never executed: goto Fail2;
0
106 -
107 lsr = s->LangSysRecord; -
108 -
109 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:3360
yes
Evaluation Count:5023
3360-5023
110 { -
111 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3360
0-3360
112 goto Fail1;
never executed: goto Fail1;
0
113 -
114 lsr[n].LangSysTag = ((HB_UInt)(stream->cursor += 4, (HB_Int)( (*(((HB_Byte*)stream->cursor)-4) << 24) | (*(((HB_Byte*)stream->cursor)-3) << 16) | (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
115 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
116 -
117 _hb_stream_frame_exit( stream ); -
118 -
119 cur_offset = _hb_stream_pos( stream ); -
120 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3360
0-3360
121 ( error = Load_LangSys( &lsr[n].LangSys, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_LangSys( &lsr[n].LangSys, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3360
0-3360
122 goto Fail1;
never executed: goto Fail1;
0
123 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
124 }
executed: }
Execution Count:3360
3360
125 -
126 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:5023
5023
127 -
128Fail1: -
129 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
130 Free_LangSys( &lsr[m].LangSys );
never executed: Free_LangSys( &lsr[m].LangSys );
0
131 -
132 do { if ( (s->LangSysRecord) ) { _hb_free( s->LangSysRecord ); s->LangSysRecord = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (s->LangSysRecord)
never evaluated: 0
0
133 -
134Fail2:
code before this statement never executed: Fail2:
0
135 Free_LangSys( &s->DefaultLangSys ); -
136 return error;
executed: return error;
Execution Count:102
102
137} -
138 -
139 -
140static void Free_Script( HB_ScriptTable* s ) -
141{ -
142 HB_UShort n, count; -
143 -
144 HB_LangSysRecord* lsr; -
145 -
146 -
147 Free_LangSys( &s->DefaultLangSys ); -
148 -
149 if ( s->LangSysRecord )
evaluated: s->LangSysRecord
TRUEFALSE
yes
Evaluation Count:728
yes
Evaluation Count:4046
728-4046
150 { -
151 count = s->LangSysCount; -
152 lsr = s->LangSysRecord; -
153 -
154 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:3186
yes
Evaluation Count:728
728-3186
155 Free_LangSys( &lsr[n].LangSys );
executed: Free_LangSys( &lsr[n].LangSys );
Execution Count:3186
3186
156 -
157 do { if ( (lsr) ) { _hb_free( lsr ); lsr = ((void *)0); } } while (0);
executed: }
Execution Count:728
executed: }
Execution Count:728
partially evaluated: (lsr)
TRUEFALSE
yes
Evaluation Count:728
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:728
0-728
158 }
executed: }
Execution Count:728
728
159}
executed: }
Execution Count:4774
4774
160 -
161 -
162 -
163 -
164 HB_Error -
165_HB_OPEN_Load_ScriptList( HB_ScriptList* sl, -
166 HB_Stream stream ) -
167{ -
168 HB_Error error; -
169 -
170 HB_UShort n, script_count; -
171 HB_UInt cur_offset, new_offset, base_offset; -
172 -
173 HB_ScriptRecord* sr; -
174 -
175 -
176 base_offset = _hb_stream_pos( stream ); -
177 -
178 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
179 return error;
never executed: return error;
0
180 -
181 script_count = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
182 -
183 _hb_stream_frame_exit( stream ); -
184 -
185 sl->ScriptRecord = ((void *)0); -
186 -
187 if ( ( (sl->ScriptRecord) = _hb_alloc( (script_count)*sizeof(HB_ScriptRecord), &error ), error != 0 ) )
partially evaluated: ( (sl->ScriptRecord) = _hb_alloc( (script_count)*sizeof(HB_ScriptRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
188 return error;
never executed: return error;
0
189 -
190 sr = sl->ScriptRecord; -
191 -
192 sl->ScriptCount= 0; -
193 for ( n = 0; n < script_count; n++ )
evaluated: n < script_count
TRUEFALSE
yes
Evaluation Count:5125
yes
Evaluation Count:278
278-5125
194 { -
195 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5125
0-5125
196 goto Fail;
never executed: goto Fail;
0
197 -
198 sr[sl->ScriptCount].ScriptTag = ((HB_UInt)(stream->cursor += 4, (HB_Int)( (*(((HB_Byte*)stream->cursor)-4) << 24) | (*(((HB_Byte*)stream->cursor)-3) << 16) | (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
199 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
200 -
201 _hb_stream_frame_exit( stream ); -
202 -
203 cur_offset = _hb_stream_pos( stream ); -
204 -
205 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5125
0-5125
206 goto Fail;
never executed: goto Fail;
0
207 -
208 error = Load_Script( &sr[sl->ScriptCount].Script, stream ); -
209 if ( error == HB_Err_Ok )
evaluated: error == HB_Err_Ok
TRUEFALSE
yes
Evaluation Count:5023
yes
Evaluation Count:102
102-5023
210 sl->ScriptCount += 1;
executed: sl->ScriptCount += 1;
Execution Count:5023
5023
211 else if ( error != HB_Err_Not_Covered )
partially evaluated: error != HB_Err_Not_Covered
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:102
0-102
212 goto Fail;
never executed: goto Fail;
0
213 -
214 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
215 }
executed: }
Execution Count:5125
5125
216 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:278
278
217 -
218Fail: -
219 for ( n = 0; n < sl->ScriptCount; n++ )
never evaluated: n < sl->ScriptCount
0
220 Free_Script( &sr[n].Script );
never executed: Free_Script( &sr[n].Script );
0
221 -
222 do { if ( (sl->ScriptRecord) ) { _hb_free( sl->ScriptRecord ); sl->ScriptRecord = ((void *)0); } } while (0);
never evaluated: (sl->ScriptRecord)
never evaluated: 0
never executed: }
never executed: }
0
223 return error;
never executed: return error;
0
224} -
225 -
226 -
227 void -
228_HB_OPEN_Free_ScriptList( HB_ScriptList* sl ) -
229{ -
230 HB_UShort n, count; -
231 -
232 HB_ScriptRecord* sr; -
233 -
234 -
235 if ( sl->ScriptRecord )
partially evaluated: sl->ScriptRecord
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
0-264
236 { -
237 count = sl->ScriptCount; -
238 sr = sl->ScriptRecord; -
239 -
240 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:4774
yes
Evaluation Count:264
264-4774
241 Free_Script( &sr[n].Script );
executed: Free_Script( &sr[n].Script );
Execution Count:4774
4774
242 -
243 do { if ( (sr) ) { _hb_free( sr ); sr = ((void *)0); } } while (0);
partially evaluated: (sr)
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:264
executed: }
Execution Count:264
executed: }
Execution Count:264
0-264
244 }
executed: }
Execution Count:264
264
245}
executed: }
Execution Count:264
264
246static HB_Error Load_Feature( HB_Feature* f, -
247 HB_Stream stream ) -
248{ -
249 HB_Error error; -
250 -
251 HB_UShort n, count; -
252 -
253 HB_UShort* lli; -
254 -
255 -
256 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4870
0-4870
257 return error;
never executed: return error;
0
258 -
259 f->FeatureParams = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
260 count = f->LookupListCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
261 -
262 _hb_stream_frame_exit( stream ); -
263 -
264 f->LookupListIndex = ((void *)0); -
265 -
266 if ( ( (f->LookupListIndex) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (f->LookupListIndex) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4870
0-4870
267 return error;
never executed: return error;
0
268 -
269 lli = f->LookupListIndex; -
270 -
271 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4870
0-4870
272 { -
273 do { if ( (f->LookupListIndex) ) { _hb_free( f->LookupListIndex ); f->LookupListIndex = ((void *)0); } } while (0);
never evaluated: (f->LookupListIndex)
never evaluated: 0
never executed: }
never executed: }
0
274 return error;
never executed: return error;
0
275 } -
276 -
277 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:6946
yes
Evaluation Count:4870
4870-6946
278 lli[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: lli[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:6946
6946
279 -
280 _hb_stream_frame_exit( stream ); -
281 -
282 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:4870
4870
283} -
284 -
285 -
286static void Free_Feature( HB_Feature* f ) -
287{ -
288 do { if ( (f->LookupListIndex) ) { _hb_free( f->LookupListIndex ); f->LookupListIndex = ((void *)0); } } while (0);
partially evaluated: (f->LookupListIndex)
TRUEFALSE
yes
Evaluation Count:4633
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4633
executed: }
Execution Count:4633
executed: }
Execution Count:4633
0-4633
289}
executed: }
Execution Count:4633
4633
290 -
291 -
292 -
293 -
294 HB_Error -
295_HB_OPEN_Load_FeatureList( HB_FeatureList* fl, -
296 HB_Stream stream ) -
297{ -
298 HB_Error error; -
299 -
300 HB_UShort n, m, count; -
301 HB_UInt cur_offset, new_offset, base_offset; -
302 -
303 HB_FeatureRecord* fr; -
304 -
305 -
306 base_offset = _hb_stream_pos( stream ); -
307 -
308 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
309 return error;
never executed: return error;
0
310 -
311 count = fl->FeatureCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
312 -
313 _hb_stream_frame_exit( stream ); -
314 -
315 fl->FeatureRecord = ((void *)0); -
316 -
317 if ( ( (fl->FeatureRecord) = _hb_alloc( (count)*sizeof(HB_FeatureRecord), &error ), error != 0 ) )
partially evaluated: ( (fl->FeatureRecord) = _hb_alloc( (count)*sizeof(HB_FeatureRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
318 return error;
never executed: return error;
0
319 if ( ( (fl->ApplyOrder) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (fl->ApplyOrder) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
320 goto Fail2;
never executed: goto Fail2;
0
321 -
322 fl->ApplyCount = 0; -
323 -
324 fr = fl->FeatureRecord; -
325 -
326 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:4870
yes
Evaluation Count:278
278-4870
327 { -
328 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4870
0-4870
329 goto Fail1;
never executed: goto Fail1;
0
330 -
331 fr[n].FeatureTag = ((HB_UInt)(stream->cursor += 4, (HB_Int)( (*(((HB_Byte*)stream->cursor)-4) << 24) | (*(((HB_Byte*)stream->cursor)-3) << 16) | (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
332 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
333 -
334 _hb_stream_frame_exit( stream ); -
335 -
336 cur_offset = _hb_stream_pos( stream ); -
337 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4870
0-4870
338 ( error = Load_Feature( &fr[n].Feature, stream ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Feature( &fr[n].Feature, stream ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4870
0-4870
339 goto Fail1;
never executed: goto Fail1;
0
340 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
341 }
executed: }
Execution Count:4870
4870
342 -
343 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:278
278
344 -
345Fail1: -
346 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
347 Free_Feature( &fr[m].Feature );
never executed: Free_Feature( &fr[m].Feature );
0
348 -
349 do { if ( (fl->ApplyOrder) ) { _hb_free( fl->ApplyOrder ); fl->ApplyOrder = ((void *)0); } } while (0);
never evaluated: (fl->ApplyOrder)
never evaluated: 0
never executed: }
never executed: }
0
350 -
351Fail2:
code before this statement never executed: Fail2:
0
352 do { if ( (fl->FeatureRecord) ) { _hb_free( fl->FeatureRecord ); fl->FeatureRecord = ((void *)0); } } while (0);
never evaluated: (fl->FeatureRecord)
never evaluated: 0
never executed: }
never executed: }
0
353 -
354 return error;
never executed: return error;
0
355} -
356 -
357 -
358 void -
359_HB_OPEN_Free_FeatureList( HB_FeatureList* fl ) -
360{ -
361 HB_UShort n, count; -
362 -
363 HB_FeatureRecord* fr; -
364 -
365 -
366 if ( fl->FeatureRecord )
partially evaluated: fl->FeatureRecord
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
0-264
367 { -
368 count = fl->FeatureCount; -
369 fr = fl->FeatureRecord; -
370 -
371 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:4633
yes
Evaluation Count:264
264-4633
372 Free_Feature( &fr[n].Feature );
executed: Free_Feature( &fr[n].Feature );
Execution Count:4633
4633
373 -
374 do { if ( (fr) ) { _hb_free( fr ); fr = ((void *)0); } } while (0);
partially evaluated: (fr)
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:264
executed: }
Execution Count:264
executed: }
Execution Count:264
0-264
375 }
executed: }
Execution Count:264
264
376 -
377 do { if ( (fl->ApplyOrder) ) { _hb_free( fl->ApplyOrder ); fl->ApplyOrder = ((void *)0); } } while (0);
partially evaluated: (fl->ApplyOrder)
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:264
executed: }
Execution Count:264
executed: }
Execution Count:264
0-264
378}
executed: }
Execution Count:264
264
379static HB_Error Load_SubTable( HB_SubTable* st, -
380 HB_Stream stream, -
381 HB_Type table_type, -
382 HB_UShort lookup_type ) -
383{ -
384 if ( table_type == HB_Type_GSUB )
evaluated: table_type == HB_Type_GSUB
TRUEFALSE
yes
Evaluation Count:6163
yes
Evaluation Count:2684
2684-6163
385 return _HB_GSUB_Load_SubTable ( &st->st.gsub, stream, lookup_type );
executed: return _HB_GSUB_Load_SubTable ( &st->st.gsub, stream, lookup_type );
Execution Count:6163
6163
386 else -
387 return _HB_GPOS_Load_SubTable ( &st->st.gpos, stream, lookup_type );
executed: return _HB_GPOS_Load_SubTable ( &st->st.gpos, stream, lookup_type );
Execution Count:2684
2684
388} -
389 -
390 -
391static void Free_SubTable( HB_SubTable* st, -
392 HB_Type table_type, -
393 HB_UShort lookup_type ) -
394{ -
395 if ( table_type == HB_Type_GSUB )
evaluated: table_type == HB_Type_GSUB
TRUEFALSE
yes
Evaluation Count:5864
yes
Evaluation Count:2547
2547-5864
396 _HB_GSUB_Free_SubTable ( &st->st.gsub, lookup_type );
executed: _HB_GSUB_Free_SubTable ( &st->st.gsub, lookup_type );
Execution Count:5864
5864
397 else -
398 _HB_GPOS_Free_SubTable ( &st->st.gpos, lookup_type );
executed: _HB_GPOS_Free_SubTable ( &st->st.gpos, lookup_type );
Execution Count:2547
2547
399} -
400 -
401 -
402 -
403 -
404static HB_Error Load_Lookup( HB_Lookup* l, -
405 HB_Stream stream, -
406 HB_Type type ) -
407{ -
408 HB_Error error; -
409 -
410 HB_UShort n, m, count; -
411 HB_UInt cur_offset, new_offset, base_offset; -
412 -
413 HB_SubTable* st; -
414 -
415 HB_Bool is_extension = 0; -
416 -
417 -
418 base_offset = _hb_stream_pos( stream ); -
419 -
420 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7105
0-7105
421 return error;
never executed: return error;
0
422 -
423 l->LookupType = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
424 l->LookupFlag = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
425 count = l->SubTableCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
426 -
427 _hb_stream_frame_exit( stream ); -
428 -
429 l->SubTable = ((void *)0); -
430 -
431 if ( ( (l->SubTable) = _hb_alloc( (count)*sizeof(HB_SubTable), &error ), error != 0 ) )
partially evaluated: ( (l->SubTable) = _hb_alloc( (count)*sizeof(HB_SubTable), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7105
0-7105
432 return error;
never executed: return error;
0
433 -
434 st = l->SubTable; -
435 -
436 if ( ( type == HB_Type_GSUB && l->LookupType == 7 ) ||
evaluated: type == HB_Type_GSUB
TRUEFALSE
yes
Evaluation Count:5065
yes
Evaluation Count:2040
partially evaluated: l->LookupType == 7
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5065
0-5065
437 ( type == HB_Type_GPOS && l->LookupType == 9 ) )
evaluated: type == HB_Type_GPOS
TRUEFALSE
yes
Evaluation Count:2040
yes
Evaluation Count:5065
partially evaluated: l->LookupType == 9
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2040
0-5065
438 is_extension = (!0);
never executed: is_extension = (!0);
0
439 -
440 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:8847
yes
Evaluation Count:7105
7105-8847
441 { -
442 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8847
0-8847
443 goto Fail;
never executed: goto Fail;
0
444 -
445 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
446 -
447 _hb_stream_frame_exit( stream ); -
448 -
449 cur_offset = _hb_stream_pos( stream ); -
450 -
451 if ( is_extension )
partially evaluated: is_extension
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8847
0-8847
452 { -
453 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) || ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 ) )
never evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
never evaluated: ( (error = (_hb_stream_frame_enter( stream, 8L ))) != 0 )
0
454 goto Fail;
never executed: goto Fail;
0
455 -
456 if (((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) != 1)
never evaluated: ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) != 1
0
457 goto Fail;
never executed: goto Fail;
0
458 -
459 l->LookupType = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
460 new_offset += ((HB_UInt)(stream->cursor += 4, (HB_Int)( (*(((HB_Byte*)stream->cursor)-4) << 24) | (*(((HB_Byte*)stream->cursor)-3) << 16) | (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
461 -
462 _hb_stream_frame_exit( stream ); -
463 }
never executed: }
0
464 -
465 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8847
0-8847
466 ( error = Load_SubTable( &st[n], stream, 0-8847
467 type, l->LookupType ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_SubTable( &st[n], stream, type, l->LookupType ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8847
0-8847
468 goto Fail;
never executed: goto Fail;
0
469 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
470 }
executed: }
Execution Count:8847
8847
471 -
472 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:7105
7105
473 -
474Fail: -
475 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
476 Free_SubTable( &st[m], type, l->LookupType );
never executed: Free_SubTable( &st[m], type, l->LookupType );
0
477 -
478 do { if ( (l->SubTable) ) { _hb_free( l->SubTable ); l->SubTable = ((void *)0); } } while (0);
never evaluated: (l->SubTable)
never evaluated: 0
never executed: }
never executed: }
0
479 return error;
never executed: return error;
0
480} -
481 -
482 -
483static void Free_Lookup( HB_Lookup* l, -
484 HB_Type type) -
485{ -
486 HB_UShort n, count; -
487 -
488 HB_SubTable* st; -
489 -
490 -
491 if ( l->SubTable )
partially evaluated: l->SubTable
TRUEFALSE
yes
Evaluation Count:6754
no
Evaluation Count:0
0-6754
492 { -
493 count = l->SubTableCount; -
494 st = l->SubTable; -
495 -
496 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:8411
yes
Evaluation Count:6754
6754-8411
497 Free_SubTable( &st[n], type, l->LookupType );
executed: Free_SubTable( &st[n], type, l->LookupType );
Execution Count:8411
8411
498 -
499 do { if ( (st) ) { _hb_free( st ); st = ((void *)0); } } while (0);
partially evaluated: (st)
TRUEFALSE
yes
Evaluation Count:6754
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6754
executed: }
Execution Count:6754
executed: }
Execution Count:6754
0-6754
500 }
executed: }
Execution Count:6754
6754
501}
executed: }
Execution Count:6754
6754
502 -
503 -
504 -
505 -
506 HB_Error -
507_HB_OPEN_Load_LookupList( HB_LookupList* ll, -
508 HB_Stream stream, -
509 HB_Type type ) -
510{ -
511 HB_Error error; -
512 -
513 HB_UShort n, m, count; -
514 HB_UInt cur_offset, new_offset, base_offset; -
515 -
516 HB_Lookup* l; -
517 -
518 -
519 base_offset = _hb_stream_pos( stream ); -
520 -
521 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
522 return error;
never executed: return error;
0
523 -
524 count = ll->LookupCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
525 -
526 _hb_stream_frame_exit( stream ); -
527 -
528 ll->Lookup = ((void *)0); -
529 -
530 if ( ( (ll->Lookup) = _hb_alloc( (count)*sizeof(HB_Lookup), &error ), error != 0 ) )
partially evaluated: ( (ll->Lookup) = _hb_alloc( (count)*sizeof(HB_Lookup), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
531 return error;
never executed: return error;
0
532 if ( ( (ll->Properties) = _hb_alloc( (count)*sizeof(HB_UInt), &error ), error != 0 ) )
partially evaluated: ( (ll->Properties) = _hb_alloc( (count)*sizeof(HB_UInt), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:278
0-278
533 goto Fail2;
never executed: goto Fail2;
0
534 -
535 l = ll->Lookup; -
536 -
537 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:7105
yes
Evaluation Count:278
278-7105
538 { -
539 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7105
0-7105
540 goto Fail1;
never executed: goto Fail1;
0
541 -
542 new_offset = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))) + base_offset; -
543 -
544 _hb_stream_frame_exit( stream ); -
545 -
546 cur_offset = _hb_stream_pos( stream ); -
547 if ( ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 ) ||
partially evaluated: ( (error = (_hb_stream_seek( stream, new_offset ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7105
0-7105
548 ( error = Load_Lookup( &l[n], stream, type ) ) != HB_Err_Ok )
partially evaluated: ( error = Load_Lookup( &l[n], stream, type ) ) != HB_Err_Ok
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7105
0-7105
549 goto Fail1;
never executed: goto Fail1;
0
550 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 ); -
551 }
executed: }
Execution Count:7105
7105
552 -
553 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:278
278
554 -
555Fail1: -
556 do { if ( (ll->Properties) ) { _hb_free( ll->Properties ); ll->Properties = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (ll->Properties)
never evaluated: 0
0
557 -
558 for ( m = 0; m < n; m++ )
never evaluated: m < n
0
559 Free_Lookup( &l[m], type );
never executed: Free_Lookup( &l[m], type );
0
560 -
561Fail2:
code before this statement never executed: Fail2:
0
562 do { if ( (ll->Lookup) ) { _hb_free( ll->Lookup ); ll->Lookup = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (ll->Lookup)
never evaluated: 0
0
563 return error;
never executed: return error;
0
564} -
565 -
566 -
567 void -
568_HB_OPEN_Free_LookupList( HB_LookupList* ll, -
569 HB_Type type ) -
570{ -
571 HB_UShort n, count; -
572 -
573 HB_Lookup* l; -
574 -
575 -
576 do { if ( (ll->Properties) ) { _hb_free( ll->Properties ); ll->Properties = ((void *)0); } } while (0);
executed: }
Execution Count:264
executed: }
Execution Count:264
partially evaluated: (ll->Properties)
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:264
0-264
577 -
578 if ( ll->Lookup )
partially evaluated: ll->Lookup
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
0-264
579 { -
580 count = ll->LookupCount; -
581 l = ll->Lookup; -
582 -
583 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:6754
yes
Evaluation Count:264
264-6754
584 Free_Lookup( &l[n], type );
executed: Free_Lookup( &l[n], type );
Execution Count:6754
6754
585 -
586 do { if ( (l) ) { _hb_free( l ); l = ((void *)0); } } while (0);
executed: }
Execution Count:264
executed: }
Execution Count:264
partially evaluated: (l)
TRUEFALSE
yes
Evaluation Count:264
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:264
0-264
587 }
executed: }
Execution Count:264
264
588}
executed: }
Execution Count:264
264
589static HB_Error Load_Coverage1( HB_CoverageFormat1* cf1, -
590 HB_Stream stream ) -
591{ -
592 HB_Error error; -
593 -
594 HB_UShort n, count; -
595 -
596 HB_UShort* ga; -
597 -
598 -
599 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6640
0-6640
600 return error;
never executed: return error;
0
601 -
602 count = cf1->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
603 -
604 _hb_stream_frame_exit( stream ); -
605 -
606 cf1->GlyphArray = ((void *)0); -
607 -
608 if ( ( (cf1->GlyphArray) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (cf1->GlyphArray) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6640
0-6640
609 return error;
never executed: return error;
0
610 -
611 ga = cf1->GlyphArray; -
612 -
613 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6640
0-6640
614 { -
615 do { if ( (cf1->GlyphArray) ) { _hb_free( cf1->GlyphArray ); cf1->GlyphArray = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (cf1->GlyphArray)
never evaluated: 0
0
616 return error;
never executed: return error;
0
617 } -
618 -
619 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:62575
yes
Evaluation Count:6640
6640-62575
620 ga[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: ga[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:62575
62575
621 -
622 _hb_stream_frame_exit( stream ); -
623 -
624 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:6640
6640
625} -
626 -
627 -
628static void Free_Coverage1( HB_CoverageFormat1* cf1) -
629{ -
630 do { if ( (cf1->GlyphArray) ) { _hb_free( cf1->GlyphArray ); cf1->GlyphArray = ((void *)0); } } while (0);
executed: }
Execution Count:6308
executed: }
Execution Count:6311
evaluated: (cf1->GlyphArray)
TRUEFALSE
yes
Evaluation Count:6308
yes
Evaluation Count:3
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6311
0-6311
631}
executed: }
Execution Count:6311
6311
632 -
633 -
634 -
635 -
636static HB_Error Load_Coverage2( HB_CoverageFormat2* cf2, -
637 HB_Stream stream ) -
638{ -
639 HB_Error error; -
640 -
641 HB_UShort n, count; -
642 -
643 HB_RangeRecord* rr; -
644 -
645 -
646 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4737
0-4737
647 return error;
never executed: return error;
0
648 -
649 count = cf2->RangeCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
650 -
651 _hb_stream_frame_exit( stream ); -
652 -
653 cf2->RangeRecord = ((void *)0); -
654 -
655 if ( ( (cf2->RangeRecord) = _hb_alloc( (count)*sizeof(HB_RangeRecord), &error ), error != 0 ) )
partially evaluated: ( (cf2->RangeRecord) = _hb_alloc( (count)*sizeof(HB_RangeRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4737
0-4737
656 return error;
never executed: return error;
0
657 -
658 rr = cf2->RangeRecord; -
659 -
660 if ( ( (error = (_hb_stream_frame_enter( stream, count * 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4737
0-4737
661 goto Fail;
never executed: goto Fail;
0
662 -
663 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:48021
yes
Evaluation Count:4737
4737-48021
664 { -
665 rr[n].Start = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
666 rr[n].End = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
667 rr[n].StartCoverageIndex = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
668 -
669 -
670 if ( rr[n].Start > rr[n].End ||
partially evaluated: rr[n].Start > rr[n].End
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48021
0-48021
671 ( rr[n].End - rr[n].Start + (long)rr[n].StartCoverageIndex ) >= 0-48021
672 0x10000L )
partially evaluated: ( rr[n].End - rr[n].Start + (long)rr[n].StartCoverageIndex ) >= 0x10000L
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48021
0-48021
673 { -
674 error = _hb_err (HB_Err_Invalid_SubTable); -
675 goto Fail;
never executed: goto Fail;
0
676 } -
677 }
executed: }
Execution Count:48021
48021
678 -
679 _hb_stream_frame_exit( stream ); -
680 -
681 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:4737
4737
682 -
683Fail: -
684 do { if ( (cf2->RangeRecord) ) { _hb_free( cf2->RangeRecord ); cf2->RangeRecord = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (cf2->RangeRecord)
never evaluated: 0
0
685 return error;
never executed: return error;
0
686} -
687 -
688 -
689static void Free_Coverage2( HB_CoverageFormat2* cf2 ) -
690{ -
691 do { if ( (cf2->RangeRecord) ) { _hb_free( cf2->RangeRecord ); cf2->RangeRecord = ((void *)0); } } while (0);
executed: }
Execution Count:4376
executed: }
Execution Count:4500
evaluated: (cf2->RangeRecord)
TRUEFALSE
yes
Evaluation Count:4376
yes
Evaluation Count:124
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4500
0-4500
692}
executed: }
Execution Count:4500
4500
693 -
694 -
695 HB_Error -
696_HB_OPEN_Load_Coverage( HB_Coverage* c, -
697 HB_Stream stream ) -
698{ -
699 HB_Error error; -
700 -
701 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11377
0-11377
702 return error;
never executed: return error;
0
703 -
704 c->CoverageFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
705 -
706 _hb_stream_frame_exit( stream ); -
707 -
708 switch ( c->CoverageFormat ) -
709 { -
710 case 1: return Load_Coverage1( &c->cf.cf1, stream );
executed: return Load_Coverage1( &c->cf.cf1, stream );
Execution Count:6640
6640
711 case 2: return Load_Coverage2( &c->cf.cf2, stream );
executed: return Load_Coverage2( &c->cf.cf2, stream );
Execution Count:4737
4737
712 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
713 } -
714 -
715 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
716} -
717 -
718 -
719 void -
720_HB_OPEN_Free_Coverage( HB_Coverage* c ) -
721{ -
722 switch ( c->CoverageFormat ) -
723 { -
724 case 1: Free_Coverage1( &c->cf.cf1 ); break;
executed: break;
Execution Count:6311
6311
725 case 2: Free_Coverage2( &c->cf.cf2 ); break;
executed: break;
Execution Count:4500
4500
726 default: break;
never executed: break;
0
727 } -
728}
executed: }
Execution Count:10811
10811
729 -
730 -
731static HB_Error Coverage_Index1( HB_CoverageFormat1* cf1, -
732 HB_UShort glyphID, -
733 HB_UShort* index ) -
734{ -
735 HB_UShort min, max, new_min, new_max, middle; -
736 -
737 HB_UShort* array = cf1->GlyphArray; -
738 -
739 -
740 -
741 -
742 if ( cf1->GlyphCount == 0 )
partially evaluated: cf1->GlyphCount == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:35026299
0-35026299
743 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
744 -
745 new_min = 0; -
746 new_max = cf1->GlyphCount - 1; -
747 -
748 do -
749 { -
750 min = new_min; -
751 max = new_max; -
752 -
753 -
754 -
755 -
756 middle = max - ( ( max - min ) >> 1 ); -
757 -
758 if ( glyphID == array[middle] )
evaluated: glyphID == array[middle]
TRUEFALSE
yes
Evaluation Count:756770
yes
Evaluation Count:73958283
756770-73958283
759 { -
760 *index = middle; -
761 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:756770
756770
762 } -
763 else if ( glyphID < array[middle] )
evaluated: glyphID < array[middle]
TRUEFALSE
yes
Evaluation Count:62609951
yes
Evaluation Count:11348332
11348332-62609951
764 { -
765 if ( middle == min )
evaluated: middle == min
TRUEFALSE
yes
Evaluation Count:28836044
yes
Evaluation Count:33773907
28836044-33773907
766 break;
executed: break;
Execution Count:28836044
28836044
767 new_max = middle - 1; -
768 }
executed: }
Execution Count:33773907
33773907
769 else -
770 { -
771 if ( middle == max )
evaluated: middle == max
TRUEFALSE
yes
Evaluation Count:5433485
yes
Evaluation Count:5914847
5433485-5914847
772 break;
executed: break;
Execution Count:5433485
5433485
773 new_min = middle + 1; -
774 }
executed: }
Execution Count:5914847
5914847
775 } while ( min < max );
partially evaluated: min < max
TRUEFALSE
yes
Evaluation Count:39688754
no
Evaluation Count:0
0-39688754
776 -
777 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:34269529
34269529
778} -
779 -
780 -
781static HB_Error Coverage_Index2( HB_CoverageFormat2* cf2, -
782 HB_UShort glyphID, -
783 HB_UShort* index ) -
784{ -
785 HB_UShort min, max, new_min, new_max, middle; -
786 -
787 HB_RangeRecord* rr = cf2->RangeRecord; -
788 -
789 -
790 -
791 -
792 if ( cf2->RangeCount == 0 )
partially evaluated: cf2->RangeCount == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:32276673
0-32276673
793 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
794 -
795 new_min = 0; -
796 new_max = cf2->RangeCount - 1; -
797 -
798 do -
799 { -
800 min = new_min; -
801 max = new_max; -
802 -
803 -
804 -
805 -
806 middle = max - ( ( max - min ) >> 1 ); -
807 -
808 if ( glyphID >= rr[middle].Start && glyphID <= rr[middle].End )
evaluated: glyphID >= rr[middle].Start
TRUEFALSE
yes
Evaluation Count:1081371
yes
Evaluation Count:80400604
evaluated: glyphID <= rr[middle].End
TRUEFALSE
yes
Evaluation Count:2902
yes
Evaluation Count:1078469
2902-80400604
809 { -
810 *index = rr[middle].StartCoverageIndex + glyphID - rr[middle].Start; -
811 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2902
2902
812 } -
813 else if ( glyphID < rr[middle].Start )
evaluated: glyphID < rr[middle].Start
TRUEFALSE
yes
Evaluation Count:80400604
yes
Evaluation Count:1078469
1078469-80400604
814 { -
815 if ( middle == min )
evaluated: middle == min
TRUEFALSE
yes
Evaluation Count:31636370
yes
Evaluation Count:48764234
31636370-48764234
816 break;
executed: break;
Execution Count:31636370
31636370
817 new_max = middle - 1; -
818 }
executed: }
Execution Count:48764234
48764234
819 else -
820 { -
821 if ( middle == max )
evaluated: middle == max
TRUEFALSE
yes
Evaluation Count:637401
yes
Evaluation Count:441068
441068-637401
822 break;
executed: break;
Execution Count:637401
637401
823 new_min = middle + 1; -
824 }
executed: }
Execution Count:441068
441068
825 } while ( min < max );
partially evaluated: min < max
TRUEFALSE
yes
Evaluation Count:49205302
no
Evaluation Count:0
0-49205302
826 -
827 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:32273771
32273771
828} -
829 -
830 -
831 HB_Error -
832_HB_OPEN_Coverage_Index( HB_Coverage* c, -
833 HB_UShort glyphID, -
834 HB_UShort* index ) -
835{ -
836 switch ( c->CoverageFormat ) -
837 { -
838 case 1: return Coverage_Index1( &c->cf.cf1, glyphID, index );
executed: return Coverage_Index1( &c->cf.cf1, glyphID, index );
Execution Count:35026299
35026299
839 case 2: return Coverage_Index2( &c->cf.cf2, glyphID, index );
executed: return Coverage_Index2( &c->cf.cf2, glyphID, index );
Execution Count:32276673
32276673
840 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
841 } -
842 -
843 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
844} -
845static HB_Error Load_ClassDef1( HB_ClassDefinition* cd, -
846 HB_UShort limit, -
847 HB_Stream stream ) -
848{ -
849 HB_Error error; -
850 -
851 HB_UShort n, count; -
852 -
853 HB_UShort* cva; -
854 -
855 HB_ClassDefFormat1* cdf1; -
856 -
857 -
858 cdf1 = &cd->cd.cd1; -
859 -
860 if ( ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 4L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2343
0-2343
861 return error;
never executed: return error;
0
862 -
863 cdf1->StartGlyph = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
864 count = cdf1->GlyphCount = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
865 -
866 _hb_stream_frame_exit( stream ); -
867 -
868 -
869 -
870 if ( cdf1->StartGlyph + (long)count >= 0x10000L )
partially evaluated: cdf1->StartGlyph + (long)count >= 0x10000L
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2343
0-2343
871 return _hb_err (HB_Err_Invalid_SubTable);
never executed: return _hb_err (HB_Err_Invalid_SubTable);
0
872 -
873 cdf1->ClassValueArray = ((void *)0); -
874 -
875 if ( ( (cdf1->ClassValueArray) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (cdf1->ClassValueArray) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2343
0-2343
876 return error;
never executed: return error;
0
877 -
878 cva = cdf1->ClassValueArray; -
879 -
880 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2343
0-2343
881 goto Fail;
never executed: goto Fail;
0
882 -
883 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:8663
yes
Evaluation Count:2343
2343-8663
884 { -
885 cva[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
886 if ( cva[n] >= limit )
partially evaluated: cva[n] >= limit
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8663
0-8663
887 { -
888 error = _hb_err (HB_Err_Invalid_SubTable); -
889 goto Fail;
never executed: goto Fail;
0
890 } -
891 }
executed: }
Execution Count:8663
8663
892 -
893 _hb_stream_frame_exit( stream ); -
894 -
895 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2343
2343
896 -
897Fail: -
898 do { if ( (cva) ) { _hb_free( cva ); cva = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (cva)
never evaluated: 0
0
899 -
900 return error;
never executed: return error;
0
901} -
902 -
903 -
904static void Free_ClassDef1( HB_ClassDefFormat1* cdf1 ) -
905{ -
906 do { if ( (cdf1->ClassValueArray) ) { _hb_free( cdf1->ClassValueArray ); cdf1->ClassValueArray = ((void *)0); } } while (0);
executed: }
Execution Count:2228
executed: }
Execution Count:2228
partially evaluated: (cdf1->ClassValueArray)
TRUEFALSE
yes
Evaluation Count:2228
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2228
0-2228
907}
executed: }
Execution Count:2228
2228
908 -
909 -
910 -
911 -
912static HB_Error Load_ClassDef2( HB_ClassDefinition* cd, -
913 HB_UShort limit, -
914 HB_Stream stream ) -
915{ -
916 HB_Error error; -
917 -
918 HB_UShort n, count; -
919 -
920 HB_ClassRangeRecord* crr; -
921 -
922 HB_ClassDefFormat2* cdf2; -
923 -
924 -
925 cdf2 = &cd->cd.cd2; -
926 -
927 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2764
0-2764
928 return error;
never executed: return error;
0
929 -
930 count = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
931 cdf2->ClassRangeCount = 0; -
932 -
933 _hb_stream_frame_exit( stream ); -
934 -
935 cdf2->ClassRangeRecord = ((void *)0); -
936 -
937 if ( ( (cdf2->ClassRangeRecord) = _hb_alloc( (count)*sizeof(HB_ClassRangeRecord), &error ), error != 0 ) )
partially evaluated: ( (cdf2->ClassRangeRecord) = _hb_alloc( (count)*sizeof(HB_ClassRangeRecord), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2764
0-2764
938 return error;
never executed: return error;
0
939 -
940 crr = cdf2->ClassRangeRecord; -
941 -
942 if ( ( (error = (_hb_stream_frame_enter( stream, count * 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2764
0-2764
943 goto Fail;
never executed: goto Fail;
0
944 -
945 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:87139
yes
Evaluation Count:2764
2764-87139
946 { -
947 crr[n].Start = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
948 crr[n].End = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
949 crr[n].Class = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
950 -
951 -
952 -
953 if ( crr[n].Start > crr[n].End ||
partially evaluated: crr[n].Start > crr[n].End
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:87139
0-87139
954 crr[n].Class >= limit )
partially evaluated: crr[n].Class >= limit
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:87139
0-87139
955 { -
956 -
957 -
958 -
959 -
960 n--; -
961 count--; -
962 }
never executed: }
0
963 }
executed: }
Execution Count:87139
87139
964 -
965 _hb_stream_frame_exit( stream ); -
966 -
967 cdf2->ClassRangeCount = count; -
968 -
969 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:2764
2764
970 -
971Fail: -
972 do { if ( (crr) ) { _hb_free( crr ); crr = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (crr)
never evaluated: 0
0
973 -
974 return error;
never executed: return error;
0
975} -
976 -
977 -
978static void Free_ClassDef2( HB_ClassDefFormat2* cdf2 ) -
979{ -
980 do { if ( (cdf2->ClassRangeRecord) ) { _hb_free( cdf2->ClassRangeRecord ); cdf2->ClassRangeRecord = ((void *)0); } } while (0);
executed: }
Execution Count:2629
executed: }
Execution Count:2629
partially evaluated: (cdf2->ClassRangeRecord)
TRUEFALSE
yes
Evaluation Count:2629
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2629
0-2629
981}
executed: }
Execution Count:2629
2629
982 -
983 -
984 -
985 -
986 HB_Error -
987_HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd, -
988 HB_UShort limit, -
989 HB_Stream stream ) -
990{ -
991 HB_Error error; -
992 -
993 if ( ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5107
0-5107
994 return error;
never executed: return error;
0
995 -
996 cd->ClassFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
997 -
998 _hb_stream_frame_exit( stream ); -
999 -
1000 switch ( cd->ClassFormat ) -
1001 { -
1002 case 1: error = Load_ClassDef1( cd, limit, stream ); break;
executed: break;
Execution Count:2343
2343
1003 case 2: error = Load_ClassDef2( cd, limit, stream ); break;
executed: break;
Execution Count:2764
2764
1004 default: error = _hb_err (HB_Err_Invalid_SubTable_Format); break;
never executed: break;
0
1005 } -
1006 -
1007 if ( error )
partially evaluated: error
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5107
0-5107
1008 return error;
never executed: return error;
0
1009 -
1010 cd->loaded = (!0); -
1011 -
1012 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:5107
5107
1013} -
1014 -
1015 -
1016static HB_Error -
1017_HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd ) -
1018{ -
1019 HB_Error error; -
1020 -
1021 cd->ClassFormat = 1; -
1022 -
1023 if ( ( (cd->cd.cd1.ClassValueArray) = _hb_alloc( (1)*sizeof(HB_UShort), &error ), error != 0 ) )
never evaluated: ( (cd->cd.cd1.ClassValueArray) = _hb_alloc( (1)*sizeof(HB_UShort), &error ), error != 0 )
0
1024 return error;
never executed: return error;
0
1025 -
1026 cd->loaded = (!0); -
1027 -
1028 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1029} -
1030 -
1031 HB_Error -
1032_HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd, -
1033 HB_UShort limit, -
1034 HB_UInt class_offset, -
1035 HB_UInt base_offset, -
1036 HB_Stream stream ) -
1037{ -
1038 HB_Error error; -
1039 HB_UInt cur_offset; -
1040 -
1041 cur_offset = _hb_stream_pos( stream ); -
1042 -
1043 if ( class_offset )
partially evaluated: class_offset
TRUEFALSE
yes
Evaluation Count:4425
no
Evaluation Count:0
0-4425
1044 { -
1045 if ( !( (error = (_hb_stream_seek( stream, class_offset + base_offset ))) != 0 ) )
partially evaluated: !( (error = (_hb_stream_seek( stream, class_offset + base_offset ))) != 0 )
TRUEFALSE
yes
Evaluation Count:4425
no
Evaluation Count:0
0-4425
1046 error = _HB_OPEN_Load_ClassDefinition( cd, limit, stream );
executed: error = _HB_OPEN_Load_ClassDefinition( cd, limit, stream );
Execution Count:4425
4425
1047 }
executed: }
Execution Count:4425
4425
1048 else -
1049 error = _HB_OPEN_Load_EmptyClassDefinition ( cd );
never executed: error = _HB_OPEN_Load_EmptyClassDefinition ( cd );
0
1050 -
1051 if (error == HB_Err_Ok)
partially evaluated: error == HB_Err_Ok
TRUEFALSE
yes
Evaluation Count:4425
no
Evaluation Count:0
0-4425
1052 (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
executed: (void)( (error = (_hb_stream_seek( stream, cur_offset ))) != 0 );
Execution Count:4425
4425
1053 -
1054 return error;
executed: return error;
Execution Count:4425
4425
1055} -
1056 -
1057 void -
1058_HB_OPEN_Free_ClassDefinition( HB_ClassDefinition* cd ) -
1059{ -
1060 if ( !cd->loaded )
evaluated: !cd->loaded
TRUEFALSE
yes
Evaluation Count:129
yes
Evaluation Count:4857
129-4857
1061 return;
executed: return;
Execution Count:129
129
1062 -
1063 switch ( cd->ClassFormat ) -
1064 { -
1065 case 1: Free_ClassDef1( &cd->cd.cd1 ); break;
executed: break;
Execution Count:2228
2228
1066 case 2: Free_ClassDef2( &cd->cd.cd2 ); break;
executed: break;
Execution Count:2629
2629
1067 default: break;
never executed: break;
0
1068 } -
1069}
executed: }
Execution Count:4857
4857
1070 -
1071 -
1072static HB_Error Get_Class1( HB_ClassDefFormat1* cdf1, -
1073 HB_UShort glyphID, -
1074 HB_UShort* klass, -
1075 HB_UShort* index ) -
1076{ -
1077 HB_UShort* cva = cdf1->ClassValueArray; -
1078 -
1079 -
1080 if ( index )
never evaluated: index
0
1081 *index = 0;
never executed: *index = 0;
0
1082 -
1083 if ( glyphID >= cdf1->StartGlyph &&
never evaluated: glyphID >= cdf1->StartGlyph
0
1084 glyphID < cdf1->StartGlyph + cdf1->GlyphCount )
never evaluated: glyphID < cdf1->StartGlyph + cdf1->GlyphCount
0
1085 { -
1086 *klass = cva[glyphID - cdf1->StartGlyph]; -
1087 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1088 } -
1089 else -
1090 { -
1091 *klass = 0; -
1092 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1093 } -
1094} -
1095 -
1096 -
1097 -
1098 -
1099 -
1100static HB_Error Get_Class2( HB_ClassDefFormat2* cdf2, -
1101 HB_UShort glyphID, -
1102 HB_UShort* klass, -
1103 HB_UShort* index ) -
1104{ -
1105 HB_Error error = HB_Err_Ok; -
1106 HB_UShort min, max, new_min, new_max, middle; -
1107 -
1108 HB_ClassRangeRecord* crr = cdf2->ClassRangeRecord; -
1109 -
1110 -
1111 -
1112 -
1113 if ( cdf2->ClassRangeCount == 0 )
partially evaluated: cdf2->ClassRangeCount == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4795286
0-4795286
1114 { -
1115 *klass = 0; -
1116 if ( index )
never evaluated: index
0
1117 *index = 0;
never executed: *index = 0;
0
1118 -
1119 return HB_Err_Not_Covered;
never executed: return HB_Err_Not_Covered;
0
1120 } -
1121 -
1122 new_min = 0; -
1123 new_max = cdf2->ClassRangeCount - 1; -
1124 -
1125 do -
1126 { -
1127 min = new_min; -
1128 max = new_max; -
1129 -
1130 -
1131 -
1132 -
1133 middle = max - ( ( max - min ) >> 1 ); -
1134 -
1135 if ( glyphID >= crr[middle].Start && glyphID <= crr[middle].End )
evaluated: glyphID >= crr[middle].Start
TRUEFALSE
yes
Evaluation Count:8338980
yes
Evaluation Count:24349859
evaluated: glyphID <= crr[middle].End
TRUEFALSE
yes
Evaluation Count:4536956
yes
Evaluation Count:3802024
3802024-24349859
1136 { -
1137 *klass = crr[middle].Class; -
1138 error = HB_Err_Ok; -
1139 break;
executed: break;
Execution Count:4536956
4536956
1140 } -
1141 else if ( glyphID < crr[middle].Start )
evaluated: glyphID < crr[middle].Start
TRUEFALSE
yes
Evaluation Count:24349859
yes
Evaluation Count:3802024
3802024-24349859
1142 { -
1143 if ( middle == min )
evaluated: middle == min
TRUEFALSE
yes
Evaluation Count:206263
yes
Evaluation Count:24143596
206263-24143596
1144 { -
1145 *klass = 0; -
1146 error = HB_Err_Not_Covered; -
1147 break;
executed: break;
Execution Count:206263
206263
1148 } -
1149 new_max = middle - 1; -
1150 }
executed: }
Execution Count:24143596
24143596
1151 else -
1152 { -
1153 if ( middle == max )
evaluated: middle == max
TRUEFALSE
yes
Evaluation Count:52067
yes
Evaluation Count:3749957
52067-3749957
1154 { -
1155 *klass = 0; -
1156 error = HB_Err_Not_Covered; -
1157 break;
executed: break;
Execution Count:52067
52067
1158 } -
1159 new_min = middle + 1; -
1160 }
executed: }
Execution Count:3749957
3749957
1161 } while ( min < max );
partially evaluated: min < max
TRUEFALSE
yes
Evaluation Count:27893553
no
Evaluation Count:0
0-27893553
1162 -
1163 if ( index )
evaluated: index
TRUEFALSE
yes
Evaluation Count:3541657
yes
Evaluation Count:1253629
1253629-3541657
1164 *index = middle;
executed: *index = middle;
Execution Count:3541657
3541657
1165 -
1166 return error;
executed: return error;
Execution Count:4795286
4795286
1167} -
1168 -
1169 -
1170 HB_Error -
1171_HB_OPEN_Get_Class( HB_ClassDefinition* cd, -
1172 HB_UShort glyphID, -
1173 HB_UShort* klass, -
1174 HB_UShort* index ) -
1175{ -
1176 switch ( cd->ClassFormat ) -
1177 { -
1178 case 1: return Get_Class1( &cd->cd.cd1, glyphID, klass, index );
never executed: return Get_Class1( &cd->cd.cd1, glyphID, klass, index );
0
1179 case 2: return Get_Class2( &cd->cd.cd2, glyphID, klass, index );
executed: return Get_Class2( &cd->cd.cd2, glyphID, klass, index );
Execution Count:4795286
4795286
1180 default: return _hb_err (HB_Err_Invalid_SubTable_Format);
never executed: return _hb_err (HB_Err_Invalid_SubTable_Format);
0
1181 } -
1182 -
1183 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1184} -
1185 HB_Error -
1186_HB_OPEN_Load_Device( HB_Device** device, -
1187 HB_Stream stream ) -
1188{ -
1189 HB_Device* d; -
1190 HB_Error error; -
1191 -
1192 HB_UShort n, count; -
1193 -
1194 HB_UShort* dv; -
1195 -
1196 -
1197 if ( ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, 6L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
0-225
1198 return error;
never executed: return error;
0
1199 -
1200 if ( ( (*device) = _hb_alloc( sizeof(HB_Device), &error ), error != 0 ) )
partially evaluated: ( (*device) = _hb_alloc( sizeof(HB_Device), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
0-225
1201 { -
1202 *device = 0; -
1203 return error;
never executed: return error;
0
1204 } -
1205 -
1206 d = *device; -
1207 -
1208 d->StartSize = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1209 d->EndSize = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1210 d->DeltaFormat = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) ))); -
1211 -
1212 _hb_stream_frame_exit( stream ); -
1213 -
1214 d->DeltaValue = ((void *)0); -
1215 -
1216 if ( d->StartSize > d->EndSize ||
partially evaluated: d->StartSize > d->EndSize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
0-225
1217 d->DeltaFormat == 0 || d->DeltaFormat > 3 )
partially evaluated: d->DeltaFormat == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
partially evaluated: d->DeltaFormat > 3
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
0-225
1218 { -
1219 -
1220 -
1221 -
1222 -
1223 -
1224 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1225 } -
1226 -
1227 count = ( ( d->EndSize - d->StartSize + 1 ) >> -
1228 ( 4 - d->DeltaFormat ) ) + 1; -
1229 -
1230 if ( ( (d->DeltaValue) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 ) )
partially evaluated: ( (d->DeltaValue) = _hb_alloc( (count)*sizeof(HB_UShort), &error ), error != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
0-225
1231 { -
1232 do { if ( (*device) ) { _hb_free( *device ); *device = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (*device)
never evaluated: 0
0
1233 *device = 0; -
1234 return error;
never executed: return error;
0
1235 } -
1236 -
1237 if ( ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 ) )
partially evaluated: ( (error = (_hb_stream_frame_enter( stream, count * 2L ))) != 0 )
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
0-225
1238 { -
1239 do { if ( (d->DeltaValue) ) { _hb_free( d->DeltaValue ); d->DeltaValue = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (d->DeltaValue)
never evaluated: 0
0
1240 do { if ( (*device) ) { _hb_free( *device ); *device = ((void *)0); } } while (0);
never executed: }
never executed: }
never evaluated: (*device)
never evaluated: 0
0
1241 *device = 0; -
1242 return error;
never executed: return error;
0
1243 } -
1244 -
1245 dv = d->DeltaValue; -
1246 -
1247 for ( n = 0; n < count; n++ )
evaluated: n < count
TRUEFALSE
yes
Evaluation Count:225
yes
Evaluation Count:225
225
1248 dv[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
executed: dv[n] = ((HB_UShort)(stream->cursor += 2, (HB_Short)( (*(((HB_Byte*)stream->cursor)-2) << 8) | *(((HB_Byte*)stream->cursor)-1) )));
Execution Count:225
225
1249 -
1250 _hb_stream_frame_exit( stream ); -
1251 -
1252 return HB_Err_Ok;
executed: return HB_Err_Ok;
Execution Count:225
225
1253} -
1254 -
1255 -
1256 void -
1257_HB_OPEN_Free_Device( HB_Device* d ) -
1258{ -
1259 if ( d )
evaluated: d
TRUEFALSE
yes
Evaluation Count:116
yes
Evaluation Count:116
116
1260 { -
1261 do { if ( (d->DeltaValue) ) { _hb_free( d->DeltaValue ); d->DeltaValue = ((void *)0); } } while (0);
executed: }
Execution Count:116
executed: }
Execution Count:116
partially evaluated: (d->DeltaValue)
TRUEFALSE
yes
Evaluation Count:116
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:116
0-116
1262 do { if ( (d) ) { _hb_free( d ); d = ((void *)0); } } while (0);
executed: }
Execution Count:116
executed: }
Execution Count:116
partially evaluated: (d)
TRUEFALSE
yes
Evaluation Count:116
no
Evaluation Count:0
partially evaluated: 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:116
0-116
1263 }
executed: }
Execution Count:116
116
1264}
executed: }
Execution Count:232
232
1265 HB_Error -
1266_HB_OPEN_Get_Device( HB_Device* d, -
1267 HB_UShort size, -
1268 HB_Short* value ) -
1269{ -
1270 HB_UShort byte, bits, mask, s; -
1271 -
1272 if ( d && d->DeltaValue && size >= d->StartSize && size <= d->EndSize )
evaluated: d
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:48
partially evaluated: d->DeltaValue
TRUEFALSE
yes
Evaluation Count:48
no
Evaluation Count:0
partially evaluated: size >= d->StartSize
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:48
never evaluated: size <= d->EndSize
0-48
1273 { -
1274 HB_UShort f = d->DeltaFormat; -
1275 s = size - d->StartSize; -
1276 byte = d->DeltaValue[s >> ( 4 - f )]; -
1277 bits = byte >> ( 16 - ( ( s % ( 1 << ( 4 - f ) ) + 1 ) << f ) ); -
1278 mask = 0xFFFF >> ( 16 - ( 1 << f ) ); -
1279 -
1280 *value = (HB_Short)( bits & mask ); -
1281 -
1282 -
1283 -
1284 if ( *value >= ( ( mask + 1 ) >> 1 ) )
never evaluated: *value >= ( ( mask + 1 ) >> 1 )
0
1285 *value -= mask + 1;
never executed: *value -= mask + 1;
0
1286 -
1287 return HB_Err_Ok;
never executed: return HB_Err_Ok;
0
1288 } -
1289 else -
1290 { -
1291 *value = 0; -
1292 return HB_Err_Not_Covered;
executed: return HB_Err_Not_Covered;
Execution Count:96
96
1293 } -
1294} -
1295 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial