Fixed compiler warnings (size_t)
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
diff --git a/include/FTVectoriser.h b/include/FTVectoriser.h
index cad50df..a568c28 100644
--- a/include/FTVectoriser.h
+++ b/include/FTVectoriser.h
@@ -126,7 +126,7 @@ class FTGL_EXPORT FTContour
*
* @return the number of points in this contour
*/
- int size() const { return pointList.size();}
+ size_t size() const { return pointList.size();}
/**
* The list of points in this contour
@@ -163,7 +163,7 @@ class FTGL_EXPORT FTTesselation
}
- int size() const { return pointList.size();}
+ size_t size() const { return pointList.size();}
GLenum meshType;
vector<ftPoint> pointList;
@@ -261,7 +261,7 @@ class FTGL_EXPORT FTVectoriser
*
* @return the number of points.
*/
- int MeshPoints() const { return mesh->size();}
+ size_t MeshPoints() const { return mesh->size();}
/**
* Get the total count of points in this outline
@@ -275,7 +275,7 @@ class FTGL_EXPORT FTVectoriser
*
* @return the number of contours
*/
- int contours() const { return contourList.size();}
+ size_t contours() const { return contourList.size();}
/**
* Get the nuber of points in a contour in this outline
@@ -283,7 +283,7 @@ class FTGL_EXPORT FTVectoriser
* @param c The contour index
* @return the number of points in contour[c]
*/
- int contourSize( int c) const { return contourList[c]->size();}
+ size_t contourSize( int c) const { return contourList[c]->size();}
/**
* Get the flag for the tesselation rule for this outline
diff --git a/src/FTVectoriser.cpp b/src/FTVectoriser.cpp
index 8e2bb8f..263b6bc 100644
--- a/src/FTVectoriser.cpp
+++ b/src/FTVectoriser.cpp
@@ -67,7 +67,7 @@ FTMesh::FTMesh()
FTMesh::~FTMesh()
{
- for( int t = 0; t < tess.size(); ++t)
+ for( size_t t = 0; t < tess.size(); ++t)
{
delete tess[t];
}
@@ -105,7 +105,7 @@ FTGL_DOUBLE* FTMesh::Point()
int FTMesh::size() const
{
int s = 0;
- for( int t = 0; t < tess.size(); ++t)
+ for( size_t t = 0; t < tess.size(); ++t)
{
s += tess[t]->size();
++s;
@@ -132,7 +132,7 @@ FTVectoriser::FTVectoriser( const FT_Glyph glyph)
FTVectoriser::~FTVectoriser()
{
- for( int c = 0; c < contours(); ++c)
+ for( size_t c = 0; c < contours(); ++c)
{
delete contourList[c];
}
@@ -147,7 +147,7 @@ FTVectoriser::~FTVectoriser()
int FTVectoriser::points()
{
int s = 0;
- for( int c = 0; c < contours(); ++c)
+ for( size_t c = 0; c < contours(); ++c)
{
s += contourList[c]->size();
}
@@ -306,11 +306,11 @@ void FTVectoriser::GetOutline( FTGL_DOUBLE* data)
{
int i = 0;
- for( int c= 0; c < contours(); ++c)
+ for( size_t c= 0; c < contours(); ++c)
{
const FTContour* contour = contourList[c];
- for( int p = 0; p < contour->size(); ++p)
+ for( size_t p = 0; p < contour->size(); ++p)
{
data[i] = static_cast<FTGL_DOUBLE>(contour->pointList[p].x / 64.0f); // is 64 correct?
data[i + 1] = static_cast<FTGL_DOUBLE>(contour->pointList[p].y / 64.0f);
@@ -353,12 +353,12 @@ void FTVectoriser::MakeMesh( int zNormal)
gluTessNormal( tobj, 0.0, 0.0, zNormal);
gluTessBeginPolygon( tobj, mesh);
- for( int c = 0; c < contours(); ++c)
+ for( size_t c = 0; c < contours(); ++c)
{
const FTContour* contour = contourList[c];
gluTessBeginContour( tobj);
- for( int p = 0; p < contour->size(); ++p)
+ for( size_t p = 0; p < contour->size(); ++p)
{
FTGL_DOUBLE* d = const_cast<FTGL_DOUBLE*>(&contour->pointList[p].x);
gluTessVertex( tobj, d, d);
@@ -379,19 +379,19 @@ void FTVectoriser::GetMesh( FTGL_DOUBLE* data)
int i = 0;
// fill out the header
- int msize = mesh->tess.size();
+ size_t msize = mesh->tess.size();
data[0] = msize;
for( int p = 0; p < data[0]; ++p)
{
FTTesselation* tess = mesh->tess[p];
- int tSize = tess->pointList.size();
+ size_t tSize = tess->pointList.size();
int tType = tess->meshType;
data[i+1] = tType;
data[i+2] = tSize;
i += 3;
- for( int q = 0; q < ( tess->pointList.size()); ++q)
+ for( size_t q = 0; q < ( tess->pointList.size()); ++q)
{
data[i] = tess->pointList[q].x / 64.0f; // is 64 correct?
data[i + 1] = tess->pointList[q].y / 64.0f;