Commit ec39a8a3914a19a39742778a397c967dbb0ba0d0

Werner Lemberg 2004-08-12T12:22:28

Make otlayout module compile (without actually working). * src/otlayout/*: s/OTL_Valid/OTL_Validator/. s/NULL/0/. * src/otlayout/otlayout.h: Fix various typos. (OTL_Bool): New typedef. (OTL_Int, OTL_Long, OTL_Int16, OTL_Int32): Use `signed' keyword. (OTL_Err_InvalidArgument): Removed. (OTL_Err_InvalidData, OTL_Err_InvalidSize): New enum values. (OTL_MAKE_TAG): Add missing parenthesis. (OTL_INVALID_DATA): Use OTL_Err_InvalidData. (OTL_INVALID_TOO_SHORT): Use OTL_Err_InvalidSize. (OTL_INVALID_FORMAT, OTL_INVALID_OFFSET): New macros. * src/otlayout/otlgpos.c: s/FT_/OTL_/. s/OTL_Short/OTL_Int16/. (otl_gpos_pairset_validate): Add return type. (otl_base_array_validate): Fix call to otl_anchor_validate. (otl_liga_array_validate): Fix call to otl_liga_attach_validate. (otl_gpos_lookup5_validate): Fix typos. (otl_gpos_lookup6_validate): Fix call to otl_mark2_array_validate. (otl_gpos_lookup7_validate): Comment out unfinished code. Fix typos. * src/otlayout/otlgsub.c: Add forward declaration for otl_gsub_validate_funcs. (otl_gsub_lookup1_apply, otl_gsub_lookup2_apply, otl_gsub_lookup3_apply): Fix call to otl_parser_check_property. s/otl_coverage_lookup/otl_coverage_get_index/. (otl_ligature_validate): Add missing variable declaration. (otl_sub_rule_validate): Fix typo. (otl_sub_class_rule_validate): Add missing variable declaration. Fix typo. (otl_gsub_lookup5_validate): Fix typo. (otl_gsub_lookup6_validate): Fix call to otl_chain_sub_class_set_validate. (otl_gsub_validate_funcs): Don't use `const'. * src/otlayout/otlcommn.c (otl_class_definition_get_value, otl_device_table_validate, otl_device_table_get_delta, otl_lookup_validate, otl_script_validate): Add missing variable declarations. (otl_lookup_list_validate): Comment out first definition. (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out. (otl_feature_list_validate): s/otl_feature_table_validate/otl_feature_validate/. (otl_script_list_validate): s/otl_script_table_validate/otl_script_validate/. * src/otlayout/otlcommn.h: Comment out first declaration. (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out. * src/otlayout/otlbase.c (otl_base_coord_validate): Fix call to otl_device_table_validate. (otl_base_scsript_validate): Add missing variable declarations. (otl_base_script_list_validate): Fix call to otl_base_script_validate. (otl_axis_table_validate): Fix calls to otl_base_tag_list_validate and otl_base_script_list_validate. (otl_base_validate): Fix calls to otl_axis_table_validate. * src/otlayout/otlgdef.c (otl_attach_list_validate): Fix call to otl_attach_point_validate. (otl_caret_value_validate): Add missing variable declaration. Fix call to otl_device_table_validate. (otl_ligature_glyph_validate): Fix call to otl_caret_value_validate. (otl_ligature_caret_list_validate): Fix call to otl_ligature_glyph_validate. (otl_gdef_validate): Fix calls to otl_class_definition_validate, otl_attach_list_validate, otl_ligature_caret_list_validate, and otl_class_definition_validate. * src/otlayout/otltable.h (otl_table_validate, otl_table_init, otl_table_set_script): Comment out. * src/otlayout/otlparse.h (OTL_ParserRec): s/OTL_Alternate/OTL_GSUB_Alternate/. (OTL_ParseError): Add OTL_Err_Parser_Memory and OTL_Err_Parser_Internal. (otl_parser_error): Fix typo. (otl_parser_check_property): Remove third argument. * src/otlayout/otlparse.c (otl_string_ensure): s/OTL_Parse_Err_Memory/OTL_Err_Parser_Memory/. (OTL_STRING_ENSURE, otl_parser_error, otl_parser_get_index, otl_parser_replace_1, otl_parser_replace_n): Fix typos. (OTL_PARSER_UNCOVERED): Removed. (otl_parser_check_property): Remove third argument. * src/otlayout/otljstf.c (otl_jstf_priority_validate): Add missing variable declaration. * src/otlayout/otlutils.h (OTL_MEM_REALLOC): Fix typo.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
diff --git a/ChangeLog b/ChangeLog
index 0760dd9..a70e983 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,100 @@
+2004-08-12  Werner Lemberg  <wl@gnu.org>
+
+	Make otlayout module compile (without actually working).
+
+	* src/otlayout/*: s/OTL_Valid/OTL_Validator/.
+	s/NULL/0/.
+
+	* src/otlayout/otlayout.h: Fix various typos.
+	(OTL_Bool): New typedef.
+	(OTL_Int, OTL_Long, OTL_Int16, OTL_Int32): Use `signed' keyword.
+	(OTL_Err_InvalidArgument): Removed.
+	(OTL_Err_InvalidData, OTL_Err_InvalidSize): New enum values.
+	(OTL_MAKE_TAG): Add missing parenthesis.
+	(OTL_INVALID_DATA): Use OTL_Err_InvalidData.
+	(OTL_INVALID_TOO_SHORT): Use OTL_Err_InvalidSize.
+	(OTL_INVALID_FORMAT, OTL_INVALID_OFFSET): New macros.
+
+	* src/otlayout/otlgpos.c: s/FT_/OTL_/.
+	s/OTL_Short/OTL_Int16/.
+	(otl_gpos_pairset_validate): Add return type.
+	(otl_base_array_validate): Fix call to otl_anchor_validate.
+	(otl_liga_array_validate): Fix call to otl_liga_attach_validate.
+	(otl_gpos_lookup5_validate): Fix typos.
+	(otl_gpos_lookup6_validate): Fix call to otl_mark2_array_validate.
+	(otl_gpos_lookup7_validate): Comment out unfinished code.
+	Fix typos.
+
+	* src/otlayout/otlgsub.c: Add forward declaration for
+	otl_gsub_validate_funcs.
+	(otl_gsub_lookup1_apply, otl_gsub_lookup2_apply,
+	otl_gsub_lookup3_apply): Fix call to otl_parser_check_property. 
+	s/otl_coverage_lookup/otl_coverage_get_index/.
+	(otl_ligature_validate): Add missing variable declaration.
+	(otl_sub_rule_validate): Fix typo.
+	(otl_sub_class_rule_validate): Add missing variable declaration.
+	Fix typo.
+	(otl_gsub_lookup5_validate): Fix typo.
+	(otl_gsub_lookup6_validate): Fix call to
+	otl_chain_sub_class_set_validate.
+	(otl_gsub_validate_funcs): Don't use `const'.
+
+	* src/otlayout/otlcommn.c (otl_class_definition_get_value,
+	otl_device_table_validate, otl_device_table_get_delta,
+	otl_lookup_validate, otl_script_validate): Add missing
+	variable declarations.
+	(otl_lookup_list_validate): Comment out first definition.
+	(otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
+	(otl_feature_list_validate):
+	s/otl_feature_table_validate/otl_feature_validate/.
+	(otl_script_list_validate):
+	s/otl_script_table_validate/otl_script_validate/.
+
+	* src/otlayout/otlcommn.h: Comment out first declaration.
+	(otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
+
+	* src/otlayout/otlbase.c (otl_base_coord_validate): Fix call to
+	otl_device_table_validate.
+	(otl_base_scsript_validate): Add missing variable declarations.
+	(otl_base_script_list_validate): Fix call to
+	otl_base_script_validate.
+	(otl_axis_table_validate): Fix calls to otl_base_tag_list_validate
+	and otl_base_script_list_validate.
+	(otl_base_validate): Fix calls to otl_axis_table_validate.
+
+	* src/otlayout/otlgdef.c (otl_attach_list_validate): Fix call to
+	otl_attach_point_validate.
+	(otl_caret_value_validate): Add missing variable declaration.
+	Fix call to otl_device_table_validate.
+	(otl_ligature_glyph_validate): Fix call to otl_caret_value_validate.
+	(otl_ligature_caret_list_validate): Fix call to
+	otl_ligature_glyph_validate.
+	(otl_gdef_validate): Fix calls to otl_class_definition_validate,
+	otl_attach_list_validate, otl_ligature_caret_list_validate, and
+	otl_class_definition_validate.
+
+	* src/otlayout/otltable.h (otl_table_validate, otl_table_init,
+	otl_table_set_script): Comment out.
+
+	* src/otlayout/otlparse.h (OTL_ParserRec):
+	s/OTL_Alternate/OTL_GSUB_Alternate/.
+	(OTL_ParseError): Add OTL_Err_Parser_Memory and
+	OTL_Err_Parser_Internal.
+	(otl_parser_error): Fix typo.
+	(otl_parser_check_property): Remove third argument.
+
+	* src/otlayout/otlparse.c (otl_string_ensure):
+	s/OTL_Parse_Err_Memory/OTL_Err_Parser_Memory/.
+	(OTL_STRING_ENSURE, otl_parser_error, otl_parser_get_index,
+	otl_parser_replace_1, otl_parser_replace_n): Fix typos.
+	(OTL_PARSER_UNCOVERED): Removed.
+	(otl_parser_check_property): Remove third argument.
+
+	* src/otlayout/otljstf.c (otl_jstf_priority_validate): Add missing
+	variable declaration.
+
+	* src/otlayout/otlutils.h (OTL_MEM_REALLOC): Fix typo.
+
 2004-08-11  Danny  <dannyboynow@yahoo.com>
 
 	* src/base/ftstream.c (FT_Stream_Close): Don't reset stream->close
diff --git a/src/cff/cfftoken.h b/src/cff/cfftoken.h
index 659d157..6bb27d5 100644
--- a/src/cff/cfftoken.h
+++ b/src/cff/cfftoken.h
@@ -49,7 +49,7 @@
   CFF_FIELD_STRING  ( 0x116, base_font_name )
   CFF_FIELD_DELTA   ( 0x117, base_font_blend, 16 )
   CFF_FIELD_CALLBACK( 0x118, multiple_master )
-  CFF_FIELD_CALLBACK( 0x119, blend_axit_types )
+  CFF_FIELD_CALLBACK( 0x119, blend_axis_types )
 #endif
 
   CFF_FIELD_CALLBACK( 0x11E, cid_ros )
diff --git a/src/otlayout/otlayout.h b/src/otlayout/otlayout.h
index 2cd67f5..ff1bdcd 100644
--- a/src/otlayout/otlayout.h
+++ b/src/otlayout/otlayout.h
@@ -6,6 +6,7 @@
 
 OTL_BEGIN_HEADER
 
+
  /************************************************************************/
  /************************************************************************/
  /*****                                                              *****/
