Commit 75c730990c325ed362f6f559a91846b34114ce65

sammy 2008-04-23T21:23:59

* Fix most compilation warnings. Most frequent causes: shadow declarations and const qualifier disappearances.

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
diff --git a/demo/FTGLDemo.cpp b/demo/FTGLDemo.cpp
index a736e0e..67bd9bc 100644
--- a/demo/FTGLDemo.cpp
+++ b/demo/FTGLDemo.cpp
@@ -157,20 +157,20 @@ void setUpLighting()
 }
 
 
-void setUpFonts(const char* fontfile)
+void setUpFonts(const char* file)
 {
-    fonts[FTGL_BITMAP] = new FTGLBitmapFont(fontfile);
-    fonts[FTGL_PIXMAP] = new FTGLPixmapFont(fontfile);
-    fonts[FTGL_OUTLINE] = new FTGLOutlineFont(fontfile);
-    fonts[FTGL_POLYGON] = new FTGLPolygonFont(fontfile);
-    fonts[FTGL_EXTRUDE] = new FTGLExtrdFont(fontfile);
-    fonts[FTGL_TEXTURE] = new FTGLTextureFont(fontfile);
+    fonts[FTGL_BITMAP] = new FTGLBitmapFont(file);
+    fonts[FTGL_PIXMAP] = new FTGLPixmapFont(file);
+    fonts[FTGL_OUTLINE] = new FTGLOutlineFont(file);
+    fonts[FTGL_POLYGON] = new FTGLPolygonFont(file);
+    fonts[FTGL_EXTRUDE] = new FTGLExtrdFont(file);
+    fonts[FTGL_TEXTURE] = new FTGLTextureFont(file);
 
     for(int x = 0; x < 6; ++x)
     {
         if(fonts[x]->Error())
         {
-            fprintf(stderr, "Failed to open font %s", fontfile);
+            fprintf(stderr, "Failed to open font %s", file);
             exit(1);
         }
 
@@ -186,11 +186,11 @@ void setUpFonts(const char* fontfile)
         fonts[x]->CharMap(ft_encoding_unicode);
     }
 
-    infoFont = new FTGLPixmapFont(fontfile);
+    infoFont = new FTGLPixmapFont(file);
 
     if(infoFont->Error())
     {
-        fprintf(stderr, "Failed to open font %s", fontfile);
+        fprintf(stderr, "Failed to open font %s", file);
         exit(1);
     }
 
@@ -450,7 +450,7 @@ void display(void)
 }
 
 
