fix compile warnings in libtess2
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 =
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user