@@ -21,24 +22,26 @@ OTL_BEGIN_HEADER
 
   typedef void*             OTL_Pointer;
 
-  typedef int               OTL_Int;
+  typedef unsigned char     OTL_Bool;
+
+  typedef signed int        OTL_Int;
   typedef unsigned int      OTL_UInt;
 
-  typedef long              OTL_Long;
+  typedef signed long       OTL_Long;
   typedef unsigned long     OTL_ULong;
 
-  typedef short             OTL_Int16;
+  typedef signed short      OTL_Int16;
   typedef unsigned short    OTL_UInt16;
 
 
 #if OTL_SIZEOF_INT == 4
 
-  typedef int               OTL_Int32;
+  typedef signed int        OTL_Int32;
   typedef unsigned int      OTL_UInt32;
 
 #elif OTL_SIZEOF_LONG == 4
 
-  typedef long              OTL_Int32;
+  typedef signed long       OTL_Int32;
   typedef unsigned long     OTL_UInt32;
 
 #else
@@ -47,6 +50,7 @@ OTL_BEGIN_HEADER
 
   typedef OTL_UInt32        OTL_Tag;
 
+
  /************************************************************************/
  /************************************************************************/
  /*****                                                              *****/
@@ -55,16 +59,17 @@ OTL_BEGIN_HEADER
  /************************************************************************/
  /************************************************************************/
 
-  typedef enum
+  enum
   {
     OTL_Err_Ok = 0,
-    OTL_Err_InvalidArgument,
     OTL_Err_InvalidFormat,
+    OTL_Err_InvalidSize,
+    OTL_Err_InvalidData,
     OTL_Err_InvalidOffset,
 
     OTL_Err_Max
 
-  } OTL_Error;
+  };
 
 
  /************************************************************************/
