summaryrefslogtreecommitdiff
path: root/src/libtess2
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-22 12:41:10 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-10-22 12:41:10 +0200
commit5d6748f8fee0fe9d7aa0da0d9ff26de1c8044815 (patch)
treeea974f9dda6f77c206f553ac3977713cfa48a318 /src/libtess2
parent8df906e2bcc6eed8968b37068317f7bfb1ab33f0 (diff)
downloadqtlocation-mapboxgl-5d6748f8fee0fe9d7aa0da0d9ff26de1c8044815.tar.gz
fix compile warnings in libtess2
Diffstat (limited to 'src/libtess2')
-rwxr-xr-xsrc/libtess2/bucketalloc.c2
-rwxr-xr-xsrc/libtess2/priorityq.c8
-rwxr-xr-xsrc/libtess2/sweep.c3
-rwxr-xr-xsrc/libtess2/tess.c14
4 files changed, 11 insertions, 16 deletions
diff --git a/src/libtess2/bucketalloc.c b/src/libtess2/bucketalloc.c
index ce64e579e7..df1a83c76c 100755
--- a/src/libtess2/bucketalloc.c
+++ b/src/libtess2/bucketalloc.c
@@ -59,7 +59,7 @@ struct BucketAlloc
static int CreateBucket( struct BucketAlloc* ba )
{
- size_t size;
+ unsigned int size;
Bucket* bucket;
void* freelist;
unsigned char* head;
diff --git a/src/libtess2/priorityq.c b/src/libtess2/priorityq.c
index 2af5f347b9..49e1c012f5 100755
--- a/src/libtess2/priorityq.c
+++ b/src/libtess2/priorityq.c
@@ -209,13 +209,13 @@ PQhandle pqHeapInsert( TESSalloc* alloc, PriorityQHeap *pq, PQkey keyNew )
// If the heap overflows, double its size.
pq->max <<= 1;
pq->nodes = (PQnode *)alloc->memrealloc( alloc->userData, pq->nodes,
- (size_t)((pq->max + 1) * sizeof( pq->nodes[0] )));
+ (unsigned int)((pq->max + 1) * sizeof( pq->nodes[0] )));
if (pq->nodes == NULL) {
pq->nodes = saveNodes; // restore ptr to free upon return
return INV_HANDLE;
}
pq->handles = (PQhandleElem *)alloc->memrealloc( alloc->userData, pq->handles,
- (size_t) ((pq->max + 1) * sizeof( pq->handles[0] )));
+ (unsigned int) ((pq->max + 1) * sizeof( pq->handles[0] )));
if (pq->handles == NULL) {
pq->handles = saveHandles; // restore ptr to free upon return
return INV_HANDLE;
@@ -351,7 +351,7 @@ int pqInit( TESSalloc* alloc, PriorityQ *pq )
(pq->size * sizeof(pq->order[0])) );
*/
pq->order = (PQkey **)alloc->memalloc( alloc->userData,
- (size_t)((pq->size+1) * sizeof(pq->order[0])) );
+ (unsigned int)((pq->size+1) * sizeof(pq->order[0])) );
/* the previous line is a patch to compensate for the fact that IBM */
/* machines return a null on a malloc of zero bytes (unlike SGI), */
/* so we have to put in this defense to guard against a memory */
@@ -438,7 +438,7 @@ PQhandle pqInsert( TESSalloc* alloc, PriorityQ *pq, PQkey keyNew )
// If the heap overflows, double its size.
pq->max <<= 1;
pq->keys = (PQkey *)alloc->memrealloc( alloc->userData, pq->keys,
- (size_t)(pq->max * sizeof( pq->keys[0] )));
+ (unsigned int)(pq->max * sizeof( pq->keys[0] )));
if (pq->keys == NULL) {
pq->keys = saveKey; // restore ptr to free upon return
return INV_HANDLE;
diff --git a/src/libtess2/sweep.c b/src/libtess2/sweep.c
index 0204d3e8a3..49559fa124 100755
--- a/src/libtess2/sweep.c
+++ b/src/libtess2/sweep.c
@@ -428,9 +428,12 @@ static void VertexWeights( TESSvertex *isect, TESSvertex *org, TESSvertex *dst,
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
static void GetIntersectData( TESStesselator *tess, TESSvertex *isect,
TESSvertex *orgUp, TESSvertex *dstUp,
TESSvertex *orgLo, TESSvertex *dstLo )
+#pragma GCC diagnostic pop
/*
* We've computed a new intersection point, now we need a "data" pointer
* from the user so that we can refer to this new vertex in the
diff --git a/src/libtess2/tess.c b/src/libtess2/tess.c
index ad71478375..80c5b70f41 100755
--- a/src/libtess2/tess.c
+++ b/src/libtess2/tess.c
@@ -46,17 +46,6 @@
#define Dot(u,v) (u[0]*v[0] + u[1]*v[1] + u[2]*v[2])
-static void Normalize( TESSreal v[3] )
-{
- TESSreal len = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
-
- assert( len > 0 );
- len = sqrtf( len );
- v[0] /= len;
- v[1] /= len;
- v[2] /= len;
-}
-
#define ABS(x) ((x) < 0 ? -(x) : (x))
static int LongAxis( TESSreal v[3] )
@@ -436,6 +425,8 @@ int tessMeshSetWindingNumber( TESSmesh *mesh, int value,
return 1;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-parameter"
void* heapAlloc( void* userData, unsigned int size )
{
return malloc( size );
@@ -450,6 +441,7 @@ void heapFree( void* userData, void* ptr )
{
free( ptr );
}
+#pragma GCC diagnostic pop
static TESSalloc defaulAlloc =
{