-void myinit(const char* fontfile)
+void myinit(const char* file)
 {
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     glClearColor(0.13, 0.17, 0.32, 0.0);
@@ -471,7 +471,7 @@ void myinit(const char* fontfile)
     tbInit(GLUT_LEFT_BUTTON);
     tbAnimate(GL_FALSE);
 
-    setUpFonts(fontfile);
+    setUpFonts(file);
 
     // Configure the SimpleLayout
     simpleLayout.SetLineLength(InitialLineLength);
@@ -510,21 +510,21 @@ void parsekey(unsigned char key, int x, int y)
         if(layouts[currentLayout]
              && (dynamic_cast <FTSimpleLayout *>(layouts[currentLayout])))
         {
-            FTSimpleLayout *simpleLayout = (FTSimpleLayout *)layouts[currentLayout];
+            FTSimpleLayout *l = (FTSimpleLayout *)layouts[currentLayout];
             // Decrement the layout
-            switch (simpleLayout->GetAlignment())
+            switch (l->GetAlignment())
             {
             case FTGL::ALIGN_LEFT:
-                simpleLayout->SetAlignment(FTGL::ALIGN_RIGHT);
+                l->SetAlignment(FTGL::ALIGN_RIGHT);
                 break;
             case FTGL::ALIGN_RIGHT:
-                simpleLayout->SetAlignment(FTGL::ALIGN_CENTER);
+                l->SetAlignment(FTGL::ALIGN_CENTER);
                 break;
             case FTGL::ALIGN_CENTER:
-                simpleLayout->SetAlignment(FTGL::ALIGN_JUSTIFY);
+                l->SetAlignment(FTGL::ALIGN_JUSTIFY);
                 break;
             case FTGL::ALIGN_JUSTIFY:
-                simpleLayout->SetAlignment(FTGL::ALIGN_LEFT);
+                l->SetAlignment(FTGL::ALIGN_LEFT);
                 break;
             }
         }
@@ -550,13 +550,13 @@ void parsekey(unsigned char key, int x, int y)
 
 void parseSpecialKey(int key, int x, int y)
 {
-    FTSimpleLayout *simpleLayout = NULL;
+    FTSimpleLayout *l = NULL;
 
-    // If the currentLayout is a SimpleLayout store a pointer in simpleLayout
+    // If the currentLayout is a SimpleLayout store a pointer in l
     if(layouts[currentLayout]
         && (dynamic_cast <FTSimpleLayout *>(layouts[currentLayout])))
     {
-        simpleLayout = (FTSimpleLayout *)layouts[currentLayout];
+        l = (FTSimpleLayout *)layouts[currentLayout];
     }
 
     switch (key)
@@ -575,11 +575,11 @@ void parseSpecialKey(int key, int x, int y)
         break;
     case GLUT_KEY_HOME:
         /* If the current layout is simple decrement its line length */
-        if (simpleLayout) simpleLayout->SetLineLength(simpleLayout->GetLineLength() - 10.0f);
+        if (l) l->SetLineLength(l->GetLineLength() - 10.0f);
         break;
     case GLUT_KEY_END:
         /* If the current layout is simple increment its line length */
-        if (simpleLayout) simpleLayout->SetLineLength(simpleLayout->GetLineLength() + 10.0f);
+        if (l) l->SetLineLength(l->GetLineLength() + 10.0f);
         break;
     case GLUT_KEY_LEFT:
         fonts[current_font]->FaceSize(fonts[current_font]->FaceSize() - 1);
@@ -590,9 +590,9 @@ void parseSpecialKey(int key, int x, int y)
     }
 
     // If the current layout is a SimpleLayout, update its font.
-    if(simpleLayout)
+    if(l)
     {
-        simpleLayout->SetFont(fonts[current_font]);
+        l->SetFont(fonts[current_font]);
     }
 
     glutPostRedisplay();
diff --git a/demo/FTGLMFontDemo.cpp b/demo/FTGLMFontDemo.cpp
index fa21eb1..d7f64c9 100644
--- a/demo/FTGLMFontDemo.cpp
+++ b/demo/FTGLMFontDemo.cpp
@@ -91,7 +91,7 @@
 #define FTGL_TEXTURE 5
 const int NumStyles = 6;
 
-char const **fontfiles;
+char const * const *fontfiles;
 int current_font = FTGL_EXTRUDE;
 
 GLint w_win = 640, h_win = 480;
@@ -515,21 +515,21 @@ void parsekey(unsigned char key, int x, int y)
         if(layouts[currentLayout]
              && (dynamic_cast <FTSimpleLayout *>(layouts[currentLayout])))
         {
-            FTSimpleLayout *simpleLayout = (FTSimpleLayout *)layouts[currentLayout];
+            FTSimpleLayout *l = (FTSimpleLayout *)layouts[currentLayout];
             // Decrement the layout
-            switch (simpleLayout->GetAlignment())
+            switch (l->GetAlignment())
             {
             case FTGL::ALIGN_LEFT:
-                simpleLayout->SetAlignment(FTGL::ALIGN_RIGHT);
+                l->SetAlignment(FTGL::ALIGN_RIGHT);
                 break;
             case FTGL::ALIGN_RIGHT:
-                simpleLayout->SetAlignment(FTGL::ALIGN_CENTER);
+                l->SetAlignment(FTGL::ALIGN_CENTER);
                 break;
             case FTGL::ALIGN_CENTER:
-                simpleLayout->SetAlignment(FTGL::ALIGN_JUSTIFY);
+                l->SetAlignment(FTGL::ALIGN_JUSTIFY);
                 break;
             case FTGL::ALIGN_JUSTIFY:
-                simpleLayout->SetAlignment(FTGL::ALIGN_LEFT);
+                l->SetAlignment(FTGL::ALIGN_LEFT);
                 break;
             }
         }
@@ -555,13 +555,13 @@ void parsekey(unsigned char key, int x, int y)
 
 void parseSpecialKey(int key, int x, int y)
 {
-    FTSimpleLayout *simpleLayout = NULL;
+    FTSimpleLayout *l = NULL;
 
-    // If the currentLayout is a SimpleLayout store a pointer in simpleLayout
+    // If the currentLayout is a SimpleLayout store a pointer in l
     if(layouts[currentLayout]
         && (dynamic_cast <FTSimpleLayout *>(layouts[currentLayout])))
     {
-        simpleLayout = (FTSimpleLayout *)layouts[currentLayout];
+        l = (FTSimpleLayout *)layouts[currentLayout];
     }
 
     switch (key)
@@ -593,19 +593,19 @@ void parseSpecialKey(int key, int x, int y)
     case GLUT_KEY_F1:
     case GLUT_KEY_F10:
         // If the current layout is simple decrement its line length
-        if (simpleLayout) simpleLayout->SetLineLength(simpleLayout->GetLineLength() - 10.0f);
+        if (l) l->SetLineLength(l->GetLineLength() - 10.0f);
         break;
     case GLUT_KEY_F2:
     case GLUT_KEY_F11:
         // If the current layout is simple increment its line length
-        if (simpleLayout) simpleLayout->SetLineLength(simpleLayout->GetLineLength() + 10.0f);
+        if (l) l->SetLineLength(l->GetLineLength() + 10.0f);
         break;
     }
 
     // If the current layout is a SimpleLayout, update its font.
-    if(simpleLayout)
+    if(l)
     {
-        simpleLayout->SetFont(fonts[current_font]);
+        l->SetFont(fonts[current_font]);
     }
 
     glutPostRedisplay();
@@ -668,7 +668,7 @@ int main(int argc, char *argv[])
 
     if((argc >= 2) && !IGNORE_ARGV)
     {
-        fontfiles = (char const **)argv + 1;
+        fontfiles = (char const * const *)argv + 1;
         numFontFiles = argc - 1;
     }
     else
diff --git a/demo/tb.c b/demo/tb.c
index f57041a..310f23d 100644
--- a/demo/tb.c
+++ b/demo/tb.c
@@ -41,7 +41,7 @@ _tbAnimate(void)
   glutPostRedisplay();
 }
 