@@ -94,6 +99,7 @@ OTL_BEGIN_HEADER
 
   } OTL_MemoryRec, *OTL_Memory;
 
+
  /************************************************************************/
  /************************************************************************/
  /*****                                                              *****/
@@ -107,9 +113,9 @@ OTL_BEGIN_HEADER
 #ifndef  OTL_MAKE_TAG
 #define  OTL_MAKE_TAG(c1,c2,c3,c4)         \
            ( ( (OTL_UInt32)(c1) << 24 ) |  \
-               (OTL_UInt32)(c2) << 16 ) |  \
-               (OTL_UInt32)(c3) <<  8 ) |  \
-               (OTL_UInt32)(c4)         )
+             ( (OTL_UInt32)(c2) << 16 ) |  \
+             ( (OTL_UInt32)(c3) <<  8 ) |  \
+             ( (OTL_UInt32)(c4)       ) )
 #endif
 
   typedef enum OTL_ScriptTag_
@@ -162,6 +168,7 @@ OTL_BEGIN_HEADER
 #define  OTL_NEXT_SHORT(p)   ((OTL_Int16)OTL_NEXT_USHORT(p))
 #define  OTL_NEXT_LONG(p)    ((OTL_Int32)OTL_NEXT_ULONG(p))
 
+
  /************************************************************************/
  /************************************************************************/
  /*****                                                              *****/
@@ -181,8 +188,8 @@ OTL_BEGIN_HEADER
 
   } OTL_ValidatorRec;
 
-  typedef void  (*OTL_ValidateFunc)( OTL_Bytes  table,
-                                     OTL_Valid  valid );
+  typedef void  (*OTL_ValidateFunc)( OTL_Bytes      table,
+                                     OTL_Validator  valid );
 
   OTL_API( void )
   otl_validator_error( OTL_Validator  validator,
@@ -190,8 +197,10 @@ OTL_BEGIN_HEADER
 
 #define  OTL_INVALID(e)  otl_validator_error( valid, e )
 
-#define  OTL_INVALID_TOO_SHORT  OTL_INVALID( OTL_Err_InvalidOffset )
-#define  OTL_INVALID_DATA       OTL_INVALID( OTL_Err_InvalidFormat )
+#define  OTL_INVALID_TOO_SHORT  OTL_INVALID( OTL_Err_InvalidSize )
+#define  OTL_INVALID_OFFSET     OTL_INVALID( OTL_Err_InvalidOffset )
+#define  OTL_INVALID_DATA       OTL_INVALID( OTL_Err_InvalidData )
+#define  OTL_INVALID_FORMAT     OTL_INVALID( OTL_Err_InvalidFormat )
 
 #define  OTL_CHECK(_count)   OTL_BEGIN_STMNT                       \
                                if ( p + (_count) > valid->limit )  \
@@ -202,4 +211,4 @@ OTL_BEGIN_HEADER
 
 OTL_END_HEADER
 
-#endif /* __OPENTYPE_LAYOUT_H__ */
+#endif /* __OT_LAYOUT_H__ */
diff --git a/src/otlayout/otlbase.c b/src/otlayout/otlbase.c
index 614e13c..98398d4 100644
--- a/src/otlayout/otlbase.c
+++ b/src/otlayout/otlbase.c
@@ -24,7 +24,7 @@
 
       case 3:
         OTL_CHECK( 2 );
-        otl_device_table_validate( table + OTL_PEEK_USHORT( p ) );
+        otl_device_table_validate( table + OTL_PEEK_USHORT( p ), valid );
         break;
 
       default:
@@ -106,7 +106,7 @@
                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
-    OTL_UInt   values, default_minmax;
+    OTL_UInt   values, default_minmax, count;
 
     OTL_CHECK(6);
 
@@ -144,7 +144,7 @@
     for ( ; count > 0; count-- )
     {
       p += 4;  /* ignore script tag */
-      otl_base_script_validate( table + OTL_NEXT_USHORT( p ) );
+      otl_base_script_validate( table + OTL_NEXT_USHORT( p ), valid );
     }
   }
 
@@ -159,9 +159,9 @@
 
     tags = OTL_NEXT_USHORT( p );
     if ( tags )
-      otl_base_tag_list_validate   ( table + tags );
+      otl_base_tag_list_validate( table + tags, valid );
 
-    otl_base_script_list_validate( table + OTL_NEXT_USHORT( p ) );
+    otl_base_script_list_validate( table + OTL_NEXT_USHORT( p ), valid );
   }
 
 
@@ -176,6 +176,6 @@
     if ( OTL_NEXT_ULONG( p ) != 0x10000UL )
       OTL_INVALID_DATA;
 
-    otl_axis_table_validate( table + OTL_NEXT_USHORT( p ) );
-    otl_axis_table_validate( table + OTL_NEXT_USHORT( p ) );
-  }
\ No newline at end of file
+    otl_axis_table_validate( table + OTL_NEXT_USHORT( p ), valid );
+    otl_axis_table_validate( table + OTL_NEXT_USHORT( p ), valid );
+  }
diff --git a/src/otlayout/otlcommn.c b/src/otlayout/otlcommn.c
index 742ff5b..b9a8259 100644
--- a/src/otlayout/otlcommn.c
+++ b/src/otlayout/otlcommn.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType layout support, common tables (body).                       */
 /*                                                                         */
