Commit 0d9165e1d6451063693eda6d7dce367051a39ead

Werner Lemberg 2002-03-07T21:59:59

* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug, FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings. * src/base/ftcalc.c (FT_MulFix): Ditto. * src/cff/cffdrivr.c (cff_get_name_index): Ditto. * src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init, CFF_GlyphSlot_Init): Ditto. * src/cid/cidobjs.c (CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs): Ditto. * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init): Ditto. * src/pshinter/pshmod.c (pshinter_interface): Use `static const'. * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused variables. * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed to... (T1_Builder_FuncsRec): This. (T1_Builder_Funcs): New typedef. (PSAux_Interface): Remove compiler warnings. * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h (t1_builder_funcs): Updated. * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ... (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines. (PSH_AlignmentRec): Updated. * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix typo. * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto. * src/base/ftstream (FT_Get_Char): Rename to... (FT_Stream_Get_Char): This. * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is a built-in function in gcc, causing warning messages with gcc 3.0. * src/autohint/ahglyph.c (ah_outline_load): Ditto. * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto. * src/cache/ftcmanag.c (ftc_family_table_alloc, ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache): Ditto. * src/cff/cffload.c (cff_new_index, cff_done_index, cff_explicit_index, CFF_Access_Element, CFF_Forget_Element, CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font, CFF_Done_Font): Ditto. * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto. * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto. * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit, ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3, * src/pshinter/pshalgo1.c (psh1_hint_table_record, psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto. * src/pshinter/pshalgo2.c (psh2_hint_table_record, psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto. * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25, TT_Get_PS_Name): Ditto. * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics, load_truetype_glyph): Ditto. * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto. * src/type1/t1afm.c (T1_Get_Kerning): Ditto. * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.

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
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
diff --git a/ChangeLog b/ChangeLog
index fa9e335..4c04559 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,66 @@
+2002-03-07  Werner Lemberg  <wl@gnu.org>
+
+	* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
+	ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
+	ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
+	FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
+	* src/base/ftcalc.c (FT_MulFix): Ditto.
+	* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
+	* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
+	CFF_GlyphSlot_Init): Ditto.
+	* src/cid/cidobjs.c (CID_GlyphSlot_Init,
+	CID_Size_Get_Globals_Funcs): Ditto.
+	* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
+	Ditto.
+	* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
+	* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
+	variables.
+
+	* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
+	to...
+	(T1_Builder_FuncsRec): This.
+	(T1_Builder_Funcs): New typedef.
+	(PSAux_Interface): Remove compiler warnings.
+	* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
+	(t1_builder_funcs): Updated.
+
+	* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
+	(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
+	(PSH_AlignmentRec): Updated.
+
+	* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
+	typo.
+	* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
+	* src/base/ftstream (FT_Get_Char): Rename to...
+	(FT_Stream_Get_Char): This.
+
+	* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
+	a built-in function in gcc, causing warning messages with gcc 3.0.
+	* src/autohint/ahglyph.c (ah_outline_load): Ditto.
+	* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
+	* src/cache/ftcmanag.c (ftc_family_table_alloc,
+	ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
+	Ditto.
+	* src/cff/cffload.c (cff_new_index, cff_done_index,
+	cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
+	CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
+	CFF_Done_Font): Ditto.
+	* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
+	* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
+	* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
+	ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
+	* src/pshinter/pshalgo1.c (psh1_hint_table_record,
+	psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
+	* src/pshinter/pshalgo2.c (psh2_hint_table_record,
+	psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
+	* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
+	TT_Get_PS_Name): Ditto.
+	* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
+	load_truetype_glyph): Ditto.
+	* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
+	* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
+	* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
+
 2002-03-06  David Turner    <david@freetype.org>
 
         * src/type1/t1objs.c (T1_Face_Init), src/cid/cidobjs.c (CID_Face_Init):
@@ -11,7 +74,6 @@
         src/base/ftobjs.c, src/base/ftinit.c: adding the new FT_Library_Version
         API to return the library's current version in dynamic links.
 
-
 2002-03-06  Werner Lemberg  <wl@gnu.org>
 
 	* src/pshinter/pshglob.h (PSH_DimensionRec): s/std/stdw/.
diff --git a/include/freetype/cache/ftcmanag.h b/include/freetype/cache/ftcmanag.h
index da6ce62..97c7759 100644
--- a/include/freetype/cache/ftcmanag.h
+++ b/include/freetype/cache/ftcmanag.h
@@ -118,7 +118,7 @@ FT_BEGIN_HEADER
 
   FT_EXPORT( void )
   ftc_family_table_free( FTC_FamilyTable  table,
-                         FT_UInt          index );
+                         FT_UInt          idx );
 
 
   /*************************************************************************/
diff --git a/include/freetype/internal/ftgloadr.h b/include/freetype/internal/ftgloadr.h
index ac3dcfb..1207c6e 100644
--- a/include/freetype/internal/ftgloadr.h
+++ b/include/freetype/internal/ftgloadr.h
@@ -50,7 +50,7 @@ FT_BEGIN_HEADER
   };
 
 
-  typedef struct  FT_SubGlyph_
+  struct  FT_SubGlyph_
   {
     FT_Int     index;
     FT_UShort  flags;
diff --git a/include/freetype/internal/ftstream.h b/include/freetype/internal/ftstream.h
index e5f029b..6bfb1b0 100644
--- a/include/freetype/internal/ftstream.h
+++ b/include/freetype/internal/ftstream.h
@@ -265,8 +265,8 @@ FT_BEGIN_HEADER
   /*                                                                       */
 #define FT_GET_MACRO( func, type )        ( (type)func( stream ) )
 
-#define GET_Char()      FT_GET_MACRO( FT_Get_Char, FT_Char )
-#define GET_Byte()      FT_GET_MACRO( FT_Get_Char, FT_Byte )
+#define GET_Char()      FT_GET_MACRO( FT_Stream_Get_Char, FT_Char )
+#define GET_Byte()      FT_GET_MACRO( FT_Stream_Get_Char, FT_Byte )
 #define GET_Short()     FT_GET_MACRO( FT_Stream_Get_Short, FT_Short )
 #define GET_UShort()    FT_GET_MACRO( FT_Stream_Get_Short, FT_UShort )
 #define GET_Offset()    FT_GET_MACRO( FT_Stream_Get_Offset, FT_Long )
diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h
index ef144ab..a104fd5 100644
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -38,9 +38,8 @@ FT_BEGIN_HEADER
   /*************************************************************************/
 
 
-  typedef struct PS_TableRec_*               PS_Table;
-
-  typedef const struct PS_Table_FuncsRec_*   PS_Table_Funcs;
+  typedef struct PS_TableRec_*              PS_Table;
+  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;
 
   /*************************************************************************/
   /*                                                                       */
@@ -433,7 +432,9 @@ FT_BEGIN_HEADER
   (*T1_Builder_Close_Contour_Func)( T1_Builder*  builder );
 
 
-  typedef struct  T1_Builder_Funcs_
+  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;
+
+  typedef struct  T1_Builder_FuncsRec_
   {
     void
     (*init)( T1_Builder*   builder,
@@ -452,8 +453,7 @@ FT_BEGIN_HEADER
     T1_Builder_Start_Point_Func    start_point;
     T1_Builder_Close_Contour_Func  close_contour;
 
-  } T1_Builder_Funcs;
-
+  } T1_Builder_FuncsRec;
 
 
   /*************************************************************************/
@@ -514,37 +514,37 @@ FT_BEGIN_HEADER
   /*                                                                       */
   struct  T1_Builder_
   {
-    FT_Memory         memory;
-    FT_Face           face;
-    FT_GlyphSlot      glyph;
-    FT_GlyphLoader    loader;
-    FT_Outline*       base;
-    FT_Outline*       current;
+    FT_Memory            memory;
+    FT_Face              face;
+    FT_GlyphSlot         glyph;
+    FT_GlyphLoader       loader;
+    FT_Outline*          base;
+    FT_Outline*          current;
 
-    FT_Vector         last;
+    FT_Vector            last;
 
-    FT_Fixed          scale_x;
-    FT_Fixed          scale_y;
+    FT_Fixed             scale_x;
+    FT_Fixed             scale_y;
 
-    FT_Pos            pos_x;
-    FT_Pos            pos_y;
+    FT_Pos               pos_x;
+    FT_Pos               pos_y;
 
-    FT_Vector         left_bearing;
-    FT_Vector         advance;
+    FT_Vector            left_bearing;
+    FT_Vector            advance;
 
-    FT_BBox           bbox;          /* bounding box */
-    FT_Bool           path_begun;
-    FT_Bool           load_points;
-    FT_Bool           no_recurse;
-    FT_Bool           shift;
+    FT_BBox              bbox;          /* bounding box */
+    FT_Bool              path_begun;
+    FT_Bool              load_points;
+    FT_Bool              no_recurse;
+    FT_Bool              shift;
 
-    FT_Error          error;         /* only used for memory errors */
-    FT_Bool           metrics_only;
+    FT_Error             error;         /* only used for memory errors */
+    FT_Bool              metrics_only;
 
-    void*             hints_funcs;    /* hinter-specific */
-    void*             hints_globals;  /* hinter-specific */
+    void*                hints_funcs;    /* hinter-specific */
+    void*                hints_globals;  /* hinter-specific */
 
-    T1_Builder_Funcs  funcs;
+    T1_Builder_FuncsRec  funcs;
   };
 
 
@@ -661,10 +661,10 @@ FT_BEGIN_HEADER
 
   typedef struct  PSAux_Interface_
   {
-    const PS_Table_Funcs     ps_table_funcs;
-    const PS_Parser_Funcs    ps_parser_funcs;
-    const T1_Builder_Funcs*  t1_builder_funcs;
-    const T1_Decoder_Funcs   t1_decoder_funcs;
+    const PS_Table_FuncsRec*    ps_table_funcs;
+    const PS_Parser_FuncsRec*   ps_parser_funcs;
+    const T1_Builder_FuncsRec*  t1_builder_funcs;
+    const T1_Decoder_FuncsRec*  t1_decoder_funcs;
 
     void
     (*t1_decrypt)( FT_Byte*   buffer,
diff --git a/src/autohint/ahglobal.c b/src/autohint/ahglobal.c
index cd123e3..0619bb5 100644
--- a/src/autohint/ahglobal.c
+++ b/src/autohint/ahglobal.c
@@ -158,7 +158,7 @@
         /* segment; we first need to find in which contour the extremum */
         /* lies, then see its previous and next points                  */
         {
-          FT_Int  index = (FT_Int)( extremum - points );
+          FT_Int  idx = (FT_Int)( extremum - points );
           FT_Int  n;
           FT_Int  first, last, prev, next, end;
           FT_Pos  dist;
@@ -170,7 +170,7 @@
           for ( n = 0; n < glyph->outline.n_contours; n++ )
           {
             end = glyph->outline.contours[n];
-            if ( end >= index )
+            if ( end >= idx )
             {
               last = end;
               break;
@@ -185,7 +185,7 @@
           /* now look for the previous and next points that are not on the */
           /* same Y coordinate.  Threshold the `closeness'...              */
 
