Commit eb45c699d7f2a86dccfb195b9a48172675982b90

dtremenak 2008-05-06T06:38:37

VC build fixes from bzflag revs 17848-17852. * size_t consistency * avoid coercing from int to bool * make casts from double to float explicit rather than implicit, mostly by way of a few new getter functions in FTPoint, or avoid if possible.

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
diff --git a/src/FTCharmap.cpp b/src/FTCharmap.cpp
index 545a0c8..27a096a 100644
--- a/src/FTCharmap.cpp
+++ b/src/FTCharmap.cpp
@@ -91,7 +91,7 @@ unsigned int FTCharmap::FontIndex(const unsigned int characterCode)
 
 
 void FTCharmap::InsertIndex(const unsigned int characterCode,
-                            const unsigned int containerIndex)
+                            const size_t containerIndex)
 {
-    charMap.insert(characterCode, containerIndex);
+	charMap.insert(characterCode, static_cast<FTCharToGlyphIndexMap::GlyphIndex>(containerIndex));
 }
diff --git a/src/FTCharmap.h b/src/FTCharmap.h
index 354c494..f4ce867 100644
--- a/src/FTCharmap.h
+++ b/src/FTCharmap.h
@@ -121,7 +121,7 @@ class FTCharmap
          *                       character code.
          */
         void InsertIndex(const unsigned int characterCode,
-                         const unsigned int containerIndex);
+                         const size_t containerIndex);
 
         /**
          * Queries for errors.
diff --git a/src/FTContour.h b/src/FTContour.h
index 4144323..17e121a 100644
--- a/src/FTContour.h
+++ b/src/FTContour.h
@@ -70,7 +70,7 @@ class FTContour
          * @param index of the point in the curve.
          * @return const point reference
          */
-        const FTPoint& Point(unsigned int index) const { return pointList[index]; }
+        const FTPoint& Point(size_t index) const { return pointList[index]; }
 
         /**
          * Return a point at index.
@@ -78,7 +78,7 @@ class FTContour
          * @param index of the point in the outset curve.
          * @return const point reference
          */
-        const FTPoint& Outset(unsigned int index) const { return outsetPointList[index]; }
+        const FTPoint& Outset(size_t index) const { return outsetPointList[index]; }
 
         /**
          * Return a point at index of the front outset contour.
@@ -86,7 +86,7 @@ class FTContour
          * @param index of the point in the curve.
          * @return const point reference
          */