-/*  Copyright 2002 by                                                      */
+/*  Copyright 2002, 2004 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -286,7 +286,7 @@
     case 2:
       {
         OTL_UInt  count = OTL_NEXT_USHORT( p );
-        OTL_UInt  min = 0, max = count, mid, gindex;
+        OTL_UInt  min = 0, max = count, mid, gindex, start, end;
 
 
         table += 4;
@@ -328,7 +328,7 @@
                              OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
-    OTL_UInt   start, end, count, format, count;
+    OTL_UInt   start, end, count, format;
 
 
     if ( p + 8 > valid->limit )
@@ -374,7 +374,7 @@
   {
     OTL_Bytes  p = table;
     OTL_Int    result = 0;
-    OTL_UInt   start, end, format, idx, value;
+    OTL_UInt   start, end, format, idx, value, shift;
 
 
     start  = OTL_NEXT_USHORT( p );
@@ -393,7 +393,7 @@
         p     += idx / 16;
         value  = OTL_PEEK_USHORT( p );
         shift  = idx & 15;
-        result = (OTL_Short)( value << shift ) >> ( 14 - shift );
+        result = (OTL_Int16)( value << shift ) >> ( 14 - shift );
 
         break;
 
@@ -402,7 +402,7 @@
         p     += idx / 16;
         value  = OTL_PEEK_USHORT( p );
         shift  = idx & 15;
-        result = (OTL_Short)( value << shift ) >> ( 12 - shift );
+        result = (OTL_Int16)( value << shift ) >> ( 12 - shift );
 
         break;
 
@@ -411,7 +411,7 @@
         p     += idx / 16;
         value  = OTL_PEEK_USHORT( p );
         shift  = idx & 15;
-        result = (OTL_Short)( value << shift ) >> ( 8 - shift );
+        result = (OTL_Int16)( value << shift ) >> ( 8 - shift );
 
         break;
 
@@ -451,7 +451,7 @@
 
     for ( ; num_tables > 0; num_tables-- )
     {
-      offset = OTL_NEXT_USHORT( p );
+      OTL_UInt offset = OTL_NEXT_USHORT( p );
 
       if ( table + offset >= valid->limit )
         OTL_INVALID_OFFSET;
@@ -475,7 +475,7 @@
   otl_lookup_get_table( OTL_Bytes  table,
                         OTL_UInt   idx )
   {
-    OTL_Bytes  p, result = NULL;
+    OTL_Bytes  p, result = 0;
     OTL_UInt   count;
 
 
@@ -499,6 +499,7 @@
   /*************************************************************************/
   /*************************************************************************/
 
+#if 0
   OTL_LOCALDEF( void )
   otl_lookup_list_validate( OTL_Bytes      table,
                             OTL_Validator  valid )
@@ -522,6 +523,7 @@
       otl_lookup_validate( table + offset, valid );
     }
   }
+#endif
 
 
   OTL_LOCALDEF( OTL_UInt )
@@ -559,7 +561,7 @@
                              OTL_UInt   lookup_index,
                              OTL_UInt   table_index )
   {
-    OTL_Bytes  result = NULL;
+    OTL_Bytes  result = 0;
 
 
     result = otl_lookup_list_get_lookup( table, lookup_index );
@@ -570,6 +572,7 @@
   }
 
 
+#if 0
   OTL_LOCALDEF( void )
   otl_lookup_list_foreach( OTL_Bytes        table,
                            OTL_ForeachFunc  func,
@@ -582,6 +585,7 @@
     for ( ; count > 0; count-- )
       func( table + OTL_NEXT_USHORT( p ), func_data );
   }
+#endif
 
 
   /*************************************************************************/
@@ -678,7 +682,7 @@
       p     += 4;                       /* skip tag */
       offset = OTL_NEXT_USHORT( p );
 
-      otl_feature_table_validate( table + offset, valid );
+      otl_feature_validate( table + offset, valid );
     }
   }
 
@@ -697,7 +701,7 @@
   otl_feature_list_get_feature( OTL_Bytes  table,
                                 OTL_UInt   idx )
   {
-    OTL_Bytes  p, result = NULL;
+    OTL_Bytes  p, result = 0;
     OTL_UInt   count;
 
 
@@ -714,6 +718,7 @@
   }
 
 
+#if 0
   OTL_LOCALDEF( void )
   otl_feature_list_foreach( OTL_Bytes        table,
                             OTL_ForeachFunc  func,
@@ -729,6 +734,7 @@
     for ( ; count > 0; count-- )
       func( table + OTL_NEXT_USHORT( p ), func_data );
   }
+#endif
 
 
   /*************************************************************************/
@@ -824,7 +830,7 @@
   otl_script_validate( OTL_Bytes      table,
                        OTL_Validator  valid )
   {
-    OTL_UInt   default_lang;
+    OTL_UInt   default_lang, num_langs;
     OTL_Bytes  p = table;
 
 
@@ -880,7 +886,7 @@
       p     += 4;                       /* skip tag */
       offset = OTL_NEXT_USHORT( p );
 
-      otl_script_table_validate( list + offset, valid );
+      otl_script_validate( list + offset, valid );
     }
   }
 
diff --git a/src/otlayout/otlcommn.h b/src/otlayout/otlcommn.h
index 25914fb..fda6144 100644
--- a/src/otlayout/otlcommn.h
+++ b/src/otlayout/otlcommn.h
@@ -126,10 +126,12 @@ OTL_BEGIN_HEADER
   /*************************************************************************/
   /*************************************************************************/
 
+#if 0
   /* validate lookup list */
   OTL_LOCALDEF( void )
   otl_lookup_list_validate( OTL_Bytes      table,
                             OTL_Validator  valid );
+#endif
 
   /* return number of lookups in list */
   OTL_LOCALDEF( OTL_UInt )
@@ -146,11 +148,13 @@ OTL_BEGIN_HEADER
                              OTL_UInt   lookup_index,
                              OTL_UInt   table_index );
 
+#if 0
   /* iterate over lookup list */
   OTL_LOCALDEF( void )
   otl_lookup_list_foreach( OTL_Bytes        table,
                            OTL_ForeachFunc  func,
                            OTL_Pointer      func_data );
+#endif
 
 
   /*************************************************************************/
@@ -202,11 +206,13 @@ OTL_BEGIN_HEADER
   otl_feature_list_get_feature( OTL_Bytes  table,
                                 OTL_UInt   idx );
 
+#if 0
   /* iterate over all features in a list */
   OTL_LOCALDEF( void )
   otl_feature_list_foreach( OTL_Bytes        table,
                             OTL_ForeachFunc  func,
                             OTL_Pointer      func_data );
+#endif
 
 
   /*************************************************************************/
diff --git a/src/otlayout/otlgdef.c b/src/otlayout/otlgdef.c
index ff1c2a1..4cce841 100644
--- a/src/otlayout/otlgdef.c
+++ b/src/otlayout/otlgdef.c
@@ -47,7 +47,7 @@
       OTL_INVALID_TOO_SHORT;
 
     for ( ; count > 0; count-- )
-      otl_attach_point_validate( table + OTL_NEXT_USHORT( p ) );
+      otl_attach_point_validate( table + OTL_NEXT_USHORT( p ), valid );
   }
 
 
@@ -64,6 +64,7 @@
                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
+    OTL_Int   format;
 
     if ( p + 4 > valid->limit )
       OTL_INVALID_TOO_SHORT;