-          prev = index;
+          prev = idx;
           next = prev;
 
           do
@@ -199,7 +199,7 @@
             if ( dist < -5 || dist > 5 )
               break;
 
-          } while ( prev != index );
+          } while ( prev != idx );
 
           do
           {
@@ -212,7 +212,7 @@
             if ( dist < -5 || dist > 5 )
               break;
 
-          } while ( next != index );
+          } while ( next != idx );
 
           /* now, set the `round' flag depending on the segment's kind */
           round = FT_BOOL(
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index 56e7ff7..65a42a8 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -552,13 +552,13 @@
         AH_Point**  contour       = outline->contours;
         AH_Point**  contour_limit = contour + outline->num_contours;
         short*      end           = source->contours;
-        short       index         = 0;
+        short       idx           = 0;
 
 
         for ( ; contour < contour_limit; contour++, end++ )
         {
-          contour[0] = points + index;
-          index      = (short)( end[0] + 1 );
+          contour[0] = points + idx;
+          idx        = (short)( end[0] + 1 );
         }
       }
 
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 8f02467..f02b2f1 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -427,7 +427,7 @@
            ( ( al * ( ub & 0xFFFF ) + 0x8000 ) >> 16 );
     }
 
-    return ( s < 0 ? -(FT_Long)ua : ua );
+    return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua );
   }
 
 
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index 324d848..be2d910 100644
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -199,7 +199,8 @@
       FT_ULong     i;
 
 
-      new_buckets = ft_mem_table_alloc( table,
+      new_buckets = (FT_MemNode *)
+                    ft_mem_table_alloc( table,
                                         new_size * sizeof ( FT_MemNode ) );
       if ( new_buckets == NULL )
         return;
@@ -241,7 +242,7 @@
     FT_MemTable  table;
 
 
-    table = memory->alloc( memory, sizeof ( *table ) );
+    table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );
     if ( table == NULL )
       goto Exit;
 
@@ -258,7 +259,8 @@
     table->realloc = memory->realloc;
     table->free    = memory->free;
 
-    table->buckets = memory->alloc( memory,
+    table->buckets = (FT_MemNode *)
+                     memory->alloc( memory,
                                     table->size * sizeof ( FT_MemNode ) );
     if ( table->buckets )
       MEM_Set( table->buckets, 0, sizeof ( FT_MemNode ) * table->size );
@@ -395,7 +397,7 @@
       }
 
       /* we need to create a new node in this table */
-      node = ft_mem_table_alloc( table, sizeof ( *node ) );
+      node = (FT_MemNode)ft_mem_table_alloc( table, sizeof ( *node ) );
       if ( node == NULL )
         ft_mem_debug_panic( "not enough memory to run memory tests" );
 
