summaryrefslogtreecommitdiff
path: root/Build/source/libs/graphite/engine-2.3.1-PATCHES/patch-01-warnings
blob: 79eb38fcddae9da5dbbd1291facfcdc2d14fd589 (plain)
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
diff -ur -N engine-2.3.1.orig/src/font/TtfUtil.cpp engine-2.3.1/src/font/TtfUtil.cpp
--- engine-2.3.1.orig/src/font/TtfUtil.cpp	2009-01-29 09:33:19.000000000 +0100
+++ engine-2.3.1/src/font/TtfUtil.cpp	2009-10-01 22:48:21.000000000 +0200
@@ -1223,7 +1223,7 @@
 		(&pGlyph->end_pts_of_contours[cContours]);
 	
 	// skip over hints & point to first flag
-	int cbHints = read(*(uint16 *)pbGlyph);
+	int cbHints = read(*(const uint16 *)pbGlyph);
 	pbGlyph += sizeof(uint16);
 	pbGlyph += cbHints;
 
@@ -1277,7 +1277,7 @@
 			}
 			else
 			{
-				prgnX[iFlag] = read(*(int16 *)pbGlyph);
+				prgnX[iFlag] = read(*(const int16 *)pbGlyph);
 				pbGlyph += sizeof(int16);
 			}
 		}
@@ -1306,7 +1306,7 @@
 			}
 			else
 			{
-				prgnY[iFlag] = read(*(int16 *)pbGlyph);
+				prgnY[iFlag] = read(*(const int16 *)pbGlyph);
 				pbGlyph += sizeof(int16);
 			}
 		}