@@ -83,7 +84,7 @@
           if ( p + 2 > valid->limit )
             OTL_INVALID_TOO_SHORT;
 
-          otl_device_table_validate( table + OTL_PEEK_USHORT( p ) );
+          otl_device_table_validate( table + OTL_PEEK_USHORT( p ), valid );
         }
         break;
 
@@ -109,7 +110,7 @@
       OTL_INVALID_TOO_SHORT;
 
     for ( ; count > 0; count-- )
-      otl_caret_value_validate( table + OTL_NEXT_USHORT( p ) );
+      otl_caret_value_validate( table + OTL_NEXT_USHORT( p ), valid );
   }
 
 
@@ -135,7 +136,7 @@
       OTL_INVALID_TOO_SHORT;
 
     for ( ; count > 0; count-- )
-      otl_ligature_glyph_validate( table + OTL_NEXT_USHORT( p ) );
+      otl_ligature_glyph_validate( table + OTL_NEXT_USHORT( p ), valid );
   }
 
 
@@ -161,15 +162,14 @@
       OTL_INVALID_FORMAT;
 
     /* validate class definition table */
-    otl_class_definition_validate( table + OTL_NEXT_USHORT( p ) );
+    otl_class_definition_validate( table + OTL_NEXT_USHORT( p ), valid );
 
     /* validate attachment point list */
-    otl_attach_list_validate( table + OTL_NEXT_USHORT( p ) );
+    otl_attach_list_validate( table + OTL_NEXT_USHORT( p ), valid );
 
     /* validate ligature caret list */
-    otl_ligature_caret_list_validate( table + OTL_NEXT_USHORT( p ) );
+    otl_ligature_caret_list_validate( table + OTL_NEXT_USHORT( p ), valid );
 
     /* validate mark attach class */
-    otl_class_definition_validate( table + OTL_NEXT_USHORT( p ) );
+    otl_class_definition_validate( table + OTL_NEXT_USHORT( p ), valid );
   }
-
diff --git a/src/otlayout/otlgdef.h b/src/otlayout/otlgdef.h
index 5046cc4..f296cee 100644
--- a/src/otlayout/otlgdef.h
+++ b/src/otlayout/otlgdef.h
@@ -6,8 +6,8 @@
 OTL_BEGIN_HEADER
 
   OTL_API( void )
-  otl_gdef_validate( OTL_Bytes  table,
-                     OTL_Valid  valid );
+  otl_gdef_validate( OTL_Bytes      table,
+                     OTL_Validator  valid );
 
 OTL_END_HEADER
 
