Commit 99aa14c226abb6ee6130cc7ef91cb97695dc49cc

Werner Lemberg 2005-09-05T19:31:27

Fixes for `make multi' and using C++ compiler. * gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset, gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte, gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF. (gxv_compare_ranges): Make it static. (gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate, gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate, gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve trace messages. (gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/. (GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE, GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to gxvcommn.h. * gxvalid/gxvcommn.h: Add prototypes for gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup, gxv_XStateTable_validate, gxv_array_getlimits_byte, gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset, gxv_set_length_by_ulong_offset, gxv_odtect_add_range, gxv_odtect_validate. (GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE, GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from gxvcommn.c. * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate, gxv_bsln_parts_fmt1_validate): Improve trace messages. * gxvalid/gxvfeat.c: Split off predefined registry stuff to... * gxvalid/gxvfeat.h: New file. * gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace message. * gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN. (gxv_kern_subtable_fmt1_valueTable_load, gxv_kern_subtable_fmt1_subtable_setup, gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors. (gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN. Improve trace message. (gxv_kern_validate_generic): Fix C++ compiler error. Improve trace message. (gxv_kern_validate_classic): Fix C++ compiler error. * gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmort1.c (gxv_mort_subtable_type1_substitutionTable_load, gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors. (gxv_mort_subtable_type1_substTable_validate): Improve trace message. (gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load, gxv_mort_subtable_type2_subtable_setup, gxv_mort_subtable_type2_ligActionOffset_validate, gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler errors. (gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup, gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler errors. (gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmort.c: Include gxvfeat.h. (gxv_mort_featurearray_validate, gxv_mort_coverage_validate): Declare with FT_LOCAL_DEF. (gxv_mort_subtables_validate, gxv_mort_validate): Improve trace messages. * gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove. * gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmorx1.c (gxv_morx_subtable_type1_substitutionTable_load, gxv_morx_subtable_type1_subtable_setup, gxv_morx_subtable_type1_entry_validate, gxv_morx_subtable_type1_substitutionTable_validate): Fix C++ compiler errors. (gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load, gxv_morx_subtable_type2_subtable_setup, gxv_morx_subtable_type2_ligActionIndex_validate, gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler errors. (gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF. Fix typo. * gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load, gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error. (gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF. * gxvalid/gxvmorx.c (gxv_morx_subtables_validate, gxv_morx_validate): Improve trace message. * gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler warnings. (gxv_opbd_validate): Improve trace message. * gxvalid/gxvprop.c: Decorate constants with `U' and `L' where appropriate. (gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace message. * gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused parameter. Update all callers. (gxv_trak_validate): Improve trace message. * rules.mk (GXV_DRV_H): Add gxvfeat.h.

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
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
diff --git a/ChangeLog b/ChangeLog
index dee79ad..ac2fbe3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,126 @@
+2005-09-05  Werner Lemberg  <wl@gnu.org>
+
+	Fixes for `make multi' and using C++ compiler.
+
+	* gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
+	gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
+	gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
+	(gxv_compare_ranges): Make it static.
+	(gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
+	gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
+	gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
+	trace messages.
+	(gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
+	(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
+	GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
+	gxvcommn.h.
+
+	* gxvalid/gxvcommn.h: Add prototypes for
+	gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
+	gxv_XStateTable_validate, gxv_array_getlimits_byte,
+	gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
+	gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
+	gxv_odtect_validate.
+	(GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
+	GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
+	gxvcommn.c.
+
+	* src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
+	gxv_bsln_parts_fmt1_validate): Improve trace messages.
+
+	* gxvalid/gxvfeat.c: Split off predefined registry stuff to...
+	* gxvalid/gxvfeat.h: New file.
+
+	* gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
+	message.
+
+	* gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
+	(gxv_kern_subtable_fmt1_valueTable_load,
+	gxv_kern_subtable_fmt1_subtable_setup,
+	gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
+	(gxv_kern_coverage_validate): Use KERN_DIALECT_UNKWOWN.
+	Improve trace message.
+	(gxv_kern_validate_generic): Fix C++ compiler error.
+	Improve trace message.
+	(gxv_kern_validate_classic): Fix C++ compiler error.
+
+	* gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
+	with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmort1.c
+	(gxv_mort_subtable_type1_substitutionTable_load,
+	gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
+	(gxv_mort_subtable_type1_substTable_validate): Improve trace
+	message.
+	(gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
+	gxv_mort_subtable_type2_subtable_setup,
+	gxv_mort_subtable_type2_ligActionOffset_validate,
+	gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
+	errors.
+	(gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
+	with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
+	gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
+	errors.
+	(gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmort.c: Include gxvfeat.h.
+	(gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
+	Declare with FT_LOCAL_DEF.
+	(gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
+	messages.
+
+	* gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
+
+	* gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
+	with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmorx1.c
+	(gxv_morx_subtable_type1_substitutionTable_load,
+	gxv_morx_subtable_type1_subtable_setup,
+	gxv_morx_subtable_type1_entry_validate,
+	gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
+	compiler errors.
+	(gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
+	gxv_morx_subtable_type2_subtable_setup,
+	gxv_morx_subtable_type2_ligActionIndex_validate,
+	gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
+	errors.
+	(gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
+	Fix typo.
+
+	* gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
+	with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
+	gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
+	(gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
+
+	* gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
+	gxv_morx_validate): Improve trace message.
+
+	* gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
+	warnings.
+	(gxv_opbd_validate): Improve trace message.
+
+	* gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
+	appropriate.
+	(gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
+	message.
+
+	* gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
+	parameter.  Update all callers.
+	(gxv_trak_validate): Improve trace message.
+
+	* rules.mk (GXV_DRV_H): Add gxvfeat.h.
+
 2005-09-01  Werner Lemberg  <wl@gnu.org>
 
 	* src/gxvalid/gxvbsln.c (GXV_BSLN_VALUE_EMPTY): Add `U'.
@@ -8,7 +131,7 @@
 
 	* src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
 	src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx4.c,
-	src/gxvalid/gxvmorx5.c, src/gxvalid/gxvmort.c: Improve tracing
+	src/gxvalid/gxvmorx5.c, src/gxvalid/gxvmort.c: Improve trace
 	messages.
 	Decorate constants with `U' and `L' where appropriate.
 	Fix compiler warnings.
@@ -17,7 +140,7 @@
 
 	* src/truetype/ttgload.c (load_truetype_glyph): Fix typo.
 
-	* src/gxvalid/gxvbsln.c (gxv_bsln_validate): Fix tracing message.
+	* src/gxvalid/gxvbsln.c (gxv_bsln_validate): Fix trace message.
 
 	* src/gxvalid/gxvcommn.c (gxv_odtect_add_range): Use `const'.
 
@@ -25,7 +148,7 @@
 	src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmod.c,
 	src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
 	src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
-	src/gxvalid/gxvmort5.c, src/gxvalid/gxvmort.c: Improve tracing
+	src/gxvalid/gxvmort5.c, src/gxvalid/gxvmort.c: Improve trace
 	messages.
 	Decorate constants with `U' and `L' where appropriate.
 	Fix compiler warnings.
@@ -37,7 +160,7 @@
 	* src/gxvalid/gxvcommn.c: Fix compiler warnings.
 	(gxv_XEntryTable_validate, gxv_compare_ranges): Remove unused
 	parameter.  Update all callers.
-	Improve tracing messages.
+	Improve trace messages.
 	Some formatting.
 
 2005-08-29  Werner Lemberg  <wl@gnu.org>
diff --git a/src/gxvalid/gxvbsln.c b/src/gxvalid/gxvbsln.c
index 5a6389f..c330138 100644
--- a/src/gxvalid/gxvbsln.c
+++ b/src/gxvalid/gxvbsln.c
@@ -80,7 +80,7 @@
     FT_UNUSED( glyph );
 
 
-    GXV_NAME_ENTER( " lookup value" );
+    GXV_NAME_ENTER( "lookup value" );
 
     if ( v >= GXV_BSLN_VALUE_COUNT )
       FT_INVALID_DATA;
@@ -171,7 +171,7 @@
     FT_Bytes  p = tables;
 
 
-    GXV_NAME_ENTER( " parts format 1" );
+    GXV_NAME_ENTER( "parts format 1" );
 
     /* deltas */
     gxv_bsln_parts_fmt0_validate( p, limit, valid );
diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c
index 5e0b6f3..c7bdfd1 100644
--- a/src/gxvalid/gxvcommn.c
+++ b/src/gxvalid/gxvcommn.c
@@ -58,13 +58,13 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_set_length_by_ushort_offset( FT_UShort*     offset,
                                    FT_UShort**    length,
                                    FT_UShort*     buff,
                                    FT_UInt        nmemb,
                                    FT_UShort      limit,
-                                   GXV_Validator  valid)
+                                   GXV_Validator  valid )
   {
     FT_UInt  i;
 
@@ -123,7 +123,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_set_length_by_ulong_offset( FT_ULong*      offset,
                                   FT_ULong**     length,
                                   FT_ULong*      buff,
@@ -176,7 +176,7 @@
   /*************************************************************************/
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_array_getlimits_byte( FT_Bytes       table,
                             FT_Bytes       limit,
                             FT_Byte*       min,
@@ -205,7 +205,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_array_getlimits_ushort( FT_Bytes       table,
                               FT_Bytes       limit,
                               FT_UShort*     min,
@@ -430,7 +430,7 @@
     GXV_LookupValueDesc  value;
 
 
-    GXV_NAME_ENTER( " LookupTable format 0" );
+    GXV_NAME_ENTER( "LookupTable format 0" );
 
     GXV_LIMIT_CHECK( 2 * valid->face->num_glyphs );
 
@@ -507,7 +507,7 @@
     GXV_LookupValueDesc  value;
 
 
-    GXV_NAME_ENTER( " LookupTable format 2" );
+    GXV_NAME_ENTER( "LookupTable format 2" );
 
     unitSize = nUnits = 0;
     gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid );
@@ -581,7 +581,7 @@
     GXV_LookupValueDesc  value;
 
 
-    GXV_NAME_ENTER( " LookupTable format 4" );
+    GXV_NAME_ENTER( "LookupTable format 4" );
 
     unitSize = nUnits = 0;
     gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid );
@@ -678,7 +678,7 @@
     GXV_LookupValueDesc  value;
 
 
-    GXV_NAME_ENTER( " LookupTable format 6" );
+    GXV_NAME_ENTER( "LookupTable format 6" );
 
     unitSize = nUnits = 0;
     gxv_BinSrchHeader_validate( p, limit, &unitSize, &nUnits, valid );
@@ -731,7 +731,7 @@
     FT_UShort             glyphCount;
 
 
-    GXV_NAME_ENTER( " LookupTable format 8" );
+    GXV_NAME_ENTER( "LookupTable format 8" );
 
     /* firstGlyph + glyphCount */
     GXV_LIMIT_CHECK( 2 + 2 );
@@ -778,7 +778,7 @@
     GXV_Validate_Func  func;
 
 
-    GXV_NAME_ENTER(" LookupTable" );
+    GXV_NAME_ENTER( "LookupTable" );
 
     /* lookuptbl_head may be used in fmt4 transit function. */
     valid->lookuptbl_head = table;
@@ -1028,7 +1028,7 @@
   {
     FT_Bytes  p = table;
     FT_Bytes  limit = table + *length_p;
-    FT_Byte   class;
+    FT_Byte   clazz;
     FT_Byte   entry;
 
 
@@ -1050,7 +1050,7 @@
     while ( p + ( 1 + maxClassID ) <= limit )
     {
       (*maxState_p)++;
-      for ( class = 0; class <= maxClassID; class++ )
+      for ( clazz = 0; clazz <= maxClassID; clazz++ )
       {
         entry = FT_NEXT_BYTE( p );
         *maxEntry_p = FT_MAX( *maxEntry_p, entry );
@@ -1220,9 +1220,6 @@
     FT_UShort   stateArray;     /* offset to StateArray */
     FT_UShort   entryTable;     /* offset to EntryTable */
 
-#define GXV_STATETABLE_HEADER_SIZE  ( 2 + 2 + 2 + 2 )
-#define GXV_STATEHEADER_SIZE        GXV_STATETABLE_HEADER_SIZE
-
     FT_UShort   classTable_length;
     FT_UShort   stateArray_length;
     FT_UShort   entryTable_length;
@@ -1416,7 +1413,7 @@
   {
     FT_Bytes   p = table;
     FT_Bytes   limit = table + *length_p;
-    FT_UShort  class;
+    FT_UShort  clazz;
     FT_UShort  entry;
 
 
@@ -1438,7 +1435,7 @@
     while ( p + ( ( 1 + maxClassID ) * 2 ) <= limit )
     {
       (*maxState_p)++;
-      for ( class = 0; class <= maxClassID; class++ )
+      for ( clazz = 0; clazz <= maxClassID; clazz++ )
       {
         entry = FT_NEXT_USHORT( p );
         *maxEntry_p = FT_MAX( *maxEntry_p, entry );
@@ -1564,9 +1561,6 @@
     FT_ULong   stateArray;      /* offset to StateArray */
     FT_ULong   entryTable;      /* offset to EntryTable */
 
-#define GXV_XSTATETABLE_HEADER_SIZE  ( 4 + 4 + 4 + 4 )
-#define GXV_XSTATEHEADER_SIZE        GXV_XSTATETABLE_HEADER_SIZE
-
     FT_ULong   classTable_length;
     FT_ULong   stateArray_length;
     FT_ULong   entryTable_length;
@@ -1669,7 +1663,7 @@
   /*************************************************************************/
   /*************************************************************************/
 
-  FT_LOCAL_DEF( int )
+  static int
   gxv_compare_ranges( FT_Bytes  table1_start,
                       FT_ULong  table1_length,
                       FT_Bytes  table2_start,
@@ -1712,7 +1706,7 @@
 
   FT_LOCAL_DEF( void )
   gxv_odtect_validate( GXV_odtect_Range  odtect,
-                       GXV_Validator     valid   )
+                       GXV_Validator     valid )
   {
     FT_UInt  i, j;
 
diff --git a/src/gxvalid/gxvcommn.h b/src/gxvalid/gxvcommn.h
index 3b83c00..14fef98 100644
--- a/src/gxvalid/gxvcommn.h
+++ b/src/gxvalid/gxvcommn.h
@@ -410,19 +410,75 @@ FT_BEGIN_HEADER
   /*************************************************************************/
 
   FT_LOCAL( void )
+  gxv_StateTable_subtable_setup( FT_UShort      table_size,
+                                 FT_UShort      classTable,
+                                 FT_UShort      stateArray,
+                                 FT_UShort      entryTable,
+                                 FT_UShort*     classTable_length_p,
+                                 FT_UShort*     stateArray_length_p,
+                                 FT_UShort*     entryTable_length_p,
+                                 GXV_Validator  valid );
+
+  FT_LOCAL( void )
+  gxv_XStateTable_subtable_setup( FT_ULong       table_size,
+                                  FT_ULong       classTable,
+                                  FT_ULong       stateArray,
+                                  FT_ULong       entryTable,
+                                  FT_ULong*      classTable_length_p,
+                                  FT_ULong*      stateArray_length_p,
+                                  FT_ULong*      entryTable_length_p,
+                                  GXV_Validator  valid );
+
+  FT_LOCAL( void )
   gxv_StateTable_validate( FT_Bytes       table,
                            FT_Bytes       limit,
                            GXV_Validator  valid );
 
+  FT_LOCAL( void )
+  gxv_XStateTable_validate( FT_Bytes       table,
+                            FT_Bytes       limit,
+                            GXV_Validator  valid );
+
 
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
-  /*****                         UTILITY MACRO                         *****/
+  /*****                 UTILITY MACROS AND FUNCTIONS                  *****/
   /*****                                                               *****/
   /*************************************************************************/
   /*************************************************************************/
 
+  FT_LOCAL( void )
+  gxv_array_getlimits_byte( FT_Bytes       table,
+                            FT_Bytes       limit,
+                            FT_Byte*       min,
+                            FT_Byte*       max,
+                            GXV_Validator  valid );
+
+  FT_LOCAL( void )
+  gxv_array_getlimits_ushort( FT_Bytes       table,
+                              FT_Bytes       limit,
+                              FT_UShort*     min,
+                              FT_UShort*     max,
+                              GXV_Validator  valid );
+
+  FT_LOCAL( void )
+  gxv_set_length_by_ushort_offset( FT_UShort*     offset,
+                                   FT_UShort**    length,
+                                   FT_UShort*     buff,
+                                   FT_UInt        nmemb,
+                                   FT_UShort      limit,
+                                   GXV_Validator  valid );
+
+  FT_LOCAL( void )
+  gxv_set_length_by_ulong_offset( FT_ULong*      offset,
+                                  FT_ULong**     length,
+                                  FT_ULong*      buff,
+                                  FT_UInt        nmemb,
+                                  FT_ULong       limit,
+                                  GXV_Validator  valid);
+
+
 #define GXV_SUBTABLE_OFFSET_CHECK( _offset )          \
           FT_BEGIN_STMNT                              \
             if ( (_offset) > valid->subtable_length ) \
@@ -439,6 +495,12 @@ FT_BEGIN_HEADER
 #define GXV_USHORT_TO_SHORT( _us )                                    \
           ( ( 0x8000U < ( _us ) ) ? ( ( _us ) - 0x8000U ) : ( _us ) )
 
+#define GXV_STATETABLE_HEADER_SIZE  ( 2 + 2 + 2 + 2 )
+#define GXV_STATEHEADER_SIZE        GXV_STATETABLE_HEADER_SIZE
+
+#define GXV_XSTATETABLE_HEADER_SIZE  ( 4 + 4 + 4 + 4 )
+#define GXV_XSTATEHEADER_SIZE        GXV_XSTATETABLE_HEADER_SIZE
+
 
   /*************************************************************************/
   /*************************************************************************/
@@ -464,6 +526,17 @@ FT_BEGIN_HEADER
   } GXV_odtect_RangeRec, *GXV_odtect_Range;
 
 
+  FT_LOCAL( void )
+  gxv_odtect_add_range( FT_Bytes          start,
+                        FT_ULong          length,
+                        const FT_String*  name,
+                        GXV_odtect_Range  odtect );
+
+  FT_LOCAL( void )
+  gxv_odtect_validate( GXV_odtect_Range  odtect,
+                       GXV_Validator     valid );
+
+
 #define GXV_ODTECT( n, odtect )                              \
           GXV_odtect_DataRec   odtect ## _range[n];          \
           GXV_odtect_RangeRec  odtect ## _rec = { 0, NULL }; \
diff --git a/src/gxvalid/gxvfeat.c b/src/gxvalid/gxvfeat.c
index ceeff9f..05e784b 100644
--- a/src/gxvalid/gxvfeat.c
+++ b/src/gxvalid/gxvfeat.c
@@ -26,6 +26,7 @@
 
 #include "gxvalid.h"
 #include "gxvcommn.h"
+#include "gxvfeat.h"
 
 
   /*************************************************************************/
@@ -41,140 +42,6 @@
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
-  /*****                Registry predefined by Apple                   *****/
-  /*****                                                               *****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /* TODO: More compact format */
-  typedef struct  GXV_Feature_RegistryRec_
-  {
-    FT_Bool  existence;
-    FT_Bool  apple_reserved;
-    FT_Bool  exclusive;
-    FT_Byte  nSettings;
-
-  } GX_Feature_RegistryRec;
-
-
-#define gxv_feat_registry_length                  \
-          ( sizeof ( gxv_feat_registry ) /        \
-              sizeof ( GX_Feature_RegistryRec ) )
-
-
-  static GX_Feature_RegistryRec  gxv_feat_registry[] =
-  {
-    /* Generated from gxvfgen.c */
-    {1, 0, 0,  1},   /* All Typographic Features */
-    {1, 0, 0,  8},   /* Ligatures */
-    {1, 0, 1,  3},   /* Cursive Connection */
-    {1, 0, 1,  6},   /* Letter Case */
-    {1, 0, 0,  1},   /* Vertical Substitution */
-    {1, 0, 0,  1},   /* Linguistic Rearrangement */
-    {1, 0, 1,  2},   /* Number Spacing */
-    {1, 1, 0,  0},   /* Apple Reserved 1 */
-    {1, 0, 0,  5},   /* Smart Swashes */
-    {1, 0, 1,  3},   /* Diacritics */
-    {1, 0, 1,  4},   /* Vertical Position */
-    {1, 0, 1,  3},   /* Fractions */
-    {1, 1, 0,  0},   /* Apple Reserved 2 */
-    {1, 0, 0,  1},   /* Overlapping Characters */
-    {1, 0, 0,  6},   /* Typographic Extras */
-    {1, 0, 0,  5},   /* Mathematical Extras */
-    {1, 0, 1,  7},   /* Ornament Sets */
-    {1, 0, 1,  1},   /* Character Alternatives */
-    {1, 0, 1,  5},   /* Design Complexity */
-    {1, 0, 1,  6},   /* Style Options */
-    {1, 0, 1, 11},   /* Character Shape */
-    {1, 0, 1,  2},   /* Number Case */
-    {1, 0, 1,  4},   /* Text Spacing */
-    {1, 0, 1, 10},   /* Transliteration */
-    {1, 0, 1,  9},   /* Annotation */
-    {1, 0, 1,  2},   /* Kana Spacing */
-    {1, 0, 1,  2},   /* Ideographic Spacing */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {0, 0, 0,  0},   /* __EMPTY__ */
-    {1, 0, 1,  4},   /* Text Spacing */
-    {1, 0, 1,  2},   /* Kana Spacing */
-    {1, 0, 1,  2},   /* Ideographic Spacing */
-    {1, 0, 1,  4},   /* CJK Roman Spacing */
-  };
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*****                                                               *****/
   /*****                      Data and Types                           *****/
   /*****                                                               *****/
   /*************************************************************************/
diff --git a/src/gxvalid/gxvfeat.h b/src/gxvalid/gxvfeat.h
new file mode 100644
index 0000000..049d23a
--- /dev/null
+++ b/src/gxvalid/gxvfeat.h
@@ -0,0 +1,172 @@
+/***************************************************************************/
+/*                                                                         */
+/*  gxvfeat.h                                                              */
+/*                                                                         */
+/*    TrueTypeGX/AAT feat table validation (specification).                */
+/*                                                                         */
+/*  Copyright 2004, 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
+/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
+/*                                                                         */
+/*  This file is part of the FreeType project, and may only be used,       */
+/*  modified, and distributed under the terms of the FreeType project      */
+/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
+/*  this file you indicate that you have read the license and              */
+/*  understand and accept it fully.                                        */
+/*                                                                         */
+/***************************************************************************/
+
+/***************************************************************************/
+/*                                                                         */
+/* gxvalid is derived from both gxlayout module and otvalid module.        */
+/* Development of gxlayout is supported by the Information-technology      */
+/* Promotion Agency(IPA), Japan.                                           */
+/*                                                                         */
+/***************************************************************************/
+
+
+#ifndef __GXVFEAT_H__
+#define __GXVFEAT_H__
+
+
+#include "gxvalid.h"
+#include "gxvcommn.h"
+
+
+  /*************************************************************************/
+  /*************************************************************************/
+  /*****                                                               *****/
+  /*****                Registry predefined by Apple                   *****/
+  /*****                                                               *****/
+  /*************************************************************************/
+  /*************************************************************************/
+
+  /* TODO: More compact format */
+  typedef struct  GXV_Feature_RegistryRec_
+  {
+    FT_Bool  existence;
+    FT_Bool  apple_reserved;
+    FT_Bool  exclusive;
+    FT_Byte  nSettings;
+
+  } GX_Feature_RegistryRec;
+
+
+#define gxv_feat_registry_length                  \
+          ( sizeof ( gxv_feat_registry ) /        \
+              sizeof ( GX_Feature_RegistryRec ) )
+
+
+  static GX_Feature_RegistryRec  gxv_feat_registry[] =
+  {
+    /* Generated from gxvfgen.c */
+    {1, 0, 0,  1},   /* All Typographic Features */
+    {1, 0, 0,  8},   /* Ligatures */
+    {1, 0, 1,  3},   /* Cursive Connection */
+    {1, 0, 1,  6},   /* Letter Case */
+    {1, 0, 0,  1},   /* Vertical Substitution */
+    {1, 0, 0,  1},   /* Linguistic Rearrangement */
+    {1, 0, 1,  2},   /* Number Spacing */
+    {1, 1, 0,  0},   /* Apple Reserved 1 */
+    {1, 0, 0,  5},   /* Smart Swashes */
+    {1, 0, 1,  3},   /* Diacritics */
+    {1, 0, 1,  4},   /* Vertical Position */
+    {1, 0, 1,  3},   /* Fractions */
+    {1, 1, 0,  0},   /* Apple Reserved 2 */
+    {1, 0, 0,  1},   /* Overlapping Characters */
+    {1, 0, 0,  6},   /* Typographic Extras */
+    {1, 0, 0,  5},   /* Mathematical Extras */
+    {1, 0, 1,  7},   /* Ornament Sets */
+    {1, 0, 1,  1},   /* Character Alternatives */
+    {1, 0, 1,  5},   /* Design Complexity */
+    {1, 0, 1,  6},   /* Style Options */
+    {1, 0, 1, 11},   /* Character Shape */
+    {1, 0, 1,  2},   /* Number Case */
+    {1, 0, 1,  4},   /* Text Spacing */
+    {1, 0, 1, 10},   /* Transliteration */
+    {1, 0, 1,  9},   /* Annotation */
+    {1, 0, 1,  2},   /* Kana Spacing */
+    {1, 0, 1,  2},   /* Ideographic Spacing */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {0, 0, 0,  0},   /* __EMPTY__ */
+    {1, 0, 1,  4},   /* Text Spacing */
+    {1, 0, 1,  2},   /* Kana Spacing */
+    {1, 0, 1,  2},   /* Ideographic Spacing */
+    {1, 0, 1,  4},   /* CJK Roman Spacing */
+  };
+
+
+#endif /* __GXVFEAT_H__ */
+
+
+/* END */
diff --git a/src/gxvalid/gxvjust.c b/src/gxvalid/gxvjust.c
index a841b40..ec092eb 100644
--- a/src/gxvalid/gxvjust.c
+++ b/src/gxvalid/gxvjust.c
@@ -108,7 +108,7 @@
     count = FT_NEXT_ULONG( p );
     for ( i = 0; i < count; i++ )
     {
-      GXV_TRACE(( "validate wdc pair %d/%d\n", i + 1, count ));
+      GXV_TRACE(( "validating wdc pair %d/%d\n", i + 1, count ));
       gxv_just_wdp_entry_validate( p, limit, valid );
       p += valid->subtable_length;
     }
diff --git a/src/gxvalid/gxvkern.c b/src/gxvalid/gxvkern.c
index 645c4ff..a17ba9c 100644
--- a/src/gxvalid/gxvkern.c
+++ b/src/gxvalid/gxvkern.c
@@ -59,9 +59,10 @@
 
   typedef enum GXV_kern_Dialect_
   {
-    KERN_DIALECT_MS    = FT_VALIDATE_MS,
-    KERN_DIALECT_APPLE = FT_VALIDATE_APPLE,
-    KERN_DIALECT_ANY   = FT_VALIDATE_CKERN
+    KERN_DIALECT_UNKNOWN = 0,
+    KERN_DIALECT_MS      = FT_VALIDATE_MS,
+    KERN_DIALECT_APPLE   = FT_VALIDATE_APPLE,
+    KERN_DIALECT_ANY     = FT_VALIDATE_CKERN
 
   } GXV_kern_Dialect;
 
@@ -168,7 +169,8 @@
                                           GXV_Validator  valid )
   {
     FT_Bytes                       p = table;
-    GXV_kern_fmt1_StateOptRecData  optdata = valid->statetable.optdata;
+    GXV_kern_fmt1_StateOptRecData  optdata =
+      (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 );
@@ -193,7 +195,8 @@
     FT_UShort  *l[4];
     FT_UShort  buff[5];
 
-    GXV_kern_fmt1_StateOptRecData  optdata = valid->statetable.optdata;
+    GXV_kern_fmt1_StateOptRecData  optdata =
+      (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata;
 
 
     o[0] = classTable;
@@ -236,7 +239,8 @@
     valueOffset =   flags & 0x3FFF;
 
     {
-      GXV_kern_fmt1_StateOptRecData vt_rec = valid->statetable.optdata;
+      GXV_kern_fmt1_StateOptRecData  vt_rec =
+        (GXV_kern_fmt1_StateOptRecData)valid->statetable.optdata;
       FT_Bytes  p;
 
 
@@ -612,10 +616,10 @@
                               FT_UShort*     format,
                               GXV_Validator  valid )
   {
-    FT_Int  result = 0;
+    GXV_kern_Dialect  result = KERN_DIALECT_UNKNOWN;
 
 
-    GXV_NAME_ENTER( "validate coverage" );
+    GXV_NAME_ENTER( "validating coverage" );
 
     GXV_TRACE(( "interprete coverage 0x%04x by Apple style\n", coverage ));
 
@@ -767,7 +771,7 @@
     KERN_DIALECT( valid ) = dialect_request;
 
     GXV_LIMIT_CHECK( 2 );
-    GXV_KERN_DATA( version ) = FT_NEXT_USHORT( p );
+    GXV_KERN_DATA( version ) = (GXV_kern_Version)FT_NEXT_USHORT( p );
     GXV_TRACE(( "version 0x%04x (higher 16bit)\n",
                 GXV_KERN_DATA( version ) ));
 
@@ -792,7 +796,7 @@
 
     for ( i = 0; i < nTables; i++ )
     {
-      GXV_TRACE(( "validate subtable %d/%d\n", i, nTables ));
+      GXV_TRACE(( "validating subtable %d/%d\n", i, nTables ));
       /* p should be 32bit-aligned? */
       gxv_kern_subtable_validate( p, 0, valid );
       p += valid->subtable_length;
@@ -820,7 +824,7 @@
     GXV_kern_Dialect  dialect_request;
 
 
-    dialect_request = dialect_flags;
+    dialect_request = (GXV_kern_Dialect)dialect_flags;
     gxv_kern_validate_generic( table, face, 1, dialect_request, ftvalid );
   }
 
diff --git a/src/gxvalid/gxvmort.c b/src/gxvalid/gxvmort.c
index 376ca91..4cb3a19 100644
--- a/src/gxvalid/gxvmort.c
+++ b/src/gxvalid/gxvmort.c
@@ -25,6 +25,7 @@
 
 
 #include "gxvmort.h"
+#include "gxvfeat.h"
 
 
   /*************************************************************************/
@@ -88,7 +89,7 @@
    * nFeatureFlags is typed to FT_UInt to accept that in
    * mort (typed FT_UShort) and morx (typed FT_ULong).
    */
-  static void
+  FT_LOCAL_DEF( void )
   gxv_mort_featurearray_validate( FT_Bytes       table,
                                   FT_Bytes       limit,
                                   FT_UInt        nFeatureFlags,
@@ -120,7 +121,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_mort_coverage_validate( FT_UShort      coverage,
                               GXV_Validator  valid )
   {
@@ -184,7 +185,7 @@
       coverage        = FT_NEXT_USHORT( p );
       subFeatureFlags = FT_NEXT_ULONG( p );
 
-      GXV_TRACE(( "validate chain subtable %d/%d (%d bytes)\n",
+      GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
                   i + 1, nSubtables, length ));
       type = coverage & 0x0007;
       rest = length - ( 2 + 2 + 4 );
@@ -258,7 +259,7 @@
     valid->face = face;
     limit       = valid->root->limit;
 
-    FT_TRACE3(( "validation mort table\n" ));
+    FT_TRACE3(( "validating `mort' table\n" ));
     GXV_INIT;
 
     GXV_LIMIT_CHECK( 4 + 4 );
@@ -270,7 +271,7 @@
 
     for ( i = 0; i < nChains; i++ )
     {
-      GXV_TRACE(( "validate chain %d/%d\n", i + 1, nChains ));
+      GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
       GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
       gxv_mort_chain_validate( p, limit, valid );
       p += valid->subtable_length;
diff --git a/src/gxvalid/gxvmort.h b/src/gxvalid/gxvmort.h
index 009162e..1d64e69 100644
--- a/src/gxvalid/gxvmort.h
+++ b/src/gxvalid/gxvmort.h
@@ -52,10 +52,6 @@
 
 
   FT_LOCAL( void )
-  gxv_mort_feature_validate( GXV_mort_feature  f,
-                             GXV_Validator     valid );
-
-  FT_LOCAL( void )
   gxv_mort_featurearray_validate( FT_Bytes       table,
                                   FT_Bytes       limit,
                                   FT_UInt        nFeatureFlags,
diff --git a/src/gxvalid/gxvmort0.c b/src/gxvalid/gxvmort0.c
index ddc37d2..c93ee4d 100644
--- a/src/gxvalid/gxvmort0.c
+++ b/src/gxvalid/gxvmort0.c
@@ -106,7 +106,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_mort_subtable_type0_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmort1.c b/src/gxvalid/gxvmort1.c
index 5bdf2d3..86d667c 100644
--- a/src/gxvalid/gxvmort1.c
+++ b/src/gxvalid/gxvmort1.c
@@ -58,7 +58,7 @@
     FT_Bytes  p = table;
 
     GXV_mort_subtable_type1_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 );
@@ -81,7 +81,7 @@
     FT_UShort  buff[5];
 
     GXV_mort_subtable_type1_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type1_StateOptRecData)valid->statetable.optdata;
 
 
     o[0] = classTable;
@@ -183,7 +183,7 @@
     FT_UShort  i;
 
 
-    GXV_NAME_ENTER( "validate contents in substitionTable" );
+    GXV_NAME_ENTER( "validating contents of substitionTable" );
     for ( i = 0; i < num_gids ; i ++ )
     {
       FT_UShort  dst_gid;
@@ -214,7 +214,7 @@
    * In addition to classTable, stateArray, and entryTable, the field
    * `substitutionTable' is added.
    */
-  static void
+  FT_LOCAL_DEF( void )
   gxv_mort_subtable_type1_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmort2.c b/src/gxvalid/gxvmort2.c
index 2d1a838..bfbe473 100644
--- a/src/gxvalid/gxvmort2.c
+++ b/src/gxvalid/gxvmort2.c
@@ -61,7 +61,7 @@
   {
     FT_Bytes p = table;
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 + 2 + 2 );
@@ -93,7 +93,7 @@
     FT_UShort  buff[7];
 
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
 
 
     GXV_NAME_ENTER( "subtable boundaries setup" );
@@ -141,7 +141,7 @@
   {
     /* access ligActionTable */
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
 
     FT_Bytes lat_base  = table + optdata->ligActionTable;
     FT_Bytes p         = table + ligActionOffset;
@@ -217,7 +217,7 @@
                                                   GXV_Validator  valid )
   {
     GXV_mort_subtable_type2_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type2_StateOptRecData)valid->statetable.optdata;
 
     FT_Bytes p     = table + optdata->ligatureTable;
     FT_Bytes limit = table + optdata->ligatureTable
@@ -241,7 +241,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_mort_subtable_type2_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmort4.c b/src/gxvalid/gxvmort4.c
index b6f1f02..959220e 100644
--- a/src/gxvalid/gxvmort4.c
+++ b/src/gxvalid/gxvmort4.c
@@ -100,7 +100,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_mort_subtable_type4_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmort5.c b/src/gxvalid/gxvmort5.c
index 70529b8..5c90ed7 100644
--- a/src/gxvalid/gxvmort5.c
+++ b/src/gxvalid/gxvmort5.c
@@ -73,7 +73,7 @@
                                           GXV_Validator  valid )
   {
     GXV_mort_subtable_type5_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata;
 
 
     gxv_StateTable_subtable_setup( table_size,
@@ -109,7 +109,7 @@
     FT_Bytes  p = table + offset;
 
     GXV_mort_subtable_type5_StateOptRecData  optdata =
-                                               valid->statetable.optdata;
+      (GXV_mort_subtable_type5_StateOptRecData)valid->statetable.optdata;
 
     if ( optdata->classTable < offset                                   &&
          offset < optdata->classTable + *(optdata->classTable_length_p) )
@@ -189,7 +189,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_mort_subtable_type5_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmorx.c b/src/gxvalid/gxvmorx.c
index 8a0ea1a..5f894c7 100644
--- a/src/gxvalid/gxvmorx.c
+++ b/src/gxvalid/gxvmorx.c
@@ -77,7 +77,7 @@
       coverage        = FT_NEXT_ULONG( p );
       subFeatureFlags = FT_NEXT_ULONG( p );
 
-      GXV_TRACE(( "validate chain subtable %d/%d (%d bytes)\n",
+      GXV_TRACE(( "validating chain subtable %d/%d (%d bytes)\n",
                   i + 1, nSubtables, length ));
 
       type = coverage & 0x0007;
@@ -152,7 +152,7 @@
     valid->root = ftvalid;
     valid->face = face;
 
-    FT_TRACE3(( "validation morx table\n" ));
+    FT_TRACE3(( "validating `morx' table\n" ));
     GXV_INIT;
 
     GXV_LIMIT_CHECK( 4 + 4 );
@@ -164,7 +164,7 @@
 
     for ( i = 0; i < nChains; i++ )
     {
-      GXV_TRACE(( "validate chain %d/%d\n", i + 1, nChains ));
+      GXV_TRACE(( "validating chain %d/%d\n", i + 1, nChains ));
       GXV_32BIT_ALIGNMENT_VALIDATE( p - table );
       gxv_morx_chain_validate( p, limit, valid );
       p += valid->subtable_length;
diff --git a/src/gxvalid/gxvmorx.h b/src/gxvalid/gxvmorx.h
index a5f7bd3..28c1a44 100644
--- a/src/gxvalid/gxvmorx.h
+++ b/src/gxvalid/gxvmorx.h
@@ -24,8 +24,8 @@
 /***************************************************************************/
 
 
-#ifndef __GXVMORX_H_
-#define __GXVMORX_H_
+#ifndef __GXVMORX_H__
+#define __GXVMORX_H__
 
 
 #include "gxvalid.h"
diff --git a/src/gxvalid/gxvmorx0.c b/src/gxvalid/gxvmorx0.c
index 7ad78af..a902941 100644
--- a/src/gxvalid/gxvmorx0.c
+++ b/src/gxvalid/gxvmorx0.c
@@ -73,7 +73,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_morx_subtable_type0_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmorx1.c b/src/gxvalid/gxvmorx1.c
index 5f6fe44..689e4a7 100644
--- a/src/gxvalid/gxvmorx1.c
+++ b/src/gxvalid/gxvmorx1.c
@@ -60,7 +60,7 @@
     FT_Bytes  p = table;
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
 
 
     GXV_LIMIT_CHECK( 2 );
@@ -83,7 +83,7 @@
     FT_ULong  buff[5];
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
 
 
     o[0] = classTable;
@@ -115,7 +115,7 @@
     FT_Short   currentIndex;
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
 
     FT_UNUSED( state );
     FT_UNUSED( table );
@@ -197,7 +197,7 @@
     FT_UShort  i;
 
     GXV_morx_subtable_type1_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type1_StateOptRecData)valid->xstatetable.optdata;
 
 
     /* TODO: calculate offset/length for each lookupTables */
@@ -225,7 +225,7 @@
    * In addition to classTable, stateArray, entryTable, the field
    * `substitutionTable' is added.
    */
-  static void
+  FT_LOCAL_DEF( void )
   gxv_morx_subtable_type1_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmorx2.c b/src/gxvalid/gxvmorx2.c
index 5c4fba6..93fe318 100644
--- a/src/gxvalid/gxvmorx2.c
+++ b/src/gxvalid/gxvmorx2.c
@@ -63,7 +63,7 @@
     FT_Bytes  p = table;
 
     GXV_morx_subtable_type2_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
 
 
     GXV_LIMIT_CHECK( 4 + 4 + 4 );
@@ -95,7 +95,7 @@
     FT_ULong   buff[7];
 
     GXV_morx_subtable_type2_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
 
 
     GXV_NAME_ENTER( "subtable boundaries setup" );
@@ -146,7 +146,7 @@
   {
     /* access ligActionTable */
     GXV_morx_subtable_type2_StateOptRecData optdata =
-                                              valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
 
     FT_Bytes lat_base  = table + optdata->ligActionTable;
     FT_Bytes p         = lat_base +
@@ -220,7 +220,7 @@
                                                   GXV_Validator  valid )
   {
     GXV_morx_subtable_type2_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type2_StateOptRecData)valid->xstatetable.optdata;
 
     FT_Bytes p     = table + optdata->ligatureTable;
     FT_Bytes limit = table + optdata->ligatureTable
@@ -246,7 +246,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_morx_subtable_type2_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
@@ -258,7 +258,7 @@
 
     GXV_NAME_ENTER( "morx chain subtable type2 (Ligature Substitution)" );
 
-    GXV_LIMIT_CHECK( GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE );
+    GXV_LIMIT_CHECK( GXV_MORX_SUBTABLE_TYPE2_HEADER_SIZE );
 
     valid->xstatetable.optdata =
       &lig_rec;
diff --git a/src/gxvalid/gxvmorx4.c b/src/gxvalid/gxvmorx4.c
index 68ad746..c0d2f78 100644
--- a/src/gxvalid/gxvmorx4.c
+++ b/src/gxvalid/gxvmorx4.c
@@ -38,7 +38,7 @@
 #define FT_COMPONENT  trace_gxvmorx
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_morx_subtable_type4_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvmorx5.c b/src/gxvalid/gxvmorx5.c
index ef5536c..de9aebc 100644
--- a/src/gxvalid/gxvmorx5.c
+++ b/src/gxvalid/gxvmorx5.c
@@ -69,7 +69,7 @@
     FT_Bytes  p = table;
 
     GXV_morx_subtable_type5_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata;
 
 
     GXV_LIMIT_CHECK( 4 );
@@ -92,7 +92,7 @@
     FT_ULong   buff[5];
 
     GXV_morx_subtable_type5_StateOptRecData  optdata =
-                                               valid->xstatetable.optdata;
+      (GXV_morx_subtable_type5_StateOptRecData)valid->xstatetable.optdata;
 
 
     o[0] = classTable;
@@ -180,7 +180,7 @@
   }
 
 
-  static void
+  FT_LOCAL_DEF( void )
   gxv_morx_subtable_type5_validate( FT_Bytes       table,
                                     FT_Bytes       limit,
                                     GXV_Validator  valid )
diff --git a/src/gxvalid/gxvopbd.c b/src/gxvalid/gxvopbd.c
index eb2d261..12a21d4 100644
--- a/src/gxvalid/gxvopbd.c
+++ b/src/gxvalid/gxvopbd.c
@@ -15,6 +15,15 @@
 /*                                                                         */
 /***************************************************************************/
 
+/***************************************************************************/
+/*                                                                         */
+/* gxvalid is derived from both gxlayout module and otvalid module.        */
+/* Development of gxlayout is supported by the Information-technology      */
+/* Promotion Agency(IPA), Japan.                                           */
+/*                                                                         */
+/***************************************************************************/
+
+
 #include "gxvalid.h"
 #include "gxvcommn.h"
 
@@ -29,7 +38,6 @@
 #define FT_COMPONENT  trace_gxvopbd
 
 
-
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
@@ -45,7 +53,8 @@
 
   } GXV_opbd_DataRec, *GXV_opbd_Data;
 
-#define  GXV_OPBD_DATA(FIELD)  GXV_TABLE_DATA( opbd, FIELD )
+
+#define GXV_OPBD_DATA( FIELD )  GXV_TABLE_DATA( opbd, FIELD )
 
 
   /*************************************************************************/
@@ -71,20 +80,19 @@
     if ( value.u < GXV_OPBD_DATA( valueOffset_min ) )
       GXV_OPBD_DATA( valueOffset_min ) = value.u;
 
-
     for ( i = 0; i < 4; i++ )
     {
       GXV_LIMIT_CHECK( 2 );
       delta_value = FT_NEXT_SHORT( p );
 
-      if ( GXV_OPBD_DATA( format ) ) /* format 1, value is ctrl pt. */
+      if ( GXV_OPBD_DATA( format ) )    /* format 1, value is ctrl pt. */
       {
         if ( delta_value == -1 )
           continue;
 
         gxv_ctlPoint_validate( glyph, delta_value, valid );
       }
-      else /* format 0, value is distance */
+      else                              /* format 0, value is distance */
         continue;
     }
   }
@@ -130,12 +138,16 @@
   {
     GXV_LookupValueDesc  value;
 
+    FT_UNUSED( lookuptbl_limit );
+    FT_UNUSED( valid );
+
 
-    value.u = base_value.u + ( relative_gindex * 4 * sizeof ( FT_Short ) );
+    value.u = base_value.u + relative_gindex * 4 * sizeof ( FT_Short );
 
     return value;
   }
 
+
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
@@ -163,9 +175,9 @@
     valid->table_data = opbd;
     valid->face       = face;
 
-    FT_TRACE3(( "validation opbd table\n" ));
+    FT_TRACE3(( "validating `opbd' table\n" ));
     GXV_INIT;
-    GXV_OPBD_DATA( valueOffset_min ) = 0xFFFF;
+    GXV_OPBD_DATA( valueOffset_min ) = 0xFFFFU;
 
 
     GXV_LIMIT_CHECK( 4 + 2 );
@@ -173,31 +185,30 @@
     GXV_OPBD_DATA( format ) = FT_NEXT_USHORT( p );
 
 
-    /* 0x00010000 is only defined (1996) */
+    /* only 0x00010000 is defined (1996) */
     GXV_TRACE(( "(version=0x%08x)\n", version ));
     if ( 0x00010000UL != version )
       FT_INVALID_FORMAT;
 
-    /* 0, 1 are only defined (1996) */
+    /* only values 0 and 1 are defined (1996) */
     GXV_TRACE(( "(format=0x%04x)\n", GXV_OPBD_DATA( format ) ));
     if ( 0x0001 < GXV_OPBD_DATA( format ) )
       FT_INVALID_FORMAT;
 
-
     valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
     valid->lookupval_func   = gxv_opbd_LookupValue_validate;
     valid->lookupfmt4_trans = gxv_opbd_LookupFmt4_transit;
+
     gxv_LookupTable_validate( p, limit, valid );
     p += valid->subtable_length;
 
-
     if ( p > table + GXV_OPBD_DATA( valueOffset_min ) )
     {
-      GXV_TRACE(( "found overlap between LookupTable and opbd_value array\n" ));
+      GXV_TRACE((
+        "found overlap between LookupTable and opbd_value array\n" ));
       FT_INVALID_OFFSET;
     }
 
-
     FT_TRACE4(( "\n" ));
   }
 
diff --git a/src/gxvalid/gxvprop.c b/src/gxvalid/gxvprop.c
index 6c0c43d..b5211f1 100644
--- a/src/gxvalid/gxvprop.c
+++ b/src/gxvalid/gxvprop.c
@@ -16,15 +16,18 @@
 /***************************************************************************/
 
 /***************************************************************************/
+/*                                                                         */
 /* gxvalid is derived from both gxlayout module and otvalid module.        */
-/* Development of gxlayout was support of Information-technology Promotion */
-/* Agency(IPA), Japan.                                                     */
+/* Development of gxlayout is supported by the Information-technology      */
+/* Promotion Agency(IPA), Japan.                                           */
+/*                                                                         */
 /***************************************************************************/
 
 
 #include "gxvalid.h"
 #include "gxvcommn.h"
 
+
   /*************************************************************************/
   /*                                                                       */
   /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
@@ -35,7 +38,6 @@
 #define FT_COMPONENT  trace_gxvprop
 
 
-
   /*************************************************************************/
   /*************************************************************************/
   /*****                                                               *****/
@@ -52,14 +54,15 @@
     FT_Fixed  version;
 
   } GXV_prop_DataRec, *GXV_prop_Data;
-#define GXV_PROP_DATA(field)  GXV_TABLE_DATA( prop, field )
 
-#define GXV_PROP_FLOATER                      0x8000
-#define GXV_PROP_USE_COMPLEMENTARY_BRACKET    0x1000
-#define GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET 0x0F00
-#define GXV_PROP_ATTACHING_TO_RIGHT           0x0080
-#define GXV_PROP_RESERVED                     0x0060
-#define GXV_PROP_DIRECTIONALITY_CLASS         0x001F
+#define GXV_PROP_DATA( field )  GXV_TABLE_DATA( prop, field )
+
+#define GXV_PROP_FLOATER                      0x8000U
+#define GXV_PROP_USE_COMPLEMENTARY_BRACKET    0x1000U
+#define GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET 0x0F00U
+#define GXV_PROP_ATTACHING_TO_RIGHT           0x0080U
+#define GXV_PROP_RESERVED                     0x0060U
+#define GXV_PROP_DIRECTIONALITY_CLASS         0x001FU
 
 
   /*************************************************************************/
@@ -79,7 +82,7 @@
     FT_GlyphSlot  glyph;
 
 
-    GXV_NAME_ENTER(" zero advance " );
+    GXV_NAME_ENTER( "zero advance" );
 
     face = valid->face;
 
@@ -98,6 +101,7 @@
     GXV_EXIT;
   }
 
+
   /* Pass 0 as GLYPH to check the default property */
   static void
   gxv_prop_property_validate( FT_UShort      property,
@@ -105,15 +109,13 @@
                               GXV_Validator  valid )
   {
     if ( glyph != 0 && ( property & GXV_PROP_FLOATER ) )
-    {
       gxv_prop_zero_advance_validate( glyph, valid );
-    }
-
 
     if ( property & GXV_PROP_USE_COMPLEMENTARY_BRACKET )
     {
-      FT_UShort offset;
-      char complement;
+      FT_UShort  offset;
+      char       complement;
+
 
       offset = property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET;
       if ( offset == 0 )
@@ -122,9 +124,9 @@
       complement = offset >> 8;
       if ( complement & 0x08 )
       {
-        /* Top bit is set: nagative */
+        /* Top bit is set: negative */
 
-        /* Calculated the absolute offset */
+        /* Calculate the absolute offset */
         complement = ( complement & 0x07 ) + 1;
 
         /* The gid for complement must be greater than 0 */
@@ -136,38 +138,34 @@
         /* The gid for complement must be the face. */
         gxv_glyphid_validate( glyph + complement, valid );
       }
-
     }
     else
     {
-      if ( ( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET ) )
+      if ( property & GXV_PROP_COMPLEMENTARY_BRACKET_OFFSET )
         GXV_TRACE(( "glyph %d cannot have complementary bracketing\n",
-                     glyph ));
+                    glyph ));
     }
 
-
-    /* this is introduced in ver 2.0 */
+    /* this is introduced in version 2.0 */
     if ( property & GXV_PROP_ATTACHING_TO_RIGHT )
     {
-      if ( GXV_PROP_DATA( version ) == 0x00010000 )
+      if ( GXV_PROP_DATA( version ) == 0x00010000UL )
         FT_INVALID_DATA;
     }
 
-
     if ( property & GXV_PROP_RESERVED )
-    {
       FT_INVALID_DATA;
-    }
 
     if ( ( property & GXV_PROP_DIRECTIONALITY_CLASS ) > 11 )
     {
       /* TODO: Too restricted. Use the validation level. */
-      if ( GXV_PROP_DATA( version ) == 0x00010000 ||
-           GXV_PROP_DATA( version ) == 0x00020000 )
+      if ( GXV_PROP_DATA( version ) == 0x00010000UL ||
+           GXV_PROP_DATA( version ) == 0x00020000UL )
         FT_INVALID_DATA;
     }
   }
 
+
   static void
   gxv_prop_LookupValue_validate( FT_UShort            glyph,
                                  GXV_LookupValueDesc  value,
@@ -216,7 +214,7 @@
     GXV_LookupValueDesc  value;
 
 
-    offset = base_value.u + ( relative_gindex * sizeof( FT_UShort ) );
+    offset = base_value.u + relative_gindex * sizeof( FT_UShort );
     p      = valid->lookuptbl_head + offset;
     limit  = lookuptbl_limit;
 
@@ -253,11 +251,11 @@
     FT_UShort         defaultProp;
 
 
-    valid->root = ftvalid;
+    valid->root       = ftvalid;
     valid->table_data = prop;
-    valid->face = face;
+    valid->face       = face;
 
-    FT_TRACE3(( "validation prop table\n" ));
+    FT_TRACE3(( "validating `prop' table\n" ));
     GXV_INIT;
 
     GXV_LIMIT_CHECK( 4 + 2 + 2 );
@@ -265,15 +263,14 @@
     format      = FT_NEXT_USHORT( p );
     defaultProp = FT_NEXT_USHORT( p );
 
-
-    /* version 1.0, 2.0, 3.0 are only defined (1996) */
-    if ( version != 0x00010000 &&
-         version != 0x00020000 &&
-         version != 0x00030000 )
+    /* only versions 1.0, 2.0, 3.0 are defined (1996) */
+    if ( version != 0x00010000UL &&
+         version != 0x00020000UL &&
+         version != 0x00030000UL )
       FT_INVALID_FORMAT;
 
 
-    /* format 0x0000, 0x0001 are only defined (1996) */
+    /* only formats 0x0000, 0x0001 are defined (1996) */
     if ( format > 1 )
       FT_INVALID_FORMAT;
 
@@ -282,7 +279,7 @@
     if ( format == 0 )
     {
       FT_TRACE3(( "(format 0, no per-glyph properties, "
-                  "rest %d bytes are skipped)", limit - p ));
+                  "remaining %d bytes are skipped)", limit - p ));
       goto Exit;
     }
 
@@ -292,6 +289,7 @@
     valid->lookupval_sign   = GXV_LOOKUPVALUE_UNSIGNED;
     valid->lookupval_func   = gxv_prop_LookupValue_validate;
     valid->lookupfmt4_trans = gxv_prop_LookupFmt4_transit;
+
     gxv_LookupTable_validate( p, limit, valid );
 
   Exit:
diff --git a/src/gxvalid/gxvtrak.c b/src/gxvalid/gxvtrak.c
index 0e91d58..432ee4e 100644
--- a/src/gxvalid/gxvtrak.c
+++ b/src/gxvalid/gxvtrak.c
@@ -16,9 +16,11 @@
 /***************************************************************************/
 
 /***************************************************************************/
+/*                                                                         */
 /* gxvalid is derived from both gxlayout module and otvalid module.        */
-/* Development of gxlayout was support of Information-technology Promotion */
-/* Agency(IPA), Japan.                                                     */
+/* Development of gxlayout is supported by the Information-technology      */
+/* Promotion Agency(IPA), Japan.                                           */
+/*                                                                         */
 /***************************************************************************/
 
 
@@ -45,9 +47,9 @@
   /*************************************************************************/
 
     /*
-     * refered track table format specification:
+     * referred track table format specification:
      * http://developer.apple.com/fonts/TTRefMan/RM06/Chap6trak.html
-     * last update is 1996.
+     * last update was 1996.
      * ----------------------------------------------
      * [MINIMUM HEADER]: GXV_TRAK_SIZE_MIN
      * version          (fixed:  32bit) = 0x00010000
@@ -75,7 +77,9 @@
 
   } GXV_trak_DataRec, *GXV_trak_Data;
 
-#define  GXV_TRAK_DATA(FIELD)       GXV_TABLE_DATA( trak, FIELD )
+
+#define GXV_TRAK_DATA( FIELD )  GXV_TABLE_DATA( trak, FIELD )
+
 
   /*************************************************************************/
   /*************************************************************************/
@@ -89,7 +93,6 @@
   gxv_trak_trackTable_validate( FT_Bytes       table,
                                 FT_Bytes       limit,
                                 FT_UShort      nTracks,
-                                FT_UShort      nSizes,
                                 GXV_Validator  valid )
   {
     FT_Bytes   p = table;
@@ -102,7 +105,7 @@
 
     GXV_NAME_ENTER( "trackTable" );
 
-    GXV_TRAK_DATA( trackValueOffset_min ) = 0xFFFF;
+    GXV_TRAK_DATA( trackValueOffset_min ) = 0xFFFFU;
     GXV_TRAK_DATA( trackValueOffset_max ) = 0x0000;
 
     for ( i = 0; i < nTracks; i ++ )
@@ -120,7 +123,7 @@
       gxv_sfntName_validate( nameIndex, 256, 32767, valid );
     }
 
-    valid->subtable_length = ( p - table );
+    valid->subtable_length = p - table;
     GXV_EXIT;
   }
 
@@ -149,22 +152,19 @@
 
     gxv_odtect_add_range( table, p - table, "trackData header", odtect );
 
-
     /* validate trackTable */
-    gxv_trak_trackTable_validate( p, limit, nTracks, nSizes, valid );
+    gxv_trak_trackTable_validate( p, limit, nTracks, valid );
     gxv_odtect_add_range( p, valid->subtable_length,
                           "trackTable", odtect );
 
-
     /* sizeTable is array of FT_Fixed, don't check contents */
     p = valid->root->base + sizeTableOffset;
     GXV_LIMIT_CHECK( nSizes * 4 );
-    gxv_odtect_add_range( p, ( nSizes * 4 ), "sizeTable", odtect );
-
+    gxv_odtect_add_range( p, nSizes * 4, "sizeTable", odtect );
 
     /* validate trackValueOffet */
     p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_min );
-    if ( ( limit - p ) < ( nTracks * nSizes * 2 ) )
+    if ( limit - p < nTracks * nSizes * 2 )
       GXV_TRACE(( "too short trackValue array\n" ));
 
     p = valid->root->base + GXV_TRAK_DATA( trackValueOffset_max );
@@ -174,10 +174,9 @@
                             + GXV_TRAK_DATA( trackValueOffset_min ),
                           GXV_TRAK_DATA( trackValueOffset_max )
                             - GXV_TRAK_DATA( trackValueOffset_min )
-                            + ( nSizes * 2 ),
+                            + nSizes * 2,
                           "trackValue array", odtect );
 
-
     gxv_odtect_validate( odtect, valid );
 
     GXV_EXIT;
@@ -215,17 +214,15 @@
 
     GXV_ODTECT( 3, odtect );
 
-
     GXV_ODTECT_INIT( odtect );
     valid->root       = ftvalid;
     valid->table_data = trak;
     valid->face       = face;
 
-
     limit      = valid->root->limit;
     table_size = limit - table;
 
-    FT_TRACE3(( "validation trak table\n" ));
+    FT_TRACE3(( "validating `trak' table\n" ));
     GXV_INIT;
 
     GXV_LIMIT_CHECK( 4 + 2 + 2 + 2 + 2 );
@@ -256,7 +253,6 @@
     if ( reserved != 0x0000 )
       FT_INVALID_DATA;
 
-
     /* validate trackData */
     if ( 0 < horizOffset )
     {
@@ -274,7 +270,6 @@
 
     gxv_odtect_validate( odtect, valid );
 
-
     FT_TRACE4(( "\n" ));
   }
 
diff --git a/src/gxvalid/rules.mk b/src/gxvalid/rules.mk
index 07aae59..57bc082 100644
--- a/src/gxvalid/rules.mk
+++ b/src/gxvalid/rules.mk
@@ -33,28 +33,29 @@ GXV_DRV_SRC := $(GXV_DIR)/gxvcommn.c \
                $(GXV_DIR)/gxvprop.c  \
                $(GXV_DIR)/gxvjust.c  \
                $(GXV_DIR)/gxvmort.c  \
-               $(GXV_DIR)/gxvmort0.c  \
-               $(GXV_DIR)/gxvmort1.c  \
-               $(GXV_DIR)/gxvmort2.c  \
-               $(GXV_DIR)/gxvmort4.c  \
-               $(GXV_DIR)/gxvmort5.c  \
+               $(GXV_DIR)/gxvmort0.c \
+               $(GXV_DIR)/gxvmort1.c \
+               $(GXV_DIR)/gxvmort2.c \
+               $(GXV_DIR)/gxvmort4.c \
+               $(GXV_DIR)/gxvmort5.c \
                $(GXV_DIR)/gxvmorx.c  \
-               $(GXV_DIR)/gxvmorx0.c  \
-               $(GXV_DIR)/gxvmorx1.c  \
-               $(GXV_DIR)/gxvmorx2.c  \
-               $(GXV_DIR)/gxvmorx4.c  \
-               $(GXV_DIR)/gxvmorx5.c  \
+               $(GXV_DIR)/gxvmorx0.c \
+               $(GXV_DIR)/gxvmorx1.c \
+               $(GXV_DIR)/gxvmorx2.c \
+               $(GXV_DIR)/gxvmorx4.c \
+               $(GXV_DIR)/gxvmorx5.c \
                $(GXV_DIR)/gxvlcar.c  \
                $(GXV_DIR)/gxvkern.c  \
                $(GXV_DIR)/gxvmod.c
 
 # GXV driver headers
 #
-GXV_DRV_H := $(GXV_DIR)/gxvalid.h \
-             $(GXV_DIR)/gxverror.h  \
+GXV_DRV_H := $(GXV_DIR)/gxvalid.h  \
+             $(GXV_DIR)/gxverror.h \
              $(GXV_DIR)/gxvcommn.h \
-             $(GXV_DIR)/gxvmod.h \
-             $(GXV_DIR)/gxvmort.h \
+             $(GXV_DIR)/gxvfeat.h  \
+             $(GXV_DIR)/gxvmod.h   \
+             $(GXV_DIR)/gxvmort.h  \
              $(GXV_DIR)/gxvmorx.h