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
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
|
--- engine/include/graphite/GrCommon.h.orig 2009-01-21 22:36:40 UTC
+++ engine/include/graphite/GrCommon.h
@@ -18,6 +18,8 @@ Last reviewed:
#ifndef GRCOMMON_INCLUDED
#define GRCOMMON_INCLUDED
+#define _SECURE_SCL 0 // to allow GlyphSetIterator to work, which points off the end of a vector
+#define _HAS_ITERATOR_DEBUGGING 0
// Standard Headers.
@@ -33,6 +35,7 @@ Last reviewed:
#include <vector>
#include <algorithm>
#include <string>
+///#include <stdexcept> -- possibly needed for std::string Xran and Xlen functions??
// Uncomment this to allow multiple versions of gr to coexist
// in the same program e.g. pangographite with gtk uses namespace gr
@@ -41,7 +44,7 @@ Last reviewed:
// Provided the client includes GrClient.h first this #define is
// picked up by all files.
-//#define gr gr2
+#define gr gr3ooo
// Project headers
#include "GrPlatform.h"
--- engine/include/graphite/GrMstypes.h.orig 2009-01-21 22:36:40 UTC
+++ engine/include/graphite/GrMstypes.h
@@ -24,11 +24,11 @@ typedef wchar_t OLECHAR;
typedef signed long HRESULT;
-inline const long InterlockedIncrement(long *const intr_lck) {
+inline long InterlockedIncrement(long *const intr_lck) {
return ++*intr_lck;
}
-inline const long InterlockedDecrement(long *const intr_lck) {
+inline long InterlockedDecrement(long *const intr_lck) {
return --*intr_lck;
}
--- engine/makefile.vc7.orig 2008-08-21 14:24:32 UTC
+++ engine/makefile.vc7
@@ -48,11 +48,7 @@ all : lib lib_dll
CPP_DEBUG=/D "TRACING" $(CPP_DEBUG)
!ENDIF
-!IF "$(OS)" == "Windows_NT"
NULL=
-!ELSE
-NULL=nul
-!ENDIF
clean :
@- rd /s/q .\release_temp
--- engine/src/font/FileFont.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/src/font/FileFont.cpp
@@ -207,11 +207,11 @@ FileFont::initializeFromFace()
cch16 += cch16Used;
}
// }
-#else
+#elif 1
m_stuFaceName.assign(rgchwFace);
- // VS 2005 needs this:
- //for (int cch16 = 0; cch16 < cchw; cch16++)
- // m_stuFaceName.push_back(rgchwFace[cch16]);
+#else // VS 2005 needs this:
+ for (int cch16 = 0; cch16 < cchw; cch16++)
+ m_stuFaceName.push_back(rgchwFace[cch16]);
#endif
pTable = readTable(ktiHead, lSize);
if (!m_fIsValid || !pTable)
@@ -233,7 +233,7 @@ byte *
FileFont::readTable(int /*TableId*/ tid, size_t & size)
{
const TableId tableId = TableId(tid);
- bool isValid = true;
+ bool isTableValid = true;
size_t lOffset = 0, lSize = 0;
if (!m_pTableCache)
{
@@ -245,9 +245,9 @@ FileFont::readTable(int /*TableId*/ tid,
size = m_pTableCache->getTableSize(tableId);
// check whether it is already in the cache
if (pTable) return pTable;
- isValid &= TtfUtil::GetTableInfo(tableId, m_pHeader, m_pTableDir,
+ isTableValid &= TtfUtil::GetTableInfo(tableId, m_pHeader, m_pTableDir,
lOffset, lSize);
- if (!isValid)
+ if (!isTableValid)
return NULL;
fseek(m_pfile, lOffset, SEEK_SET);
// only allocate if needed
@@ -255,16 +255,16 @@ FileFont::readTable(int /*TableId*/ tid,
if (!pTable)
{
- isValid = false;
+ isTableValid = false;
return NULL;
}
size_t bytesRead = fread(pTable, 1, lSize, m_pfile);
- isValid = bytesRead == lSize;
- if (isValid)
+ isTableValid = bytesRead == lSize;
+ if (isTableValid)
{
- isValid &= TtfUtil::CheckTable(tableId, pTable, lSize);
+ isTableValid &= TtfUtil::CheckTable(tableId, pTable, lSize);
}
- if (!isValid)
+ if (!isTableValid)
{
return 0;
}
--- engine/src/font/Font.cpp.orig 2008-05-20 06:04:16 UTC
+++ engine/src/font/Font.cpp
@@ -626,7 +626,7 @@ FeatureIterator FeatureIterator::operato
Assert(false);
m_ifeat = m_cfeat;
}
- else if (m_ifeat + n < 0)
+ else if (static_cast<int>(m_ifeat) + n < 0)
{
// Can't decrement.
Assert(false);
@@ -727,7 +727,7 @@ FeatureSettingIterator FeatureSettingIte
Assert(false);
m_ifset = m_cfset;
}
- if (m_ifset + n < 0)
+ if (static_cast<int>(m_ifset) + n < 0)
{
// Can't decrement.
Assert(false);
@@ -820,7 +820,7 @@ FeatLabelLangIterator FeatLabelLangItera
Assert(false);
m_ilang = m_clang;
}
- else if (m_ilang + n < 0)
+ else if (static_cast<int>(m_ilang) + n < 0)
{
// Can't decrement.
Assert(false);
@@ -906,7 +906,7 @@ LanguageIterator LanguageIterator::opera
Assert(false);
m_ilang = m_clang;
}
- else if (m_ilang + n < 0)
+ else if (static_cast<int>(m_ilang) + n < 0)
{
// Can't decrement.
Assert(false);
--- engine/src/font/TtfUtil.cpp.orig 2009-01-29 08:33:19 UTC
+++ engine/src/font/TtfUtil.cpp
@@ -492,7 +492,7 @@ bool IsItalic(const void * pHead)
const Sfnt::FontHeader * pTable =
reinterpret_cast<const Sfnt::FontHeader *>(pHead);
- return read(((pTable->mac_style) & 0x00000002) != 0);
+ return ((read(pTable->mac_style) & 0x00000002) != 0);
}
/*----------------------------------------------------------------------------------------------
@@ -1108,8 +1108,8 @@ size_t LocaLookup(gr::gid16 nGlyphId,
{ // loca entries are two bytes and have been divided by two
if (nGlyphId <= (lLocaSize >> 1) - 1) // allow sentinel value to be accessed
{
- const uint16 * pTable = reinterpret_cast<const uint16 *>(pLoca);
- return (read(pTable[nGlyphId]) << 1);
+ const uint16 * pTableLoca = reinterpret_cast<const uint16 *>(pLoca);
+ return (read(pTableLoca[nGlyphId]) << 1);
}
}
@@ -1117,8 +1117,8 @@ size_t LocaLookup(gr::gid16 nGlyphId,
{ // loca entries are four bytes
if (nGlyphId <= (lLocaSize >> 2) - 1)
{
- const uint32 * pTable = reinterpret_cast<const uint32 *>(pLoca);
- return read(pTable[nGlyphId]);
+ const uint32 * pTableLoca = reinterpret_cast<const uint32 *>(pLoca);
+ return read(pTableLoca[nGlyphId]);
}
}
@@ -1586,7 +1586,7 @@ bool IsDeepComposite(gr::gid16 nGlyphId,
for (size_t i = 0; i < cCompId; i++)
{
- void * pSimpleGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]),
+ pSimpleGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]),
pGlyf, pLoca, lLocaSize, pHead);
if (pSimpleGlyf == NULL) {return false;}
@@ -1748,7 +1748,7 @@ bool GlyfContourEndPoints(gr::gid16 nGly
----------------------------------------------------------------------------------------------*/
bool GlyfPoints(gr::gid16 nGlyphId, const void * pGlyf,
const void * pLoca, size_t lLocaSize, const void * pHead,
- const int * prgnContourEndPoint, size_t cnEndPoints,
+ const int * /*prgnContourEndPoint*/, size_t /*cnEndPoints*/,
int * prgnX, int * prgnY, bool * prgfOnCurve, size_t cnPoints)
{
std::fill_n(prgnX, cnPoints, INT_MAX);
--- engine/src/painter/SegmentPainter.cpp.orig 2009-01-28 02:01:29 UTC
+++ engine/src/painter/SegmentPainter.cpp
@@ -353,7 +353,7 @@ void SegmentPainter::positionsOfIP(
@param bOn - true if we are turning on (ignored in this implementation)
----------------------------------------------------------------------------------------------*/
bool SegmentPainter::drawSelectionRange(int ichwAnchor, int ichwEnd,
- float ydLineTop, float ydLineBottom, bool bOn)
+ float ydLineTop, float ydLineBottom, bool /*bOn*/)
{
if (g_fDrawing)
return true;
@@ -993,7 +993,7 @@ size_t SegmentPainter::getUnderlinePlace
an I-beam (std selection)
----------------------------------------------------------------------------------------------*/
void SegmentPainter::CalcOrDrawInsertionPoint(
- int ichwIP, bool fAssocPrev, bool bOn, bool fForceSplit,
+ int ichwIP, bool fAssocPrev, bool /*bOn*/, bool fForceSplit,
Rect * prdPrimary, Rect * prdSecondary)
{
GrResult res = kresOk;
@@ -1277,7 +1277,7 @@ void SegmentPainter::CalcOrDrawInsertion
if NULL, do the drawing
----------------------------------------------------------------------------------------------*/
void SegmentPainter::InvertIBeam(float xs, float ysTop, float ysBottom,
- bool fAssocPrev, Rect * prdRet)
+ bool /*fAssocPrev*/, Rect * prdRet)
{
float xd = ScaleXToDest(xs);
float ydTop = ScaleYToDest(ysTop);
@@ -1675,7 +1675,7 @@ bool SegmentPainter::AtEdgeOfCluster(GrS
}
bool SegmentPainter::AtEdgeOfCluster(GrSlotOutput * psloutBase, int isloutBase,
- GrSlotOutput * pslout, int islout, bool fBefore)
+ GrSlotOutput * /*pslout*/, int islout, bool fBefore)
{
// Compare pslout to all the members of the cluster. If it is the minimum or maximum, it
// is at an edge.
@@ -1778,12 +1778,12 @@ void SegmentPainter::CalcPartialLigature
}
for (icomp = 0; icomp < pslout->NumberOfComponents(); icomp++)
{
- for (int ichw = pslout->FirstUnderlyingComponent(icomp) ;
- ichw <= pslout->LastUnderlyingComponent(icomp) ;
- ichw++)
+ for (int ichwTemp = pslout->FirstUnderlyingComponent(icomp) ;
+ ichwTemp <= pslout->LastUnderlyingComponent(icomp) ;
+ ichwTemp++)
{
- if (m_pseg->m_prgiComponent[ichw - m_pseg->m_ichwAssocsMin] == icomp)
- prgfAllSelected[ichw] = fAll;
+ if (m_pseg->m_prgiComponent[ichwTemp - m_pseg->m_ichwAssocsMin] == icomp)
+ prgfAllSelected[ichwTemp] = fAll;
}
}
}
@@ -2304,7 +2304,11 @@ bool SegmentPainter::AdjustRectsToNotOve
Assert that there are no overlaps among all the rectangles in the array, which should
be the case if AdjustRectsToNotOverlap is working properly.
----------------------------------------------------------------------------------------------*/
+#ifdef _DEBUG
void SegmentPainter::AssertNoOverlaps(std::vector<Rect> & vrect)
+#else
+void SegmentPainter::AssertNoOverlaps(std::vector<Rect> & /*vrect*/)
+#endif
{
#ifdef _DEBUG
for (int irect1 = 0; irect1 < signed(vrect.size() - 1); irect1++)
@@ -2452,7 +2456,11 @@ bool SegmentPainter::AdjustLineSegsToNot
Assert that there are no overlaps among all the rectangles in the array, which should
be the case if AdjustRectsToNotOverlap is working properly.
----------------------------------------------------------------------------------------------*/
+#ifdef _DEBUG
void SegmentPainter::AssertNoOverlaps(std::vector<LineSeg> & vls)
+#else
+void SegmentPainter::AssertNoOverlaps(std::vector<LineSeg> & /*vls*/)
+#endif
{
#ifdef _DEBUG
for (int ils1 = 0; ils1 < (int)vls.size() - 1; ils1++)
@@ -2884,7 +2892,7 @@ bool SegmentPainter::AdjacentLigComponen
{
if (icompNext != icompCurr)
{
- float xsHorizNext = (fIPOnRight) ? vxsRights[icompNext] : vxsLefts[icompNext];
+ xsHorizNext = (fIPOnRight) ? vxsRights[icompNext] : vxsLefts[icompNext];
if (fMovingRight && xsHorizNext > xsHorizCurr)
break;
else if (!fMovingRight && xsHorizNext < xsHorizCurr)
@@ -2996,7 +3004,7 @@ float SegmentPainter::ScaleY(float ys, R
/*----------------------------------------------------------------------------------------------
Make sure the font is set to use the character properties required by this segment.
----------------------------------------------------------------------------------------------*/
-void SegmentPainter::SetFontProps(unsigned long clrFore, unsigned long clrBack)
+void SegmentPainter::SetFontProps(unsigned long /*clrFore*/, unsigned long /*clrBack*/)
{
return;
}
--- engine/src/segment/FileInput.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/FileInput.cpp
@@ -80,7 +80,7 @@ GrBufferIStream::~GrBufferIStream()
#ifdef GR_FW
bool GrBufferIStream::Open(std::wstring stuFileName, int kMode)
#else
-bool GrBufferIStream::Open(const char * pcFileName, std::ios::openmode kMode)
+bool GrBufferIStream::Open(const char * /*pcFileName*/, std::ios::openmode /*kMode*/)
#endif
{
Assert(false); // use OpenBuffer
--- engine/src/segment/GrCharStream.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/GrCharStream.cpp
@@ -417,8 +417,11 @@ bool GrCharStream::AtUnicodeCharBoundary
return true;
*/
}
-
+#ifdef NDEBUG
+bool GrCharStream::AtUnicodeCharBoundary(utf8 * prgchs, int cchs, int ichs, UtfType /*utf*/)
+#else
bool GrCharStream::AtUnicodeCharBoundary(utf8 * prgchs, int cchs, int ichs, UtfType utf)
+#endif
{
Assert(ichs >= 0);
Assert(ichs <= cchs);
--- engine/src/segment/GrClassTable.h.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/GrClassTable.h
@@ -54,7 +54,11 @@ protected:
/*------------------------------------------------------------------------------------------
Copy the raw memory into the instance.
------------------------------------------------------------------------------------------*/
+#ifdef NDEBUG
+ void CopyFrom(data16 * pchwStart, int /*cchw*/)
+#else
void CopyFrom(data16 * pchwStart, int cchw)
+#endif
{
m_cgixBIG = pchwStart[0];
m_digixBIGInit = pchwStart[1];
--- engine/src/segment/GrEngine.cpp.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/GrEngine.cpp
@@ -159,12 +159,12 @@ void GrEngine::BasicInit()
GrEngine::~GrEngine()
{
DestroyEverything();
- #ifdef _MSC_VER
- if (!_CrtCheckMemory())
- {
- OutputDebugString(L"bad memory");
- }
- #endif
+// #ifdef _MSC_VER
+// if (!_CrtCheckMemory())
+// {
+// OutputDebugString(L"bad memory");
+// }
+// #endif
}
/*----------------------------------------------------------------------------------------------
@@ -173,12 +173,12 @@ GrEngine::~GrEngine()
void GrEngine::DestroyEverything()
{
DestroyContents();
- #ifdef _MSC_VER
- if (!_CrtCheckMemory())
- {
- OutputDebugString(L"bad memory");
- }
- #endif
+// #ifdef _MSC_VER
+// if (!_CrtCheckMemory())
+// {
+// OutputDebugString(L"bad memory");
+// }
+// #endif
m_strCtrlFileReg.erase();
m_strCtrlFileBold.erase();
@@ -417,7 +417,11 @@ GrResult GrEngine::get_SegDatMaxLength(i
@return The supported script direction(s). If more than one, the application is
responsible for choosing the most appropriate.
----------------------------------------------------------------------------------------------*/
+#ifdef NDEBUG
+GrResult GrEngine::get_ScriptDirection(unsigned int * pgrfsdc, OLECHAR * /*prgchwErrMsg*/, int /*cchMaxErrMsg*/)
+#else
GrResult GrEngine::get_ScriptDirection(unsigned int * pgrfsdc, OLECHAR * prgchwErrMsg, int cchMaxErrMsg)
+#endif
{
ChkGrOutPtr(pgrfsdc);
ChkGrArrayArg(prgchwErrMsg, cchMaxErrMsg);
@@ -789,7 +793,7 @@ void GrEngine::RecordFontLoadError(OLECH
Record a system error indicating a bad error in rendering using a supposedly valid font.
OBSOLETE
----------------------------------------------------------------------------------------------*/
-void GrEngine::RecordFontRunError(OLECHAR * prgchwErrMsg, int cchMax, GrResult res)
+void GrEngine::RecordFontRunError(OLECHAR * prgchwErrMsg, int cchMax, GrResult /*res*/)
{
if (prgchwErrMsg == NULL || cchMax == 0)
return;
@@ -970,7 +974,7 @@ void GrEngine::InitFromControlFileTest()
/*----------------------------------------------------------------------------------------------
Return whether the text is asking for bold and/or italic text.
----------------------------------------------------------------------------------------------*/
-void GrEngine::GetStyles(Font * pfont, int ichwMin, bool * pfBold, bool * pfItalic)
+void GrEngine::GetStyles(Font * pfont, int /*ichwMin*/, bool * pfBold, bool * pfItalic)
{
*pfBold = pfont->bold();
*pfItalic = pfont->italic();
@@ -981,7 +985,11 @@ void GrEngine::GetStyles(Font * pfont, i
Should only be called when we know we are using a base font, or when we are reading
the base font to see if it is valid.
----------------------------------------------------------------------------------------------*/
+#ifdef NDEBUG
+void GrEngine::SwitchGraphicsFont(bool /*fBase*/)
+#else
void GrEngine::SwitchGraphicsFont(bool fBase)
+#endif
{
Assert(!fBase || m_stuBaseFaceName.size() > 0);
@@ -1135,7 +1143,7 @@ bool GrEngine::ReadSilfTable(GrIStream &
m_chwJShrink0 = 0xffff;
m_chwJStep0 = 0xffff;
m_chwJWeight0 = 0xffff;
- for (int i = 0; i < m_cJLevels; i++)
+ for (i = 0; i < m_cJLevels; i++)
{
// justification glyph attribute IDs
bTmp = grstrm.ReadByteFromFont();
@@ -1210,10 +1218,12 @@ bool GrEngine::ReadSilfTable(GrIStream &
// rendering behaviors--ignore for now
byte cBehaviors = grstrm.ReadByteFromFont();
- unsigned int nBehaviors[kMaxRenderingBehavior];
+ int nTmp;
+ //unsigned int nBehaviors[kMaxRenderingBehavior]; -- this big buffer causes a stack overflow in Multiscribe; rework eventually
for (i = 0; i < cBehaviors; i++)
{
- nBehaviors[i] = unsigned(grstrm.ReadIntFromFont());
+ //nBehaviors[i] = unsigned(grstrm.ReadIntFromFont());
+ nTmp = unsigned(grstrm.ReadIntFromFont());
}
// linebreak glyph ID
--- engine/src/segment/GrFSM.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/GrFSM.cpp
@@ -46,7 +46,7 @@ namespace gr
Fill in the FSM by reading from the font stream.
Assumes the stream is in the correct position.
----------------------------------------------------------------------------------------------*/
-bool GrFSM::ReadFromFont(GrIStream & grstrm, int fxdVersion)
+bool GrFSM::ReadFromFont(GrIStream & grstrm, int /*fxdVersion*/)
{
short snTmp;
@@ -138,7 +138,7 @@ bool GrFSM::ReadFromFont(GrIStream & grs
Fill in the FSM's state table by reading from the font stream.
Assumes the stream is in the correct position.
----------------------------------------------------------------------------------------------*/
-bool GrFSM::ReadStateTableFromFont(GrIStream & grstrm, int fxdVersion)
+bool GrFSM::ReadStateTableFromFont(GrIStream & grstrm, int /*fxdVersion*/)
{
int cCells = ((m_crow - m_crowFinal) * m_ccol);
m_prgrowTransitions = new short[cCells];
--- engine/src/segment/GrFeature.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/GrFeature.cpp
@@ -186,7 +186,7 @@ std::wstring GrFeature::NthSettingLabel(
/*----------------------------------------------------------------------------------------------
Read the languages from the font.
----------------------------------------------------------------------------------------------*/
-bool GrLangTable::ReadFromFont(GrIStream * pgrstrm, int fxdVersion)
+bool GrLangTable::ReadFromFont(GrIStream * pgrstrm, int /*fxdVersion*/)
{
GrIStream & grstrm = *pgrstrm;
@@ -206,13 +206,22 @@ bool GrLangTable::ReadFromFont(GrIStream
m_cbOffset0 = (lsbf)(m_prglang[0].cbOffsetBIG);
- Assert((lsbf)(m_prglang[m_clang].cFeaturesBIG) == 0); // bogus entry has no settings
+ if ((lsbf)(m_prglang[m_clang].cFeaturesBIG) == 0) // bogus entry has no settings
+ {
cb = (lsbf)(m_prglang[m_clang].cbOffsetBIG) - m_cbOffset0;
- Assert(cb % sizeof(FeatSet) == 0); // # of bytes fits nicely into FeatSet class
+ if (cb % sizeof(FeatSet) == 0) // # of bytes fits nicely into FeatSet class
+ {
int cfset = cb / sizeof(FeatSet);
m_prgfset = new FeatSet[cfset];
m_cfset = cfset;
grstrm.ReadBlockFromFont(m_prgfset, cb);
+ }
+ else return false;
+ }
+ else
+ {
+ return false;
+ }
return true;
}
--- engine/src/segment/GrPass.cpp.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/GrPass.cpp
@@ -279,9 +279,10 @@ void GrPass::InitializeWithNoRules()
@param twsh - how we are handling trailing white-space
@param pnRet - return value
@param pcslotGot - return the number of slots gotten
- @param pislotFinalBreak - return the index of the final slot, when we are removing
- the trailing white-space and so the end of the segment
- will be before the any actual line-break slot
+ @param pislotFinalBreak - index of the final slot (LB or actual glyph), or -1;
+ adjusted when we are removing the trailing white-space and
+ so the end of the segment will be before the any actual
+ line-break slot
@return kNextPass if we were able to generated the number requested, or processing is
complete; otherwise return the number of slots needed from the previous pass.
@@ -465,7 +466,7 @@ void GrPass::ExtendOutput(GrTableManager
void GrBidiPass::ExtendOutput(GrTableManager * ptman,
GrSlotStream* psstrmIn, GrSlotStream* psstrmOut,
int cslotNeededByNext, TrWsHandling twsh,
- int * pnRet, int * pcslotGot, int * pislotFinalBreak)
+ int * pnRet, int * pcslotGot, int * /*pislotFinalBreak*/)
{
Assert(psstrmIn->SlotsToReprocess() == 0);
@@ -776,7 +777,7 @@ int GrPass::ExtendGlyphIDOutput(GrTableM
int GrPass::ExtendFinalOutput(GrTableManager * ptman,
GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
float xsSpaceAllotted, bool fWidthIsCharCount, bool fInfiniteWidth,
- bool fHaveLineBreak, bool fMustBacktrack, LineBrk lbMax, TrWsHandling twsh,
+ bool fHaveLineBreak, bool fMustBacktrack, LineBrk /*lbMax*/, TrWsHandling twsh,
int * pislotLB, float * pxsWidth)
{
EngineState * pengst = ptman->State();
@@ -897,7 +898,11 @@ int GrPass::ExtendFinalOutput(GrTableMan
Remove undesirable trailing white-space.
----------------------------------------------------------------------------------------------*/
int GrPass::RemoveTrailingWhiteSpace(GrTableManager * ptman, GrSlotStream * psstrmOut,
+#ifdef NDEBUG
+ TrWsHandling /*twsh*/, int * pislotFinalBreak)
+#else
TrWsHandling twsh, int * pislotFinalBreak)
+#endif
{
EngineState * pengst = ptman->State();
@@ -944,7 +949,7 @@ int GrPass::RemoveTrailingWhiteSpace(GrT
should never be necessary if they've set up their tables right.
----------------------------------------------------------------------------------------------*/
void GrPass::CheckInputProgress(GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
- int islotOrigInput)
+ int /*islotOrigInput*/)
{
int islotInput = psstrmInput->ReadPosForNextGet();
// Assert(islotInput >= islotOrigInput); -- no longer true now that we can back up
@@ -1752,7 +1757,7 @@ int GrBidiPass::Reverse(GrTableManager *
----------------------------------------------------------------------------------------------*/
int GrPass::Unwind(GrTableManager * ptman,
int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
- bool fFirst)
+ bool /*fFirst*/)
{
// Back up the number of slots required for the longest rule context,
// but if we land in the middle of a chunk, go forward to its boundary.
@@ -1824,7 +1829,7 @@ int GrPass::Unwind(GrTableManager * ptma
----------------------------------------------------------------------------------------------*/
int GrBidiPass::Unwind(GrTableManager * ptman,
int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
- bool fFirst)
+ bool /*fFirst*/)
{
int islotIn;
int islotOut;
@@ -1901,8 +1906,8 @@ void PassState::UnwindLogInfo(int islotI
OBSOLETE
----------------------------------------------------------------------------------------------*/
//:Ignore
-void GrPosPass::Unattach(GrSlotStream * psstrmIn, int islotIn,
- GrSlotStream * psstrmOut, int islotOut, int islotLB)
+void GrPosPass::Unattach(GrSlotStream * /*psstrmIn*/, int /*islotIn*/,
+ GrSlotStream * /*psstrmOut*/, int /*islotOut*/, int /*islotLB*/)
{
// Because this is a positioning pass, there is a one-to-one correspondence between
// the slots in the input and the slots in the output. Thus we can make simplifying
--- engine/src/segment/GrPass.h.orig 2008-08-21 14:24:32 UTC
+++ engine/src/segment/GrPass.h
@@ -197,7 +197,7 @@ public:
bool ReadFromFont(GrIStream & grstrm, int fxdSilfVersion, int fxdRuleVersion, int nOffset);
void InitializeWithNoRules();
- virtual void SetTopDirLevel(int n)
+ virtual void SetTopDirLevel(int /*n*/)
{ // only GrBidiPass does anything interesting
}
@@ -253,13 +253,13 @@ public:
m_pzpst->SetResyncSkip(n);
}
- virtual void DoCleanUpSegMin(GrTableManager * ptman,
- GrSlotStream * psstrmIn, int islotInitReadPos, GrSlotStream * psstrmOut)
+ virtual void DoCleanUpSegMin(GrTableManager * /*ptman*/,
+ GrSlotStream * /*psstrmIn*/, int /*islotInitReadPos*/, GrSlotStream * /*psstrmOut*/)
{
}
- virtual void DoCleanUpSegLim(GrTableManager * ptman, GrSlotStream * psstrmOut,
- TrWsHandling twsh)
+ virtual void DoCleanUpSegLim(GrTableManager * /*ptman*/, GrSlotStream * /*psstrmOut*/,
+ TrWsHandling /*twsh*/)
{
}
@@ -383,8 +383,8 @@ protected:
void MapChunks(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
int islotChunkI, int islotChunkO, int cslotReprocessed);
- virtual void Unattach(GrSlotStream * psstrmIn, int islotIn, // GrPosPass overrides
- GrSlotStream * psstrmOut, int islotOut, int islotLB)
+ virtual void Unattach(GrSlotStream * /*psstrmIn*/, int /*islotIn*/, // GrPosPass overrides
+ GrSlotStream * /*psstrmOut*/, int /*islotOut*/, int /*islotLB*/)
{
}
@@ -500,8 +500,8 @@ public:
protected:
// Irrelevant when generating glyphs.
- virtual void RunRule(GrTableManager *, int ruln,
- GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+ virtual void RunRule(GrTableManager *, int /*ruln*/,
+ GrSlotStream * /*psstrmInput*/, GrSlotStream * /*psstrmOutput*/)
{
Assert(false);
}
--- engine/src/segment/GrPassActionCode.cpp.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/GrPassActionCode.cpp
@@ -632,8 +632,13 @@ GrPass::StackMachineFlag GrPass::CheckSt
/*----------------------------------------------------------------------------------------------
We are finished processing a slot; go on to the next slot, or possibly go backwards.
----------------------------------------------------------------------------------------------*/
-void GrPass::DoNext(GrTableManager * ptman,
- int cslot, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+#ifdef NDEBUG
+void GrPass::DoNext(GrTableManager * /*ptman*/,
+ int /*cslot*/, GrSlotStream * /*psstrmIn*/, GrSlotStream * /*psstrmOut*/)
+#else
+void GrPass::DoNext(GrTableManager * /*ptman*/,
+ int cslot, GrSlotStream * /*psstrmIn*/, GrSlotStream * /*psstrmOut*/)
+#endif
{
gAssert(cslot == 1); // for now anyway
}
@@ -690,6 +695,7 @@ void GrPass::DoPutGlyph(GrTableManager *
psstrmOut->SetSegMinToWritePos(false);
if (fSetSegLim)
psstrmOut->SetSegLimToWritePos(false);
+ //gid16 chw; chw = pslotNew->GlyphID();
psstrmOut->NextPut(pslotNew);
}
@@ -729,6 +735,7 @@ void GrPass::DoPutCopy(GrTableManager *
psstrmOut->SetSegMinToWritePos(false);
if (fSetSegLim)
psstrmOut->SetSegLimToWritePos(false);
+ //gid16 chw; chw = pslotNew->GlyphID();
psstrmOut->NextPut(pslotNew);
}
@@ -825,7 +832,7 @@ void GrPass::DoPutSubs2(GrTableManager *
@param psstrmIn / Out - input/output streams
----------------------------------------------------------------------------------------------*/
void GrPass::DoPutSubs3(GrTableManager * ptman, bool fInserting,
- int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int cslotSel3, int nSelClass3,
+ int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int /*cslotSel3*/, int nSelClass3,
int nReplacementClass,
GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
@@ -888,7 +895,7 @@ void GrPass::DoPutSubsInit(GrSlotStream
Common part of all the DoPutSubs... methods.
----------------------------------------------------------------------------------------------*/
void GrPass::DoPutSubsAux(GrTableManager * ptman, bool fInserting, gid16 nGlyphReplacement,
- GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, GrSlotState * pslotNextInput,
+ GrSlotStream * /*psstrmIn*/, GrSlotStream * psstrmOut, GrSlotState * pslotNextInput,
bool fAtSegMin, bool fAtSegLim)
{
EngineState * pengst = ptman->State();
@@ -915,6 +922,7 @@ void GrPass::DoPutSubsAux(GrTableManager
psstrmOut->SetSegMinToWritePos(false);
if (fSetSegLim)
psstrmOut->SetSegLimToWritePos(false);
+ //gid16 chw; chw = pslotNew->GlyphID();
psstrmOut->NextPut(pslotNew);
}
@@ -924,7 +932,7 @@ void GrPass::DoPutSubsAux(GrTableManager
and its after-assoc to the slot before it. This makes it basically unselectable.
OBSOLETE - handled by slot initialization code
----------------------------------------------------------------------------------------------*/
-void GrPass::SetNeutralAssocs(GrSlotState * pslotNew, GrSlotStream * psstrmIn)
+void GrPass::SetNeutralAssocs(GrSlotState * pslotNew, GrSlotStream * /*psstrmIn*/)
{
pslotNew->ClearAssocs();
}
@@ -943,6 +951,7 @@ void GrPass::DoDelete(GrTableManager * p
psstrmOut->SetSegLimToWritePos();
GrSlotState * pslot = psstrmIn->NextGet();
+ //gid16 chw; chw = pslotNew->GlyphID();
pslot->MarkDeleted();
if (ptman->LoggingTransduction())
@@ -957,7 +966,7 @@ void GrPass::DoDelete(GrTableManager * p
@param fInserting - whether current slot was inserted
@param psstrmIn / Out - input/output streams
----------------------------------------------------------------------------------------------*/
-void GrPass::DoAssoc(int cnAssocs, std::vector<int> & vnAssocs, bool fInserting,
+void GrPass::DoAssoc(int cnAssocs, std::vector<int> & vnAssocs, bool /*fInserting*/,
GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
gAssert((unsigned)cnAssocs == vnAssocs.size());
@@ -997,7 +1006,11 @@ void GrPass::DoAssoc(int cnAssocs, std::
@param vnStack - stack to read value from
@param psstrmIn / Out - input/output streams
----------------------------------------------------------------------------------------------*/
+#ifdef NDEBUG
+void GrPass::DoSetAttr(GrTableManager * ptman, ActionCommand op, bool /*fInserting*/,
+#else
void GrPass::DoSetAttr(GrTableManager * ptman, ActionCommand op, bool fInserting,
+#endif
SlotAttrName slat, int slati, std::vector<int> & vnStack,
GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
@@ -1192,7 +1205,7 @@ void GrPass::DoSetAttr(GrTableManager *
@param psstrmIn - input stream
----------------------------------------------------------------------------------------------*/
void GrPass::DoPushSlotAttr(GrTableManager * ptman,
- int nSlotRef, bool fInserting,
+ int nSlotRef, bool /*fInserting*/,
SlotAttrName slat, int slati, std::vector<int> & vnStack,
GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
@@ -1236,16 +1249,16 @@ void GrPass::DoPushSlotAttr(GrTableManag
case kslatAttTo: nVal = pslot->AttachTo(); break;
case kslatAttLevel: nVal = pslot->AttachLevel(); break;
- case kslatAttAtX: nVal = pslot->AttachAtX(ptman, psstrmIn); break;
case kslatAttAtY: nVal = pslot->AttachAtY(); break;
case kslatAttAtGpt: nVal = pslot->AttachAtGpoint(); break;
case kslatAttAtXoff: nVal = pslot->AttachAtXOffset(); break;
case kslatAttAtYoff: nVal = pslot->AttachAtYOffset(); break;
- case kslatAttWithX: nVal = pslot->AttachWithX(ptman, psstrmIn); break;
case kslatAttWithY: nVal = pslot->AttachWithY(); break;
case kslatAttWithGpt: nVal = pslot->AttachWithGpoint(); break;
case kslatAttWithXoff: nVal = pslot->AttachWithXOffset(); break;
case kslatAttWithYoff: nVal = pslot->AttachWithYOffset(); break;
+ case kslatAttAtX: nVal = pslot->AttachAtX(ptman, psstrmIn); break;
+ case kslatAttWithX: nVal = pslot->AttachWithX(ptman, psstrmIn); break;
case kslatMeasureSol: nVal = pslot->MeasureSol(); break;
case kslatMeasureEol: nVal = pslot->MeasureEol(); break;
@@ -1282,7 +1295,7 @@ void GrPass::DoPushSlotAttr(GrTableManag
@param vnStack - stack to push onto
@param psstrmIn - input stream
----------------------------------------------------------------------------------------------*/
-void GrPass::DoPushGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
+void GrPass::DoPushGlyphAttr(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
int nGlyphAttr,
std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
@@ -1307,7 +1320,7 @@ void GrPass::DoPushGlyphAttr(GrTableMana
@param vnStack - stack to push onto
@param psstrmIn - input stream
----------------------------------------------------------------------------------------------*/
-void GrPass::DoPushAttToGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
+void GrPass::DoPushAttToGlyphAttr(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
int nGlyphAttr, std::vector<int> & vnStack,
GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
@@ -1337,7 +1350,7 @@ void GrPass::DoPushAttToGlyphAttr(GrTabl
@param vnStack - stack to push onto
@param psstrmIn - input stream
----------------------------------------------------------------------------------------------*/
-void GrPass::DoPushGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
+void GrPass::DoPushGlyphMetric(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
int nGlyphAttr, int nAttLevel,
std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
@@ -1364,7 +1377,7 @@ void GrPass::DoPushGlyphMetric(GrTableMa
@param psstrmIn - input stream
@param psstrmOut - output stream
----------------------------------------------------------------------------------------------*/
-void GrPass::DoPushAttToGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
+void GrPass::DoPushAttToGlyphMetric(GrTableManager * ptman, int nSlotRef, bool /*fInserting*/,
int nGlyphAttr, int nAttLevel,
std::vector<int> & vnStack,
GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
@@ -1399,7 +1412,7 @@ void GrPass::DoPushGlyphMetricAux(GrTabl
}
else
{
- pslot->CalcCompositeMetrics(ptman, psstrmIn, nAttLevel, true);
+ pslot->CalcCompositeMetrics(ptman, psstrmIn, NULL, nAttLevel, true);
float xy;
switch (gmet)
@@ -1435,7 +1448,11 @@ void GrPass::DoPushGlyphMetricAux(GrTabl
@param psstrmIn - input stream
@param psstrmOut - output stream
----------------------------------------------------------------------------------------------*/
-void GrPass::DoPushFeatValue(GrTableManager * ptman, int nSlotRef, bool fInserting,
+#ifdef NDEBUG
+void GrPass::DoPushFeatValue(GrTableManager * /*ptman*/, int nSlotRef, bool /*fInserting*/,
+#else
+void GrPass::DoPushFeatValue(GrTableManager * /*ptman*/, int nSlotRef, bool fInserting,
+#endif
int nFeat, std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
{
gAssert(!fInserting);
--- engine/src/segment/GrSlotState.cpp.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/GrSlotState.cpp
@@ -261,7 +261,7 @@ gid16 GrSlotAbstract::ActualGlyphForOutp
root or attached leaf slots.
OBSOLETE
----------------------------------------------------------------------------------------------*/
-void GrSlotState::FixAttachmentTree(GrSlotState * pslotOld)
+void GrSlotState::FixAttachmentTree(GrSlotState * /*pslotOld*/)
{
#if 0
pslotOld->m_vpslotAttLeaves.CopyTo(m_vpslotAttLeaves);
@@ -524,13 +524,13 @@ void GrSlotState::AllComponentRefs(std::
GrSlotState * pslot;
if (HasComponents())
{
- for (int iComponent = 0; iComponent < m_cnCompPerLig; iComponent++)
+ for (int iLigComponent = 0; iLigComponent < m_cnCompPerLig; iLigComponent++)
{
- pslot = CompRefSlot(iComponent);
+ pslot = CompRefSlot(iLigComponent);
if (pslot)
{
Assert(PassModified() >= pslot->PassModified());
- pslot->AllComponentRefs(vichw, vicomp, iComponent);
+ pslot->AllComponentRefs(vichw, vicomp, iLigComponent);
}
}
}
@@ -1024,7 +1024,7 @@ void GrSlotState::EnsureLocalAttachmentT
NOTE: the caller is responsible to zap the cached positions of following glyphs
in the stream.
----------------------------------------------------------------------------------------------*/
-void GrSlotState::AttachToRoot(GrTableManager * ptman, GrSlotStream * psstrm,
+void GrSlotState::AttachToRoot(GrTableManager * /*ptman*/, GrSlotStream * psstrm,
GrSlotState * pslotNewRoot)
{
GrSlotState * pslotOldRoot = (m_dislotRootFixed == 0) ?
@@ -1063,7 +1063,7 @@ void GrSlotState::Position(GrTableManage
float xsWidth, xsVisWidth;
if (m_xsPositionX == kNegInfFloat || m_ysPositionY == kNegInfFloat)
- ptman->CalcPositionsUpTo(psstrmOut->m_ipass, this, &xsWidth, &xsVisWidth);
+ ptman->CalcPositionsUpTo(psstrmOut->m_ipass, this, true, &xsWidth, &xsVisWidth);
*pmXPos = ptman->LogToEmUnits(m_xsPositionX);
*pmYPos = ptman->LogToEmUnits(m_ysPositionY);
@@ -1077,7 +1077,7 @@ void GrSlotState::AdjustRootMetrics(GrTa
{
Assert(m_dislotRootFixed == m_srAttachTo);
GrSlotState * pslotRoot = AttachRoot(psstrm);
- CalcRootMetrics(ptman, psstrm, kPosInfinity);
+ CalcRootMetrics(ptman, psstrm, NULL, kPosInfinity);
if (pslotRoot)
pslotRoot->AdjustRootMetrics(ptman, psstrm);
}
@@ -1086,13 +1086,15 @@ void GrSlotState::AdjustRootMetrics(GrTa
Calculate the composite metrics for this slot.
@param psstrm - stream for which we are calculating it
+ @param psstrmNext - because when processing in the middle of a pass, we may need to
+ get the slot from the following (output) stream
@param nLevel - attachment level we are asking for; kPosInifinity means all levels
@param fThorough - true: do a thorough recalculation; false: don't recalculate
metrics for leaves (are they assumed to be accurate???)
--currently not used
----------------------------------------------------------------------------------------------*/
void GrSlotState::CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
- int nLevel, bool fThorough)
+ GrSlotStream * psstrmNext, int nLevel, bool fThorough)
{
if (m_nCompositeLevel == nLevel)
return;
@@ -1101,19 +1103,38 @@ void GrSlotState::CalcCompositeMetrics(G
{
Assert(m_dislotRootFixed == m_srAttachTo);
GrSlotState * pslotRoot = AttachRoot(psstrm);
+ // Kludge to handle the fact that we might have gotten the root from the wrong stream.
+ // Calling MidPassSlotAt finds the right one.
+ if (psstrmNext && pslotRoot)
+ {
+ int islotRoot = pslotRoot->PosPassIndex();
+ pslotRoot = psstrm->MidPassSlotAt(islotRoot, psstrmNext);
+ }
InitMetrics(ptman, pslotRoot);
for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++)
{
- GrSlotState * pslotLeaf = SlotAtOffset(psstrm, m_vdislotAttLeaves[islot]);
+ GrSlotState * pslotLeaf;
+ if (psstrmNext)
+ {
+ // Calculating a position in the middle of processing a pass.
+ pslotLeaf = psstrm->MidPassSlotAt(PosPassIndex() + m_vdislotAttLeaves[islot],
+ psstrmNext);
+ }
+ else
+ {
+ // Calculating the final position.
+ pslotLeaf = SlotAtOffset(psstrm, m_vdislotAttLeaves[islot]);
+ }
+
if (pslotLeaf->AttachLevel() <= nLevel)
- pslotLeaf->CalcCompositeMetrics(ptman, psstrm, nLevel, fThorough);
+ pslotLeaf->CalcCompositeMetrics(ptman, psstrm, psstrmNext, nLevel, fThorough);
else
// this slot will be ignored in the composite metrics
pslotLeaf->ZapRootMetrics();
}
- CalcRootMetrics(ptman, psstrm, nLevel);
+ CalcRootMetrics(ptman, psstrm, psstrmNext, nLevel);
m_nCompositeLevel = nLevel;
}
@@ -1129,25 +1150,33 @@ void GrSlotState::CalcCompositeMetrics(G
/*----------------------------------------------------------------------------------------------
Calculate the metrics for this node and all its leaf nodes.
----------------------------------------------------------------------------------------------*/
-void GrSlotState::CalcRootMetrics(GrTableManager * ptman, GrSlotStream * psstrm, int nLevel)
+void GrSlotState::CalcRootMetrics(GrTableManager * /*ptman*/, GrSlotStream * psstrm,
+ GrSlotStream * psstrmNext, int nLevel)
{
for (size_t idislot = 0; idislot < m_vdislotAttLeaves.size(); idislot++)
{
- GrSlotState * pslot = SlotAtOffset(psstrm, m_vdislotAttLeaves[idislot]);
- if (pslot->AttachLevel() > nLevel)
+ GrSlotState * pslotLeaf = SlotAtOffset(psstrm, m_vdislotAttLeaves[idislot]);
+ // Kludge to handle the fact that we might have gotten the leaf from the wrong stream.
+ // Calling MidPassSlotAt finds the right one.
+ if (psstrmNext)
+ {
+ int islot = pslotLeaf->PosPassIndex();
+ pslotLeaf = psstrm->MidPassSlotAt(islot, psstrmNext);
+ }
+ if (pslotLeaf->AttachLevel() > nLevel)
continue;
- m_xsClusterXOffset = min(m_xsClusterXOffset, pslot->m_xsClusterXOffset);
- if (!pslot->m_fIgnoreAdvance)
+ m_xsClusterXOffset = min(m_xsClusterXOffset, pslotLeaf->m_xsClusterXOffset);
+ if (!pslotLeaf->m_fIgnoreAdvance)
{
m_xsClusterAdv = max(
m_xsClusterAdv,
- pslot->m_xsClusterAdv + m_xsRootShiftX);
+ pslotLeaf->m_xsClusterAdv + m_xsRootShiftX);
}
- m_xsClusterBbLeft = min(m_xsClusterBbLeft, pslot->m_xsClusterBbLeft);
- m_xsClusterBbRight = max(m_xsClusterBbRight, pslot->m_xsClusterBbRight);
- m_ysClusterBbTop = max(m_ysClusterBbTop, pslot->m_ysClusterBbTop);
- m_ysClusterBbBottom = min(m_ysClusterBbBottom, pslot->m_ysClusterBbBottom);
+ m_xsClusterBbLeft = min(m_xsClusterBbLeft, pslotLeaf->m_xsClusterBbLeft);
+ m_xsClusterBbRight = max(m_xsClusterBbRight, pslotLeaf->m_xsClusterBbRight);
+ m_ysClusterBbTop = max(m_ysClusterBbTop, pslotLeaf->m_ysClusterBbTop);
+ m_ysClusterBbBottom = min(m_ysClusterBbBottom, pslotLeaf->m_ysClusterBbBottom);
}
}
@@ -1263,7 +1292,7 @@ float GrSlotState::GlyphXOffset(GrSlotSt
/*----------------------------------------------------------------------------------------------
Y-offsets of a single glyph relative to the previous advance position.
----------------------------------------------------------------------------------------------*/
-float GrSlotState::GlyphYOffset(GrSlotStream * psstrm)
+float GrSlotState::GlyphYOffset(GrSlotStream * /*psstrm*/)
{
return m_ysOffsetY;
}
--- engine/src/segment/GrSlotState.h.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/GrSlotState.h
@@ -48,7 +48,7 @@ public:
{
}
- ~GrSlotAbstract()
+ virtual ~GrSlotAbstract()
{
// the table manager is responsible for destroying the contents of m_prgnVarLenBuf
}
@@ -231,7 +231,7 @@ public:
ZapCompositeMetrics();
}
- ~GrSlotState()
+ virtual ~GrSlotState()
{
}
@@ -308,7 +308,11 @@ public:
{
return m_islotPosPass;
}
+#ifdef NDEBUG
+ void SetPosPassIndex(int islot, bool /*fInputToPosPass1*/)
+#else
void SetPosPassIndex(int islot, bool fInputToPosPass1)
+#endif
{
// If we're resetting it, it should be to the same value as before:
Assert(fInputToPosPass1 || m_islotPosPass == kNotYetSet || m_islotPosPass == islot);
@@ -386,12 +390,12 @@ public:
return (IsInitialLineBreak(chwLB) || IsFinalLineBreak(chwLB));
//return (m_chwGlyphID == chwLB); // TODO: remove
}
- bool IsInitialLineBreak(gid16 chwLB)
+ bool IsInitialLineBreak(gid16 /*chwLB*/)
{
return (m_spsl == kspslLbInitial);
//return (IsLineBreak(chwLB) && m_fInitialLB == true); // TODO: remove
}
- bool IsFinalLineBreak(gid16 chwLB)
+ bool IsFinalLineBreak(gid16 /*chwLB*/)
{
return (m_spsl == kspslLbFinal);
//return (IsLineBreak(chwLB) && m_fInitialLB == false); // TODO: remove
@@ -475,7 +479,7 @@ public:
return m_mAttachAtX;
}
- int AttachWithX(GrTableManager * ptman, GrSlotStream * psstrm)
+ int AttachWithX(GrTableManager * /*ptman*/, GrSlotStream * /*psstrm*/)
{
if (m_mAttachAtX == kNotYetSet)
{
@@ -615,7 +619,7 @@ public:
GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis);
void CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
- int nLevel, bool fThorough = false);
+ GrSlotStream * psstrmNext, int nLevel, bool fThorough = false);
void Position(GrTableManager * ptman,
GrSlotStream * psstrmOut, int * pmXPos, int * pmYPos);
@@ -646,7 +650,7 @@ public:
{
return ClusterBbLeft(psstrm) + xs;
}
- float ClusterRsb(GrSlotStream * psstrm, float xs)
+ float ClusterRsb(GrSlotStream * /*psstrm*/, float xs)
{
return ClusterAdvWidthFrom(xs) - ClusterBbRightFrom(xs);
}
@@ -668,19 +672,19 @@ public:
{
return ClusterBbRightFrom(Base(psstrm)->ClusterRootOffset());
}
- float ClusterBbTop(GrSlotStream * psstrm)
+ float ClusterBbTop(GrSlotStream * /*psstrm*/)
{
return m_ysClusterBbTop;
}
- float ClusterBbBottom(GrSlotStream * psstrm)
+ float ClusterBbBottom(GrSlotStream * /*psstrm*/)
{
return m_ysClusterBbBottom;
}
- float ClusterBbWidth(GrSlotStream * psstrm)
+ float ClusterBbWidth(GrSlotStream * /*psstrm*/)
{
return m_xsClusterBbRight - m_xsClusterBbLeft + 1;
}
- float ClusterBbHeight(GrSlotStream * psstrm)
+ float ClusterBbHeight(GrSlotStream * /*psstrm*/)
{
return m_ysClusterBbTop - m_ysClusterBbBottom + 1;
}
@@ -990,7 +994,8 @@ protected:
void InitMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
void InitLeafMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
void InitRootMetrics(GrTableManager * ptman);
- void CalcRootMetrics(GrTableManager * ptman, GrSlotStream *, int nLevel);
+ void CalcRootMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
+ GrSlotStream * psstrmNext, int nLevel);
void AttachToRoot(GrTableManager * ptman, GrSlotStream *, GrSlotState * pslotNewRoot);
void AttachLogUnits(GrTableManager * ptman,
GrSlotState * pslotRoot,
--- engine/src/segment/GrSlotStream.cpp.orig 2009-02-04 05:53:26 UTC
+++ engine/src/segment/GrSlotStream.cpp
@@ -189,12 +189,16 @@ GrSlotState * GrSlotStream::Peek(int dis
stream position when the rule is being run.
@param dislot - how far back to peek before the write position
- when the rule started; a negative number
+ WHEN THE RULE STARTED; a negative number
(NOTE: the current write position is irrelevant)
@param fNullOkay - true if it's okay to return NULL in the situation where we're asking
for something before the beginning of the stream
----------------------------------------------------------------------------------------------*/
+#ifdef NDEBUG
+GrSlotState * GrSlotStream::PeekBack(int dislot, bool /*fNullOkay*/)
+#else
GrSlotState * GrSlotStream::PeekBack(int dislot, bool fNullOkay)
+#endif
{
Assert(dislot < 0);
if (dislot < m_islotRuleStartWrite * -1)
@@ -1104,6 +1108,7 @@ bool RightToLeftDir(DirCode dirc)
case kdircRLO:
case kdircRLE:
case kdircPdfR:
+ case kdircRlb:
return true;
case kdircNeutral:
@@ -1212,7 +1217,7 @@ bool GrSlotStream::MoreSpace(GrTableMana
return true;
float xsWidth, xsVisWidth;
- ptman->CalcPositionsUpTo(m_ipass, NULL, &xsWidth, &xsVisWidth);
+ ptman->CalcPositionsUpTo(m_ipass, NULL, false, &xsWidth, &xsVisWidth);
*pxsWidth = (fIgnoreTrailingWS || twsh == ktwshOnlyWs) ? xsVisWidth : xsWidth;
return (*pxsWidth < xsSpaceAllotted);
@@ -1322,7 +1327,7 @@ int GrSlotStream::InsertLineBreak(GrTabl
@param islotMin - first slot that is officially part of the segment (after initial LB)
----------------------------------------------------------------------------------------------*/
int GrSlotStream::MakeSegmentBreak(GrTableManager * ptman,
- int islotPrevBreak, bool fInsertedLB, int islotStartTry,
+ int /*islotPrevBreak*/, bool /*fInsertedLB*/, int islotStartTry,
LineBrk lb, TrWsHandling twsh, int islotMin,
LineBrk * plbNextToTry)
{
@@ -1576,7 +1581,11 @@ int GrSlotStream::MaxClusterSlot(int isl
Return the break weight of the given slot, which should be a line-break.
OBSOLETE??
----------------------------------------------------------------------------------------------*/
+#ifdef NDEBUG
+LineBrk GrSlotStream::BreakWeightAt(gid16 /*chwLB*/, int islot)
+#else
LineBrk GrSlotStream::BreakWeightAt(gid16 chwLB, int islot)
+#endif
{
GrSlotState * pslot = GetSlotAt(islot);
Assert(pslot->IsLineBreak(chwLB));
@@ -1769,7 +1778,7 @@ void GrSlotStream::UnwindOutput(int islo
@param fBackingUp - this chunk results in the stream position moving backwards,
so clear anything we're backing over
----------------------------------------------------------------------------------------------*/
-void GrSlotStream::MapInputChunk(int islotInputMin, int islotOutputMin, int islotInputLim,
+void GrSlotStream::MapInputChunk(int islotInputMin, int islotOutputMin, int /*islotInputLim*/,
bool fSkipChunkStart, bool fBackingUp)
{
Assert(AssertValid());
@@ -1828,7 +1837,7 @@ int GrSlotStream::LastNextChunkLength()
@param fBackingUp - this chunk results in the stream position moving backwards,
so clear anything we're backing over
----------------------------------------------------------------------------------------------*/
-void GrSlotStream::MapOutputChunk(int islotOutputMin, int islotInputMin, int islotOutputLim,
+void GrSlotStream::MapOutputChunk(int islotOutputMin, int islotInputMin, int /*islotOutputLim*/,
bool fSkipChunkStart, int cslotReprocess, bool fBackingUp)
{
Assert(AssertValid());
@@ -1863,7 +1872,11 @@ void GrSlotStream::MapOutputChunk(int is
Ensure that the chunk maps for a pair of streams match properly. The recipient is
the input stream.
----------------------------------------------------------------------------------------------*/
+#ifdef _DEBUG
void GrSlotStream::AssertChunkMapsValid(GrSlotStream * psstrmOut)
+#else
+void GrSlotStream::AssertChunkMapsValid(GrSlotStream * )
+#endif
{
#ifdef _DEBUG
GrSlotStream * psstrmIn = this;
@@ -1915,7 +1928,11 @@ void GrSlotStream::AssertChunkMapsValid(
Ensure that corresponding items in the streams of a positioning pass have matching
stream indices. The recipient is the output stream.
----------------------------------------------------------------------------------------------*/
+#ifdef _DEBUG
void GrSlotStream::AssertStreamIndicesValid(GrSlotStream * psstrmIn)
+#else
+void GrSlotStream::AssertStreamIndicesValid(GrSlotStream * )
+#endif
{
#ifdef _DEBUG
if (!GotIndexOffset())
@@ -1939,7 +1956,11 @@ void GrSlotStream::AssertStreamIndicesVa
in the output stream. (Currently the compiler ensures this by making it an error
to write rules that don't do this.)
----------------------------------------------------------------------------------------------*/
+#ifdef _DEBUG
void GrSlotStream::AssertAttachmentsInOutput(int islotMin, int islotLim)
+#else
+void GrSlotStream::AssertAttachmentsInOutput(int , int )
+#endif
{
#ifdef _DEBUG
for (int islot = islotMin; islot < islotLim; islot++)
@@ -2007,7 +2028,11 @@ void GrSlotStream::ResyncSkip(int cslot)
Record the number of slots in the stream that are previous to the official start of the
segment.
----------------------------------------------------------------------------------------------*/
+#ifdef _DEBUG
void GrSlotStream::CalcIndexOffset(GrTableManager * ptman)
+#else
+void GrSlotStream::CalcIndexOffset(GrTableManager * )
+#endif
{
if (GotIndexOffset())
return; // already figured it
@@ -2203,6 +2228,21 @@ GrSlotState * GrSlotStream::GetSlotAt(in
}
/*----------------------------------------------------------------------------------------------
+ In the middle of running a pass, return the given slot to use in processing.
+ Read it from the reprocess buffer if appropriate, or for slots previous to the current
+ position, read from the output stream (psstrmNext).
+
+ psstrmNext may be NULL when processing is complete, therefore we only have one stream to
+ deal with.
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotStream::MidPassSlotAt(int islot, GrSlotStream * psstrmNext)
+{
+ int islotInput = islot - ReadPosForNextGet() + 1; // +1 because RuleInputSlot takes 0 to mean the previously read slot
+ GrSlotState * pslot = RuleInputSlot(islotInput, psstrmNext);
+ return pslot;
+}
+
+/*----------------------------------------------------------------------------------------------
Return the "current" input item from the rule's perspective, ie, the last slot read.
So dislotOffset = 0 means not the slot at the read position but one slot earlier.
@@ -2214,7 +2254,6 @@ GrSlotState * GrSlotStream::GetSlotAt(in
@param fNullOkay - true if it's okay to return NULL in the situation where we're asking
for something before the beginning of the stream
----------------------------------------------------------------------------------------------*/
-
GrSlotState * GrSlotStream::RuleInputSlot(int dislotOffset, GrSlotStream * psstrmOutput,
bool fNullOkay)
{
@@ -2244,8 +2283,10 @@ GrSlotState * GrSlotStream::RuleInputSlo
if (cslotOffsetBack >= cslotPostReproc + cslotValidReproc)
{
- // Read from the output stream.
- int dislotTmp = dislotOffset - 1 + cslotPostReproc + cslotValidReproc;
+ // Read from the output stream. (Remember that PeekBack works relative to
+ // the rule-start write position, not the current write position.)
+ int dislotTmp = dislotOffset - 1 + cslotPostReproc
+ + cslotValidReproc - SlotsToReprocess();
Assert(dislotTmp < 0);
return psstrmOutput->PeekBack(dislotTmp);
}
@@ -2253,7 +2294,7 @@ GrSlotState * GrSlotStream::RuleInputSlo
{
if (m_islotReprocPos > -1)
{
- // Current read pos is inside reprocess buffer.
+ // Current read pos could be inside reprocess buffer.
Assert(cslotPostReproc == 0);
int islotStartReadReprocBuf = m_vpslotReproc.size() - cslotValidReproc;
Assert(islotStartReadReprocBuf >= 0);
@@ -2342,9 +2383,10 @@ void GrSlotStream::SetNeutralAssociation
else if (pslotAfter)
pslot->Associate(pslotAfter);
else
+ {
// Weird, but can happen with an empty segment.
Warn("No assocations");
-
+ }
// Assert(pslot->m_vpslotAssoc.Size() > 0);
pslot->m_fNeutralAssocs = true;
}
--- engine/src/segment/GrSlotStream.h.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/GrSlotStream.h
@@ -107,7 +107,7 @@ public:
ReleaseSlots(0, m_vpslot.size());
}
- void ReleaseSlots(int islotMin, int islotLim)
+ void ReleaseSlots(int /*islotMin*/, int /*islotLim*/)
{
// A slot stream is responsible for deleting the slot states that it created,
// that is, the ones whose modified tag equals this stream's pass index.
@@ -182,6 +182,7 @@ public:
return Peek(islot - ReadPosForNextGet());
}
+ // Return the functional read position, taking into account the reprocess buffer.
int ReadPosForNextGet()
{
return ReadPos() - SlotsToReprocess();
@@ -260,12 +261,16 @@ public:
void MarkFullyWritten();
+#ifdef NDEBUG
+ void SetSegMin(int islot, bool /*fAdjusting*/ = false)
+#else
void SetSegMin(int islot, bool fAdjusting = false)
+#endif
{
Assert(fAdjusting || m_islotSegMin == -1 || m_islotSegMin == islot);
m_islotSegMin = islot;
}
- void SetSegMinToWritePos(bool fMod = true)
+ void SetSegMinToWritePos(bool /*fMod*/ = true)
{
if (m_islotSegMin == -1)
m_islotSegMin = m_islotWritePos;
@@ -456,6 +461,7 @@ public:
}
}
+ GrSlotState * MidPassSlotAt(int islot, GrSlotStream * psstrmNext = NULL);
GrSlotState * RuleInputSlot(int dislot = 0, GrSlotStream * psstrmOut = NULL,
bool fNullOkay = false);
GrSlotState * RuleOutputSlot(int dislot = 0);
--- engine/src/segment/GrTableManager.cpp.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/GrTableManager.cpp
@@ -25,8 +25,8 @@ Description:
DEFINE_THIS_FILE
#ifndef _WIN32
#include <stdlib.h>
-#include <math.h>
#endif
+#include <math.h>
//:>********************************************************************************************
//:> Forward declarations
@@ -572,7 +572,7 @@ void GrTableManager::Run(Segment * psegN
else
{
Assert(!m_engst.m_fInsertedLB);
- Assert(islotUnderBreak == -1 || m_engst.m_fFinalLB);
+ //Assert(islotUnderBreak == -1 || m_engst.m_fFinalLB); -- no, ExtendGlyphIDOutput clearly sets islotUnderBreak regardless
}
int islotTmp = OutputStream(m_cpass - 1)->WritePos();
GrSlotState * pslotTmp;
@@ -931,7 +931,7 @@ void GrTableManager::InitSegmentAsEmpty(
@param plbFound - kind of line-break created
----------------------------------------------------------------------------------------------*/
bool GrTableManager::Backtrack(int * pislotPrevBreak,
- LineBrk * plbMin, LineBrk lbMax, TrWsHandling twsh, bool fMoreText,
+ LineBrk * plbMin, LineBrk lbMax, TrWsHandling twsh, bool /*fMoreText*/,
int ichwCallerBtLim, bool fEndLine,
LineBrk * plbFound)
{
@@ -1343,7 +1343,7 @@ LBackupPC:
Calculate the associations, and record the output slots in the segment.
----------------------------------------------------------------------------------------------*/
void GrTableManager::RecordAssocsAndOutput(Font * pfont,
- Segment * pseg, bool fWidthIsCharCount,
+ Segment * pseg, bool /*fWidthIsCharCount*/,
TrWsHandling twsh, bool fParaRtl, int nDirDepth)
{
int cchwUnderlying = pseg->stopCharacter() - pseg->startCharacter();
@@ -1362,7 +1362,7 @@ void GrTableManager::RecordAssocsAndOutp
#endif // OLD_TEST_STUFF
// Make sure the final positions are set for every glyph.
- CalcPositionsUpTo(m_cpass-1, reinterpret_cast<GrSlotState *>(NULL),
+ CalcPositionsUpTo(m_cpass-1, reinterpret_cast<GrSlotState *>(NULL), false,
&xsTotalWidth, &xsVisWidth);
pseg->SetWidths(xsVisWidth, xsTotalWidth);
@@ -1377,7 +1377,7 @@ void GrTableManager::RecordAssocsAndOutp
Calculate the underlying-to-surface associations and ligature mappings.
Assumes the arrays have been properly initialized.
----------------------------------------------------------------------------------------------*/
-void GrTableManager::CalculateAssociations(Segment * pseg, int csloutSurface)
+void GrTableManager::CalculateAssociations(Segment * pseg, int /*csloutSurface*/)
{
GrSlotStream * psstrmFinal = OutputStream(m_cpass-1);
@@ -2350,18 +2350,20 @@ bool GrTableManager::LoggingTransduction
final pass, but it could be another if positions are
requested by the rules themselves
@param pslotLast - last slot that needs to be positioned, or NULL
+ @param fMidPass - calculating the position of some slot in the middle of the pass
@param pxsWidth - return the total width used so far
@param psxVisibleWidth - return the visible width so far
MOVE to EngineState
----------------------------------------------------------------------------------------------*/
-void GrTableManager::CalcPositionsUpTo(int ipass, GrSlotState * pslotLast,
+void GrTableManager::CalcPositionsUpTo(int ipass, GrSlotState * pslotLast, bool fMidPass,
float * pxsWidth, float * pxsVisibleWidth)
{
Assert(ipass >= m_ipassPos1 - 1);
int isstrm = ipass;
GrSlotStream * psstrm = OutputStream(isstrm);
+ GrSlotStream * psstrmNext = (isstrm >= m_cpass - 1) ? NULL : OutputStream(isstrm + 1);
Assert(psstrm->GotIndexOffset());
if (psstrm->WritePos() <= psstrm->IndexOffset())
{
@@ -2399,7 +2401,9 @@ void GrTableManager::CalcPositionsUpTo(i
// to be later in the stream than the last actual slot passed in.
if (!psstrm->HasSlotAtPosPassIndex(pslotLast->AttachRootPosPassIndex()))
return;
- GrSlotState * pslotLastBase = pslotLast->Base(psstrm);
+ GrSlotState * pslotLastBase = (fMidPass && pslotLast->PosPassIndex() < psstrm->WritePos())
+ ? pslotLast->Base(psstrmNext)
+ : pslotLast->Base(psstrm);
if (ipass == m_cpass - 1 && m_engst.m_islotPosNext > -1)
{
@@ -2428,6 +2432,7 @@ void GrTableManager::CalcPositionsUpTo(i
}
std::vector<GrSlotState *> vpslotAttached;
+ std::vector<GrSlotStream *> vpsstrmAttached;
bool fRtl = RightToLeft();
@@ -2435,13 +2440,24 @@ void GrTableManager::CalcPositionsUpTo(i
{
Assert(islot < psstrm->SlotsPresent());
- pslot = (isstrm == ipass) ? psstrm->SlotAt(islot) : psstrm->OutputSlotAt(islot);
+ GrSlotStream * psstrmThis = psstrm;
+ if (fMidPass && islot < psstrm->WritePos())
+ {
+ pslot = psstrm->MidPassSlotAt(islot, psstrmNext);
+ psstrmThis = psstrmNext;
+ }
+ else
+ {
+ //pslot = (isstrm == ipass) ? psstrm->SlotAt(islot) : psstrm->OutputSlotAt(islot);
+ pslot = psstrm->SlotAt(islot);
+ }
if (!pslot->IsBase())
{
// This slot is attached to another; it will be positioned strictly
// relative to that one. This happens in the loop below.
vpslotAttached.push_back(pslot);
+ vpsstrmAttached.push_back(psstrmThis);
}
else
{
@@ -2455,7 +2471,7 @@ void GrTableManager::CalcPositionsUpTo(i
}
// Make sure the metrics are the complete ones.
- pslot->CalcCompositeMetrics(this, psstrm, kPosInfinity, true);
+ pslot->CalcCompositeMetrics(this, psstrm, psstrmNext, kPosInfinity, true);
float xsInc = pslot->GlyphXOffset(psstrm, fakeItalicRatio);
float ysInc = pslot->GlyphYOffset(psstrm);
@@ -2514,8 +2530,9 @@ void GrTableManager::CalcPositionsUpTo(i
for (size_t ipslot = 0; ipslot < vpslotAttached.size(); ipslot++)
{
- GrSlotState * pslot = vpslotAttached[ipslot];
- GrSlotState * pslotBase = pslot->Base(psstrm);
+ GrSlotState * pslotAtt = vpslotAttached[ipslot];
+ GrSlotStream * psstrmAtt = vpsstrmAttached[ipslot];
+ GrSlotState * pslotBase = pslotAtt->Base(psstrmAtt);
if (pslotBase->XPosition() == kNegInfinity || pslotBase->YPosition() == kNegInfinity)
{
Assert(false);
@@ -2523,10 +2540,10 @@ void GrTableManager::CalcPositionsUpTo(i
}
float xsCluster = pslotBase->XPosition() - pslotBase->GlyphXOffset(psstrm, fakeItalicRatio);
float ysCluster = pslotBase->YPosition() - pslotBase->GlyphYOffset(psstrm);
- float xsInc = pslot->GlyphXOffset(psstrm, fakeItalicRatio);
- float ysInc = pslot->GlyphYOffset(psstrm);
- pslot->SetXPos(xsCluster + xsInc);
- pslot->SetYPos(ysCluster + ysInc);
+ float xsInc = pslotAtt->GlyphXOffset(psstrm, fakeItalicRatio);
+ float ysInc = pslotAtt->GlyphYOffset(psstrm);
+ pslotAtt->SetXPos(xsCluster + xsInc);
+ pslotAtt->SetYPos(ysCluster + ysInc);
// My theory is that we don't need to adjust *pxsWidth here, because the width of
// any non-base slots should be factored into the advance width of their cluster
--- engine/src/segment/GrTableManager.h.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/GrTableManager.h
@@ -442,7 +442,7 @@ public:
int LogToEmUnits(float xys);
bool GPointToXY(gid16 chwGlyphID, int nGPoint, float * xs, float * ys);
- void CalcPositionsUpTo(int ipass, GrSlotState * pslotLast,
+ void CalcPositionsUpTo(int ipass, GrSlotState * pslotLast, bool fMidPass,
float * pxsWidth, float * pxsVisibleWidth);
void InitPosCache()
--- engine/src/segment/MemoryUsage.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/MemoryUsage.cpp
@@ -11,10 +11,10 @@ Last reviewed: Not yet.
Description:
Calculates memory usage for the engine and segments.
----------------------------------------------------------------------------------------------*/
-
+#ifdef _MSC_VER
#pragma warning(disable: 4244) // conversion from wchar_t to char
#pragma warning(disable: 4702) // unreachable code
-
+#endif
//:>********************************************************************************************
//:> Include files
//:>********************************************************************************************
@@ -54,8 +54,6 @@ Description:
#ifdef _MSC_VER
#pragma hdrstop
#endif
-#undef THIS_FILE
-DEFINE_THIS_FILE
//:End Ignore
--- engine/src/segment/Platform.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/src/segment/Platform.cpp
@@ -103,7 +103,7 @@ size_t utf16len(const utf16 *s)
{
// assumes NULL terminated strings
const utf16 *start = s;
- for (; *s; ++s);
+ for (; *s; ++s) {};
return s - start;
}
--- engine/src/segment/Segment.cpp.orig 2008-08-21 14:24:32 UTC
+++ engine/src/segment/Segment.cpp
@@ -246,6 +246,8 @@ void Segment::Initialize(ITextSource * p
m_dxsVisibleWidth = -1;
m_dxsTotalWidth = -1;
+ m_ichwAssocsMin = 0;
+ m_ichwAssocsLim = 0;
// m_psstrm = NULL;
m_prgslout = NULL;
@@ -1178,7 +1180,7 @@ LineBrk Segment::getBreakWeight(int ich,
part of the segment.
----------------------------------------------------------------------------------------------*/
float Segment::getRangeWidth(int ichMin, int ichLim,
- bool fStartLine, bool fEndLine, bool fSkipSpace)
+ bool /*fStartLine*/, bool /*fEndLine*/, bool fSkipSpace)
{
if (m_dxsWidth < 0)
{
@@ -1549,7 +1551,11 @@ void Segment::ComputeOverhangs(float * p
void Segment::SetUpOutputArrays(Font * pfont, GrTableManager * ptman,
GrSlotStream * psstrmFinal,
int cchwInThisSeg, int csloutSurface, gid16 chwLB,
+#ifdef NDEBUG
+ TrWsHandling twsh, bool fParaRtl, int nDirDepth, bool /*fEmpty*/)
+#else
TrWsHandling twsh, bool fParaRtl, int nDirDepth, bool fEmpty)
+#endif
{
m_mFontEmUnits = EngineImpl()->GetFontEmUnits();
@@ -1725,7 +1731,7 @@ void Segment::SetUpOutputArrays(Font * p
Set up the data structures that represent the actual rendered glyphs for the new segment.
----------------------------------------------------------------------------------------------*/
void Segment::SetUpGlyphInfo(GrTableManager * ptman, GrSlotStream * psstrmFinal,
- gid16 chwLB, int nDirDepth, int islotMin, int cslot)
+ gid16 chwLB, int /*nDirDepth*/, int islotMin, int cslot)
{
//int paraDirLevel = (ptman->State()->ParaRightToLeft()) ? 1 : 0;
@@ -1751,7 +1757,7 @@ void Segment::SetUpGlyphInfo(GrTableMana
m_isloutGinf0 = -1;
int iginf = 0;
- for (int islot = islotMin; islot < cslot; islot++)
+ for (islot = islotMin; islot < cslot; islot++)
{
GrSlotState * pslot = psstrmFinal->SlotAt(islot);
@@ -2160,7 +2166,7 @@ void Segment::RecordLigature(int ichwUnd
@param ichwUnder - character index relative to the official beginning of the segment
@param islot - processed glyph it maps to
----------------------------------------------------------------------------------------------*/
-void Segment::MarkSlotInPrevSeg(int ichwUnder, int islot)
+void Segment::MarkSlotInPrevSeg(int ichwUnder, int /*islot*/)
{
if (ichwUnder >= m_ichwAssocsMin)
m_prgisloutBefore[ichwUnder - m_ichwAssocsMin] = kNegInfinity;
@@ -2174,7 +2180,7 @@ void Segment::MarkSlotInPrevSeg(int ichw
@param ichwUnder - character index relative to the official beginning of the segment
@param islot - processed glyph it maps to
----------------------------------------------------------------------------------------------*/
-void Segment::MarkSlotInNextSeg(int ichwUnder, int islot)
+void Segment::MarkSlotInNextSeg(int ichwUnder, int /*islot*/)
{
if (ichwUnder < m_ichwAssocsLim)
m_prgisloutAfter[ichwUnder - m_ichwAssocsMin] = kPosInfinity;
@@ -2351,7 +2357,7 @@ void Segment::SetJustifier(IGrJustifier
@param pfAfter - return true if they clicked on trailing side; possibly NULL
----------------------------------------------------------------------------------------------*/
int Segment::LogicalSurfaceToUnderlying(int islout, float xsOffset, float ysClick,
- float dxsGlyphWidth, float dysGlyphHeight, bool * pfAfter)
+ float dxsGlyphWidth, float /*dysGlyphHeight*/, bool * pfAfter)
{
Assert(islout >= 0);
Assert(islout < m_cslout);
@@ -2529,31 +2535,31 @@ int Segment::UnderlyingToLogicalSurface(
else if (fBefore)
{
int isloutRet;
- int ichw = ichwSegOffset;
+ int ichwTemp = ichwSegOffset;
// If no association has been made, loop forward to the next slot
// we are before. As a last resort, answer kPosInfinity, meaning we
// aren't before anything.
do
{
- isloutRet = m_prgisloutBefore[ichw - m_ichwAssocsMin];
- do { ++ichw; }
- while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichw));
- } while (isloutRet == kPosInfinity && ichw < m_ichwAssocsLim);
+ isloutRet = m_prgisloutBefore[ichwTemp - m_ichwAssocsMin];
+ do { ++ichwTemp; }
+ while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichwTemp));
+ } while (isloutRet == kPosInfinity && ichwTemp < m_ichwAssocsLim);
return isloutRet;
}
else
{
int isloutRet;
- int ichw = ichwSegOffset;
+ int ichwTemp = ichwSegOffset;
// If no association has been made, loop backward to the previous slot
// we are after. As a last resort, answer kNegInfinity, meaning we
// aren't after anything.
do
{
- isloutRet = m_prgisloutAfter[ichw - m_ichwAssocsMin];
- do { --ichw; }
- while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichw));
- } while (isloutRet == kNegInfinity && ichw >= 0);
+ isloutRet = m_prgisloutAfter[ichwTemp - m_ichwAssocsMin];
+ do { --ichwTemp; }
+ while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichwTemp));
+ } while (isloutRet == kNegInfinity && ichwTemp >= 0);
return isloutRet;
}
Assert(false); // should never reach here
@@ -2748,7 +2754,11 @@ int Segment::SlotIsRightToLeft(GrSlotOut
that root glyph as one of its roots.
OBSOLETE
----------------------------------------------------------------------------------------------*/
+#ifdef _DEBUG
void Segment::AssertValidClusters(GrSlotStream * psstrm)
+#else
+void Segment::AssertValidClusters(GrSlotStream * /*psstrm*/)
+#endif
{
#ifdef _DEBUG
for (int islot = 0; islot < psstrm->WritePos(); islot++)
@@ -2980,9 +2990,10 @@ GrResult Segment::getUniscribeClusters(
return kresOk;
}
-
+#ifdef __GNUC__
// suppress GCC 4.3 warning for optimized min()/max() when called with (ich, ich+1) or similar
#pragma GCC diagnostic ignored "-Wstrict-overflow"
+#endif
/*----------------------------------------------------------------------------------------------
Merge the given characters into the same Uniscribe cluster. This means merging any
--- engine/src/segment/TransductionLog.cpp.orig 2009-01-28 02:01:29 UTC
+++ engine/src/segment/TransductionLog.cpp
@@ -175,7 +175,7 @@ bool GrTableManager::WriteAssociationLog
Output a file showing a log of the transduction process and the resulting segment.
----------------------------------------------------------------------------------------------*/
void GrTableManager::WriteXductnLog(std::ostream & strmOut,
- GrCharStream * pchstrm, Segment * psegRet,
+ GrCharStream * pchstrm, Segment * /*psegRet*/,
int cbPrevSegDat, byte * pbPrevSegDat)
{
if (cbPrevSegDat == 0)
@@ -416,8 +416,8 @@ int GrCharStream::GetLogData(GrTableMana
the raw (UTF-16 or UTF-8) chars for display. To do this we get the raw characters
directly from the text source.
----------------------------------------------------------------------------------------------*/
-void GrCharStream::GetLogDataRaw(GrTableManager * ptman, int cchl, int cchrBackup,
- int cchrMaxRaw, int * prgchl,
+void GrCharStream::GetLogDataRaw(GrTableManager * /*ptman*/, int cchl, int cchrBackup,
+ int /*cchrMaxRaw*/, int * prgchl,
utf16 * prgchw2, utf16 * prgchw3, utf16 * prgchw4, utf16 * prgchw5, utf16 * prgchw6,
int * prgcchr)
{
@@ -441,7 +441,7 @@ void GrCharStream::GetLogDataRaw(GrTable
case kutf8:
prgchsRunText8 = new utf8[cchrRange];
m_pgts->fetch(ichrMin, cchrRange, prgchsRunText8);
- for (int ichr = 0; ichr < cchrRange; ichr++)
+ for (ichr = 0; ichr < cchrRange; ichr++)
prgchwRunText[ichr] = (utf16)prgchsRunText8[ichr]; // zero-extend into UTF-16 buffer
break;
case kutf16:
@@ -634,7 +634,7 @@ void GrPass::LogRulesFiredAndFailed(std:
m_pzpst->LogRulesFiredAndFailed(strmOut, psstrmIn);
}
-void PassState::LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * psstrmIn)
+void PassState::LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * /*psstrmIn*/)
{
strmOut << "PASS " << m_ipass << "\n\n" << "Rules matched: ";
@@ -1193,7 +1193,7 @@ void Segment::LogSurfaceToUnderlying(GrT
if (fAnyPseudos)
{
strmOut << "Actual glyphs: ";
- for (int islout = 0; islout < m_cslout; islout++)
+ for (islout = 0; islout < m_cslout; islout++)
{
GrSlotOutput * psloutTmp = m_prgslout + islout;
if (psloutTmp->GlyphID() != psloutTmp->ActualGlyphForOutput(ptman))
@@ -1319,7 +1319,7 @@ void GrTableManager::LogUnderlyingHeader
Write out the header lines for the slot contents.
----------------------------------------------------------------------------------------------*/
void GrTableManager::LogSlotHeader(std::ostream & strmOut, int islotLim,
- int cspPerSlot, int cspLeading, int islotMin)
+ int /*cspPerSlot*/, int cspLeading, int islotMin)
{
islotLim = min(islotLim, MAX_SLOTS);
@@ -1721,7 +1721,7 @@ void GrSlotState::LogSlotAttribute(GrTab
case kslatAttAtX: // always do these in pairs
case kslatAttAtY:
- if (m_mAttachAtX != (pslotPrev ? pslotPrev->m_mAttachAtX : kNotYetSet) ||
+ if (m_mAttachAtX != (pslotPrev ? pslotPrev->m_mAttachAtX : static_cast<short>(kNotYetSet)) ||
m_mAttachAtY != (pslotPrev ? pslotPrev->m_mAttachAtY : 0))
{
ptman->LogInTable(strmOut,
@@ -1730,7 +1730,7 @@ void GrSlotState::LogSlotAttribute(GrTab
}
break;
case kslatAttAtGpt:
- if (m_nAttachAtGpoint != (pslotPrev ? pslotPrev->m_nAttachAtGpoint : kNotYetSet))
+ if (m_nAttachAtGpoint != (pslotPrev ? pslotPrev->m_nAttachAtGpoint : static_cast<short>(kNotYetSet)))
{
ptman->LogInTable(strmOut,
((m_nAttachAtGpoint == kGpointZero) ? 0 : m_nAttachAtGpoint));
@@ -1750,7 +1750,7 @@ void GrSlotState::LogSlotAttribute(GrTab
case kslatAttWithX: // always do these in pairs
case kslatAttWithY:
- if (m_mAttachWithX != (pslotPrev ? pslotPrev->m_mAttachWithX : kNotYetSet) ||
+ if (m_mAttachWithX != (pslotPrev ? pslotPrev->m_mAttachWithX : static_cast<short>(kNotYetSet)) ||
m_mAttachWithY != (pslotPrev ? pslotPrev->m_mAttachWithY : 0))
{
ptman->LogInTable(strmOut,
@@ -1759,7 +1759,7 @@ void GrSlotState::LogSlotAttribute(GrTab
}
break;
case kslatAttWithGpt:
- if (m_nAttachWithGpoint != (pslotPrev ? pslotPrev->m_nAttachWithGpoint : kNotYetSet))
+ if (m_nAttachWithGpoint != (pslotPrev ? pslotPrev->m_nAttachWithGpoint : static_cast<short>(kNotYetSet)))
{
ptman->LogInTable(strmOut,
((m_nAttachWithGpoint == kGpointZero) ? 0 : m_nAttachWithGpoint));
@@ -1786,14 +1786,14 @@ void GrSlotState::LogSlotAttribute(GrTab
break;
case kslatBreak:
- if (m_lb != (pslotPrev ? pslotPrev->m_lb : kNotYetSet8))
+ if (m_lb != (pslotPrev ? pslotPrev->m_lb : static_cast<sdata8>(kNotYetSet8)))
{
ptman->LogBreakWeightInTable(strmOut, m_lb);
return;
}
break;
case kslatDir:
- if (m_dirc != (pslotPrev ? pslotPrev->m_dirc : kNotYetSet8))
+ if (m_dirc != (pslotPrev ? pslotPrev->m_dirc : static_cast<sdata8>(kNotYetSet8)))
{
ptman->LogDirCodeInTable(strmOut, m_dirc);
return;
--- engine/test/ProfileHarness/GrUtfTextSrc.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/test/ProfileHarness/GrUtfTextSrc.cpp
@@ -210,12 +210,12 @@ size_t GrUtfTextSrc::fetch(gr::toffset i
}
-bool GrUtfTextSrc::getRightToLeft(gr::toffset ich)
+bool GrUtfTextSrc::getRightToLeft(gr::toffset /*ich*/)
{
return mRtl; // assumes src only contains one direction
}
-unsigned int GrUtfTextSrc::getDirectionDepth(gr::toffset ich)
+unsigned int GrUtfTextSrc::getDirectionDepth(gr::toffset /*ich*/)
{
return (mRtl) ? 1 : 0; // TBD
}
@@ -254,7 +254,7 @@ std::pair<gr::toffset, gr::toffset> GrUt
return range;
}
-size_t GrUtfTextSrc::getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset)
+size_t GrUtfTextSrc::getFontFeatures(gr::toffset /*ich*/, gr::FeatureSetting * /*prgfset*/)
{
return 0;
}
@@ -277,14 +277,14 @@ void GrUtfTextSrc::getColors(gr::toffset
// these should be called I hope
float
-GrUtfTextSrc::getFontSize(gr::toffset ich)
+GrUtfTextSrc::getFontSize(gr::toffset /*ich*/)
{
assert(mFont);
return mPointSize;
}
bool
-GrUtfTextSrc::getBold(gr::toffset ich)
+GrUtfTextSrc::getBold(gr::toffset /*ich*/)
{
assert(mFont);
// NS_ASSERTION(false, "unexpected call to getBold");
@@ -293,7 +293,7 @@ GrUtfTextSrc::getBold(gr::toffset ich)
}
bool
-GrUtfTextSrc::getItalic(gr::toffset ich)
+GrUtfTextSrc::getItalic(gr::toffset /*ich*/)
{
assert(mFont);
//NS_ASSERTION(false, "unexpected call to getItalic");
@@ -301,7 +301,7 @@ GrUtfTextSrc::getItalic(gr::toffset ich)
return mFont->italic();
}
-gr::isocode GrUtfTextSrc::getLanguage(gr::toffset ich)
+gr::isocode GrUtfTextSrc::getLanguage(gr::toffset /*ich*/)
{
gr::isocode unknown;
std::fill_n(unknown.rgch, 4, '\0');
--- engine/test/ProfileHarness/GrUtfTextSrc.h.orig 2009-01-21 22:36:42 UTC
+++ engine/test/ProfileHarness/GrUtfTextSrc.h
@@ -79,7 +79,7 @@ public:
virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchBuffer);
virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf8 * prgchsBuffer);
- virtual gr::GrResult getFaceName(int ich, unsigned int cchMax,
+ virtual gr::GrResult getFaceName(int /*ich*/, unsigned int /*cchMax*/,
gr::utf16 * prgchFaceName, unsigned int * pcchLen)
{
prgchFaceName[0] = 0;
@@ -92,12 +92,12 @@ public:
virtual bool getItalic(gr::toffset ich);
virtual bool getRightToLeft(gr::toffset ich);
virtual unsigned int getDirectionDepth(gr::toffset ich);
- virtual float getVerticalOffset(gr::toffset ich) { return 0;};
+ virtual float getVerticalOffset(gr::toffset /*ich*/) { return 0;};
virtual gr::isocode getLanguage(gr::toffset ich);
virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
- virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2) { return true; };
+ virtual bool sameSegment(gr::toffset /*ich1*/, gr::toffset /*ich2*/) { return true; };
protected:
bool checkBuffer8();
@@ -129,11 +129,11 @@ public: // methods that will go
virtual void getColors(gr::toffset ich, int * pclrFore, int * pclrBack);
// Shouldn't be here!
- virtual gr::GrResult Fetch(int ichMin, int ichLim, gr::utf16 * prgchBuf) { return gr::kresNotImpl; };
- virtual gr::GrResult get_Length(int * pcch) { return gr::kresNotImpl; };
- virtual gr::GrResult GetFontVariations(int ich,
- wchar_t * prgchFontVar, int ichMax, int * pich,
- int * pichMin, int * pichLim) { return gr::kresNotImpl; };
+ virtual gr::GrResult Fetch(int /*ichMin*/, int /*ichLim*/, gr::utf16 * /*prgchBuf*/) { return gr::kresNotImpl; };
+ virtual gr::GrResult get_Length(int * /*pcch*/) { return gr::kresNotImpl; };
+ virtual gr::GrResult GetFontVariations(int /*ich*/,
+ wchar_t * /*prgchFontVar*/, int /*ichMax*/, int * /*pich*/,
+ int * /*pichMin*/, int * /*pichLim*/) { return gr::kresNotImpl; };
};
--- engine/test/ProfileHarness/ProfileHarness.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/test/ProfileHarness/ProfileHarness.cpp
@@ -39,14 +39,14 @@ diagnostic log of the segment creation i
typedef std::pair< gr::GlyphIterator, gr::GlyphIterator > GlyphRange;
#ifndef HAVE_STRTOF
-float strtof(char * text, char ** ignore)
+float strtof(char * text, char ** /*ignore*/)
{
return static_cast<float>(atof(text));
}
#endif
#ifndef HAVE_STRTOL
-long strtol(char * text, char ** ignore)
+long strtol(char * text, char ** /*ignore*/)
{
return atol(text);
}
--- engine/test/RegressionTest/GrJustifier.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/test/RegressionTest/GrJustifier.cpp
@@ -16,8 +16,9 @@ Description:
//:> Include files
//:>********************************************************************************************
//#include "main.h" // This is used by clients, so main.h is not available
-
+#ifdef _MSC_VER
#pragma hdrstop
+#endif
// any other headers (not precompiled)
#include "GrClient.h"
#include "ITextSource.h"
@@ -31,9 +32,6 @@ Description:
#include <string>
#endif
-#undef THIS_FILE
-DEFINE_THIS_FILE
-
//:>********************************************************************************************
//:> Global constants
//:>********************************************************************************************
@@ -327,9 +325,9 @@ LMainLoop:
&dxStretchAchieved);
for (int iiiGlyph = 0; iiiGlyph < cStretchable; iiiGlyph++)
{
- int iiGlyph = viiGlyphsRem[iiiGlyph];
- vdxStretchLeft[iiGlyph] = vdxStretchRem[iiiGlyph];
- vdxWidth[iiGlyph] = vdxWidthRem[iiiGlyph];
+ int ivGlyph = viiGlyphsRem[iiiGlyph];
+ vdxStretchLeft[ivGlyph] = vdxStretchRem[iiiGlyph];
+ vdxWidth[ivGlyph] = vdxWidthRem[iiiGlyph];
}
}
else
@@ -366,12 +364,12 @@ LMainLoop:
{
#ifdef WIN32
wchar_t rgchw[20];
- std::fill_n(rgchw, 20, 0);
+ std::fill_n(rgchw, 20, L'\0');
_itow(dxStretchNeeded - dxStretchAchieved, rgchw, 10);
std::wstring strTmp(L"justification failed by ");
strTmp += rgchw;
strTmp += L" units (width needed = ";
- std::fill_n(rgchw, 10, 0);
+ std::fill_n(rgchw, 10, L'\0');
_itow(dxDesiredWidth, rgchw, 10);
strTmp += rgchw;
strTmp += L")\n";
--- engine/test/RegressionTest/GrJustifier.h.orig 2009-01-21 22:36:42 UTC
+++ engine/test/RegressionTest/GrJustifier.h
@@ -11,7 +11,9 @@ Last reviewed: Not yet.
Description:
A default justification agent for Graphite.
-------------------------------------------------------------------------------*//*:End Ignore*/
+#ifdef _MSC_VER
#pragma once
+#endif
#ifndef GRJUSTIFIER_INCLUDED
#define GRJUSTIFIER_INCLUDED
--- engine/test/RegressionTest/RegressionTest.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/test/RegressionTest/RegressionTest.cpp
@@ -675,7 +675,7 @@ void OutputErrorWithValues(TestCase * pt
OutputErrorAux(ptcase, strErr, i, true, valueFound, valueExpected);
}
-void OutputErrorAux(TestCase * ptcase, std::string strErr, int i,
+void OutputErrorAux(TestCase * /*ptcase*/, std::string strErr, int i,
bool showValues, int valueFound, int valueExpected)
{
// if (g_debugMode)
--- engine/test/RegressionTest/SimpleTextSrc.cpp.orig 2009-01-21 22:36:42 UTC
+++ engine/test/RegressionTest/SimpleTextSrc.cpp
@@ -15,7 +15,9 @@ Description:
//:>********************************************************************************************
//:> Include files
//:>********************************************************************************************
+#ifdef _MSC_VER
#pragma hdrstop
+#endif
// any other headers (not precompiled)
#include "GrClient.h"
@@ -23,9 +25,6 @@ Description:
#include "ITextSource.h"
#include "SimpleTextSrc.h"
-#undef THIS_FILE
-DEFINE_THIS_FILE
-
//:>********************************************************************************************
//:> Initialization and destruction
//:>********************************************************************************************
@@ -70,7 +69,7 @@ size_t SimpleTextSrc::fetch(toffset ichM
/*----------------------------------------------------------------------------------------------
Return true if the text uses a right-to-left writing system.
----------------------------------------------------------------------------------------------*/
-bool SimpleTextSrc::getRightToLeft(toffset ich)
+bool SimpleTextSrc::getRightToLeft(toffset /*ich*/)
{
return false;
}
@@ -78,7 +77,7 @@ bool SimpleTextSrc::getRightToLeft(toffs
/*----------------------------------------------------------------------------------------------
Return the depth of embedding of the writing system.
----------------------------------------------------------------------------------------------*/
-unsigned int SimpleTextSrc::getDirectionDepth(toffset ich)
+unsigned int SimpleTextSrc::getDirectionDepth(toffset /*ich*/)
{
return 0;
}
@@ -87,7 +86,7 @@ unsigned int SimpleTextSrc::getDirection
Return the vertical offset of the text. This simple implementation provides no
vertical offset.
----------------------------------------------------------------------------------------------*/
-float SimpleTextSrc::getVerticalOffset(toffset ich)
+float SimpleTextSrc::getVerticalOffset(toffset /*ich*/)
{
return 0;
}
--- engine/test/RegressionTest/SimpleTextSrc.h.orig 2009-01-21 22:36:42 UTC
+++ engine/test/RegressionTest/SimpleTextSrc.h
@@ -11,7 +11,9 @@ Last reviewed: Not yet.
Description:
A simple text source that shows how to use this interface within Graphite.
-------------------------------------------------------------------------------*//*:End Ignore*/
+#ifdef _MSC_VER
#pragma once
+#endif
#ifndef GRTXTSRC_INCLUDED
#define GRTXTSRC_INCLUDED
@@ -59,12 +61,12 @@ public:
{
return m_cchLength;
}
- virtual size_t fetch(toffset ichMin, size_t cch, utf32 * prgchBuffer)
+ virtual size_t fetch(toffset /*ichMin*/, size_t /*cch*/, utf32 * /*prgchBuffer*/)
{
throw;
}
virtual size_t fetch(toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
- virtual size_t fetch(toffset ichMin, size_t cch, utf8 * prgchsBuffer)
+ virtual size_t fetch(toffset /*ichMin*/, size_t /*cch*/, utf8 * /*prgchsBuffer*/)
{
throw;
};
@@ -73,14 +75,14 @@ public:
virtual unsigned int getDirectionDepth(toffset ich);
virtual float getVerticalOffset(toffset ich);
- virtual isocode getLanguage(toffset ich)
+ virtual isocode getLanguage(toffset /*ich*/)
{
isocode ret;
ret.rgch[0] = 'e'; ret.rgch[1] = 'n'; ret.rgch[2] = 0; ret.rgch[3] = 0;
return ret;
}
- virtual std::pair<toffset, toffset> propertyRange(toffset ich)
+ virtual std::pair<toffset, toffset> propertyRange(toffset /*ich*/)
{
std::pair<toffset, toffset> pairRet;
pairRet.first = 0;
@@ -88,16 +90,16 @@ public:
return pairRet;
}
- virtual size_t getFontFeatures(toffset ich, FeatureSetting * prgfset)
+ virtual size_t getFontFeatures(toffset /*ich*/, FeatureSetting * /*prgfset*/)
{
return 0; // no features in this simple implementation
}
- virtual bool sameSegment(toffset ich1, toffset ich2)
+ virtual bool sameSegment(toffset /*ich1*/, toffset /*ich2*/)
{
return true;
}
- virtual void getColors(toffset ich, int * pclrFore, int * pclrBack)
+ virtual void getColors(toffset /*ich*/, int * pclrFore, int * pclrBack)
{
*pclrFore = kclrBlack;
*pclrBack = kclrTransparent;
--- wrappers/win32/WinFont.cpp.orig 2009-01-29 08:33:19 UTC
+++ wrappers/win32/WinFont.cpp
@@ -70,6 +70,7 @@ WinFont::WinFont(HDC hdc)
// But don't store m_hfont, because we don't really "own" it; the client is
// responsible for releasing it.
m_hfont = 0;
+ m_pGlyphMetricMap = NULL;
memset(&m_fpropSet, 0, sizeof(m_fpropSet));
m_pbCmapTbl = NULL;
@@ -196,6 +197,7 @@ WinFont::WinFont(WinFont & font)
m_hdc = 0;
m_hfont = 0;
m_hfontClient = 0;
+ m_pGlyphMetricMap = NULL;
memset(&m_fpropSet, 0, sizeof(FontProps));
m_pbCmapTbl = NULL;
@@ -408,7 +410,7 @@ void WinFont::getGlyphPoint(gid16 gid, u
if (pPolyCurve->wType == TT_PRIM_QSPLINE &&
// test if this is the last curve
pPolyHdr->cb - (int)((byte *)(&pPolyCurve->apfx[j]) - (byte *)(pPolyHdr))
- == sizeof POINTFX &&
+ == sizeof (POINTFX) &&
// and the two points are identical
CompareFixed(pPolyCurve->apfx[j].x, pPolyHdr->pfxStart.x) &&
CompareFixed(pPolyCurve->apfx[j].y, pPolyHdr->pfxStart.y))
@@ -457,6 +459,16 @@ void WinFont::getGlyphPoint(gid16 gid, u
----------------------------------------------------------------------------------------------*/
void WinFont::getGlyphMetrics(gid16 chw, gr::Rect & boundingBox, gr::Point & advances)
{
+ if (m_pGlyphMetricMap)
+ {
+ GlyphMetricMap::iterator i = m_pGlyphMetricMap->find(chw);
+ if (i != m_pGlyphMetricMap->end())
+ {
+ boundingBox = i->second.first;
+ advances = i->second.second;
+ return;
+ }
+ }
GLYPHMETRICS gm;
const MAT2 mat2 = {{0,1}, {0,0}, {0,0}, {0,1}};
if (GDI_ERROR == ::GetGlyphOutline(m_hdc, chw, GGO_GLYPH_INDEX | GGO_METRICS,
@@ -474,6 +486,10 @@ void WinFont::getGlyphMetrics(gid16 chw,
boundingBox.bottom = (float)gm.gmptGlyphOrigin.y - gm.gmBlackBoxY;
advances.x = gm.gmCellIncX;
advances.y = gm.gmCellIncY;
+ if (m_pGlyphMetricMap)
+ {
+ (*m_pGlyphMetricMap)[chw] = std::pair<gr::Rect,gr::Point>(boundingBox, advances);
+ }
}
/*----------------------------------------------------------------------------------------------
@@ -618,7 +634,10 @@ GrResult WinFont::SetInternalFont(unsign
static int cCreateFontCalls = 0;
static int cCreateFontZero = 0;
- HFONT hfont = g_fhc.GetFont(lf);
+ FontHandleCache::FontCacheValue cache = g_fhc.GetCache(lf);
+ HFONT hfont = cache.hfont;
+ m_pGlyphMetricMap = cache.pGlyphMetricMap;
+ //HFONT hfont = g_fhc.GetFont(lf);
//char ch1[200];
//if (hfont == 0)
//{
@@ -731,7 +750,7 @@ WinFont::FontHandleCache::~FontHandleCac
@param lf LOGFONT value that describes the desired font
@return Font handle
----------------------------------------------------------------------------------------------*/
-HFONT WinFont::FontHandleCache::GetFont(LOGFONT & lf)
+WinFont::FontHandleCache::FontCacheValue WinFont::FontHandleCache::GetCache(LOGFONT & lf)
{
FontCacheValue fcv;
FontHandleHashMap::iterator itFound = m_hmlffcv.find(lf);
@@ -752,11 +771,12 @@ HFONT WinFont::FontHandleCache::GetFont(
THROW(kresFail);
fcv.nRefs = 1;
+ fcv.pGlyphMetricMap = new GlyphMetricMap();
m_hmlffcv.insert(std::pair<LOGFONT, FontCacheValue>(lf, fcv));
}
- return fcv.hfont;
+ return fcv;
}
/*----------------------------------------------------------------------------------------------
@@ -767,7 +787,7 @@ HFONT WinFont::FontHandleCache::GetFont(
----------------------------------------------------------------------------------------------*/
void WinFont::FontHandleCache::DeleteFont(HFONT hfont)
{
- if (!hfont || !m_bValid)
+ if (!hfont || !m_bValid || m_hmlffcv.size() == 0)
return;
// find the font in the hash map
@@ -782,6 +802,8 @@ void WinFont::FontHandleCache::DeleteFon
{
// delete font
::DeleteObject(hfont);
+ if (fcv.pGlyphMetricMap)
+ delete fcv.pGlyphMetricMap;
m_hmlffcv.erase(it);
}
else
@@ -832,7 +854,8 @@ size_t WinFont::LogFontHashFuncs::operat
bool WinFont::LogFontHashFuncs::operator() (const WinFont::LogFontWrapper & key1,
const WinFont::LogFontWrapper & key2) const
{
- return (key1 == key2);
+ // return true if key1 should be ordered before key2
+ return (operator()(key1) < operator()(key2));
}
/*--------------------------------------------------------------------------------------
--- wrappers/win32/WinFont.h.orig 2009-01-29 08:33:19 UTC
+++ wrappers/win32/WinFont.h
@@ -26,9 +26,15 @@ Description:
#include "GrDebug.h"
#include "GrClient.h"
#include "Font.h"
+#include <map>
+
+#ifdef _STLPORT_VERSION
+namespace stdext = _STLP_STD;
+#endif
namespace gr
{
+typedef std::map<gid16, std::pair<gr::Rect, gr::Point> > GlyphMetricMap;
class FontFace;
@@ -100,6 +106,7 @@ protected:
HFONT m_hfontClient; // need to replace this HFONT into the DC when we are finished
// with it
+ GlyphMetricMap * m_pGlyphMetricMap;
// Debugging:
//OLECHAR m_rgchTemp[32];
@@ -185,11 +192,13 @@ protected:
class FontHandleCache // hungarian: fhc
{
public:
- struct FontCacheValue
+ struct FontCacheValue
{
int nRefs; // reference count
HFONT hfont; // font handle
+ GlyphMetricMap * pGlyphMetricMap; // glyph metrics
+
bool operator==(const FontCacheValue & val) const
{
return (hfont == val.hfont);
@@ -199,7 +208,8 @@ protected:
FontHandleCache() : m_bValid(true) {};
~FontHandleCache();
- HFONT GetFont(LOGFONT & lf);
+ //HFONT GetFont(LOGFONT & lf);
+ FontCacheValue GetCache(LOGFONT & lf);
void DeleteFont(HFONT hfont);
typedef stdext::hash_map<LogFontWrapper, FontCacheValue, LogFontHashFuncs> FontHandleHashMap;
--- wrappers/win32/win32_dll.cpp.orig 2008-05-09 11:10:30 UTC
+++ wrappers/win32/win32_dll.cpp
@@ -14,7 +14,7 @@ HMODULE Win32DllGetModuleHandle()
DllMain. This is the main DLL entry point for a non-MFC DLL. For an MFC DLL, DllMain is
in DllModul.cpp. Both DllMains call ModuleEntry::DllMain.
----------------------------------------------------------------------------------------------*/
-extern "C" BOOL WINAPI DllMain(HMODULE hmod, DWORD dwReason, PVOID pvReserved)
+extern "C" BOOL WINAPI DllMain(HMODULE hmod, DWORD dwReason, PVOID /*pvReserved*/)
{
bool fRet = true;
|