-void
+static void
 _tbStartMotion(int x, int y, int time)
 {
   assert(tb_button != -1);
@@ -53,7 +53,7 @@ _tbStartMotion(int x, int y, int time)
   beginy = y;
 }
 
-void
+static void
 _tbStopMotion(unsigned time)
 {
   assert(tb_button != -1);
diff --git a/demo/trackball.c b/demo/trackball.c
index e021d09..d1fa869 100644
--- a/demo/trackball.c
+++ b/demo/trackball.c
@@ -70,7 +70,7 @@
 static float tb_project_to_sphere(float, float, float);
 static void normalize_quat(float [4]);
 
-void
+static void
 vzero(float *v)
 {
     v[0] = 0.0;
@@ -78,7 +78,7 @@ vzero(float *v)
     v[2] = 0.0;
 }
 
-void
+static void
 vset(float *v, float x, float y, float z)
 {
     v[0] = x;
@@ -86,7 +86,7 @@ vset(float *v, float x, float y, float z)
     v[2] = z;
 }
 
-void
+static void
 vsub(const float *src1, const float *src2, float *dst)
 {
     dst[0] = src1[0] - src2[0];
@@ -94,7 +94,7 @@ vsub(const float *src1, const float *src2, float *dst)
     dst[2] = src1[2] - src2[2];
 }
 
-void
+static void
 vcopy(const float *v1, float *v2)
 {
     register int i;
@@ -102,7 +102,7 @@ vcopy(const float *v1, float *v2)
         v2[i] = v1[i];
 }
 
-void
+static void
 vcross(const float *v1, const float *v2, float *cross)
 {
     float temp[3];
@@ -113,13 +113,13 @@ vcross(const float *v1, const float *v2, float *cross)
     vcopy(temp, cross);
 }
 
-float
+static float
 vlength(const float *v)
 {
     return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
 }
 
-void
+static void
 vscale(float *v, float div)
 {
     v[0] *= div;
@@ -127,19 +127,19 @@ vscale(float *v, float div)
     v[2] *= div;
 }
 
-void
+static void
 vnormal(float *v)
 {
     vscale(v,1.0/vlength(v));
 }
 
-float
+static float
 vdot(const float *v1, const float *v2)
 {
     return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
 }
 
-void
+static void
 vadd(const float *src1, const float *src2, float *dst)
 {
     dst[0] = src1[0] + src2[0];
diff --git a/include/FTGlyph.h b/include/FTGlyph.h
index 61e69fc..a20af05 100644
--- a/include/FTGlyph.h
+++ b/include/FTGlyph.h
@@ -116,13 +116,6 @@ class FTGL_EXPORT FTGlyph
         FTBBox bBox;
 
         /**
-         * Flag to enable or disable the use of Display Lists inside FTGL
-         * <code>true</code> turns ON display lists.
-         * <code>false</code> turns OFF display lists.
-         */
-        bool useDisplayList;
-
-        /**
          * Current error code. Zero means no error.
          */
         FT_Error err;
diff --git a/include/FTVector.h b/include/FTVector.h
index 43a890a..3707b7b 100644
--- a/include/FTVector.h
+++ b/include/FTVector.h
@@ -160,26 +160,26 @@ class FTGL_EXPORT FTVector
             {
                 return;
             }
-            
+
             reserve(n);
-            iterator begin, end;
-            
-            if( n >= Size)
+            iterator ibegin, iend;
+
+            if(n >= Size)
             {
-                begin = this->end();
-                end = this->begin() + n;
+                ibegin = this->end();
+                iend = this->begin() + n;
             }
             else
             {
-                begin = this->begin() + n;
-                end = this->end();
+                ibegin = this->begin() + n;
+                iend = this->end();
             }
-        
-            while( begin != end)
+
+            while(ibegin != iend)
             {
-                *begin++ = x;
+                *ibegin++ = x;
             }
-        
+
             Size = n;
         }
 
@@ -195,19 +195,19 @@ class FTGL_EXPORT FTVector
                     new_capacity *= 2;
                 }
             }