@@ -469,14 +471,14 @@
   ft_mem_debug_alloc( FT_Memory  memory,
                       FT_Long    size )
   {
-    FT_MemTable  table = memory->user;
+    FT_MemTable  table = (FT_MemTable)memory->user;
     FT_Byte*     block;
 
 
     if ( size <= 0 )
       ft_mem_debug_panic( "negative block size allocation (%ld)", size );
 
-    block = ft_mem_table_alloc( table, size );
+    block = (FT_Byte *)ft_mem_table_alloc( table, size );
     if ( block )
       ft_mem_table_set( table, block, (FT_ULong)size );
 
@@ -491,7 +493,7 @@
   ft_mem_debug_free( FT_Memory   memory,
                      FT_Pointer  block )
   {
-    FT_MemTable  table = memory->user;
+    FT_MemTable  table = (FT_MemTable)memory->user;
 
 
     if ( block == NULL )
@@ -513,7 +515,7 @@
                         FT_Long     new_size,
                         FT_Pointer  block )
   {
-    FT_MemTable  table = memory->user;
+    FT_MemTable  table = (FT_MemTable)memory->user;
     FT_MemNode   node, *pnode;
     FT_Pointer   new_block;
 
@@ -589,7 +591,7 @@
   extern void
   ft_mem_debug_done( FT_Memory  memory )
   {
-    FT_MemTable  table = memory->user;
+    FT_MemTable  table = (FT_MemTable)memory->user;
 
 
     if ( table )
@@ -611,7 +613,7 @@
                   const char*  file_name,
                   FT_Long      line_no )
   {
-    FT_MemTable  table = memory->user;
+    FT_MemTable  table = (FT_MemTable)memory->user;
 
 
     if ( table )
@@ -631,7 +633,7 @@
                     const char*  file_name,
                     FT_Long      line_no )
   {
-    FT_MemTable  table = memory->user;
+    FT_MemTable  table = (FT_MemTable)memory->user;
 
 
     if ( table )
@@ -649,7 +651,7 @@
                  const char*  file_name,
                  FT_Long      line_no )
   {
-    FT_MemTable  table = memory->user;
+    FT_MemTable  table = (FT_MemTable)memory->user;
 
 
     if ( table )
@@ -657,7 +659,7 @@
       table->file_name = file_name;
       table->line_no   = line_no;
     }
-    FT_Free( memory, block );
+    FT_Free( memory, (void **)block );
   }
 
 
diff --git a/src/base/ftnames.c b/src/base/ftnames.c
index d38d2d5..43c6cf1 100644
--- a/src/base/ftnames.c
+++ b/src/base/ftnames.c
@@ -40,7 +40,7 @@
 
   FT_EXPORT_DEF( FT_Error )
   FT_Get_Sfnt_Name( FT_Face       face,
-                    FT_UInt       index,
+                    FT_UInt       idx,
                     FT_SfntName  *aname )
   {
     FT_Error  error = FT_Err_Invalid_Argument;
@@ -51,9 +51,9 @@
       TT_Face  ttface = (TT_Face)face;
 
 
-      if ( index < (FT_UInt)ttface->num_names )
+      if ( idx < (FT_UInt)ttface->num_names )
       {
-        TT_NameRec*  name = ttface->name_table.names + index;
+        TT_NameRec*  name = ttface->name_table.names + idx;
 
 
         aname->platform_id = name->platformID;
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index 459bf83..cda168c 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -289,7 +289,7 @@
 
 
   FT_BASE_DEF( FT_Char )
-  FT_Get_Char( FT_Stream  stream )
+  FT_Stream_Get_Char( FT_Stream  stream )
   {
     FT_Char  result;
 
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index e72c89f..9219f64 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -177,27 +177,27 @@
     if ( !error )
     {
       FT_UInt      count = face->num_charmaps;
-      FT_UInt      index = count;
+      FT_UInt      idx   = count;
       FT_CharMap*  cur   = face->charmaps;
 
 
       switch ( desc->type )
       {
       case FTC_CMAP_BY_INDEX:
-        index = desc->u.index;
-        hash  = index * 33;
+        idx  = desc->u.index;
+        hash = idx * 33;
         break;
 
       case FTC_CMAP_BY_ENCODING:
-        for ( index = 0; index < count; index++, cur++ )
+        for ( idx = 0; idx < count; idx++, cur++ )
           if ( cur[0]->encoding == desc->u.encoding )
             break;
 
-        hash = index * 67;
+        hash = idx * 67;
         break;
 
       case FTC_CMAP_BY_ID:
-        for ( index = 0; index < count; index++, cur++ )
+        for ( idx = 0; idx < count; idx++, cur++ )
         {
           if ( (FT_UInt)cur[0]->platform_id == desc->u.id.platform &&
                (FT_UInt)cur[0]->encoding_id == desc->u.id.encoding )
@@ -212,11 +212,11 @@
         ;
       }
 
-      if ( index >= count )
+      if ( idx >= count )
         goto Bad_Descriptor;
 
       /* compute hash value, both in family and query */
-      cfam->index               = index;
+      cfam->index               = idx;
       cfam->hash                = hash ^ FTC_FACE_ID_HASH( desc->face_id );
       FTC_QUERY( cquery )->hash = FTC_CMAP_HASH( cfam, cquery );
 
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index efc74c8..9d100b0 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -356,7 +356,7 @@
     if ( table->free == FTC_FAMILY_ENTRY_NONE && table->count >= table->size )
     {
       FT_UInt  old_size = table->size;
-      FT_UInt  new_size, index;
+      FT_UInt  new_size, idx;
 
 
       if ( old_size == 0 )
@@ -379,14 +379,14 @@
       entry       = table->entries + old_size;
       table->free = old_size;
 
-      for ( index = old_size; index + 1 < new_size; index++, entry++ )
+      for ( idx = old_size; idx + 1 < new_size; idx++, entry++ )
       {
-        entry->link  = index + 1;
-        entry->index = index;
+        entry->link  = idx + 1;
+        entry->index = idx;
       }
 
       entry->link  = FTC_FAMILY_ENTRY_NONE;
-      entry->index = index;
+      entry->index = idx;
     }
 
     if ( table->free != FTC_FAMILY_ENTRY_NONE )
@@ -414,12 +414,12 @@
 
   FT_EXPORT_DEF( void )
   ftc_family_table_free( FTC_FamilyTable  table,
-                         FT_UInt          index )
+                         FT_UInt          idx )
   {
     /* simply add it to the linked list of free entries */
-    if ( index < table->count )
+    if ( idx < table->count )
     {
-      FTC_FamilyEntry  entry = table->entries + index;
+      FTC_FamilyEntry  entry = table->entries + idx;
 
 
       if ( entry->link != FTC_FAMILY_ENTRY_NONE )
@@ -521,7 +521,7 @@
   FTC_Manager_Done( FTC_Manager  manager )
   {
     FT_Memory  memory;
-    FT_UInt    index;
+    FT_UInt    idx;
 
 
     if ( !manager || !manager->library )
@@ -530,16 +530,16 @@
     memory = manager->library->memory;
 
     /* now discard all caches */
-    for (index = 0; index < FTC_MAX_CACHES; index++ )
+    for (idx = 0; idx < FTC_MAX_CACHES; idx++ )
     {
-      FTC_Cache  cache = manager->caches[index];
+      FTC_Cache  cache = manager->caches[idx];
 
 
       if ( cache )
       {
         cache->clazz->cache_done( cache );
         FREE( cache );
-        manager->caches[index] = 0;
+        manager->caches[idx] = 0;
       }
     }
 
@@ -697,18 +697,18 @@
     if ( manager && clazz && acache )
     {
       FT_Memory  memory = manager->library->memory;
-      FT_UInt    index  = 0;
+      FT_UInt    idx  = 0;
 
 
       /* check for an empty cache slot in the manager's table */
-      for ( index = 0; index < FTC_MAX_CACHES; index++ )
+      for ( idx = 0; idx < FTC_MAX_CACHES; idx++ )
       {
-        if ( manager->caches[index] == 0 )
+        if ( manager->caches[idx] == 0 )
           break;
       }
 
       /* return an error if there are too many registered caches */
-      if ( index >= FTC_MAX_CACHES )
+      if ( idx >= FTC_MAX_CACHES )
       {
         error = FTC_Err_Too_Many_Caches;
         FT_ERROR(( "FTC_Manager_Register_Cache:" ));
@@ -724,7 +724,7 @@
 
         /* THIS IS VERY IMPORTANT!  IT WILL WRETCH THE MANAGER */
         /* IF IT IS NOT SET CORRECTLY                          */
-        cache->cache_index = index;
+        cache->cache_index = idx;
 
         if ( clazz->cache_init )
         {
@@ -739,7 +739,7 @@
           }
         }
 
-        manager->caches[index] = cache;
+        manager->caches[idx] = cache;
       }
     }
 
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 84d295a..9420bc1 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -393,7 +393,7 @@
     FT_Int           result;
 
 
-    cff     = face->extra.data;
+    cff     = (CFF_Font *)face->extra.data;
     charset = &cff->charset;
 
     psnames = (PSNames_Service)FT_Get_Module_Interface(
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 53efb49..7781e4f 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -1793,16 +1793,16 @@
 
         case cff_op_index:
           {
-            FT_Int  index = args[0] >> 16;
+            FT_Int  idx = args[0] >> 16;
 
 
             FT_TRACE4(( " index" ));
 
-            if ( index < 0 )
-              index = 0;
-            else if ( index > num_args - 2 )
-              index = num_args - 2;
-            args[0] = args[-( index + 1 )];
+            if ( idx < 0 )
+              idx = 0;
+            else if ( idx > num_args - 2 )
+              idx = num_args - 2;
+            args[0] = args[-( idx + 1 )];
             args++;
           }
           break;
@@ -1810,7 +1810,7 @@
         case cff_op_roll:
           {
             FT_Int  count = (FT_Int)( args[0] >> 16 );
-            FT_Int  index = (FT_Int)( args[1] >> 16 );
+            FT_Int  idx   = (FT_Int)( args[1] >> 16 );
 
 
             FT_TRACE4(( " roll" ));
@@ -1822,9 +1822,9 @@
             if ( args < stack )
               goto Stack_Underflow;
 
-            if ( index >= 0 )
+            if ( idx >= 0 )
             {
-              while ( index > 0 )
+              while ( idx > 0 )
               {
                 FT_Fixed  tmp = args[count - 1];
                 FT_Int    i;
@@ -1833,12 +1833,12 @@
                 for ( i = count - 2; i >= 0; i-- )
                   args[i + 1] = args[i];
                 args[0] = tmp;
-                index--;
+                idx--;
               }
             }
             else
             {
-              while ( index < 0 )
+              while ( idx < 0 )
               {
                 FT_Fixed  tmp = args[0];
                 FT_Int    i;
@@ -1847,7 +1847,7 @@
                 for ( i = 0; i < count - 1; i++ )
                   args[i] = args[i + 1];
                 args[count - 1] = tmp;
-                index++;
+                idx++;
               }
             }
             args += count;
@@ -1863,27 +1863,27 @@
 
         case cff_op_put:
           {
-            FT_Fixed  val   = args[0];
-            FT_Int    index = (FT_Int)( args[1] >> 16 );
+            FT_Fixed  val = args[0];
+            FT_Int    idx = (FT_Int)( args[1] >> 16 );
 
 
             FT_TRACE4(( " put" ));
 
-            if ( index >= 0 && index < decoder->len_buildchar )
-              decoder->buildchar[index] = val;
+            if ( idx >= 0 && idx < decoder->len_buildchar )
+              decoder->buildchar[idx] = val;
           }
           break;
 
         case cff_op_get:
           {
-            FT_Int   index = (FT_Int)( args[0] >> 16 );
-            FT_Fixed val   = 0;
+            FT_Int    idx = (FT_Int)( args[0] >> 16 );
+            FT_Fixed  val = 0;
 
 
             FT_TRACE4(( " get" ));
 
-            if ( index >= 0 && index < decoder->len_buildchar )
-              val = decoder->buildchar[index];
+            if ( idx >= 0 && idx < decoder->len_buildchar )
+              val = decoder->buildchar[idx];
 
             args[0] = val;
             args++;
@@ -1956,13 +1956,13 @@
 
         case cff_op_callsubr:
           {
-            FT_UInt  index = (FT_UInt)( ( args[0] >> 16 ) +
-                                        decoder->locals_bias );
+            FT_UInt  idx = (FT_UInt)( ( args[0] >> 16 ) +
+                                      decoder->locals_bias );
 
 
-            FT_TRACE4(( " callsubr(%d)", index ));
+            FT_TRACE4(( " callsubr(%d)", idx ));
 
-            if ( index >= decoder->num_locals )
+            if ( idx >= decoder->num_locals )
             {
               FT_ERROR(( "CFF_Parse_CharStrings:" ));
               FT_ERROR(( "  invalid local subr index\n" ));
@@ -1978,8 +1978,8 @@
             zone->cursor = ip;  /* save current instruction pointer */
 
             zone++;
-            zone->base   = decoder->locals[index];
-            zone->limit  = decoder->locals[index + 1];
+            zone->base   = decoder->locals[idx];
+            zone->limit  = decoder->locals[idx + 1];
             zone->cursor = zone->base;
 
             if ( !zone->base )
@@ -1996,13 +1996,13 @@
 
         case cff_op_callgsubr:
           {
-            FT_UInt  index = (FT_UInt)( ( args[0] >> 16 ) +
-                                        decoder->globals_bias );
+            FT_UInt  idx = (FT_UInt)( ( args[0] >> 16 ) +
+                                      decoder->globals_bias );
 
 
-            FT_TRACE4(( " callgsubr(%d)", index ));
+            FT_TRACE4(( " callgsubr(%d)", idx ));
 
-            if ( index >= decoder->num_globals )
+            if ( idx >= decoder->num_globals )
             {
               FT_ERROR(( "CFF_Parse_CharStrings:" ));
               FT_ERROR(( " invalid global subr index\n" ));
@@ -2018,8 +2018,8 @@
             zone->cursor = ip;  /* save current instruction pointer */
 
             zone++;
-            zone->base   = decoder->globals[index];
-            zone->limit  = decoder->globals[index+1];
+            zone->base   = decoder->globals[idx];
+            zone->limit  = decoder->globals[idx + 1];
             zone->cursor = zone->base;
 
             if ( !zone->base )
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 12202b6..006bb3d 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1082,18 +1082,18 @@
 
 
   static FT_Error
-  cff_new_index( CFF_Index  index,
-                 FT_Stream   stream,
-                 FT_Bool     load )
+  cff_new_index( CFF_Index  idx,
+                 FT_Stream  stream,
+                 FT_Bool    load )
   {
     FT_Error   error;
     FT_Memory  memory = stream->memory;
     FT_UShort  count;
 
 
-    MEM_Set( index, 0, sizeof ( *index ) );
+    MEM_Set( idx, 0, sizeof ( *idx ) );
 
-    index->stream = stream;
+    idx->stream = stream;
     if ( !READ_UShort( count ) &&
          count > 0             )
     {
@@ -1108,16 +1108,16 @@
       if ( READ_Byte( offsize ) )
         goto Exit;
 
-      index->stream   = stream;
-      index->count    = count;
-      index->off_size = offsize;
-      data_size       = (FT_ULong)( count + 1 ) * offsize;
+      idx->stream   = stream;
+      idx->count    = count;
+      idx->off_size = offsize;
+      data_size     = (FT_ULong)( count + 1 ) * offsize;
 
-      if ( ALLOC_ARRAY( index->offsets, count + 1, FT_ULong ) ||
-           ACCESS_Frame( data_size )                          )
+      if ( ALLOC_ARRAY( idx->offsets, count + 1, FT_ULong ) ||
+           ACCESS_Frame( data_size )                        )
         goto Exit;
 
-      poff = index->offsets;
+      poff = idx->offsets;
       p    = (FT_Byte*)stream->cursor;
 
       for ( ; (FT_Short)count >= 0; count-- )
@@ -1129,13 +1129,13 @@
 
       FORGET_Frame();
 
-      index->data_offset = FILE_Pos();
-      data_size          = poff[-1] - 1;
+      idx->data_offset = FILE_Pos();
+      data_size        = poff[-1] - 1;
 
       if ( load )
       {
         /* load the data */
-        if ( EXTRACT_Frame( data_size, index->bytes ) )
+        if ( EXTRACT_Frame( data_size, idx->bytes ) )
           goto Exit;
       }
       else
@@ -1148,52 +1148,52 @@
 
   Exit:
     if ( error )
-      FREE( index->offsets );
+      FREE( idx->offsets );
 
     return error;
   }
 
 
   static void
-  cff_done_index( CFF_Index  index )
+  cff_done_index( CFF_Index  idx )
   {
-    if ( index->stream )
+    if ( idx->stream )
     {
-      FT_Stream  stream = index->stream;
+      FT_Stream  stream = idx->stream;
       FT_Memory  memory = stream->memory;
 
 
-      if ( index->bytes )
-        RELEASE_Frame( index->bytes );
+      if ( idx->bytes )
+        RELEASE_Frame( idx->bytes );
 
-      FREE( index->offsets );
-      MEM_Set( index, 0, sizeof ( *index ) );
+      FREE( idx->offsets );
+      MEM_Set( idx, 0, sizeof ( *idx ) );
     }
   }
 
 
   static FT_Error
-  cff_explicit_index( CFF_Index  index,
+  cff_explicit_index( CFF_Index   idx,
                       FT_Byte***  table )
   {
     FT_Error   error  = 0;
-    FT_Memory  memory = index->stream->memory;
+    FT_Memory  memory = idx->stream->memory;
     FT_UInt    n, offset, old_offset;
     FT_Byte**  t;
 
 
     *table = 0;
 
-    if ( index->count > 0 && !ALLOC_ARRAY( t, index->count + 1, FT_Byte* ) )
+    if ( idx->count > 0 && !ALLOC_ARRAY( t, idx->count + 1, FT_Byte* ) )
     {
       old_offset = 1;
-      for ( n = 0; n <= index->count; n++ )
+      for ( n = 0; n <= idx->count; n++ )
       {
-        offset = index->offsets[n];
+        offset = idx->offsets[n];
         if ( !offset )
           offset = old_offset;
 
-        t[n] = index->bytes + offset - 1;
+        t[n] = idx->bytes + offset - 1;
 
         old_offset = offset;
       }
@@ -1205,29 +1205,29 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  CFF_Access_Element( CFF_Index  index,
-                      FT_UInt     element,
-                      FT_Byte**   pbytes,
-                      FT_ULong*   pbyte_len )
+  CFF_Access_Element( CFF_Index  idx,
+                      FT_UInt    element,
+                      FT_Byte**  pbytes,
+                      FT_ULong*  pbyte_len )
   {
     FT_Error  error = 0;
 
 
-    if ( index && index->count > element )
+    if ( idx && idx->count > element )
     {
       /* compute start and end offsets */
       FT_ULong  off1, off2 = 0;
 
 
-      off1 = index->offsets[element];
+      off1 = idx->offsets[element];
       if ( off1 )
       {
         do
         {
           element++;
-          off2 = index->offsets[element];
+          off2 = idx->offsets[element];
 
-        } while ( off2 == 0 && element < index->count );
+        } while ( off2 == 0 && element < idx->count );
 
         if ( !off2 )
           off1 = 0;
@@ -1238,18 +1238,18 @@
       {
         *pbyte_len = off2 - off1;
 
-        if ( index->bytes )
+        if ( idx->bytes )
         {
           /* this index was completely loaded in memory, that's easy */
-          *pbytes = index->bytes + off1 - 1;
+          *pbytes = idx->bytes + off1 - 1;
         }
         else
         {
           /* this index is still on disk/file, access it through a frame */
-          FT_Stream  stream = index->stream;
+          FT_Stream  stream = idx->stream;
 
 
-          if ( FILE_Seek( index->data_offset + off1 - 1 ) ||
+          if ( FILE_Seek( idx->data_offset + off1 - 1 ) ||
                EXTRACT_Frame( off2 - off1, *pbytes )      )
             goto Exit;
         }
@@ -1270,12 +1270,12 @@
 
 
   FT_LOCAL_DEF( void )
-  CFF_Forget_Element( CFF_Index  index,
-                      FT_Byte**   pbytes )
+  CFF_Forget_Element( CFF_Index  idx,
+                      FT_Byte**  pbytes )
   {
-    if ( index->bytes == 0 )
+    if ( idx->bytes == 0 )
     {
-      FT_Stream  stream = index->stream;
+      FT_Stream  stream = idx->stream;
 
 
       RELEASE_Frame( *pbytes );
@@ -1284,17 +1284,17 @@
 
 
   FT_LOCAL_DEF( FT_String* )
-  CFF_Get_Name( CFF_Index  index,
-                FT_UInt     element )
+  CFF_Get_Name( CFF_Index  idx,
+                FT_UInt    element )
   {
-    FT_Memory   memory = index->stream->memory;
+    FT_Memory   memory = idx->stream->memory;
     FT_Byte*    bytes;
     FT_ULong    byte_len;
     FT_Error    error;
     FT_String*  name = 0;
 
 
-    error = CFF_Access_Element( index, element, &bytes, &byte_len );
+    error = CFF_Access_Element( idx, element, &bytes, &byte_len );
     if ( error )
       goto Exit;
 
@@ -1303,7 +1303,7 @@
       MEM_Copy( name, bytes, byte_len );
       name[byte_len] = 0;
     }
-    CFF_Forget_Element( index, &bytes );
+    CFF_Forget_Element( idx, &bytes );
 
   Exit:
     return name;
@@ -1311,13 +1311,13 @@
 
 
   FT_LOCAL_DEF( FT_String* )
-  CFF_Get_String( CFF_Index          index,
-                  FT_UInt             sid,
+  CFF_Get_String( CFF_Index        idx,
+                  FT_UInt          sid,
                   PSNames_Service  interface )
   {
     /* if it is not a standard string, return it */
     if ( sid > 390 )
-      return CFF_Get_Name( index, sid - 391 );
+      return CFF_Get_Name( idx, sid - 391 );
 
     /* that's a standard string, fetch a copy from the PSName module */
     {
@@ -1328,7 +1328,7 @@
 
       if ( adobe_name )
       {
-        FT_Memory  memory = index->stream->memory;
+        FT_Memory  memory = idx->stream->memory;
         FT_Error   error;
 
 
@@ -1958,7 +1958,7 @@
 
   static FT_Error
   CFF_Load_SubFont( CFF_SubFont*  font,
-                    CFF_Index    index,
+                    CFF_Index     idx,
                     FT_UInt       font_index,
                     FT_Stream     stream,
                     FT_ULong      base_offset )
@@ -1983,10 +1983,10 @@
     top->font_matrix.yy      = 0x10000L;
     top->cid_count           = 8720;
 
-    error = CFF_Access_Element( index, font_index, &dict, &dict_len ) ||
+    error = CFF_Access_Element( idx, font_index, &dict, &dict_len ) ||
             CFF_Parser_Run( &parser, dict, dict + dict_len );
 
-    CFF_Forget_Element( index, &dict );
+    CFF_Forget_Element( idx, &dict );
 
     if ( error )
       goto Exit;
@@ -2034,7 +2034,7 @@
 
       font->num_local_subrs = font->local_subrs_index.count;
       error = cff_explicit_index( &font->local_subrs_index,
-                                     &font->local_subrs );
+                                  &font->local_subrs );
       if ( error )
         goto Exit;
     }
@@ -2137,9 +2137,9 @@
     /* now, check for a CID font */
     if ( dict->cid_registry )
     {
-      CFF_IndexRec     fd_index;
+      CFF_IndexRec  fd_index;
       CFF_SubFont*  sub;
-      FT_UInt       index;
+      FT_UInt       idx;
 
 
       /* this is a CID-keyed font, we must now allocate a table of */
@@ -2163,14 +2163,14 @@
         goto Fail_CID;
 
       /* setup pointer table */
-      for ( index = 0; index < fd_index.count; index++ )
-        font->subfonts[index] = sub + index;
+      for ( idx = 0; idx < fd_index.count; idx++ )
+        font->subfonts[idx] = sub + idx;
 
       /* now load each sub font independently */
-      for ( index = 0; index < fd_index.count; index++ )
+      for ( idx = 0; idx < fd_index.count; idx++ )
       {
-        sub = font->subfonts[index];
-        error = CFF_Load_SubFont( sub, &fd_index, index,
+        sub = font->subfonts[idx];
+        error = CFF_Load_SubFont( sub, &fd_index, idx,
                                   stream, base_offset );
         if ( error )
           goto Fail_CID;
@@ -2243,7 +2243,7 @@
   CFF_Done_Font( CFF_Font*  font )
   {
     FT_Memory  memory = font->memory;
-    FT_UInt    index;
+    FT_UInt    idx;
 
 
     cff_done_index( &font->global_subrs_index );
@@ -2256,8 +2256,8 @@
     /* a CID keyed CFF font                                */
     if ( font->num_subfonts > 0 )
     {
-      for ( index = 0; index < font->num_subfonts; index++ )
-        CFF_Done_SubFont( memory, font->subfonts[index] );
+      for ( idx = 0; idx < font->num_subfonts; idx++ )
+        CFF_Done_SubFont( memory, font->subfonts[idx] );
 
       FREE( font->subfonts );
     }
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 51af7d8..258e339 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -59,10 +59,10 @@
   static PSH_Globals_Funcs
   CFF_Size_Get_Globals_Funcs( CFF_Size  size )
   {
-    CFF_Face           face     = (CFF_Face)size->face;
-    CFF_Font*          font     = face->extra.data;
-    PSHinter_Service   pshinter = font->pshinter;
-    FT_Module          module;
+    CFF_Face          face     = (CFF_Face)size->face;
+    CFF_Font*         font     = (CFF_Font *)face->extra.data;
+    PSHinter_Service  pshinter = (PSHinter_Service)font->pshinter;
+    FT_Module         module;
 
 
     module = FT_Get_Module( size->face->driver->root.library,
@@ -101,7 +101,7 @@
     {
       PSH_Globals    globals;
       CFF_Face       face    = (CFF_Face)size->face;
-      CFF_Font*      font    = face->extra.data;
+      CFF_Font*      font    = (CFF_Font *)face->extra.data;
       CFF_SubFont*   subfont = &font->top_font;
 
       CFF_Private   cpriv   = &subfont->private_dict;
@@ -195,9 +195,9 @@
   FT_LOCAL_DEF( FT_Error )
   CFF_GlyphSlot_Init( CFF_GlyphSlot  slot )
   {
-    CFF_Face             face     = (CFF_Face)slot->root.face;
-    CFF_Font*            font     = face->extra.data;
-    PSHinter_Service  pshinter = font->pshinter;
+    CFF_Face          face     = (CFF_Face)slot->root.face;
+    CFF_Font*         font     = (CFF_Font *)face->extra.data;
+    PSHinter_Service  pshinter = (PSHinter_Service)font->pshinter;
 
 
     if ( pshinter )
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index 1c7207e..4aee956 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -52,14 +52,14 @@
 
 
   FT_LOCAL_DEF( FT_Error )
-  CID_GlyphSlot_Init( CID_GlyphSlot   slot )
+  CID_GlyphSlot_Init( CID_GlyphSlot  slot )
   {
-    CID_Face             face;
+    CID_Face          face;
     PSHinter_Service  pshinter;
 
 
-    face     = (CID_Face) slot->root.face;
-    pshinter = face->pshinter;
+    face     = (CID_Face)slot->root.face;
+    pshinter = (PSHinter_Service)face->pshinter;
 
     if ( pshinter )
     {
@@ -92,9 +92,9 @@
   static PSH_Globals_Funcs
   CID_Size_Get_Globals_Funcs( CID_Size  size )
   {
-    CID_Face             face     = (CID_Face)size->root.face;
-    PSHinter_Service  pshinter = face->pshinter;
-    FT_Module            module;
+    CID_Face          face     = (CID_Face)size->root.face;
+    PSHinter_Service  pshinter = (PSHinter_Service)face->pshinter;
+    FT_Module         module;
 
 
     module = FT_Get_Module( size->root.face->driver->root.library,
diff --git a/src/psaux/psauxmod.c b/src/psaux/psauxmod.c
index 72a9b82..6d99aff 100644
--- a/src/psaux/psauxmod.c
+++ b/src/psaux/psauxmod.c
@@ -51,7 +51,7 @@
 
 
   FT_CALLBACK_TABLE_DEF
-  const T1_Builder_Funcs  t1_builder_funcs =
+  const T1_Builder_FuncsRec  t1_builder_funcs =
   {
     T1_Builder_Init,
     T1_Builder_Done,
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 7dadb0a..8514132 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -151,11 +151,11 @@
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   PS_Table_Add( PS_Table  table,
-                FT_Int     index,
-                void*      object,
-                FT_Int     length )
+                FT_Int    idx,
+                void*     object,
+                FT_Int    length )
   {
-    if ( index < 0 || index > table->max_elems )
+    if ( idx < 0 || idx > table->max_elems )
     {
       FT_ERROR(( "PS_Table_Add: invalid index\n" ));
       return PSaux_Err_Invalid_Argument;
@@ -185,8 +185,8 @@
     }
 
     /* add the object to the base block and adjust offset */
-    table->elements[index] = table->block + table->cursor;
-    table->lengths [index] = length;
+    table->elements[idx] = table->block + table->cursor;
+    table->lengths [idx] = length;
     MEM_Copy( table->block + table->cursor, object, length );
 
     table->cursor += length;
@@ -794,7 +794,7 @@
     FT_Byte*  cur;
     FT_Byte*  limit;
     FT_UInt   count;
-    FT_UInt   index;
+    FT_UInt   idx;
     FT_Error  error;
 
 
@@ -803,7 +803,7 @@
       goto Fail;
 
     count = 1;
-    index = 0;
+    idx   = 0;
     cur   = token.start;
     limit = token.limit;
 
@@ -814,12 +814,12 @@
         goto Fail;
 
       count = max_objects;
-      index = 1;
+      idx = 1;
     }
 
-    for ( ; count > 0; count--, index++ )
+    for ( ; count > 0; count--, idx++ )
     {
-      FT_Byte*    q = (FT_Byte*)objects[index] + field->offset;
+      FT_Byte*    q = (FT_Byte*)objects[idx] + field->offset;
       FT_Long     val;
       FT_String*  string;
 
diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h
index dac58fb..23fd0cc 100644
--- a/src/psaux/psobjs.h
+++ b/src/psaux/psobjs.h
@@ -37,13 +37,13 @@ FT_BEGIN_HEADER
 
 
   FT_CALLBACK_TABLE
-  const PS_Table_FuncsRec   ps_table_funcs;
+  const PS_Table_FuncsRec    ps_table_funcs;
 
   FT_CALLBACK_TABLE
-  const PS_Parser_FuncsRec  ps_parser_funcs;
+  const PS_Parser_FuncsRec   ps_parser_funcs;
 
   FT_CALLBACK_TABLE
-  const T1_Builder_Funcs    t1_builder_funcs;
+  const T1_Builder_FuncsRec  t1_builder_funcs;
 
 
   FT_LOCAL( FT_Error )
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index 8a4bb84..9c67360 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -575,7 +575,8 @@
 
         case 2:                     /* add flex vectors */
           {
-            FT_Int  index;
+            FT_Int  idx;
+
 
             if ( top[0] != 0 )
               goto Unexpected_OtherSubr;
@@ -583,12 +584,12 @@
             /* note that we should not add a point for index 0; */
             /* this will move our current position to the flex  */
             /* point without adding any point to the outline    */
-            index = decoder->num_flex_vectors++;
-            if ( index > 0 && index < 7 )
+            idx = decoder->num_flex_vectors++;
+            if ( idx > 0 && idx < 7 )
               add_point( builder,
                          x,
                          y,
-                         (FT_Byte)( index == 3 || index == 6 ) );
+                         (FT_Byte)( idx == 3 || idx == 6 ) );
           }
           break;
 
@@ -933,13 +934,13 @@
 
         case op_callsubr:
           {
-            FT_Int  index;
+            FT_Int  idx;
 
 
             FT_TRACE4(( " callsubr" ));
 
-            index = top[0];
-            if ( index < 0 || index >= (FT_Int)decoder->num_subrs )
+            idx = top[0];
+            if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
             {
               FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
                          "invalid subrs index\n" ));
@@ -960,16 +961,16 @@
             /* The Type 1 driver stores subroutines without the seed bytes. */
             /* The CID driver stores subroutines with seed bytes.  This     */
             /* case is taken care of when decoder->subrs_len == 0.          */
-            zone->base = decoder->subrs[index];
+            zone->base = decoder->subrs[idx];
 
             if ( decoder->subrs_len )
-              zone->limit = zone->base + decoder->subrs_len[index];
+              zone->limit = zone->base + decoder->subrs_len[idx];
             else
             {
               /* We are using subroutines from a CID font.  We must adjust */
               /* for the seed bytes.                                       */
               zone->base  += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );
-              zone->limit  = decoder->subrs[index + 1];
+              zone->limit  = decoder->subrs[idx + 1];
             }
 
             zone->cursor = zone->base;
diff --git a/src/pshinter/pshalgo1.c b/src/pshinter/pshalgo1.c
index 438e99c..c09260b 100644
--- a/src/pshinter/pshalgo1.c
+++ b/src/pshinter/pshalgo1.c
@@ -84,14 +84,14 @@
   /* internal function used to record a new hint */
   static void
   psh1_hint_table_record( PSH1_Hint_Table  table,
-                          FT_UInt          index )
+                          FT_UInt          idx )
   {
-    PSH1_Hint  hint = table->hints + index;
+    PSH1_Hint  hint = table->hints + idx;
 
 
-    if ( index >= table->max_hints )
+    if ( idx >= table->max_hints )
     {
-      FT_ERROR(( "%s.activate: invalid hint index %d\n", index ));
+      FT_ERROR(( "%s.activate: invalid hint index %d\n", idx ));
       return;
     }
 
@@ -136,7 +136,7 @@
   {
     FT_Int    mask = 0, val = 0;
     FT_Byte*  cursor = hint_mask->bytes;
-    FT_UInt   index, limit;
+    FT_UInt   idx, limit;
 
 
     limit = hint_mask->num_bits;
@@ -145,7 +145,7 @@
       FT_ERROR(( "%s.activate_mask: invalid bit count (%d instead of %d)\n",
                  "ps.fitter", hint_mask->num_bits, table->max_hints ));
 
-    for ( index = 0; index < limit; index++ )
+    for ( idx = 0; idx < limit; idx++ )
     {
       if ( mask == 0 )
       {
@@ -154,7 +154,7 @@
       }
 
       if ( val & mask )
-        psh1_hint_table_record( table, index );
+        psh1_hint_table_record( table, idx );
 
       mask >>= 1;
     }
@@ -238,7 +238,7 @@
   {
     FT_Int    mask = 0, val = 0;
     FT_Byte*  cursor = hint_mask->bytes;
-    FT_UInt   index, limit, count;
+    FT_UInt   idx, limit, count;
 
 
     limit = hint_mask->num_bits;
@@ -246,7 +246,7 @@
 
     psh1_hint_table_deactivate( table );
 
-    for ( index = 0; index < limit; index++ )
+    for ( idx = 0; idx < limit; idx++ )
     {
       if ( mask == 0 )
       {
@@ -256,7 +256,7 @@
 
       if ( val & mask )
       {
-        PSH1_Hint  hint = &table->hints[index];
+        PSH1_Hint  hint = &table->hints[idx];
 
 
         if ( !psh1_hint_is_active( hint ) )
diff --git a/src/pshinter/pshalgo2.c b/src/pshinter/pshalgo2.c
index bbc5265..35f18af 100644
--- a/src/pshinter/pshalgo2.c
+++ b/src/pshinter/pshalgo2.c
@@ -85,14 +85,14 @@
   /* internal function used to record a new hint */
   static void
   psh2_hint_table_record( PSH2_Hint_Table  table,
-                          FT_UInt          index )
+                          FT_UInt          idx )
   {
-    PSH2_Hint  hint = table->hints + index;
+    PSH2_Hint  hint = table->hints + idx;
 
 
-    if ( index >= table->max_hints )
+    if ( idx >= table->max_hints )
     {
-      FT_ERROR(( "%s.activate: invalid hint index %d\n", index ));
+      FT_ERROR(( "%s.activate: invalid hint index %d\n", idx ));
       return;
     }
 
@@ -137,12 +137,12 @@
   {
     FT_Int    mask = 0, val = 0;
     FT_Byte*  cursor = hint_mask->bytes;
-    FT_UInt   index, limit;
+    FT_UInt   idx, limit;
 
 
     limit = hint_mask->num_bits;
 
-    for ( index = 0; index < limit; index++ )
+    for ( idx = 0; idx < limit; idx++ )
     {
       if ( mask == 0 )
       {
@@ -151,7 +151,7 @@
       }
 
       if ( val & mask )
-        psh2_hint_table_record( table, index );
+        psh2_hint_table_record( table, idx );
 
       mask >>= 1;
     }
@@ -235,7 +235,7 @@
   {
     FT_Int    mask = 0, val = 0;
     FT_Byte*  cursor = hint_mask->bytes;
-    FT_UInt   index, limit, count;
+    FT_UInt   idx, limit, count;
 
 
     limit = hint_mask->num_bits;
@@ -243,7 +243,7 @@
 
     psh2_hint_table_deactivate( table );
 
-    for ( index = 0; index < limit; index++ )
+    for ( idx = 0; idx < limit; idx++ )
     {
       if ( mask == 0 )
       {
@@ -253,7 +253,7 @@
 
       if ( val & mask )
       {
-        PSH2_Hint  hint = &table->hints[index];
+        PSH2_Hint  hint = &table->hints[idx];
 
 
         if ( !psh2_hint_is_active( hint ) )
diff --git a/src/pshinter/pshglob.h b/src/pshinter/pshglob.h
index a0ba233..0c666b7 100644
--- a/src/pshinter/pshglob.h
+++ b/src/pshinter/pshglob.h
@@ -141,20 +141,16 @@ FT_BEGIN_HEADER
   } PSH_GlobalsRec;
 
 
-  typedef enum
-  {
-    PSH_BLUE_ALIGN_NONE = 0,
-    PSH_BLUE_ALIGN_TOP = 1,
-    PSH_BLUE_ALIGN_BOT = 2
-
-  } PSH_Blue_Align;
+#define PSH_BLUE_ALIGN_NONE  0
+#define PSH_BLUE_ALIGN_TOP   1
+#define PSH_BLUE_ALIGN_BOT   2
 
 
   typedef struct  PSH_AlignmentRec_
   {
-    PSH_Blue_Align  align;
-    FT_Pos          align_top;
-    FT_Pos          align_bot;
+    int     align;
+    FT_Pos  align_top;
+    FT_Pos  align_bot;
 
   } PSH_AlignmentRec, *PSH_Alignment;
 
diff --git a/src/pshinter/pshmod.c b/src/pshinter/pshmod.c
index 47d38ba..afaf73a 100644
--- a/src/pshinter/pshmod.c
+++ b/src/pshinter/pshmod.c
@@ -91,8 +91,8 @@
   }
 
 
-  FT_CALLBACK_DEF( PSHinter_Interface )
-  pshinter_interface =
+  static
+  const PSHinter_Interface  pshinter_interface =
   {
     pshinter_get_globals_funcs,
     pshinter_get_t1_funcs,
diff --git a/src/pshinter/pshrec.c b/src/pshinter/pshrec.c
index e5485f4..eb72563 100644
--- a/src/pshinter/pshrec.c
+++ b/src/pshinter/pshrec.c
@@ -151,55 +151,55 @@
   /* test a bit value in a given mask */
   static FT_Int
   ps_mask_test_bit( PS_Mask  mask,
-                    FT_Int   index )
+                    FT_Int   idx )
   {
-    if ( (FT_UInt)index >= mask->num_bits )
+    if ( (FT_UInt)idx >= mask->num_bits )
       return 0;
 
-    return mask->bytes[index >> 3] & ( 0x80 >> ( index & 7 ) );
+    return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) );
   }
 
 
   /* clear a given bit */
   static void
   ps_mask_clear_bit( PS_Mask  mask,
-                     FT_Int   index )
+                     FT_Int   idx )
   {
     FT_Byte*  p;
 
 
-    if ( (FT_UInt)index >= mask->num_bits )
+    if ( (FT_UInt)idx >= mask->num_bits )
       return;
 
-    p    = mask->bytes + ( index >> 3 );
-    p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( index & 7 ) ) );
+    p    = mask->bytes + ( idx >> 3 );
+    p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( idx & 7 ) ) );
   }
 
 
   /* set a given bit, possibly grow the mask */
   static FT_Error
   ps_mask_set_bit( PS_Mask    mask,
-                   FT_Int     index,
+                   FT_Int     idx,
                    FT_Memory  memory )
   {
     FT_Error  error = 0;
     FT_Byte*  p;
 
 
-    if ( index < 0 )
+    if ( idx < 0 )
       goto Exit;
 
-    if ( (FT_UInt)index >= mask->num_bits )
+    if ( (FT_UInt)idx >= mask->num_bits )
     {
-      error = ps_mask_ensure( mask, index + 1, memory );
+      error = ps_mask_ensure( mask, idx + 1, memory );
       if ( error )
         goto Exit;
 
-      mask->num_bits = index + 1;
+      mask->num_bits = idx + 1;
     }
 
-    p    = mask->bytes + ( index >> 3 );
-    p[0] = (FT_Byte)( p[0] | ( 0x80 >> ( index & 7 ) ) );
+    p    = mask->bytes + ( idx >> 3 );
+    p[0] = (FT_Byte)( p[0] | ( 0x80 >> ( idx & 7 ) ) );
 
   Exit:
     return error;
@@ -554,7 +554,7 @@
   /* set a bit at a given index in the current hint mask */
   static FT_Error
   ps_dimension_set_mask_bit( PS_Dimension  dim,
-                             FT_UInt       index,
+                             FT_UInt       idx,
                              FT_Memory     memory )
   {
     PS_Mask  mask;
@@ -566,7 +566,7 @@
     if ( error )
       goto Exit;
 
-    error = ps_mask_set_bit( mask, index, memory );
+    error = ps_mask_set_bit( mask, idx, memory );
 
   Exit:
     return error;
@@ -665,19 +665,19 @@
     /* now, lookup stem in the current hints table */
     {
       PS_Mask  mask;
-      FT_UInt  index;
+      FT_UInt  idx;
       FT_UInt  max   = dim->hints.num_hints;
       PS_Hint  hint  = dim->hints.hints;
 
 
-      for ( index = 0; index < max; index++, hint++ )
+      for ( idx = 0; idx < max; idx++, hint++ )
       {
         if ( hint->pos == pos && hint->len == len )
           break;
       }
 
       /* we need to create a new hint in the table */
-      if ( index >= max )
+      if ( idx >= max )
       {
         error = ps_hint_table_alloc( &dim->hints, memory, &hint );
         if ( error )
@@ -693,12 +693,12 @@
       if ( error )
         goto Exit;
 
-      error = ps_mask_set_bit( mask, index, memory );
+      error = ps_mask_set_bit( mask, idx, memory );
       if ( error )
         goto Exit;
 
       if ( aindex )
-        *aindex = (FT_Int)index;
+        *aindex = (FT_Int)idx;
     }
 
   Exit:
@@ -898,7 +898,7 @@
       PS_Dimension  dim;
       FT_Memory     memory = hints->memory;
       FT_Int        count;
-      FT_Int        index[3];
+      FT_Int        idx[3];
 
 
       /* limit "dimension" to 0..1 */
@@ -918,14 +918,14 @@
         for ( count = 0; count < 3; count++, stems += 2 )
         {
           error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
-                                           memory, &index[count] );
+                                           memory, &idx[count] );
           if ( error )
             goto Fail;
         }
 
         /* now, add the hints to the counters table */
-        error = ps_dimension_add_counter( dim, index[0], index[1],
-                                          index[2], memory );
+        error = ps_dimension_add_counter( dim, idx[0], idx[1], idx[2],
+                                          memory );
         if ( error )
           goto Fail;
       }
diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c
index fa2baee..628ec63 100644
--- a/src/sfnt/ttpost.c
+++ b/src/sfnt/ttpost.c
@@ -204,15 +204,15 @@
 
       for ( n = 0; n < num_glyphs; n++ )
       {
-        FT_Int  index;
+        FT_Int  idx;
 
 
-        index = glyph_indices[n];
-        if ( index >= 258 )
+        idx = glyph_indices[n];
+        if ( idx >= 258 )
         {
-          index -= 257;
-          if ( index > num_names )
-            num_names = (FT_UShort)index;
+          idx -= 257;
+          if ( idx > num_names )
+            num_names = (FT_UShort)idx;
         }
       }
     }
@@ -303,10 +303,10 @@
 
       for ( n = 0; n < num_glyphs; n++ )
       {
-        FT_Long  index = (FT_Long)n + offset_table[n];
+        FT_Long  idx = (FT_Long)n + offset_table[n];
 
 
-        if ( index < 0 || index > num_glyphs )
+        if ( idx < 0 || idx > num_glyphs )
         {
           error = SFNT_Err_Invalid_File_Format;
           goto Fail;
@@ -431,7 +431,7 @@
   /* <Input>                                                               */
   /*    face   :: A handle to the parent face.                             */
   /*                                                                       */
-  /*    index  :: The glyph index.                                         */
+  /*    idx    :: The glyph index.                                         */
   /*                                                                       */
   /*    PSname :: The address of a string pointer.  Will be NULL in case   */
   /*              of error, otherwise it is a pointer to the glyph name.   */
@@ -443,7 +443,7 @@
   /*                                                                       */
   FT_LOCAL_DEF( FT_Error )
   TT_Get_PS_Name( TT_Face      face,
-                  FT_UInt      index,
+                  FT_UInt      idx,
                   FT_String**  PSname )
   {
     FT_Error            error;
@@ -457,7 +457,7 @@
     if ( !face )
       return SFNT_Err_Invalid_Face_Handle;
 
-    if ( index >= (FT_UInt)face->root.num_glyphs )
+    if ( idx >= (FT_UInt)face->root.num_glyphs )
       return SFNT_Err_Invalid_Glyph_Index;
 
 #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
@@ -474,8 +474,8 @@
     switch ( face->postscript.FormatType )
     {
     case 0x00010000L:
-      if ( index < 258 )                    /* paranoid checking */
-        *PSname = MAC_NAME( index );
+      if ( idx < 258 )                    /* paranoid checking */
+        *PSname = MAC_NAME( idx );
       break;
 
     case 0x00020000L:
@@ -490,9 +490,9 @@
             break;
         }
 
-        if ( index < (FT_UInt)table->num_glyphs )
+        if ( idx < (FT_UInt)table->num_glyphs )
         {
-          FT_UShort  name_index = table->glyph_indices[index];
+          FT_UShort  name_index = table->glyph_indices[idx];
 
 
           if ( name_index < 258 )
@@ -515,10 +515,10 @@
             break;
         }
 
-        if ( index < (FT_UInt)table->num_glyphs )    /* paranoid checking */
+        if ( idx < (FT_UInt)table->num_glyphs )    /* paranoid checking */
         {
-          index  += table->offsets[index];
-          *PSname = MAC_NAME( index );
+          idx    += table->offsets[idx];
+          *PSname = MAC_NAME( idx );
         }
       }
       break;
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index ba5ee72..5201a67 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -70,7 +70,7 @@
   /*    header  :: A pointer to either the horizontal or vertical metrics  */
   /*               structure.                                              */
   /*                                                                       */
-  /*    index   :: The glyph index.                                        */
+  /*    idx     :: The glyph index.                                        */
   /*                                                                       */
   /* <Output>                                                              */
   /*    bearing :: The bearing, either left side or top side.              */
@@ -83,7 +83,7 @@
   /*                                                                       */
   FT_LOCAL_DEF( void )
   TT_Get_Metrics( TT_HoriHeader*  header,
-                  FT_UInt         index,
+                  FT_UInt         idx,
                   FT_Short*       bearing,
                   FT_UShort*      advance )
   {
@@ -91,15 +91,15 @@
     FT_UShort        k = header->number_Of_HMetrics;
 
 
-    if ( index < (FT_UInt)k )
+    if ( idx < (FT_UInt)k )
     {
-      longs_m  = (TT_LongMetrics*)header->long_metrics + index;
+      longs_m  = (TT_LongMetrics*)header->long_metrics + idx;
       *bearing = longs_m->bearing;
       *advance = longs_m->advance;
     }
     else
     {
-      *bearing = ((TT_ShortMetrics*)header->short_metrics)[index - k];
+      *bearing = ((TT_ShortMetrics*)header->short_metrics)[idx - k];
       *advance = ((TT_LongMetrics*)header->long_metrics)[k - 1].advance;
     }
   }
@@ -113,12 +113,12 @@
   /*                                                                       */
   static void
   Get_HMetrics( TT_Face     face,
-                FT_UInt     index,
+                FT_UInt     idx,
                 FT_Bool     check,
                 FT_Short*   lsb,
                 FT_UShort*  aw )
   {
-    TT_Get_Metrics( &face->horizontal, index, lsb, aw );
+    TT_Get_Metrics( &face->horizontal, idx, lsb, aw );
 
     if ( check && face->postscript.isFixedPitch )
       *aw = face->horizontal.advance_Width_Max;
@@ -749,22 +749,22 @@
     TT_Face          face   = (TT_Face)loader->face;
     FT_ULong         offset;
     FT_Int           contours_count;
-    FT_UInt          index, num_points, count;
+    FT_UInt          idx, num_points, count;
     FT_Fixed         x_scale, y_scale;
     FT_GlyphLoader   gloader = loader->gloader;
     FT_Bool          opened_frame = 0;
 
 
     /* check glyph index */
-    index = glyph_index;
-    if ( index >= (FT_UInt)face->root.num_glyphs )
+    idx = glyph_index;
+    if ( idx >= (FT_UInt)face->root.num_glyphs )
     {
       error = TT_Err_Invalid_Glyph_Index;
       goto Exit;
     }
 
     loader->glyph_index = glyph_index;
-    num_points   = 0;
+    num_points          = 0;
 
     x_scale = 0x10000L;
     y_scale = 0x10000L;
@@ -780,7 +780,7 @@
       FT_UShort  advance_width;
 
 
-      Get_HMetrics( face, index,
+      Get_HMetrics( face, idx,
                     (FT_Bool)!(loader->load_flags &
                                 FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH),
                     &left_bearing,
@@ -796,11 +796,11 @@
       }
     }
 
-    offset = face->glyph_locations[index];
+    offset = face->glyph_locations[idx];
     count  = 0;
 
-    if ( index < (FT_UInt)face->num_locations - 1 )
-       count = face->glyph_locations[index + 1] - offset;
+    if ( idx < (FT_UInt)face->num_locations - 1 )
+       count = face->glyph_locations[idx + 1] - offset;
 
     if ( count == 0 )
     {
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index edb7408..2c4dc18 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -251,7 +251,7 @@
                   FT_Vector*  kerning )
   {
     T1_Kern_Pair  *min, *mid, *max;
-    FT_ULong      index = KERN_INDEX( glyph1, glyph2 );
+    FT_ULong      idx = KERN_INDEX( glyph1, glyph2 );
 
 
     /* simple binary search */
@@ -266,13 +266,13 @@
       mid  = min + ( max - min ) / 2;
       midi = KERN_INDEX( mid->glyph1, mid->glyph2 );
 
-      if ( midi == index )
+      if ( midi == idx )
       {
         *kerning = mid->kerning;
         return;
       }
 
-      if ( midi < index )
+      if ( midi < idx )
         min = mid + 1;
       else
         max = mid - 1;
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 25c553c..9228b0d 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1133,7 +1133,7 @@
 
     for ( n = 0; n < loader->num_subrs; n++ )
     {
-      FT_Int    index, size;
+      FT_Int    idx, size;
       FT_Byte*  base;
 
 
@@ -1142,7 +1142,7 @@
       if ( strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
         break;
 
-      index = T1_ToInt( parser );
+      idx = T1_ToInt( parser );
 
       if ( !read_binary_data( parser, &size, &base ) )
         return;
@@ -1177,12 +1177,12 @@
         MEM_Copy( temp, base, size );
         psaux->t1_decrypt( temp, size, 4330 );
         size -= face->type1.private_dict.lenIV;
-        error = T1_Add_Table( table, index,
+        error = T1_Add_Table( table, idx,
                               temp + face->type1.private_dict.lenIV, size );
         FREE( temp );
       }
       else
-        error = T1_Add_Table( table, index, base, size );
+        error = T1_Add_Table( table, idx, base, size );
       if ( error )
         goto Fail;
     }
@@ -1709,7 +1709,7 @@
     /* array..                                                */
     if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
     {
-      FT_Int    charcode, index, min_char, max_char;
+      FT_Int    charcode, idx, min_char, max_char;
       FT_Byte*  char_name;
       FT_Byte*  glyph_name;
 
@@ -1730,13 +1730,13 @@
 
         char_name = loader.encoding_table.elements[charcode];
         if ( char_name )
-          for ( index = 0; index < type1->num_glyphs; index++ )
+          for ( idx = 0; idx < type1->num_glyphs; idx++ )
           {
-            glyph_name = (FT_Byte*)type1->glyph_names[index];
+            glyph_name = (FT_Byte*)type1->glyph_names[idx];
             if ( strcmp( (const char*)char_name,
                          (const char*)glyph_name ) == 0 )
             {
-              type1->encoding.char_index[charcode] = (FT_UShort)index;
+              type1->encoding.char_index[charcode] = (FT_UShort)idx;
               type1->encoding.char_name [charcode] = (char*)glyph_name;
 
               /* Change min/max encoded char only if glyph name is */
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 7c36a6f..a21f16f 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -58,9 +58,9 @@
   static PSH_Globals_Funcs
   T1_Size_Get_Globals_Funcs( T1_Size  size )
   {
-    T1_Face              face     = (T1_Face) size->root.face;
-    PSHinter_Service  pshinter = face->pshinter;
-    FT_Module            module;
+    T1_Face           face     = (T1_Face)size->root.face;
+    PSHinter_Service  pshinter = (PSHinter_Service)face->pshinter;
+    FT_Module         module;
 
 
     module = FT_Get_Module( size->root.face->driver->root.library,
@@ -143,15 +143,18 @@
   FT_LOCAL_DEF( FT_Error )
   T1_GlyphSlot_Init( T1_GlyphSlot   slot )
   {
-    T1_Face              face;
+    T1_Face           face;
     PSHinter_Service  pshinter;
 
-    face     = (T1_Face) slot->root.face;
-    pshinter = face->pshinter;
-    if (pshinter)
+
+    face     = (T1_Face)slot->root.face;
+    pshinter = (PSHinter_Service)face->pshinter;
+
+    if ( pshinter )
     {
       FT_Module  module;
 
+
       module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" );
       if (module)
       {
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index f3c7d53..4a85efb 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -414,13 +414,11 @@
     return result;
   }
 
+
   static FT_Long
   FNT_Get_Next_Char( FT_CharMap  charmap,
                      FT_Long     char_code )
   {
-    FT_ULong  result = 0;
-    FT_UInt   gindex = 0;
-
     char_code++;
     if ( charmap )
     {
@@ -441,10 +439,6 @@
 #endif /* !FT_CONFIG_OPTION_USE_CMAPS */
 
 
-
-
-
-
   static void
   FNT_Face_Done( FNT_Face  face )
   {