@@ -1342,9 +1342,9 @@
 	size_t iCurrentComp = 0;
 	do 
 	{
-		GlyphFlags = read(*((uint16 *)pbGlyph));
+		GlyphFlags = read(*((const uint16 *)pbGlyph));
 		pbGlyph += sizeof(uint16);
-		prgnCompId[iCurrentComp++] = read(*((uint16 *)pbGlyph));
+		prgnCompId[iCurrentComp++] = read(*((const uint16 *)pbGlyph));
 		pbGlyph += sizeof(uint16);
 		if (iCurrentComp >= cnCompIdTotal) 
 			return false;
@@ -1386,18 +1386,18 @@
 	uint16 GlyphFlags;
 	do 
 	{
-		GlyphFlags = read(*((uint16 *)pbGlyph));
+		GlyphFlags = read(*((const uint16 *)pbGlyph));
 		pbGlyph += sizeof(uint16);
-		if (read(*((uint16 *)pbGlyph)) == nCompId)
+		if (read(*((const uint16 *)pbGlyph)) == nCompId)
 		{
 			pbGlyph += sizeof(uint16); // skip over glyph id of component
 			fOffset = (GlyphFlags & CompoundGlyph::ArgsAreXYValues) == CompoundGlyph::ArgsAreXYValues;
 
 			if (GlyphFlags & CompoundGlyph::Arg1Arg2Words )
 			{
-				a = read(*(int16 *)pbGlyph);
+				a = read(*(const int16 *)pbGlyph);
 				pbGlyph += sizeof(int16);
-				b = read(*(int16 *)pbGlyph);
+				b = read(*(const int16 *)pbGlyph);
 				pbGlyph += sizeof(int16);
 			}
 			else
@@ -1451,9 +1451,9 @@
 	uint16 GlyphFlags;
 	do 
 	{
-		GlyphFlags = read(*((uint16 *)pbGlyph));
+		GlyphFlags = read(*((const uint16 *)pbGlyph));
 		pbGlyph += sizeof(uint16);
-		if (read(*((uint16 *)pbGlyph)) == nCompId)
+		if (read(*((const uint16 *)pbGlyph)) == nCompId)
 		{
 			pbGlyph += sizeof(uint16); // skip over glyph id of component
 			pbGlyph += GlyphFlags & CompoundGlyph::Arg1Arg2Words  ? 4 : 2; // skip over placement data
@@ -1465,7 +1465,7 @@
 
 			if (GlyphFlags & CompoundGlyph::HaveScale)
 			{
-				flt11 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+				flt11 = fixed_to_float<14>(read(*(const uint16 *)pbGlyph));
 				pbGlyph += sizeof(uint16);
 				flt12 = 0;
 				flt21 = 0;
@@ -1473,22 +1473,22 @@
 			}
 			else if (GlyphFlags & CompoundGlyph::HaveXAndYScale)
 			{
-				flt11 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+				flt11 = fixed_to_float<14>(read(*(const uint16 *)pbGlyph));
 				pbGlyph += sizeof(uint16);
 				flt12 = 0;
 				flt21 = 0;
-				flt22 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+				flt22 = fixed_to_float<14>(read(*(const uint16 *)pbGlyph));
 				pbGlyph += sizeof(uint16);
 			}
 			else if (GlyphFlags & CompoundGlyph::HaveTwoByTwo)
 			{
-				flt11 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+				flt11 = fixed_to_float<14>(read(*(const uint16 *)pbGlyph));
 				pbGlyph += sizeof(uint16);
-				flt12 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+				flt12 = fixed_to_float<14>(read(*(const uint16 *)pbGlyph));
 				pbGlyph += sizeof(uint16);
-				flt21 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+				flt21 = fixed_to_float<14>(read(*(const uint16 *)pbGlyph));
 				pbGlyph += sizeof(uint16);
-				flt22 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+				flt22 = fixed_to_float<14>(read(*(const uint16 *)pbGlyph));
 				pbGlyph += sizeof(uint16);
 			}
 			else
diff -ur -N engine-2.3.1.orig/src/segment/FileInput.cpp engine-2.3.1/src/segment/FileInput.cpp
--- engine-2.3.1.orig/src/segment/FileInput.cpp	2009-01-21 23:36:42.000000000 +0100
+++ engine-2.3.1/src/segment/FileInput.cpp	2009-10-01 23:08:51.000000000 +0200
@@ -90,7 +90,7 @@
 /*----------------------------------------------------------------------------------------------
 	Initialize the stream to a buffer.
 ----------------------------------------------------------------------------------------------*/
-bool GrBufferIStream::OpenBuffer(byte * pbBuffer, int cb)
+bool GrBufferIStream::OpenBuffer(const byte * pbBuffer, int cb)
 {
 	Assert(m_pbStart == NULL);
 	Assert(m_pbNext == NULL);
@@ -133,7 +133,7 @@
 ----------------------------------------------------------------------------------------------*/
 short GrBufferIStream::ReadShortFromFont()
 {
-	short snInput = *(short *)m_pbNext;
+	short snInput = *(const short *)m_pbNext;
 	m_pbNext += isizeof(short);
 	if (m_pbLim && m_pbNext > m_pbLim)
 		THROW(kresReadFault);
@@ -147,7 +147,7 @@
 ----------------------------------------------------------------------------------------------*/
 utf16 GrBufferIStream::ReadUShortFromFont()
 {
-	utf16 chwInput = *(utf16 *)m_pbNext;
+	utf16 chwInput = *(const utf16 *)m_pbNext;
 	m_pbNext += isizeof(utf16);
 	if (m_pbLim && m_pbNext > m_pbLim)
 		THROW(kresReadFault);
@@ -161,7 +161,7 @@
 ----------------------------------------------------------------------------------------------*/
 int GrBufferIStream::ReadIntFromFont()
 {
-	int nInput = *(int *)m_pbNext;
+	int nInput = *(const int *)m_pbNext;
 	m_pbNext += isizeof(int);
 	if (m_pbLim && m_pbNext > m_pbLim)
 		THROW(kresReadFault);
diff -ur -N engine-2.3.1.orig/src/segment/FileInput.h engine-2.3.1/src/segment/FileInput.h
--- engine-2.3.1.orig/src/segment/FileInput.h	2009-01-21 23:36:42.000000000 +0100
+++ engine-2.3.1/src/segment/FileInput.h	2009-10-01 23:02:12.000000000 +0200
@@ -54,7 +54,7 @@
 	virtual void GetPositionInFont(long * plPos) = 0;
 	virtual void SetPositionInFont(long lPos) = 0;
 
-	virtual bool OpenBuffer(byte * pbBuffer, int cb) = 0;
+	virtual bool OpenBuffer(const byte * pbBuffer, int cb) = 0;
 	virtual void CloseBuffer() = 0;
 
 protected:
@@ -87,16 +87,16 @@
 	virtual void GetPositionInFont(long * plPos);
 	virtual void SetPositionInFont(long lPos);
 
-	virtual bool OpenBuffer(byte * pbBuffer, int cb);
+	virtual bool OpenBuffer(const byte * pbBuffer, int cb);
 	virtual void CloseBuffer()
 	{
 		Close();
 	}
 
 protected:
-	byte * m_pbStart;
-	byte * m_pbNext;
-	byte * m_pbLim;
+	const byte * m_pbStart;
+	const byte * m_pbNext;
+	const byte * m_pbLim;
 };
 
 } // namespace gr
diff -ur -N engine-2.3.1.orig/src/segment/FontFace.cpp engine-2.3.1/src/segment/FontFace.cpp
--- engine-2.3.1.orig/src/segment/FontFace.cpp	2009-01-21 23:36:42.000000000 +0100
+++ engine-2.3.1/src/segment/FontFace.cpp	2009-10-01 23:05:26.000000000 +0200
@@ -340,9 +340,9 @@
 
 //	ibGlocStart = cbGlatTbl;
 	fOk = CheckTableVersions(&grstrm,
-    		(byte *)pSilfTbl, 0,
-    		(byte *)pGlocTbl, 0,
-    		(byte *)pFeatTbl, 0,
+    		(const byte *)pSilfTbl, 0,
+    		(const byte *)pGlocTbl, 0,
+    		(const byte *)pFeatTbl, 0,
     		&m_fxdBadVersion);
 	if (!fOk)
 	{
@@ -376,7 +376,7 @@
 	try 
 	{
 		// Parse the "Silf" table.
-		grstrm.OpenBuffer((byte*)pSilfTbl, cbSilfSz);
+		grstrm.OpenBuffer((const byte*)pSilfTbl, cbSilfSz);
 		int chwGlyphIDMax, fxdVersion;
 		bool f = ReadSilfTable(grstrm, 0, 0, &chwGlyphIDMax, &fxdVersion);
 		grstrm.Close();
@@ -391,8 +391,8 @@
 		{
 			GrBufferIStream grstrmGlat;
 	
-			grstrm.OpenBuffer((byte *)pGlocTbl, cbGlocSz);
-			grstrmGlat.OpenBuffer((byte *)pGlatTbl, cbGlatSz);
+			grstrm.OpenBuffer((const byte *)pGlocTbl, cbGlocSz);
+			grstrmGlat.OpenBuffer((const byte *)pGlatTbl, cbGlatSz);
 			f = ReadGlocAndGlatTables(grstrm, 0, grstrmGlat, 0, chwGlyphIDMax, fxdVersion);
 			grstrm.Close();
 			grstrmGlat.Close();
@@ -405,7 +405,7 @@
 		}
 	
 		//	Parse the "Feat" table.
-		grstrm.OpenBuffer((byte *)pFeatTbl, cbFeatSz);
+		grstrm.OpenBuffer((const byte *)pFeatTbl, cbFeatSz);
 		f = ReadFeatTable(grstrm, 0);
 		grstrm.Close();
 		if (!f)
@@ -418,7 +418,7 @@
 		//	Parse the "Sill" table.
 		if (pSillTbl)
 		{
-			grstrm.OpenBuffer((byte *)pSillTbl, cbFeatSz);
+			grstrm.OpenBuffer((const byte *)pSillTbl, cbFeatSz);
 			f = ReadSillTable(grstrm, 0);
 			grstrm.Close();
 			if (!f)
@@ -551,7 +551,7 @@
 
 	if (!m_fNameTblCopy)
 	{
-		res = (pNameTbl = (byte *)pfont->getTable(TtfUtil::TableIdTag(ktiName), &cbNameSz)) ? kresOk : kresFail;
+		res = (pNameTbl = (const byte *)pfont->getTable(TtfUtil::TableIdTag(ktiName), &cbNameSz)) ? kresOk : kresFail;
 		fOk = pNameTbl && (cbNameSz == 0 || TtfUtil::CheckTable(ktiName, pNameTbl, cbNameSz));
 		if (!fOk)
 		{
diff -ur -N engine-2.3.1.orig/src/segment/GrEngine.cpp engine-2.3.1/src/segment/GrEngine.cpp
--- engine-2.3.1.orig/src/segment/GrEngine.cpp	2009-01-28 03:01:29.000000000 +0100
+++ engine-2.3.1/src/segment/GrEngine.cpp	2009-10-01 23:05:27.000000000 +0200
@@ -891,9 +891,9 @@
 	implementation of the engine can't handle.
 ----------------------------------------------------------------------------------------------*/
 bool GrEngine::CheckTableVersions(GrIStream * pgrstrm,
-		byte *pSilfTbl, int lSilfStart,
-		byte *pGlobTbl, int lGlocStart,
-		byte *pFeatTbl, int lFeatStart,
+		const byte *pSilfTbl, int lSilfStart,
+		const byte *pGlobTbl, int lGlocStart,
+		const byte *pFeatTbl, int lFeatStart,
 		int * pfxdBadVersion)
 {
 	pgrstrm->OpenBuffer(pSilfTbl, isizeof(int));
diff -ur -N engine-2.3.1.orig/src/segment/GrEngine.h engine-2.3.1/src/segment/GrEngine.h
--- engine-2.3.1.orig/src/segment/GrEngine.h	2009-01-21 23:36:42.000000000 +0100
+++ engine-2.3.1/src/segment/GrEngine.h	2009-10-01 23:05:29.000000000 +0200
@@ -541,9 +541,9 @@
 	void DestroyEverything();
 
 	bool CheckTableVersions(GrIStream * pgrstrm,
-		byte *silf_tbl, int lSilfStart,
-		byte *gloc_tbl, int lGlocStart,
-		byte *feat_tbl, int lFeatStart,
+		const byte *silf_tbl, int lSilfStart,
+		const byte *gloc_tbl, int lGlocStart,
+		const byte *feat_tbl, int lFeatStart,
 		int * pfxdBadVersion);
 	//bool ReadSileTable(GrIStream & grstrm, long lTableSTart,
 	//	int * pmFontEmUnits, bool * pfMismatchedBase);