-            
+
             value_type *new_items = new value_type[new_capacity];
-            
-            iterator begin = this->begin();
-            iterator end = this->end();
+
+            iterator ibegin = this->begin();
+            iterator iend = this->end();
             value_type *ptr = new_items;
-            
-            while( begin != end)
+
+            while(ibegin != iend)
             {
-                *ptr++ = *begin++;
+                *ptr++ = *ibegin++;
             }
-            
-            if( Capacity)
+
+            if(Capacity)
             {
                 delete [] Items;
             }
diff --git a/src/FTContour.cpp b/src/FTContour.cpp
index 5eab697..58156cc 100644
--- a/src/FTContour.cpp
+++ b/src/FTContour.cpp
@@ -216,13 +216,11 @@ FTContour::FTContour(FT_Vector* contour, char* tags, unsigned int n)
 
         if(tags[i] == FT_Curve_Tag_Cubic)
         {
-            FTPoint cur2 = next;
+            FTPoint next2 = (i == n - 2)
+                             ? pointList[0]
+                             : FTPoint(contour[i + 2]);
 
-            FTPoint next = (i == n - 2)
-                           ? pointList[0]
-                           : FTPoint(contour[i + 2]);
-
-            evaluateCubicCurve(prev, cur, cur2, next);
+            evaluateCubicCurve(prev, cur, next, next2);
             ++i;
             continue;
         }
diff --git a/src/FTExtrdGlyph.cpp b/src/FTExtrdGlyph.cpp
index 66a49eb..398b31e 100644
--- a/src/FTExtrdGlyph.cpp
+++ b/src/FTExtrdGlyph.cpp
@@ -40,7 +40,9 @@
 #include "FTVectoriser.h"
 
 