diff --git a/src/otlayout/otlgpos.c b/src/otlayout/otlgpos.c
index 01942d7..99ae819 100644
--- a/src/otlayout/otlgpos.c
+++ b/src/otlayout/otlgpos.c
@@ -16,7 +16,7 @@
   static OTL_UInt
   otl_value_length( OTL_UInt  format )
   {
-    FT_UInt  count;
+    OTL_UInt  count;
 
     count = (( format & 0xAA ) >> 1) + ( format & 0x55 );
     count = (( count  & 0xCC ) >> 2) + ( count  & 0x33 );
@@ -161,7 +161,7 @@
     {
       case 1:
         {
-          FT_UInt  coverage, value_format;
+          OTL_UInt  coverage, value_format;
 
           OTL_CHECK( 4 );
           coverage     = OTL_NEXT_USHORT( p );
@@ -174,7 +174,7 @@
 
       case 2:
         {
-          FT_UInt  coverage, value_format, count, len;
+          OTL_UInt  coverage, value_format, count, len;
 
           OTL_CHECK( 6 );
           coverage     = OTL_NEXT_USHORT( p );
@@ -207,11 +207,12 @@
  /************************************************************************/
  /************************************************************************/
 
-  static otl_gpos_pairset_validate( OTL_Bytes      table,
-                                    OTL_Bytes      pos_table,
-                                    OTL_UInt       format1,
-                                    OTL_UInt       format2,
-                                    OTL_Validator  valid )
+  static void
+  otl_gpos_pairset_validate( OTL_Bytes      table,
+                             OTL_Bytes      pos_table,
+                             OTL_UInt       format1,
+                             OTL_UInt       format2,
+                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
     OTL_UInt   len1, len2, count;
@@ -314,8 +315,8 @@
  /************************************************************************/
 
   static void
-  otl_gpos_lookup3_validate( OTL_Bytes  table,
-                             OTL_Valid  valid )
+  otl_gpos_lookup3_validate( OTL_Bytes      table,
+                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
     OTL_UInt   format;
@@ -377,13 +378,13 @@
     OTL_CHECK( count*class_count*2 );
     for ( ; count > 0; count-- )
       for ( count2 = class_count; count2 > 0; count2-- )
-        otl_anchor_validate( table + OTL_NEXT_USHORT( p ) );
+        otl_anchor_validate( table + OTL_NEXT_USHORT( p ), valid );
   }
 
 
   static void
-  otl_gpos_lookup4_validate( OTL_Bytes  table,
-                             OTL_Valid  valid )
+  otl_gpos_lookup4_validate( OTL_Bytes      table,
+                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
     OTL_UInt   format;
@@ -456,13 +457,14 @@
 
     OTL_CHECK( count*2 );
     for ( ; count > 0; count-- )
-      otl_liga_attach_validate( table + OTL_NEXT_USHORT( p ), valid );
+      otl_liga_attach_validate( table + OTL_NEXT_USHORT( p ),
+                                class_count, valid );
   }
 
 
   static void
-  otl_gpos_lookup5_validate( OTL_Bytes  table,
-                             OTL_Valid  valid )
+  otl_gpos_lookup5_validate( OTL_Bytes      table,
+                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
     OTL_UInt   format;
@@ -473,8 +475,8 @@
     {
       case 1:
         {
-          OTL_UInt  mark_coverage, lig_coverage, class_count;
-          OTL_UInt  mar_array, lig_array;
+          OTL_UInt  mark_coverage, liga_coverage, class_count;
+          OTL_UInt  mark_array, liga_array;
 
           OTL_CHECK( 10 );
           mark_coverage = OTL_NEXT_USHORT( p );
@@ -524,8 +526,8 @@
 
 
   static void
-  otl_gpos_lookup6_validate( OTL_Bytes  table,
-                             OTL_Valid  valid )
+  otl_gpos_lookup6_validate( OTL_Bytes      table,
+                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
     OTL_UInt   format;
@@ -549,7 +551,7 @@
           otl_coverage_validate( table + coverage2, valid );
 
           otl_mark_array_validate( table + array1, valid );
-          otl_mark2_array_validate( table + array2, valid );
+          otl_mark2_array_validate( table + array2, class_count, valid );
         }
         break;
 
@@ -680,8 +682,10 @@
           otl_class_definition_validate( table + class_def, valid );
 
           OTL_CHECK( count*2 );
+#if 0 /* XXX */
           for ( ; count > 0; count-- )
             otl_
+#endif
         }
         break;
 
@@ -694,7 +698,7 @@
           pos_count   = OTL_NEXT_USHORT( p );
 
           OTL_CHECK( glyph_count*2 + pos_count*4 );
-          for ( ; glyph_count > 0; glyph_count )
+          for ( ; glyph_count > 0; glyph_count-- )
             otl_coverage_validate( table + OTL_NEXT_USHORT( p ), valid );
 
           /* XXX: check pos lookups */
@@ -900,8 +904,8 @@
  /************************************************************************/
 
   static void
-  otl_gpos_lookup9_validate( OTL_Bytes  table,
-                             OTL_Valid  valid )
+  otl_gpos_lookup9_validate( OTL_Bytes      table,
+                             OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
     OTL_UInt   format;
@@ -977,4 +981,3 @@
     otl_lookup_list_validate( table + lookups, 9, otl_gpos_validate_funcs,
                               valid );
   }
-  
\ No newline at end of file
diff --git a/src/otlayout/otlgsub.c b/src/otlayout/otlgsub.c
index 13a8eae..cbe35fb 100644
--- a/src/otlayout/otlgsub.c
+++ b/src/otlayout/otlgsub.c
@@ -1,5 +1,10 @@
 #include "otlgsub.h"
 #include "otlcommn.h"
+#include "otlparse.h"
+
+ /* forward declaration */
+  static OTL_ValidateFunc  otl_gsub_validate_funcs[];
+
 
  /************************************************************************/
  /************************************************************************/
@@ -92,12 +97,13 @@
 
     gindex = otl_parser_get_gindex( parser );
 
-    if ( !otl_parser_check_property( parser, gindex, &property ) )
+    otl_parser_check_property( parser, gindex, &property );
+    if ( parser->error )
       goto Exit;
 
     format   = OTL_NEXT_USHORT(p);
     coverage = table + OTL_NEXT_USHORT(p);
-    index    = otl_coverage_lookup( coverage, gindex );
+    index    = otl_coverage_get_index( coverage, gindex );
 
     if ( index >= 0 )
     {
@@ -219,22 +225,22 @@
   {
     OTL_Bytes  p = table;
     OTL_Bytes  coverage, sequence;
-    OTL_UInt   format, gindex, index, property;
-    OTL_Int    index;
+    OTL_UInt   format, gindex, index, property, context_len, seq_count, count;
     OTL_Bool   subst = 0;
 
-    if ( context_len != 0xFFFFU && context_len < 1 )
+    if ( parser->context_len != 0xFFFFU && parser->context_len < 1 )
       goto Exit;
 
     gindex = otl_parser_get_gindex( parser );
 
-    if ( !otl_parser_check_property( parser, gindex, &property ) )
+    otl_parser_check_property( parser, gindex, &property );
+    if ( parser->error )
       goto Exit;
 
     p        += 2;  /* skip format */
     coverage  = table + OTL_NEXT_USHORT(p);
     seq_count = OTL_NEXT_USHORT(p);
-    index     = otl_coverage_lookup( coverage, gindex );
+    index     = otl_coverage_get_index( coverage, gindex );
 
     if ( (OTL_UInt) index >= seq_count )
       goto Exit;
@@ -335,27 +341,27 @@
   {
     OTL_Bytes  p = table;
     OTL_Bytes  coverage, alternates;
-    OTL_UInt   format, gindex, index, property;
-    OTL_Int    index;
+    OTL_UInt   format, gindex, index, property, seq_count, count;
     OTL_Bool   subst = 0;
 
     OTL_GSUB_Alternate  alternate = parser->alternate;
 
-    if ( context_len != 0xFFFFU && context_len < 1 )
+    if ( parser->context_len != 0xFFFFU && parser->context_len < 1 )
       goto Exit;
 
-    if ( alternate == NULL )
+    if ( alternate == 0 )
       goto Exit;
 
     gindex = otl_parser_get_gindex( parser );
 
-    if ( !otl_parser_check_property( parser, gindex, &property ) )
+    otl_parser_check_property( parser, gindex, &property );
+    if ( parser->error )
       goto Exit;
 
     p        += 2;  /* skip format */
     coverage  = table + OTL_NEXT_USHORT(p);
     seq_count = OTL_NEXT_USHORT(p);
-    index     = otl_coverage_lookup( coverage, gindex );
+    index     = otl_coverage_get_index( coverage, gindex );
 
     if ( (OTL_UInt) index >= seq_count )
       goto Exit;
@@ -387,7 +393,8 @@
   otl_ligature_validate( OTL_Bytes      table,
                          OTL_Validator  valid )
   {
-    OTL_UInt  glyph_id, count;
+    OTL_Bytes  p = table;
+    OTL_UInt   glyph_id, count;
 
     OTL_CHECK( 4 );
     glyph_id = OTL_NEXT_USHORT( p );
@@ -473,7 +480,7 @@
     if ( glyph_count == 0 )
       OTL_INVALID_DATA;
 
-    OTL_CHECK( (glyph_count-1)*2 + substcount*4 );
+    OTL_CHECK( (glyph_count-1)*2 + subst_count*4 );
 
     /* XXX: check glyph indices and subst lookups */
   }
@@ -499,7 +506,8 @@
   otl_sub_class_rule_validate( OTL_Bytes      table,
                                OTL_Validator  valid )
   {
-    OTL_UInt  glyph_count, subst_count;
+    OTL_Bytes  p = table;
+    OTL_UInt   glyph_count, subst_count;
 
     OTL_CHECK( 4 );
     glyph_count = OTL_NEXT_USHORT( p );
@@ -508,7 +516,7 @@
     if ( glyph_count == 0 )
       OTL_INVALID_DATA;
 
-    OTL_CHECK( (glyph_count-1)*2 + substcount*4 );
+    OTL_CHECK( (glyph_count-1)*2 + subst_count*4 );
 
     /* XXX: check glyph indices and subst lookups */
   }
@@ -571,7 +579,7 @@
 
           OTL_CHECK( 2*count );
           for ( ; count > 0; count-- )
-            otl_sub_class_rule_set_validate( table + coveragen valid );
+            otl_sub_class_rule_set_validate( table + coverage, valid );
         }
         break;
 
@@ -745,7 +753,8 @@
 
           OTL_CHECK( 2*count );
           for ( ; count > 0; count-- )
-            otl_chain_sub_class_set( table + OTL_NEXT_USHORT( p ), valid );
+            otl_chain_sub_class_set_validate( table + OTL_NEXT_USHORT( p ),
+                                              valid );
         }
         break;
 
@@ -782,10 +791,11 @@
     }
   }
 
+
  /************************************************************************/
  /************************************************************************/
  /*****                                                              *****/
- /*****                 GSUB LOOKUP TYPE 6                           *****/
+ /*****                 GSUB LOOKUP TYPE 7                           *****/
  /*****                                                              *****/
  /************************************************************************/
  /************************************************************************/
@@ -824,7 +834,7 @@
   }
 
 
-  static const OTL_ValidateFunc  otl_gsub_validate_funcs[ 7 ] =
+  static OTL_ValidateFunc  otl_gsub_validate_funcs[ 7 ] =
   {
     otl_gsub_lookup1_validate,
     otl_gsub_lookup2_validate,
@@ -834,6 +844,7 @@
     otl_gsub_lookup6_validate
   };
 
+
  /************************************************************************/
  /************************************************************************/
  /*****                                                              *****/
diff --git a/src/otlayout/otljstf.c b/src/otlayout/otljstf.c
index b0fa9f4..8e49718 100644
--- a/src/otlayout/otljstf.c
+++ b/src/otlayout/otljstf.c
@@ -69,7 +69,7 @@
                               OTL_Validator  valid )
   {
     OTL_Bytes  p = table;
-    OTL_UInt   offset;
+    OTL_UInt   offset, val;
 
     OTL_CHECK( 20 );
 
@@ -186,4 +186,3 @@
       otl_jstf_script_validate( table + OTL_NEXT_USHORT( p ), valid );
     }
   }
-  
\ No newline at end of file
diff --git a/src/otlayout/otljstf.h b/src/otlayout/otljstf.h
index c8a98a6..33947f8 100644
--- a/src/otlayout/otljstf.h
+++ b/src/otlayout/otljstf.h
@@ -11,4 +11,4 @@ OTL_BEGIN_HEADER
 
 OTL_END_HEADER
 
-#endif /* __OTL_JSTF_H__ */
\ No newline at end of file
+#endif /* __OTL_JSTF_H__ */
diff --git a/src/otlayout/otlparse.c b/src/otlayout/otlparse.c
index 705c0c6..cdc854f 100644
--- a/src/otlayout/otlparse.c
+++ b/src/otlayout/otlparse.c
@@ -1,6 +1,7 @@
 #include "otlparse.h"
 #include "otlutils.h"
 
+
   static void
   otl_string_ensure( OTL_String  string,
                      OTL_UInt    count,
@@ -18,7 +19,7 @@
         new_count += (new_count >> 1) + 16;
 
       if ( OTL_MEM_RENEW_ARRAY( string->glyphs, old_count, new_count ) )
-        otl_parser_error( parser, OTL_Parse_Err_Memory );
+        otl_parser_error( parser, OTL_Err_Parser_Memory );
 
       string->capacity = new_count;
     }
@@ -26,7 +27,7 @@
 
 #define  OTL_STRING_ENSURE(str,count,parser)                   \
            OTL_BEGIN_STMNT                                     \
-             if ( (str)->length + (count) > (str)>capacity )   \
+             if ( (str)->length + (count) > (str)->capacity )  \
                otl_string_ensure( str, count, parser );        \
            OTL_END_STMNT
 
@@ -36,27 +37,24 @@
   {
     OTL_String  in = parser->str_in;
 
-    if ( in->cursor >= in->num_glyphs )
+    if ( in->cursor >= in->length )
       otl_parser_error( parser, OTL_Err_Parser_Internal );
 
-    return in->str[ in->cursor ].gindex;
+    return in->glyphs[ in->cursor ].gindex;
   }
 
 
   OTL_LOCALDEF( void )
   otl_parser_error( OTL_Parser      parser,
-                    OTL_ParseError  error; )
+                    OTL_ParseError  error )
   {
     parser->error = error;
     otl_longjmp( parser->jump_buffer, 1 );
   }
 
-#define  OTL_PARSER_UNCOVERED(x)  otl_parser_error( x, OTL_Parse_Err_UncoveredGlyph );
-
   OTL_LOCAL( void )
   otl_parser_check_property( OTL_Parser  parser,
                              OTL_UInt    gindex,
-                             OTL_UInt    flags,
                              OTL_UInt   *aproperty );
 
   OTL_LOCALDEF( void )
@@ -68,14 +66,14 @@
     OTL_StringGlyph  glyph, in_glyph;
 
     /* sanity check */
-    if ( in == NULL               ||
-         out == NULL              ||
+    if ( in == 0                  ||
+         out == 0                 ||
          in->length == 0          ||
          in->cursor >= in->length )
     {
       /* report as internal error, since these should */
       /* never happen !!                              */
-      otl_parser_error( parser, OTL_Err_Parse_Internal );
+      otl_parser_error( parser, OTL_Err_Parser_Internal );
     }
 
     OTL_STRING_ENSURE( out, 1, parser );
@@ -83,7 +81,7 @@
     in_glyph = in->glyphs  + in->cursor;
 
     glyph->gindex        = gindex;
-    glyph->property      = in_glyph->property;
+    glyph->properties    = in_glyph->properties;
     glyph->lig_component = in_glyph->lig_component;
     glyph->lig_id        = in_glyph->lig_id;
 
@@ -97,37 +95,37 @@
                         OTL_UInt    count,
                         OTL_Bytes   indices )
   {
-    OTL_UInt         lig_component, lig_id, property;
+    OTL_UInt         lig_component, lig_id, properties;
     OTL_String       in  = parser->str_in;
     OTL_String       out = parser->str_out;
     OTL_StringGlyph  glyph, in_glyph;
     OTL_Bytes        p = indices;
 
     /* sanity check */
-    if ( in == NULL               ||
-         out == NULL              ||
+    if ( in == 0                  ||
+         out == 0                 ||
          in->length == 0          ||
          in->cursor >= in->length )
     {
       /* report as internal error, since these should */
       /* never happen !!                              */
-      otl_parser_error( parser, OTL_Err_Parse_Internal );
+      otl_parser_error( parser, OTL_Err_Parser_Internal );
     }
 
     OTL_STRING_ENSURE( out, count, parser );
     glyph    = out->glyphs + out->length;
     in_glyph = in->glyphs  + in->cursor;
 
-    glyph->gindex = gindex;
+    glyph->gindex = in_glyph->gindex;
 
     lig_component = in_glyph->lig_component;
-    lig_id        = in_glyph->lid_id;
-    property      = in_glyph->property;
+    lig_id        = in_glyph->lig_id;
+    properties    = in_glyph->properties;
 
     for ( ; count > 0; count-- )
     {
       glyph->gindex        = OTL_NEXT_USHORT(p);
-      glyph->property      = property;
+      glyph->properties    = properties;
       glyph->lig_component = lig_component;
       glyph->lig_id        = lig_id;
 
@@ -137,6 +135,3 @@
     out->cursor  = out->length;
     in->cursor  += 1;
   }
-
-
-
diff --git a/src/otlayout/otlparse.h b/src/otlayout/otlparse.h
index 92f34bf..1b388ff 100644
--- a/src/otlayout/otlparse.h
+++ b/src/otlayout/otlparse.h
@@ -32,24 +32,24 @@ OTL_BEGIN_HEADER
 
   typedef struct OTL_ParserRec_
   {
-    OTL_Bytes      tab_gdef;
-    OTL_Bytes      tab_gsub;
-    OTL_Bytes      tab_gpos;
-    OTL_Bytes      tab_base;
-    OTL_Bytes      tab_jstf;
+    OTL_Bytes           tab_gdef;
+    OTL_Bytes           tab_gsub;
+    OTL_Bytes           tab_gpos;
+    OTL_Bytes           tab_base;
+    OTL_Bytes           tab_jstf;
 
-    OTL_Alternate  alternate;  /* external alternate handler */
+    OTL_GSUB_Alternate  alternate;  /* external alternate handler */
 
-    OTL_UInt       context_len;
-    OTL_UInt       markup_flags;
+    OTL_UInt            context_len;
+    OTL_UInt            markup_flags;
 
-    OTL_jmp_buf    jump_buffer;
-    OTL_Memory     memory;
-    OTL_Error      error;
+    OTL_jmp_buf         jump_buffer;
+    OTL_Memory          memory;
+    OTL_Error           error;
 
-    OTL_StringRec  strings[2];
-    OTL_String     str_in;
-    OTL_String     str_out;
+    OTL_StringRec       strings[2];
+    OTL_String          str_in;
+    OTL_String          str_out;
 
   } OTL_ParserRec;
 
@@ -57,7 +57,9 @@ OTL_BEGIN_HEADER
   {
     OTL_Err_Parser_Ok = 0,
     OTL_Err_Parser_InvalidData,
-    OTL_Err_Parser_UncoveredGlyph
+    OTL_Err_Parser_UncoveredGlyph,
+    OTL_Err_Parser_Memory,
+    OTL_Err_Parser_Internal,
 
   } OTL_ParseError;
 
@@ -66,7 +68,8 @@ OTL_BEGIN_HEADER
 
 
   OTL_LOCAL( void )
-  otl_parser_error( OTL_Parser  parser, OTL_ParserError  error );
+  otl_parser_error( OTL_Parser      parser,
+                    OTL_ParseError  error );
 
 #define  OTL_PARSER_UNCOVERED(x)  \
            otl_parser_error( x, OTL_Err_Parser_UncoveredGlyph )
@@ -74,7 +77,6 @@ OTL_BEGIN_HEADER
   OTL_LOCAL( void )
   otl_parser_check_property( OTL_Parser  parser,
                              OTL_UInt    gindex,
-                             OTL_UInt    flags,
                              OTL_UInt   *aproperty );
 
  /* copy current input glyph to output */
@@ -96,4 +98,3 @@ OTL_BEGIN_HEADER
 OTL_END_HEADER
 
 #endif /* __OTL_PARSER_H__ */
-
diff --git a/src/otlayout/otltable.h b/src/otlayout/otltable.h
index af7bd78..ccc04b5 100644
--- a/src/otlayout/otltable.h
+++ b/src/otlayout/otltable.h
@@ -38,6 +38,7 @@ OTL_BEGIN_HEADER
   } OTL_TableRec;
 
 
+#if 0
   OTL_API( OTL_Error )
   otl_table_validate( OTL_Bytes      table,
                       OTL_Size       size,
@@ -54,6 +55,7 @@ OTL_BEGIN_HEADER
   otl_table_set_script( OTL_Table      table,
                         OTL_ScriptTag  script,
                         OTL_LangTag    language );
+#endif
 
 OTL_END_HEADER
 
diff --git a/src/otlayout/otltags.h b/src/otlayout/otltags.h
index d954b58..a51630c 100644
--- a/src/otlayout/otltags.h
+++ b/src/otlayout/otltags.h
@@ -85,4 +85,3 @@ OTL_SCRIPT_TAG( 'y','i',' ',' ', "Yi", YI )
 #endif
 
 #undef OTL_FEATURE_TAG
-
diff --git a/src/otlayout/otlutils.h b/src/otlayout/otlutils.h
index de50f66..9ac2ba1 100644
--- a/src/otlayout/otlutils.h
+++ b/src/otlayout/otlutils.h
@@ -22,7 +22,7 @@ OTL_BEGIN_HEADER
 
 #define  OTL_MEM_ALLOC(p,s)       otl_mem_alloc( (void**)&(p), (s), memory )
 #define  OTL_MEM_FREE(p)          otl_mem_free( (void**)&(p), memory )
-#define  OTL_MEM_REALLOC(p,c,n)   otl_mem_realloc( (void**)&(p), (c), (s), memory )
+#define  OTL_MEM_REALLOC(p,c,s)   otl_mem_realloc( (void**)&(p), (c), (s), memory )
 
 #define  OTL_MEM_NEW(p)   OTL_MEM_ALLOC(p,sizeof(*(p)))
 #define  OTL_MEM_NEW_ARRAY(p,c)  OTL_MEM_ALLOC(p,(c)*sizeof(*(p)))