-        const FTPoint& FrontPoint(unsigned int index) const
+        const FTPoint& FrontPoint(size_t index) const
         {
             if(frontPointList.size() == 0)
                 return Point(index);
@@ -100,7 +100,7 @@ class FTContour
          * @param index of the point in the curve.
          * @return const point reference
          */
-        const FTPoint& BackPoint(unsigned int index) const
+        const FTPoint& BackPoint(size_t index) const
         {
             if(backPointList.size() == 0)
                 return Point(index);
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index 8a3cf6d..da9a166 100644
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -49,7 +49,7 @@ FTFace::FTFace(const char* fontFilePath, bool precomputeKerning)
     }
 
     numGlyphs = (*ftFace)->num_glyphs;
-    hasKerningTable = FT_HAS_KERNING((*ftFace));
+	hasKerningTable = (FT_HAS_KERNING((*ftFace)) != 0);
 
     if(hasKerningTable && precomputeKerning)
     {
@@ -69,7 +69,7 @@ FTFace::FTFace(const unsigned char *pBufferBytes, size_t bufferSizeInBytes,
     ftFace = new FT_Face;
 
     err = FT_New_Memory_Face(*FTLibrary::Instance().GetLibrary(),
-                             (FT_Byte const *)pBufferBytes, bufferSizeInBytes,
+                             (FT_Byte const *)pBufferBytes, (FT_Long)bufferSizeInBytes,
                              DEFAULT_FACE_INDEX, ftFace);
     if(err)
     {
@@ -79,7 +79,7 @@ FTFace::FTFace(const unsigned char *pBufferBytes, size_t bufferSizeInBytes,
     }
 
     numGlyphs = (*ftFace)->num_glyphs;
-    hasKerningTable = FT_HAS_KERNING((*ftFace));
+	hasKerningTable = (FT_HAS_KERNING((*ftFace)) != 0);
 
     if(hasKerningTable && precomputeKerning)
     {
@@ -118,7 +118,7 @@ bool FTFace::Attach(const unsigned char *pBufferBytes,
 
     open.flags = FT_OPEN_MEMORY;
     open.memory_base = (FT_Byte const *)pBufferBytes;
-    open.memory_size = bufferSizeInBytes;
+    open.memory_size = (FT_Long)bufferSizeInBytes;
 
     err = FT_Attach_Stream(*ftFace, &open);
     return !err;
diff --git a/src/FTFont/FTFont.cpp b/src/FTFont/FTFont.cpp
index a971030..f8d1876 100644
--- a/src/FTFont/FTFont.cpp
+++ b/src/FTFont/FTFont.cpp
@@ -469,12 +469,12 @@ inline void FTFontImpl::BBoxI(const T* string, const int start, const int end,
     }
 
     // TODO: The Z values do not follow the proper ordering.  I'm not sure why.
-    llx = totalBBox.Lower().X() < totalBBox.Upper().X() ? totalBBox.Lower().X() : totalBBox.Upper().X();
-    lly = totalBBox.Lower().Y() < totalBBox.Upper().Y() ? totalBBox.Lower().Y() : totalBBox.Upper().Y();
-    llz = totalBBox.Lower().Z() < totalBBox.Upper().Z() ? totalBBox.Lower().Z() : totalBBox.Upper().Z();
-    urx = totalBBox.Lower().X() > totalBBox.Upper().X() ? totalBBox.Lower().X() : totalBBox.Upper().X();
-    ury = totalBBox.Lower().Y() > totalBBox.Upper().Y() ? totalBBox.Lower().Y() : totalBBox.Upper().Y();
-    urz = totalBBox.Lower().Z() > totalBBox.Upper().Z() ? totalBBox.Lower().Z() : totalBBox.Upper().Z();
+    llx = totalBBox.Lower().Xf() < totalBBox.Upper().Xf() ? totalBBox.Lower().Xf() : totalBBox.Upper().Xf();
+    lly = totalBBox.Lower().Yf() < totalBBox.Upper().Yf() ? totalBBox.Lower().Yf() : totalBBox.Upper().Yf();
+    llz = totalBBox.Lower().Zf() < totalBBox.Upper().Zf() ? totalBBox.Lower().Zf() : totalBBox.Upper().Zf();
+    urx = totalBBox.Lower().Xf() > totalBBox.Upper().Xf() ? totalBBox.Lower().Xf() : totalBBox.Upper().Xf();
+    ury = totalBBox.Lower().Yf() > totalBBox.Upper().Yf() ? totalBBox.Lower().Yf() : totalBBox.Upper().Yf();
+    urz = totalBBox.Lower().Zf() > totalBBox.Upper().Zf() ? totalBBox.Lower().Zf() : totalBBox.Upper().Zf();
 }
 
 
diff --git a/src/FTFont/FTFontGlue.cpp b/src/FTFont/FTFontGlue.cpp
index 14ddc79..f2a3a00 100644
--- a/src/FTFont/FTFontGlue.cpp
+++ b/src/FTFont/FTFontGlue.cpp
@@ -168,7 +168,7 @@ C_FUN(void, ftglSetFontOutset, (FTGLfont *f, float front, float back),
 
 // void FTFont::UseDisplayList(bool useList);
 C_FUN(void, ftglSetFontDisplayList, (FTGLfont *f, int l),
-      return, UseDisplayList, (l));
+      return, UseDisplayList, (true));
 
 // float FTFont::Ascender() const;
 C_FUN(float, ftglGetFontAscender, (FTGLfont *f), return 0.f, Ascender, ());
diff --git a/src/FTFont/FTTextureFont.cpp b/src/FTFont/FTTextureFont.cpp
index 33ceae4..c8159f5 100644
--- a/src/FTFont/FTTextureFont.cpp
+++ b/src/FTFont/FTTextureFont.cpp
@@ -123,7 +123,7 @@ FTTextureFontImpl::~FTTextureFontImpl()
 {
     if(textureIDList.size())
     {
-        glDeleteTextures(textureIDList.size(),
+        glDeleteTextures((GLsizei)textureIDList.size(),
                          (const GLuint*)&textureIDList[0]);
     }
 }
@@ -214,7 +214,7 @@ bool FTTextureFontImpl::FaceSize(const unsigned int size, const unsigned int res
 {
     if(!textureIDList.empty())
     {
-        glDeleteTextures(textureIDList.size(), (const GLuint*)&textureIDList[0]);
+        glDeleteTextures((GLsizei)textureIDList.size(), (const GLuint*)&textureIDList[0]);
         textureIDList.clear();
         remGlyphs = numGlyphs = face.GlyphCount();
     }
diff --git a/src/FTGL/FTPoint.h b/src/FTGL/FTPoint.h
index 9d7fc98..b549a3f 100644
--- a/src/FTGL/FTPoint.h
+++ b/src/FTGL/FTPoint.h
@@ -242,6 +242,9 @@ class FTGL_EXPORT FTPoint
         inline FTGL_DOUBLE X() const { return values[0]; };
         inline FTGL_DOUBLE Y() const { return values[1]; };
         inline FTGL_DOUBLE Z() const { return values[2]; };
+        inline FTGL_FLOAT Xf() const { return static_cast<FTGL_FLOAT>(values[0]); };
+        inline FTGL_FLOAT Yf() const { return static_cast<FTGL_FLOAT>(values[1]); };
+        inline FTGL_FLOAT Zf() const { return static_cast<FTGL_FLOAT>(values[2]); };
 
     private:
         /**
diff --git a/src/FTGlyph/FTBitmapGlyph.cpp b/src/FTGlyph/FTBitmapGlyph.cpp
index cda8ac8..5c3d703 100644
--- a/src/FTGlyph/FTBitmapGlyph.cpp
+++ b/src/FTGlyph/FTBitmapGlyph.cpp
@@ -112,8 +112,8 @@ const FTPoint& FTBitmapGlyphImpl::RenderImpl(const FTPoint& pen, int renderMode)
     {
         float dx, dy;
 
-        dx = pen.X() + pos.X();
-        dy = pen.Y() - pos.Y();
+        dx = pen.Xf() + pos.Xf();
+        dy = pen.Yf() - pos.Yf();
 
         glBitmap(0, 0, 0.0f, 0.0f, dx, dy, (const GLubyte*)0);
         glPixelStorei(GL_UNPACK_ROW_LENGTH, destPitch * 8);
diff --git a/src/FTGlyph/FTExtrudeGlyph.cpp b/src/FTGlyph/FTExtrudeGlyph.cpp
index 5d6e4cc..a360c0b 100644
--- a/src/FTGlyph/FTExtrudeGlyph.cpp
+++ b/src/FTGlyph/FTExtrudeGlyph.cpp
@@ -133,7 +133,7 @@ FTExtrudeGlyphImpl::~FTExtrudeGlyphImpl()
 const FTPoint& FTExtrudeGlyphImpl::RenderImpl(const FTPoint& pen,
                                               int renderMode)
 {
-    glTranslatef(pen.X(), pen.Y(), 0);
+    glTranslatef(pen.Xf(), pen.Yf(), 0);
     if(glList)
     {
         if(renderMode & FTGL::RENDER_FRONT)
@@ -152,7 +152,7 @@ const FTPoint& FTExtrudeGlyphImpl::RenderImpl(const FTPoint& pen,
         if(renderMode & FTGL::RENDER_SIDE)
             RenderSide();
     }
-    glTranslatef(-pen.X(), -pen.Y(), 0);
+    glTranslatef(-pen.Xf(), -pen.Yf(), 0);
 
     return advance;
 }
@@ -174,11 +174,11 @@ void FTExtrudeGlyphImpl::RenderFront()
             {
                 FTPoint pt = subMesh->Point(i);
 
-                glTexCoord2f(pt.X() / hscale,
-                             pt.Y() / vscale);
+                glTexCoord2f(pt.Xf() / hscale,
+                             pt.Yf() / vscale);
 
-                glVertex3f(pt.X() / 64.0f,
-                           pt.Y() / 64.0f,
+                glVertex3f(pt.Xf() / 64.0f,
+                           pt.Yf() / 64.0f,
                            0.0f);
             }
         glEnd();
@@ -202,11 +202,11 @@ void FTExtrudeGlyphImpl::RenderBack()
             {
                 FTPoint pt = subMesh->Point(i);
 
-                glTexCoord2f(subMesh->Point(i).X() / hscale,
-                             subMesh->Point(i).Y() / vscale);
+                glTexCoord2f(subMesh->Point(i).Xf() / hscale,
+                             subMesh->Point(i).Yf() / vscale);
 
-                glVertex3f(subMesh->Point(i).X() / 64.0f,
-                           subMesh->Point(i).Y() / 64.0f,
+                glVertex3f(subMesh->Point(i).Xf() / 64.0f,
+                           subMesh->Point(i).Yf() / 64.0f,
                            -depth);
             }
         glEnd();
@@ -221,7 +221,7 @@ void FTExtrudeGlyphImpl::RenderSide()
     for(size_t c = 0; c < vectoriser->ContourCount(); ++c)
     {
         const FTContour* contour = vectoriser->Contour(c);
-        unsigned int n = contour->PointCount();
+        size_t n = contour->PointCount();
 
         if(n < 2)
         {
@@ -229,10 +229,10 @@ void FTExtrudeGlyphImpl::RenderSide()
         }
 
         glBegin(GL_QUAD_STRIP);
-            for(unsigned int j = 0; j <= n; ++j)
+            for(size_t j = 0; j <= n; ++j)
             {
-                unsigned int cur = (j == n) ? 0 : j;
-                unsigned int next = (cur == n - 1) ? 0 : cur + 1;
+                size_t cur = (j == n) ? 0 : j;
+                size_t next = (cur == n - 1) ? 0 : cur + 1;
 
                 FTPoint frontPt = contour->FrontPoint(cur);
                 FTPoint nextPt = contour->FrontPoint(next);
@@ -244,17 +244,17 @@ void FTExtrudeGlyphImpl::RenderSide()
                     glNormal3dv(static_cast<const FTGL_DOUBLE*>(normal.Normalise()));
                 }
 
-                glTexCoord2f(frontPt.X() / hscale, frontPt.Y() / vscale);
+                glTexCoord2f(frontPt.Xf() / hscale, frontPt.Yf() / vscale);
 
                 if(contourFlag & ft_outline_reverse_fill)
                 {
-                    glVertex3f(backPt.X() / 64.0f, backPt.Y() / 64.0f, 0.0f);
-                    glVertex3f(frontPt.X() / 64.0f, frontPt.Y() / 64.0f, -depth);
+                    glVertex3f(backPt.Xf() / 64.0f, backPt.Yf() / 64.0f, 0.0f);
+                    glVertex3f(frontPt.Xf() / 64.0f, frontPt.Yf() / 64.0f, -depth);
                 }
                 else
                 {
-                    glVertex3f(backPt.X() / 64.0f, backPt.Y() / 64.0f, -depth);
-                    glVertex3f(frontPt.X() / 64.0f, frontPt.Y() / 64.0f, 0.0f);
+                    glVertex3f(backPt.Xf() / 64.0f, backPt.Yf() / 64.0f, -depth);
+                    glVertex3f(frontPt.Xf() / 64.0f, frontPt.Yf() / 64.0f, 0.0f);
                 }
             }
         glEnd();
diff --git a/src/FTGlyph/FTGlyphGlue.cpp b/src/FTGlyph/FTGlyphGlue.cpp
index a6870d4..bf892c2 100644
--- a/src/FTGlyph/FTGlyphGlue.cpp
+++ b/src/FTGlyph/FTGlyphGlue.cpp
@@ -57,13 +57,13 @@ C_TOR(ftglCreateBitmapGlyph, (FT_GlyphSlot glyph),
 // FTExtrudeGlyph::FTExtrudeGlyph();
 C_TOR(ftglCreateExtrudeGlyph, (FT_GlyphSlot glyph, float depth,
                    float frontOutset, float backOutset, int useDisplayList),
-      FTExtrudeGlyph, (glyph, depth, frontOutset, backOutset, useDisplayList),
+      FTExtrudeGlyph, (glyph, depth, frontOutset, backOutset, (useDisplayList != 0)),
       GLYPH_EXTRUDE);
 
 // FTOutlineGlyph::FTOutlineGlyph();
 C_TOR(ftglCreateOutlineGlyph, (FT_GlyphSlot glyph, float outset,
                                int useDisplayList),
-      FTOutlineGlyph, (glyph, outset, useDisplayList), GLYPH_OUTLINE);
+      FTOutlineGlyph, (glyph, outset, (useDisplayList != 0)), GLYPH_OUTLINE);
 
 // FTPixmapGlyph::FTPixmapGlyph();
 C_TOR(ftglCreatePixmapGlyph, (FT_GlyphSlot glyph),
@@ -72,7 +72,7 @@ C_TOR(ftglCreatePixmapGlyph, (FT_GlyphSlot glyph),
 // FTPolygonGlyph::FTPolygonGlyph();
 C_TOR(ftglCreatePolyGlyph, (FT_GlyphSlot glyph, float outset,
                             int useDisplayList),
-      FTPolygonGlyph, (glyph, outset, useDisplayList), GLYPH_OUTLINE);
+      FTPolygonGlyph, (glyph, outset, (useDisplayList != 0)), GLYPH_OUTLINE);
 
 // FTTextureGlyph::FTTextureGlyph();
 C_TOR(ftglCreateTextureGlyph, (FT_GlyphSlot glyph, int id, int xOffset,
@@ -174,8 +174,8 @@ void ftglGetGlyphBBox(FTGLglyph *g, float bounds[6])
 {
     FTBBox ret = _ftglGetGlyphBBox(g);
     FTPoint lower = ret.Lower(), upper = ret.Upper();
-    bounds[0] = lower.X(); bounds[1] = lower.Y(); bounds[2] = lower.Z();
-    bounds[3] = upper.X(); bounds[4] = upper.Y(); bounds[5] = upper.Z();
+    bounds[0] = lower.Xf(); bounds[1] = lower.Yf(); bounds[2] = lower.Zf();
+    bounds[3] = upper.Xf(); bounds[4] = upper.Yf(); bounds[5] = upper.Zf();
 }
 
 // FT_Error FTGlyph::Error() const;
diff --git a/src/FTGlyph/FTOutlineGlyph.cpp b/src/FTGlyph/FTOutlineGlyph.cpp
index 5cd4704..9cd3d43 100644
--- a/src/FTGlyph/FTOutlineGlyph.cpp
+++ b/src/FTGlyph/FTOutlineGlyph.cpp
@@ -113,7 +113,7 @@ FTOutlineGlyphImpl::~FTOutlineGlyphImpl()
 const FTPoint& FTOutlineGlyphImpl::RenderImpl(const FTPoint& pen,
                                               int renderMode)
 {
-    glTranslatef(pen.X(), pen.Y(), 0.0f);
+    glTranslatef(pen.Xf(), pen.Yf(), 0.0f);
     if(glList)
     {
         glCallList(glList);
@@ -122,7 +122,7 @@ const FTPoint& FTOutlineGlyphImpl::RenderImpl(const FTPoint& pen,
     {
         DoRender();
     }
-    glTranslatef(-pen.X(), -pen.Y(), 0.0f);
+    glTranslatef(-pen.Xf(), -pen.Yf(), 0.0f);
 
     return advance;
 }
@@ -140,7 +140,7 @@ void FTOutlineGlyphImpl::DoRender()
                 FTPoint point = FTPoint(contour->Point(i).X() + contour->Outset(i).X() * outset,
                                         contour->Point(i).Y() + contour->Outset(i).Y() * outset,
                                         0);
-                glVertex2f(point.X() / 64.0f, point.Y() / 64.0f);
+                glVertex2f(point.Xf() / 64.0f, point.Yf() / 64.0f);
             }
         glEnd();
     }
diff --git a/src/FTGlyph/FTPixmapGlyph.cpp b/src/FTGlyph/FTPixmapGlyph.cpp
index a1b9fc1..20eb2d7 100644
--- a/src/FTGlyph/FTPixmapGlyph.cpp
+++ b/src/FTGlyph/FTPixmapGlyph.cpp
@@ -121,8 +121,8 @@ const FTPoint& FTPixmapGlyphImpl::RenderImpl(const FTPoint& pen,
     {
         float dx, dy;
 
-        dx = floor(pen.X() + pos.X());
-        dy = floor(pen.Y() - pos.Y());
+        dx = floor(pen.Xf() + pos.Xf());
+        dy = floor(pen.Yf() - pos.Yf());
 
         glBitmap(0, 0, 0.0f, 0.0f, dx, dy, (const GLubyte*)0);
         glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
diff --git a/src/FTGlyph/FTPolygonGlyph.cpp b/src/FTGlyph/FTPolygonGlyph.cpp
index 2f8b7b1..46346a2 100644
--- a/src/FTGlyph/FTPolygonGlyph.cpp
+++ b/src/FTGlyph/FTPolygonGlyph.cpp
@@ -116,7 +116,7 @@ FTPolygonGlyphImpl::~FTPolygonGlyphImpl()
 const FTPoint& FTPolygonGlyphImpl::RenderImpl(const FTPoint& pen,
                                               int renderMode)
 {
-    glTranslatef(pen.X(), pen.Y(), 0.0f);
+    glTranslatef(pen.Xf(), pen.Yf(), 0.0f);
     if(glList)
     {
         glCallList(glList);
@@ -125,7 +125,7 @@ const FTPoint& FTPolygonGlyphImpl::RenderImpl(const FTPoint& pen,
     {
         DoRender();
     }
-    glTranslatef(-pen.X(), -pen.Y(), 0.0f);
+    glTranslatef(-pen.Xf(), -pen.Yf(), 0.0f);
 
     return advance;
 }
@@ -146,8 +146,8 @@ void FTPolygonGlyphImpl::DoRender()
             for(unsigned int i = 0; i < subMesh->PointCount(); ++i)
             {
                 FTPoint point = subMesh->Point(i);
-                glTexCoord2f(point.X() / hscale, point.Y() / vscale);
-                glVertex3f(point.X() / 64.0f, point.Y() / 64.0f, 0.0f);
+                glTexCoord2f(point.Xf() / hscale, point.Yf() / vscale);
+                glVertex3f(point.Xf() / 64.0f, point.Yf() / 64.0f, 0.0f);
             }
         glEnd();
     }
diff --git a/src/FTGlyph/FTTextureGlyph.cpp b/src/FTGlyph/FTTextureGlyph.cpp
index b283aa2..9827729 100644
--- a/src/FTGlyph/FTTextureGlyph.cpp
+++ b/src/FTGlyph/FTTextureGlyph.cpp
@@ -131,20 +131,20 @@ const FTPoint& FTTextureGlyphImpl::RenderImpl(const FTPoint& pen,
         activeTextureID = glTextureID;
     }
 
-    dx = floor(pen.X() + pos.X());
-    dy = floor(pen.Y() + pos.Y());
+    dx = floor(pen.Xf() + pos.Xf());
+    dy = floor(pen.Yf() + pos.Yf());
 
     glBegin(GL_QUADS);
-        glTexCoord2f(uv[0].X(), uv[0].Y());
+        glTexCoord2f(uv[0].Xf(), uv[0].Yf());
         glVertex2f(dx, dy);
 
-        glTexCoord2f(uv[0].X(), uv[1].Y());
+        glTexCoord2f(uv[0].Xf(), uv[1].Yf());
         glVertex2f(dx, dy - destHeight);
 
-        glTexCoord2f(uv[1].X(), uv[1].Y());
+        glTexCoord2f(uv[1].Xf(), uv[1].Yf());
         glVertex2f(dx + destWidth, dy - destHeight);
 
-        glTexCoord2f(uv[1].X(), uv[0].Y());
+        glTexCoord2f(uv[1].Xf(), uv[0].Yf());
         glVertex2f(dx + destWidth, dy);
     glEnd();
 
diff --git a/src/FTGlyphContainer.cpp b/src/FTGlyphContainer.cpp
index 7e0af85..fb88e2f 100644
--- a/src/FTGlyphContainer.cpp
+++ b/src/FTGlyphContainer.cpp
@@ -93,8 +93,8 @@ float FTGlyphContainer::Advance(const unsigned int characterCode, const unsigned
     unsigned int left = charMap->FontIndex(characterCode);
     unsigned int right = charMap->FontIndex(nextCharacterCode);
 
-    float width = face->KernAdvance(left, right).X();
-    width += glyphs[charMap->GlyphListIndex(characterCode)]->Advance().X();
+    float width = face->KernAdvance(left, right).Xf();
+    width += glyphs[charMap->GlyphListIndex(characterCode)]->Advance().Xf();
 
     return width;
 }
diff --git a/src/FTLayout/FTSimpleLayout.cpp b/src/FTLayout/FTSimpleLayout.cpp
index 76ae367..444a198 100644
--- a/src/FTLayout/FTSimpleLayout.cpp
+++ b/src/FTLayout/FTSimpleLayout.cpp
@@ -169,8 +169,8 @@ inline void FTSimpleLayoutImpl::BBoxI(const T* string,
     FTBBox bounds;
 
     WrapText(string, 0, &bounds);
-    llx = bounds.Lower().X(); lly = bounds.Lower().Y(); llz = bounds.Lower().Z();
-    urx = bounds.Upper().X(); ury = bounds.Upper().Y(); urz = bounds.Upper().Z();
+    llx = bounds.Lower().Xf(); lly = bounds.Lower().Yf(); llz = bounds.Lower().Zf();
+    urx = bounds.Upper().Xf(); ury = bounds.Upper().Yf(); urz = bounds.Upper().Zf();
 }
 
 
@@ -267,7 +267,7 @@ inline void FTSimpleLayoutImpl::WrapTextI(const T *buf, int renderMode,
         // Find the width of the current glyph
         CheckGlyph(currentFont, buf[i]);
         glyphBounds = GetGlyphs(currentFont)->BBox(buf[i]);
-        glyphWidth = glyphBounds.Upper().X() - glyphBounds.Lower().X();
+        glyphWidth = glyphBounds.Upper().Xf() - glyphBounds.Lower().Xf();
 
         advance = GetGlyphs(currentFont)->Advance(buf[i], buf[i + 1]);
         prevWidth = currentWidth;
diff --git a/src/FTPoint.cpp b/src/FTPoint.cpp
index 6fd38ee..5d55c1a 100644
--- a/src/FTPoint.cpp
+++ b/src/FTPoint.cpp
@@ -43,10 +43,10 @@ bool operator != (const FTPoint &a, const FTPoint &b)
 
 FTPoint FTPoint::Normalise()
 {
-    float norm = sqrt(values[0] * values[0]
+    double norm = sqrt(values[0] * values[0]
                        + values[1] * values[1]
                        + values[2] * values[2]);
-    if(norm == 0.f)
+    if(norm == 0.0)
     {
         return *this;
     }
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index bb7aa2c..ed5cf3d 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -191,7 +191,7 @@ size_t FTVectoriser::PointCount()
 }
 
 
-const FTContour* const FTVectoriser::Contour(unsigned int index) const
+const FTContour* const FTVectoriser::Contour(size_t index) const
 {
     return (index < ContourCount()) ? contourList[index] : NULL;
 }
diff --git a/src/FTVectoriser.h b/src/FTVectoriser.h
index 1d039ca..cb6987b 100644
--- a/src/FTVectoriser.h
+++ b/src/FTVectoriser.h
@@ -149,12 +149,12 @@ class FTMesh
         /**
          * The number of tesselations in the mesh
          */
-        unsigned int TesselationCount() const { return tesselationList.size(); }
+        size_t TesselationCount() const { return tesselationList.size(); }
 
         /**
          * Get a tesselation by index
          */
-        const FTTesselation* const Tesselation(unsigned int index) const;
+        const FTTesselation* const Tesselation(size_t index) const;
 
         /**
          * Return the temporary point list. For testing only.
@@ -256,7 +256,7 @@ class FTVectoriser
          *
          * @return the number of contours
          */
-         const FTContour* const Contour(unsigned int index) const;
+         const FTContour* const Contour(size_t index) const;
 
         /**
          * Get the number of points in a specific contour in this outline