-FTExtrdGlyph::FTExtrdGlyph(FT_GlyphSlot glyph, float depth, float frontOutset, float backOutset, bool useDisplayList)
+FTExtrdGlyph::FTExtrdGlyph(FT_GlyphSlot glyph, float _depth,
+                           float _frontOutset, float _backOutset,
+                           bool useDisplayList)
 :   FTGlyph(glyph),
     glList(0)
 {
@@ -61,11 +63,11 @@ FTExtrdGlyph::FTExtrdGlyph(FT_GlyphSlot glyph, float depth, float frontOutset, f
         return;
     }
 
-    this->hscale = glyph->face->size->metrics.x_ppem * 64;
-    this->vscale = glyph->face->size->metrics.y_ppem * 64;
-    this->depth = depth;
-    this->frontOutset = frontOutset;
-    this->backOutset = backOutset;
+    hscale = glyph->face->size->metrics.x_ppem * 64;
+    vscale = glyph->face->size->metrics.y_ppem * 64;
+    depth = _depth;
+    frontOutset = _frontOutset;
+    backOutset = _backOutset;
 
     if(useDisplayList)
     {
@@ -94,7 +96,7 @@ FTExtrdGlyph::FTExtrdGlyph(FT_GlyphSlot glyph, float depth, float frontOutset, f
 
 FTExtrdGlyph::~FTExtrdGlyph()
 {
-    if(useDisplayList)
+    if(glList)
     {
         glDeleteLists(glList, 1);
     }
diff --git a/src/FTFace.cpp b/src/FTFace.cpp
index 31c3ff1..f61d331 100644
--- a/src/FTFace.cpp
+++ b/src/FTFace.cpp
@@ -69,8 +69,9 @@ FTFace::FTFace( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
     const FT_Long DEFAULT_FACE_INDEX = 0;
     ftFace = new FT_Face;
 
-    err = FT_New_Memory_Face( *FTLibrary::Instance().GetLibrary(), (FT_Byte *)pBufferBytes, bufferSizeInBytes, DEFAULT_FACE_INDEX, ftFace);
-
+    err = FT_New_Memory_Face(*FTLibrary::Instance().GetLibrary(),
+                             (FT_Byte const *)pBufferBytes, bufferSizeInBytes,
+                             DEFAULT_FACE_INDEX, ftFace);
     if( err)
     {
         delete ftFace;
@@ -101,12 +102,13 @@ bool FTFace::Attach( const char* fontFilePath)
 }
 
 
-bool FTFace::Attach( const unsigned char *pBufferBytes, size_t bufferSizeInBytes)
+bool FTFace::Attach(const unsigned char *pBufferBytes,
+                    size_t bufferSizeInBytes)
 {
     FT_Open_Args open;
 
     open.flags = FT_OPEN_MEMORY;
-    open.memory_base = (FT_Byte *)pBufferBytes;
+    open.memory_base = (FT_Byte const *)pBufferBytes;
     open.memory_size = bufferSizeInBytes;
 
     err = FT_Attach_Stream( *ftFace, &open);
diff --git a/src/FTGlyph.cpp b/src/FTGlyph.cpp
index 17dec1c..a254ba1 100644
--- a/src/FTGlyph.cpp
+++ b/src/FTGlyph.cpp
@@ -37,9 +37,7 @@
 #include "FTGlyph.h"
 
 
-FTGlyph::FTGlyph( FT_GlyphSlot glyph, bool useList)
-:   useDisplayList(useList),
-    err(0)  
+FTGlyph::FTGlyph( FT_GlyphSlot glyph, bool useList) : err(0)
 {
     if( glyph)
     {
diff --git a/src/FTOutlineGlyph.cpp b/src/FTOutlineGlyph.cpp
index 8b17c88..0ad798b 100644
--- a/src/FTOutlineGlyph.cpp
+++ b/src/FTOutlineGlyph.cpp
@@ -39,7 +39,8 @@
 #include "FTVectoriser.h"
 
 
-FTOutlineGlyph::FTOutlineGlyph(FT_GlyphSlot glyph, float outset, bool useDisplayList)
+FTOutlineGlyph::FTOutlineGlyph(FT_GlyphSlot glyph, float _outset,
+                               bool useDisplayList)
 :   FTGlyph(glyph),
     glList(0)
 {
diff --git a/src/FTPolyGlyph.cpp b/src/FTPolyGlyph.cpp
index f812abd..6347037 100644
--- a/src/FTPolyGlyph.cpp
+++ b/src/FTPolyGlyph.cpp
@@ -39,7 +39,8 @@
 #include "FTVectoriser.h"
 
 
-FTPolyGlyph::FTPolyGlyph(FT_GlyphSlot glyph, float outset, bool useDisplayList)
+FTPolyGlyph::FTPolyGlyph(FT_GlyphSlot glyph, float _outset,
+                         bool useDisplayList)
 :   FTGlyph(glyph),
     glList(0)
 {
@@ -80,7 +81,7 @@ FTPolyGlyph::FTPolyGlyph(FT_GlyphSlot glyph, float outset, bool useDisplayList)
 
 FTPolyGlyph::~FTPolyGlyph()
 {
-    if(useDisplayList)
+    if(glList)
     {
         glDeleteLists(glList, 1);
     }
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index 7ef4bb0..bab3be6 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -254,11 +254,14 @@ void FTVectoriser::MakeMesh(FTGL_DOUBLE zNormal, int outsetType, float outsetSiz
                     const FTGL_DOUBLE* d;
                     switch(outsetType)
                     {
-                        case 0: d = contour->Point(p); break;
                         case 1: d = contour->FrontPoint(p); break;
                         case 2: d = contour->BackPoint(p); break;
+                        case 0: default: d = contour->Point(p); break;
                     }
-                    gluTessVertex( tobj, (GLdouble*)d, (GLdouble*)d);
+                    // XXX: gluTessVertex doesn't modify the data but does not
+                    // specify "const" in its prototype, so we cannot cast to
+                    // a const type.
+                    gluTessVertex(tobj, (GLdouble *)d, (GLvoid *)d);
                 }
 
             gluTessEndContour( tobj);
diff --git a/test/FTFont-Test.cpp b/test/FTFont-Test.cpp
index 297ac88..c9cb60d 100644
--- a/test/FTFont-Test.cpp
+++ b/test/FTFont-Test.cpp
@@ -243,9 +243,9 @@ class FTFontTest : public CppUnit::TestCase
         
         void testCheckGlyphFailure()
         {
-            BadGlyphTestFont* testFont = new BadGlyphTestFont(GOOD_FONT_FILE);
+            BadGlyphTestFont* font = new BadGlyphTestFont(GOOD_FONT_FILE);
 
-            float advance = testFont->Advance( GOOD_ASCII_TEST_STRING);
+            float advance = font->Advance( GOOD_ASCII_TEST_STRING);
             CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.0, advance, 0.01);            
         }
         
diff --git a/test/FTMesh-Test.cpp b/test/FTMesh-Test.cpp
index 1cd2a2d..309e261 100644
--- a/test/FTMesh-Test.cpp
+++ b/test/FTMesh-Test.cpp
@@ -60,8 +60,9 @@ class FTMeshTest : public CppUnit::TestCase
         
         void testAddPoint()
         {
-            FTGL_DOUBLE testPoint[3] = { 1, 2, 3};
-            FTGL_DOUBLE* hole[] = { 0, 0, 0, 0};
+            FTGL_DOUBLE testPoint[3] = { 1, 2, 3 };
+            FTGL_DOUBLE* hole[] = { 0, 0, 0, 0 };
+            void *pHole = (void *)hole;
 
             FTMesh mesh;
             CPPUNIT_ASSERT( mesh.TesselationCount() == 0);
@@ -83,7 +84,7 @@ class FTMeshTest : public CppUnit::TestCase
             ftglVertex( &POINT_DATA[15], &mesh);
             ftglError( 2, &mesh);
             ftglVertex( &POINT_DATA[18], &mesh);
-            ftglCombine( testPoint, NULL, NULL, (void**)hole, &mesh);
+            ftglCombine(testPoint, NULL, NULL, &pHole, &mesh);
             ftglVertex( &POINT_DATA[21], &mesh);
             ftglError( 3, &mesh);
             ftglEnd( &mesh);
@@ -103,24 +104,26 @@ class FTMeshTest : public CppUnit::TestCase
             FTGL_DOUBLE testPoint[3] = { 1, 2, 3};
 
             FTGL_DOUBLE* testOutput[] = { 0, 0, 0, 0};
+            void *pOutput = (void *)testOutput;
             FTGL_DOUBLE* hole[] = { 0, 0, 0, 0};
-            
+            void *pHole = (void *)hole;
+
             FTMesh mesh;
-			unsigned int x;
-        
+            unsigned int x;
+
             ftglBegin( GL_TRIANGLES, &mesh);
-            ftglCombine( testPoint, NULL, NULL, (void**)testOutput, &mesh);
-            
+            ftglCombine(testPoint, NULL, NULL, &pOutput, &mesh);
+
             for( x = 0; x < 200; ++x)
             {
-                ftglCombine( testPoint, NULL, NULL, (void**)hole, &mesh);
+                ftglCombine(testPoint, NULL, NULL, &pHole, &mesh);
             }
 
             CPPUNIT_ASSERT( *testOutput == static_cast<const FTGL_DOUBLE*>(mesh.TempPointList().front()));
             
             for( x = 201; x < 300; ++x)
             {
-                ftglCombine( testPoint, NULL, NULL, (void**)hole, &mesh);            
+                ftglCombine(testPoint, NULL, NULL, &pHole, &mesh);
             }
 
             ftglEnd( &mesh);