diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b43525..245a1f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ option(BUILD_LIBRARY "Build libtriangle library" ON) if(BUILD_LIBRARY) add_library(triangle STATIC triangle.cpp) - target_compile_definitions(triangle PRIVATE -DTRILIBRARY -DANSI_DECLARATORS) + target_compile_definitions(triangle PRIVATE -DTRILIBRARY) if(WIN32) target_compile_definitions(triangle PRIVATE -DNO_TIMER) endif() @@ -17,7 +17,7 @@ endif() if(BUILD_EXECUTABLE) add_executable(triangle_exec triangle.cpp) - target_compile_definitions(triangle_exec PRIVATE -DANSI_DECLARATORS) + target_compile_definitions(triangle_exec PRIVATE) if(WIN32) target_compile_definitions(triangle_exec PRIVATE -DNO_TIMER) endif() diff --git a/triangle.cpp b/triangle.cpp index 765caac..c1d2d43 100644 --- a/triangle.cpp +++ b/triangle.cpp @@ -308,12 +308,6 @@ #define DEADVERTEX -32768 #define UNDEADVERTEX -32767 -/* The next line is used to outsmart some very stupid compilers. If your */ -/* compiler is smarter, feel free to replace the "int" with "void". */ -/* Not that it matters. */ - -#define VOID int - /* Two constants for algorithms based on random sampling. Both constants */ /* have been chosen empirically to optimize their respective algorithms. */ @@ -340,11 +334,6 @@ #define ONETHIRD 0.333333333333333333333333333333333333333333333333333333333333 - -/* Define the size large enough to store and operate on a pointer. */ -#define INT_PTR unsigned long long - - #include #include #include @@ -586,7 +575,7 @@ struct flipstacker { struct event { REAL xkey, ykey; /* Coordinates of the event. */ - VOID *eventptr; /* Can be a vertex or the location of a circle event. */ + void *eventptr; /* Can be a vertex or the location of a circle event. */ int heapposition; /* Marks this event's position in the heap. */ }; @@ -631,11 +620,11 @@ struct splaynode { /* number of records kept on deaditemstack. */ struct memorypool { - VOID **firstblock, **nowblock; - VOID *nextitem; - VOID *deaditemstack; - VOID **pathblock; - VOID *pathitem; + void **firstblock, **nowblock; + void *nextitem; + void *deaditemstack; + void **pathblock; + void *pathitem; int alignbytes; int itembytes; int itemsperblock; @@ -945,16 +934,16 @@ int minus1mod3[3] = {2, 0, 1}; /* extracted from the two least significant bits of the pointer. */ #define decode(ptr, otri) \ - (otri).orient = (int) ((INT_PTR) (ptr) & (INT_PTR) 3l); \ + (otri).orient = (int) ((intptr_t) (ptr) & (intptr_t) 3l); \ (otri).tri = (triangle *) \ - ((INT_PTR) (ptr) ^ (INT_PTR) (otri).orient) + ((intptr_t) (ptr) ^ (intptr_t) (otri).orient) /* encode() compresses an oriented triangle into a single pointer. It */ /* relies on the assumption that all triangles are aligned to four-byte */ /* boundaries, so the two least significant bits of (otri).tri are zero. */ #define encode(otri) \ - (triangle) ((INT_PTR) (otri).tri | (INT_PTR) (otri).orient) + (triangle) ((intptr_t) (otri).tri | (intptr_t) (otri).orient) /* The following handle manipulation primitives are all described by Guibas */ /* and Stolfi. However, Guibas and Stolfi use an edge-based data */ @@ -1118,16 +1107,16 @@ int minus1mod3[3] = {2, 0, 1}; #define infect(otri) \ (otri).tri[6] = (triangle) \ - ((INT_PTR) (otri).tri[6] | (INT_PTR) 2l) + ((intptr_t) (otri).tri[6] | (intptr_t) 2l) #define uninfect(otri) \ (otri).tri[6] = (triangle) \ - ((INT_PTR) (otri).tri[6] & ~ (INT_PTR) 2l) + ((intptr_t) (otri).tri[6] & ~ (intptr_t) 2l) /* Test a triangle for viral infection. */ #define infected(otri) \ - (((INT_PTR) (otri).tri[6] & (INT_PTR) 2l) != 0l) + (((intptr_t) (otri).tri[6] & (intptr_t) 2l) != 0l) /* Check or set a triangle's attributes. */ @@ -1165,16 +1154,16 @@ int minus1mod3[3] = {2, 0, 1}; /* are masked out to produce the real pointer. */ #define sdecode(sptr, osub) \ - (osub).ssorient = (int) ((INT_PTR) (sptr) & (INT_PTR) 1l); \ + (osub).ssorient = (int) ((intptr_t) (sptr) & (intptr_t) 1l); \ (osub).ss = (subseg *) \ - ((INT_PTR) (sptr) & ~ (INT_PTR) 3l) + ((intptr_t) (sptr) & ~ (intptr_t) 3l) /* sencode() compresses an oriented subsegment into a single pointer. It */ /* relies on the assumption that all subsegments are aligned to two-byte */ /* boundaries, so the least significant bit of (osub).ss is zero. */ #define sencode(osub) \ - (subseg) ((INT_PTR) (osub).ss | (INT_PTR) (osub).ssorient) + (subseg) ((intptr_t) (osub).ss | (intptr_t) (osub).ssorient) /* ssym() toggles the orientation of a subsegment. */ @@ -1367,16 +1356,7 @@ int triunsuitable(); #else /* not EXTERNAL_TEST */ -#ifdef ANSI_DECLARATORS int triunsuitable(vertex triorg, vertex tridest, vertex triapex, REAL area) -#else /* not ANSI_DECLARATORS */ -int triunsuitable(triorg, tridest, triapex, area) -vertex triorg; /* The triangle's origin vertex. */ -vertex tridest; /* The triangle's destination vertex. */ -vertex triapex; /* The triangle's apex vertex. */ -REAL area; /* The area of the triangle. */ -#endif /* not ANSI_DECLARATORS */ - { REAL dxoa, dxda, dxod; REAL dyoa, dyda, dyod; @@ -1414,42 +1394,24 @@ REAL area; /* The area of the triangle. */ /** **/ /** **/ -#ifdef ANSI_DECLARATORS void triexit(int status) -#else /* not ANSI_DECLARATORS */ -void triexit(status) -int status; -#endif /* not ANSI_DECLARATORS */ - { throw std::runtime_error("triexit("+std::to_string(status)+")"); } -#ifdef ANSI_DECLARATORS -VOID *trimalloc(int size) -#else /* not ANSI_DECLARATORS */ -VOID *trimalloc(size) -int size; -#endif /* not ANSI_DECLARATORS */ - +void *trimalloc(int size) { - VOID *memptr; + void *memptr; - memptr = (VOID *) malloc((unsigned int) size); - if (memptr == (VOID *) NULL) { + memptr = (void *) malloc((unsigned int) size); + if (memptr == (void *) NULL) { printf("Error: Out of memory.\n"); triexit(1); } return(memptr); } -#ifdef ANSI_DECLARATORS -void trifree(VOID *memptr) -#else /* not ANSI_DECLARATORS */ -void trifree(memptr) -VOID *memptr; -#endif /* not ANSI_DECLARATORS */ - +void trifree(void *memptr) { free(memptr); } @@ -3286,15 +3248,7 @@ void internalerror() /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void parsecommandline(int argc, char **argv, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void parsecommandline(argc, argv, b) -int argc; -char **argv; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { #ifdef TRILIBRARY #define STARTINDEX 0 @@ -3668,15 +3622,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void printtriangle(struct mesh *m, struct behavior *b, struct otri *t) -#else /* not ANSI_DECLARATORS */ -void printtriangle(m, b, t) -struct mesh *m; -struct behavior *b; -struct otri *t; -#endif /* not ANSI_DECLARATORS */ - { struct otri printtri; struct osub printsh; @@ -3762,15 +3708,7 @@ struct otri *t; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void printsubseg(struct mesh *m, struct behavior *b, struct osub *s) -#else /* not ANSI_DECLARATORS */ -void printsubseg(m, b, s) -struct mesh *m; -struct behavior *b; -struct osub *s; -#endif /* not ANSI_DECLARATORS */ - { struct osub printsh; struct otri printtri; @@ -3856,20 +3794,14 @@ struct osub *s; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void poolzero(struct memorypool *pool) -#else /* not ANSI_DECLARATORS */ -void poolzero(pool) -struct memorypool *pool; -#endif /* not ANSI_DECLARATORS */ - { - pool->firstblock = (VOID **) NULL; - pool->nowblock = (VOID **) NULL; - pool->nextitem = (VOID *) NULL; - pool->deaditemstack = (VOID *) NULL; - pool->pathblock = (VOID **) NULL; - pool->pathitem = (VOID *) NULL; + pool->firstblock = (void **) NULL; + pool->nowblock = (void **) NULL; + pool->nextitem = (void *) NULL; + pool->deaditemstack = (void *) NULL; + pool->pathblock = (void **) NULL; + pool->pathitem = (void *) NULL; pool->alignbytes = 0; pool->itembytes = 0; pool->itemsperblock = 0; @@ -3890,31 +3822,25 @@ struct memorypool *pool; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void poolrestart(struct memorypool *pool) -#else /* not ANSI_DECLARATORS */ -void poolrestart(pool) -struct memorypool *pool; -#endif /* not ANSI_DECLARATORS */ - { - INT_PTR alignptr = 0; + intptr_t alignptr = 0; pool->items = 0; pool->maxitems = 0; /* Set the currently active block. */ pool->nowblock = pool->firstblock; - /* Find the first item in the pool. Increment by the size of (VOID *). */ - alignptr = (INT_PTR) (pool->nowblock + 1); + /* Find the first item in the pool. Increment by the size of (void *). */ + alignptr = (intptr_t) (pool->nowblock + 1); /* Align the item on an `alignbytes'-byte boundary. */ - pool->nextitem = (VOID *) - (alignptr + (INT_PTR) pool->alignbytes - - (alignptr % (INT_PTR) pool->alignbytes)); + pool->nextitem = (void *) + (alignptr + (intptr_t) pool->alignbytes - + (alignptr % (intptr_t) pool->alignbytes)); /* There are lots of unallocated items left in this block. */ pool->unallocateditems = pool->itemsfirstblock; /* The stack of deallocated items is empty. */ - pool->deaditemstack = (VOID *) NULL; + pool->deaditemstack = (void *) NULL; } /*****************************************************************************/ @@ -3936,27 +3862,17 @@ struct memorypool *pool; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void poolinit(struct memorypool *pool, int bytecount, int itemcount, int firstitemcount, int alignment) -#else /* not ANSI_DECLARATORS */ -void poolinit(pool, bytecount, itemcount, firstitemcount, alignment) -struct memorypool *pool; -int bytecount; -int itemcount; -int firstitemcount; -int alignment; -#endif /* not ANSI_DECLARATORS */ - { /* Find the proper alignment, which must be at least as large as: */ /* - The parameter `alignment'. */ - /* - sizeof(VOID *), so the stack of dead items can be maintained */ + /* - sizeof(void *), so the stack of dead items can be maintained */ /* without unaligned accesses. */ - if (alignment > sizeof(VOID *)) { + if (alignment > sizeof(void *)) { pool->alignbytes = alignment; } else { - pool->alignbytes = sizeof(VOID *); + pool->alignbytes = sizeof(void *); } pool->itembytes = ((bytecount - 1) / pool->alignbytes + 1) * pool->alignbytes; @@ -3970,11 +3886,11 @@ int alignment; /* Allocate a block of items. Space for `itemsfirstblock' items and one */ /* pointer (to point to the next block) are allocated, as well as space */ /* to ensure alignment of the items. */ - pool->firstblock = (VOID **) - trimalloc(pool->itemsfirstblock * pool->itembytes + (int) sizeof(VOID *) + + pool->firstblock = (void **) + trimalloc(pool->itemsfirstblock * pool->itembytes + (int) sizeof(void *) + pool->alignbytes); /* Set the next block pointer to NULL. */ - *(pool->firstblock) = (VOID *) NULL; + *(pool->firstblock) = (void *) NULL; poolrestart(pool); } @@ -3984,17 +3900,11 @@ int alignment; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void pooldeinit(struct memorypool *pool) -#else /* not ANSI_DECLARATORS */ -void pooldeinit(pool) -struct memorypool *pool; -#endif /* not ANSI_DECLARATORS */ - { - while (pool->firstblock != (VOID **) NULL) { - pool->nowblock = (VOID **) *(pool->firstblock); - trifree((VOID *) pool->firstblock); + while (pool->firstblock != (void **) NULL) { + pool->nowblock = (void **) *(pool->firstblock); + trifree((void *) pool->firstblock); pool->firstblock = pool->nowblock; } } @@ -4005,46 +3915,40 @@ struct memorypool *pool; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS -VOID *poolalloc(struct memorypool *pool) -#else /* not ANSI_DECLARATORS */ -VOID *poolalloc(pool) -struct memorypool *pool; -#endif /* not ANSI_DECLARATORS */ - +void *poolalloc(struct memorypool *pool) { - VOID *newitem; - VOID **newblock; - INT_PTR alignptr = 0; + void *newitem; + void **newblock; + intptr_t alignptr = 0; /* First check the linked list of dead items. If the list is not */ /* empty, allocate an item from the list rather than a fresh one. */ - if (pool->deaditemstack != (VOID *) NULL) { + if (pool->deaditemstack != (void *) NULL) { newitem = pool->deaditemstack; /* Take first item in list. */ - pool->deaditemstack = * (VOID **) pool->deaditemstack; + pool->deaditemstack = * (void **) pool->deaditemstack; } else { /* Check if there are any free items left in the current block. */ if (pool->unallocateditems == 0) { /* Check if another block must be allocated. */ - if (*(pool->nowblock) == (VOID *) NULL) { + if (*(pool->nowblock) == (void *) NULL) { /* Allocate a new block of items, pointed to by the previous block. */ - newblock = (VOID **) trimalloc(pool->itemsperblock * pool->itembytes + - (int) sizeof(VOID *) + + newblock = (void **) trimalloc(pool->itemsperblock * pool->itembytes + + (int) sizeof(void *) + pool->alignbytes); - *(pool->nowblock) = (VOID *) newblock; + *(pool->nowblock) = (void *) newblock; /* The next block pointer is NULL. */ - *newblock = (VOID *) NULL; + *newblock = (void *) NULL; } /* Move to the new block. */ - pool->nowblock = (VOID **) *(pool->nowblock); + pool->nowblock = (void **) *(pool->nowblock); /* Find the first item in the block. */ - /* Increment by the size of (VOID *). */ - alignptr = (INT_PTR) (pool->nowblock + 1); + /* Increment by the size of (void *). */ + alignptr = (intptr_t) (pool->nowblock + 1); /* Align the item on an `alignbytes'-byte boundary. */ - pool->nextitem = (VOID *) - (alignptr + (INT_PTR) pool->alignbytes - - (alignptr % (INT_PTR) pool->alignbytes)); + pool->nextitem = (void *) + (alignptr + (intptr_t) pool->alignbytes - + (alignptr % (intptr_t) pool->alignbytes)); /* There are lots of unallocated items left in this block. */ pool->unallocateditems = pool->itemsperblock; } @@ -4052,7 +3956,7 @@ struct memorypool *pool; /* Allocate a new item. */ newitem = pool->nextitem; /* Advance `nextitem' pointer to next free item in block. */ - pool->nextitem = (VOID *) ((char *) pool->nextitem + pool->itembytes); + pool->nextitem = (void *) ((char *) pool->nextitem + pool->itembytes); pool->unallocateditems--; pool->maxitems++; } @@ -4068,17 +3972,10 @@ struct memorypool *pool; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS -void pooldealloc(struct memorypool *pool, VOID *dyingitem) -#else /* not ANSI_DECLARATORS */ -void pooldealloc(pool, dyingitem) -struct memorypool *pool; -VOID *dyingitem; -#endif /* not ANSI_DECLARATORS */ - +void pooldealloc(struct memorypool *pool, void *dyingitem) { /* Push freshly killed item onto stack. */ - *((VOID **) dyingitem) = pool->deaditemstack; + *((void **) dyingitem) = pool->deaditemstack; pool->deaditemstack = dyingitem; pool->items--; } @@ -4091,24 +3988,18 @@ VOID *dyingitem; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void traversalinit(struct memorypool *pool) -#else /* not ANSI_DECLARATORS */ -void traversalinit(pool) -struct memorypool *pool; -#endif /* not ANSI_DECLARATORS */ - { - INT_PTR alignptr = 0; + intptr_t alignptr = 0; /* Begin the traversal in the first block. */ pool->pathblock = pool->firstblock; - /* Find the first item in the block. Increment by the size of (VOID *). */ - alignptr = (INT_PTR) (pool->pathblock + 1); + /* Find the first item in the block. Increment by the size of (void *). */ + alignptr = (intptr_t) (pool->pathblock + 1); /* Align with item on an `alignbytes'-byte boundary. */ - pool->pathitem = (VOID *) - (alignptr + (INT_PTR) pool->alignbytes - - (alignptr % (INT_PTR) pool->alignbytes)); + pool->pathitem = (void *) + (alignptr + (intptr_t) pool->alignbytes - + (alignptr % (intptr_t) pool->alignbytes)); /* Set the number of items left in the current block. */ pool->pathitemsleft = pool->itemsfirstblock; } @@ -4127,39 +4018,33 @@ struct memorypool *pool; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS -VOID *traverse(struct memorypool *pool) -#else /* not ANSI_DECLARATORS */ -VOID *traverse(pool) -struct memorypool *pool; -#endif /* not ANSI_DECLARATORS */ - +void *traverse(struct memorypool *pool) { - VOID *newitem; - INT_PTR alignptr = 0; + void *newitem; + intptr_t alignptr = 0; /* Stop upon exhausting the list of items. */ if (pool->pathitem == pool->nextitem) { - return (VOID *) NULL; + return (void *) NULL; } /* Check whether any untraversed items remain in the current block. */ if (pool->pathitemsleft == 0) { /* Find the next block. */ - pool->pathblock = (VOID **) *(pool->pathblock); - /* Find the first item in the block. Increment by the size of (VOID *). */ - alignptr = (INT_PTR) (pool->pathblock + 1); + pool->pathblock = (void **) *(pool->pathblock); + /* Find the first item in the block. Increment by the size of (void *). */ + alignptr = (intptr_t) (pool->pathblock + 1); /* Align with item on an `alignbytes'-byte boundary. */ - pool->pathitem = (VOID *) - (alignptr + (INT_PTR) pool->alignbytes - - (alignptr % (INT_PTR) pool->alignbytes)); + pool->pathitem = (void *) + (alignptr + (intptr_t) pool->alignbytes - + (alignptr % (intptr_t) pool->alignbytes)); /* Set the number of items left in the current block. */ pool->pathitemsleft = pool->itemsperblock; } newitem = pool->pathitem; /* Find the next item in the block. */ - pool->pathitem = (VOID *) ((char *) pool->pathitem + pool->itembytes); + pool->pathitem = (void *) ((char *) pool->pathitem + pool->itembytes); pool->pathitemsleft--; return newitem; } @@ -4192,28 +4077,19 @@ struct memorypool *pool; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void dummyinit(struct mesh *m, struct behavior *b, int trianglebytes, int subsegbytes) -#else /* not ANSI_DECLARATORS */ -void dummyinit(m, b, trianglebytes, subsegbytes) -struct mesh *m; -struct behavior *b; -int trianglebytes; -int subsegbytes; -#endif /* not ANSI_DECLARATORS */ - { - INT_PTR alignptr = 0; + intptr_t alignptr = 0; /* Set up `dummytri', the `triangle' that occupies "outer space." */ m->dummytribase = (triangle *) trimalloc(trianglebytes + m->triangles.alignbytes); /* Align `dummytri' on a `triangles.alignbytes'-byte boundary. */ - alignptr = (INT_PTR) m->dummytribase; + alignptr = (intptr_t) m->dummytribase; m->dummytri = (triangle *) - (alignptr + (INT_PTR) m->triangles.alignbytes - - (alignptr % (INT_PTR) m->triangles.alignbytes)); + (alignptr + (intptr_t) m->triangles.alignbytes - + (alignptr % (intptr_t) m->triangles.alignbytes)); /* Initialize the three adjoining triangles to be "outer space." These */ /* will eventually be changed by various bonding operations, but their */ /* values don't really matter, as long as they can legally be */ @@ -4233,10 +4109,10 @@ int subsegbytes; m->dummysubbase = (subseg *) trimalloc(subsegbytes + m->subsegs.alignbytes); /* Align `dummysub' on a `subsegs.alignbytes'-byte boundary. */ - alignptr = (INT_PTR) m->dummysubbase; + alignptr = (intptr_t) m->dummysubbase; m->dummysub = (subseg *) - (alignptr + (INT_PTR) m->subsegs.alignbytes - - (alignptr % (INT_PTR) m->subsegs.alignbytes)); + (alignptr + (intptr_t) m->subsegs.alignbytes - + (alignptr % (intptr_t) m->subsegs.alignbytes)); /* Initialize the two adjoining subsegments to be the omnipresent */ /* subsegment. These will eventually be changed by various bonding */ /* operations, but their values don't really matter, as long as they */ @@ -4272,14 +4148,7 @@ int subsegbytes; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void initializevertexpool(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void initializevertexpool(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { int vertexsize; @@ -4315,14 +4184,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void initializetrisubpools(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void initializetrisubpools(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { int trisize; @@ -4382,19 +4244,12 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void triangledealloc(struct mesh *m, triangle *dyingtriangle) -#else /* not ANSI_DECLARATORS */ -void triangledealloc(m, dyingtriangle) -struct mesh *m; -triangle *dyingtriangle; -#endif /* not ANSI_DECLARATORS */ - { /* Mark the triangle as dead. This makes it possible to detect dead */ /* triangles when traversing the list of all triangles. */ killtri(dyingtriangle); - pooldealloc(&m->triangles, (VOID *) dyingtriangle); + pooldealloc(&m->triangles, (void *) dyingtriangle); } /*****************************************************************************/ @@ -4403,13 +4258,7 @@ triangle *dyingtriangle; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS triangle *triangletraverse(struct mesh *m) -#else /* not ANSI_DECLARATORS */ -triangle *triangletraverse(m) -struct mesh *m; -#endif /* not ANSI_DECLARATORS */ - { triangle *newtriangle; @@ -4428,19 +4277,12 @@ struct mesh *m; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void subsegdealloc(struct mesh *m, subseg *dyingsubseg) -#else /* not ANSI_DECLARATORS */ -void subsegdealloc(m, dyingsubseg) -struct mesh *m; -subseg *dyingsubseg; -#endif /* not ANSI_DECLARATORS */ - { /* Mark the subsegment as dead. This makes it possible to detect dead */ /* subsegments when traversing the list of all subsegments. */ killsubseg(dyingsubseg); - pooldealloc(&m->subsegs, (VOID *) dyingsubseg); + pooldealloc(&m->subsegs, (void *) dyingsubseg); } /*****************************************************************************/ @@ -4449,13 +4291,7 @@ subseg *dyingsubseg; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS subseg *subsegtraverse(struct mesh *m) -#else /* not ANSI_DECLARATORS */ -subseg *subsegtraverse(m) -struct mesh *m; -#endif /* not ANSI_DECLARATORS */ - { subseg *newsubseg; @@ -4474,19 +4310,12 @@ struct mesh *m; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void vertexdealloc(struct mesh *m, vertex dyingvertex) -#else /* not ANSI_DECLARATORS */ -void vertexdealloc(m, dyingvertex) -struct mesh *m; -vertex dyingvertex; -#endif /* not ANSI_DECLARATORS */ - { /* Mark the vertex as dead. This makes it possible to detect dead */ /* vertices when traversing the list of all vertices. */ setvertextype(dyingvertex, DEADVERTEX); - pooldealloc(&m->vertices, (VOID *) dyingvertex); + pooldealloc(&m->vertices, (void *) dyingvertex); } /*****************************************************************************/ @@ -4495,13 +4324,7 @@ vertex dyingvertex; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS vertex vertextraverse(struct mesh *m) -#else /* not ANSI_DECLARATORS */ -vertex vertextraverse(m) -struct mesh *m; -#endif /* not ANSI_DECLARATORS */ - { vertex newvertex; @@ -4523,19 +4346,12 @@ struct mesh *m; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void badsubsegdealloc(struct mesh *m, struct badsubseg *dyingseg) -#else /* not ANSI_DECLARATORS */ -void badsubsegdealloc(m, dyingseg) -struct mesh *m; -struct badsubseg *dyingseg; -#endif /* not ANSI_DECLARATORS */ - { /* Set subsegment's origin to NULL. This makes it possible to detect dead */ /* badsubsegs when traversing the list of all badsubsegs . */ dyingseg->subsegorg = (vertex) NULL; - pooldealloc(&m->badsubsegs, (VOID *) dyingseg); + pooldealloc(&m->badsubsegs, (void *) dyingseg); } #endif /* not CDT_ONLY */ @@ -4548,13 +4364,7 @@ struct badsubseg *dyingseg; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS struct badsubseg *badsubsegtraverse(struct mesh *m) -#else /* not ANSI_DECLARATORS */ -struct badsubseg *badsubsegtraverse(m) -struct mesh *m; -#endif /* not ANSI_DECLARATORS */ - { struct badsubseg *newseg; @@ -4581,19 +4391,11 @@ struct mesh *m; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS vertex getvertex(struct mesh *m, struct behavior *b, int number) -#else /* not ANSI_DECLARATORS */ -vertex getvertex(m, b, number) -struct mesh *m; -struct behavior *b; -int number; -#endif /* not ANSI_DECLARATORS */ - { - VOID **getblock; + void **getblock; char *foundvertex; - INT_PTR alignptr = 0; + intptr_t alignptr = 0; int current; getblock = m->vertices.firstblock; @@ -4601,18 +4403,18 @@ int number; /* Find the right block. */ if (current + m->vertices.itemsfirstblock <= number) { - getblock = (VOID **) *getblock; + getblock = (void **) *getblock; current += m->vertices.itemsfirstblock; while (current + m->vertices.itemsperblock <= number) { - getblock = (VOID **) *getblock; + getblock = (void **) *getblock; current += m->vertices.itemsperblock; } } /* Now find the right vertex. */ - alignptr = (INT_PTR) (getblock + 1); - foundvertex = (char *) (alignptr + (INT_PTR) m->vertices.alignbytes - - (alignptr % (INT_PTR) m->vertices.alignbytes)); + alignptr = (intptr_t) (getblock + 1); + foundvertex = (char *) (alignptr + (intptr_t) m->vertices.alignbytes - + (alignptr % (intptr_t) m->vertices.alignbytes)); return (vertex) (foundvertex + m->vertices.itembytes * (number - current)); } @@ -4622,20 +4424,13 @@ int number; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void triangledeinit(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void triangledeinit(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { pooldeinit(&m->triangles); - trifree((VOID *) m->dummytribase); + trifree((void *) m->dummytribase); if (b->usesegments) { pooldeinit(&m->subsegs); - trifree((VOID *) m->dummysubbase); + trifree((void *) m->dummysubbase); } pooldeinit(&m->vertices); #ifndef CDT_ONLY @@ -4663,15 +4458,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void maketriangle(struct mesh *m, struct behavior *b, struct otri *newotri) -#else /* not ANSI_DECLARATORS */ -void maketriangle(m, b, newotri) -struct mesh *m; -struct behavior *b; -struct otri *newotri; -#endif /* not ANSI_DECLARATORS */ - { int i; @@ -4707,14 +4494,7 @@ struct otri *newotri; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void makesubseg(struct mesh *m, struct osub *newsubseg) -#else /* not ANSI_DECLARATORS */ -void makesubseg(m, newsubseg) -struct mesh *m; -struct osub *newsubseg; -#endif /* not ANSI_DECLARATORS */ - { newsubseg->ss = (subseg *) poolalloc(&m->subsegs); /* Initialize the two adjoining subsegments to be the omnipresent */ @@ -4965,17 +4745,7 @@ void exactinit() /*****************************************************************************/ static -#ifdef ANSI_DECLARATORS int fast_expansion_sum_zeroelim(int elen, REAL *e, int flen, REAL *f, REAL *h) -#else /* not ANSI_DECLARATORS */ -int fast_expansion_sum_zeroelim(elen, e, flen, f, h) /* h cannot be e or f. */ -int elen; -REAL *e; -int flen; -REAL *f; -REAL *h; -#endif /* not ANSI_DECLARATORS */ - { REAL Q; INEXACT REAL Qnew; @@ -5059,17 +4829,7 @@ REAL *h; /* */ /*****************************************************************************/ -static -#ifdef ANSI_DECLARATORS int scale_expansion_zeroelim(int elen, REAL *e, REAL b, REAL *h) -#else /* not ANSI_DECLARATORS */ -int scale_expansion_zeroelim(elen, e, b, h) /* e and h cannot be the same. */ -int elen; -REAL *e; -REAL b; -REAL *h; -#endif /* not ANSI_DECLARATORS */ - { INEXACT REAL Q, sum; REAL hh; @@ -5117,14 +4877,7 @@ REAL *h; /*****************************************************************************/ static -#ifdef ANSI_DECLARATORS REAL estimate(int elen, REAL *e) -#else /* not ANSI_DECLARATORS */ -REAL estimate(elen, e) -int elen; -REAL *e; -#endif /* not ANSI_DECLARATORS */ - { REAL Q; int eindex; @@ -5156,16 +4909,7 @@ REAL *e; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS REAL counterclockwiseadapt(vertex pa, vertex pb, vertex pc, REAL detsum) -#else /* not ANSI_DECLARATORS */ -REAL counterclockwiseadapt(pa, pb, pc, detsum) -vertex pa; -vertex pb; -vertex pc; -REAL detsum; -#endif /* not ANSI_DECLARATORS */ - { INEXACT REAL acx, acy, bcx, bcy; REAL acxtail, acytail, bcxtail, bcytail; @@ -5245,18 +4989,8 @@ REAL detsum; return(D[Dlength - 1]); } -#ifdef ANSI_DECLARATORS REAL counterclockwise(struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc) -#else /* not ANSI_DECLARATORS */ -REAL counterclockwise(m, b, pa, pb, pc) -struct mesh *m; -struct behavior *b; -vertex pa; -vertex pb; -vertex pc; -#endif /* not ANSI_DECLARATORS */ - { REAL detleft, detright, det; REAL detsum, errbound; @@ -5315,17 +5049,7 @@ vertex pc; /*****************************************************************************/ static -#ifdef ANSI_DECLARATORS REAL incircleadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL permanent) -#else /* not ANSI_DECLARATORS */ -REAL incircleadapt(pa, pb, pc, pd, permanent) -vertex pa; -vertex pb; -vertex pc; -vertex pd; -REAL permanent; -#endif /* not ANSI_DECLARATORS */ - { INEXACT REAL adx, bdx, cdx, ady, bdy, cdy; REAL det, errbound; @@ -5895,19 +5619,8 @@ REAL permanent; } static -#ifdef ANSI_DECLARATORS REAL incircle(struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc, vertex pd) -#else /* not ANSI_DECLARATORS */ -REAL incircle(m, b, pa, pb, pc, pd) -struct mesh *m; -struct behavior *b; -vertex pa; -vertex pb; -vertex pc; -vertex pd; -#endif /* not ANSI_DECLARATORS */ - { REAL adx, bdx, cdx, ady, bdy, cdy; REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady; @@ -5978,23 +5691,9 @@ vertex pd; /*****************************************************************************/ static -#ifdef ANSI_DECLARATORS REAL orient3dadapt(vertex pa, vertex pb, vertex pc, vertex pd, REAL aheight, REAL bheight, REAL cheight, REAL dheight, REAL permanent) -#else /* not ANSI_DECLARATORS */ -REAL orient3dadapt(pa, pb, pc, pd, - aheight, bheight, cheight, dheight, permanent) -vertex pa; -vertex pb; -vertex pc; -vertex pd; -REAL aheight; -REAL bheight; -REAL cheight; -REAL dheight; -REAL permanent; -#endif /* not ANSI_DECLARATORS */ { INEXACT REAL adx, bdx, cdx, ady, bdy, cdy, adheight, bdheight, cdheight; @@ -6404,24 +6103,9 @@ REAL permanent; } static -#ifdef ANSI_DECLARATORS REAL orient3d(struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc, vertex pd, REAL aheight, REAL bheight, REAL cheight, REAL dheight) -#else /* not ANSI_DECLARATORS */ -REAL orient3d(m, b, pa, pb, pc, pd, aheight, bheight, cheight, dheight) -struct mesh *m; -struct behavior *b; -vertex pa; -vertex pb; -vertex pc; -vertex pd; -REAL aheight; -REAL bheight; -REAL cheight; -REAL dheight; -#endif /* not ANSI_DECLARATORS */ - { REAL adx, bdx, cdx, ady, bdy, cdy, adheight, bdheight, cdheight; REAL bdxcdy, cdxbdy, cdxady, adxcdy, adxbdy, bdxady; @@ -6487,18 +6171,8 @@ REAL dheight; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS REAL nonregular(struct mesh *m, struct behavior *b, vertex pa, vertex pb, vertex pc, vertex pd) -#else /* not ANSI_DECLARATORS */ -REAL nonregular(m, b, pa, pb, pc, pd) -struct mesh *m; -struct behavior *b; -vertex pa; -vertex pb; -vertex pc; -vertex pd; -#endif /* not ANSI_DECLARATORS */ { if (b->weighted == 0) { @@ -6528,24 +6202,9 @@ vertex pd; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void findcircumcenter(struct mesh *m, struct behavior *b, vertex torg, vertex tdest, vertex tapex, vertex circumcenter, REAL *xi, REAL *eta, int offcenter) -#else /* not ANSI_DECLARATORS */ -void findcircumcenter(m, b, torg, tdest, tapex, circumcenter, xi, eta, - offcenter) -struct mesh *m; -struct behavior *b; -vertex torg; -vertex tdest; -vertex tapex; -vertex circumcenter; -REAL *xi; -REAL *eta; -int offcenter; -#endif /* not ANSI_DECLARATORS */ - { REAL xdo, ydo, xao, yao; REAL dodist, aodist, dadist; @@ -6642,13 +6301,7 @@ int offcenter; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void triangleinit(struct mesh *m) -#else /* not ANSI_DECLARATORS */ -void triangleinit(m) -struct mesh *m; -#endif /* not ANSI_DECLARATORS */ - { poolzero(&m->vertices); poolzero(&m->triangles); @@ -6681,13 +6334,7 @@ struct mesh *m; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS unsigned long randomnation(unsigned int choices) -#else /* not ANSI_DECLARATORS */ -unsigned long randomnation(choices) -unsigned int choices; -#endif /* not ANSI_DECLARATORS */ - { randomseed = (randomseed * 1366l + 150889l) % 714025l; return randomseed / (714025l / choices + 1); @@ -6705,14 +6352,7 @@ unsigned int choices; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void checkmesh(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void checkmesh(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri triangleloop; struct otri oppotri, oppooppotri; @@ -6804,14 +6444,7 @@ struct behavior *b; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void checkdelaunay(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void checkdelaunay(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri triangleloop; struct otri oppotri; @@ -6914,16 +6547,8 @@ struct behavior *b; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void enqueuebadtriang(struct mesh *m, struct behavior *b, struct badtriang *badtri) -#else /* not ANSI_DECLARATORS */ -void enqueuebadtriang(m, b, badtri) -struct mesh *m; -struct behavior *b; -struct badtriang *badtri; -#endif /* not ANSI_DECLARATORS */ - { REAL length, multiplier; int exponent, expincrement; @@ -7020,20 +6645,8 @@ struct badtriang *badtri; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void enqueuebadtri(struct mesh *m, struct behavior *b, struct otri *enqtri, REAL minedge, vertex enqapex, vertex enqorg, vertex enqdest) -#else /* not ANSI_DECLARATORS */ -void enqueuebadtri(m, b, enqtri, minedge, enqapex, enqorg, enqdest) -struct mesh *m; -struct behavior *b; -struct otri *enqtri; -REAL minedge; -vertex enqapex; -vertex enqorg; -vertex enqdest; -#endif /* not ANSI_DECLARATORS */ - { struct badtriang *newbad; @@ -7057,13 +6670,7 @@ vertex enqdest; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS struct badtriang *dequeuebadtriang(struct mesh *m) -#else /* not ANSI_DECLARATORS */ -struct badtriang *dequeuebadtriang(m) -struct mesh *m; -#endif /* not ANSI_DECLARATORS */ - { struct badtriang *result; @@ -7110,16 +6717,8 @@ struct mesh *m; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS int checkseg4encroach(struct mesh *m, struct behavior *b, struct osub *testsubseg) -#else /* not ANSI_DECLARATORS */ -int checkseg4encroach(m, b, testsubseg) -struct mesh *m; -struct behavior *b; -struct osub *testsubseg; -#endif /* not ANSI_DECLARATORS */ - { struct otri neighbortri; struct osub testsym; @@ -7223,15 +6822,7 @@ struct osub *testsubseg; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void testtriangle(struct mesh *m, struct behavior *b, struct otri *testtri) -#else /* not ANSI_DECLARATORS */ -void testtriangle(m, b, testtri) -struct mesh *m; -struct behavior *b; -struct otri *testtri; -#endif /* not ANSI_DECLARATORS */ - { struct otri tri1, tri2; struct osub testsub; @@ -7409,14 +7000,7 @@ struct otri *testtri; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void makevertexmap(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void makevertexmap(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri triangleloop; vertex triorg; @@ -7504,19 +7088,9 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS enum locateresult preciselocate(struct mesh *m, struct behavior *b, vertex searchpoint, struct otri *searchtri, int stopatsubsegment) -#else /* not ANSI_DECLARATORS */ -enum locateresult preciselocate(m, b, searchpoint, searchtri, stopatsubsegment) -struct mesh *m; -struct behavior *b; -vertex searchpoint; -struct otri *searchtri; -int stopatsubsegment; -#endif /* not ANSI_DECLARATORS */ - { struct otri backtracktri; struct osub checkedge; @@ -7648,23 +7222,14 @@ int stopatsubsegment; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS enum locateresult locate(struct mesh *m, struct behavior *b, vertex searchpoint, struct otri *searchtri) -#else /* not ANSI_DECLARATORS */ -enum locateresult locate(m, b, searchpoint, searchtri) -struct mesh *m; -struct behavior *b; -vertex searchpoint; -struct otri *searchtri; -#endif /* not ANSI_DECLARATORS */ - { - VOID **sampleblock; + void **sampleblock; char *firsttri; struct otri sampletri; vertex torg, tdest; - INT_PTR alignptr = 0; + intptr_t alignptr = 0; REAL searchdist, dist; REAL ahead; long samplesperblock, totalsamplesleft, samplesleft; @@ -7736,11 +7301,11 @@ struct otri *searchtri; population = totalpopulation; } /* Find a pointer to the first triangle in the block. */ - alignptr = (INT_PTR) (sampleblock + 1); + alignptr = (intptr_t) (sampleblock + 1); firsttri = (char *) (alignptr + - (INT_PTR) m->triangles.alignbytes - + (intptr_t) m->triangles.alignbytes - (alignptr % - (INT_PTR) m->triangles.alignbytes)); + (intptr_t) m->triangles.alignbytes)); /* Choose `samplesleft' randomly sampled triangles in this block. */ do { @@ -7766,7 +7331,7 @@ struct otri *searchtri; } while ((samplesleft > 0) && (totalsamplesleft > 0)); if (totalsamplesleft > 0) { - sampleblock = (VOID **) *sampleblock; + sampleblock = (void **) *sampleblock; samplesleft = samplesperblock; totalpopulation -= population; population = TRIPERBLOCK; @@ -7819,17 +7384,8 @@ struct otri *searchtri; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void insertsubseg(struct mesh *m, struct behavior *b, struct otri *tri, int subsegmark) -#else /* not ANSI_DECLARATORS */ -void insertsubseg(m, b, tri, subsegmark) -struct mesh *m; -struct behavior *b; -struct otri *tri; /* Edge at which to insert the new subsegment. */ -int subsegmark; /* Marker for the new subsegment. */ -#endif /* not ANSI_DECLARATORS */ - { struct otri oppotri; struct osub newsubseg; @@ -7923,14 +7479,7 @@ int subsegmark; /* Marker for the new subsegment. */ /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void flip(struct mesh *m, struct behavior *b, struct otri *flipedge) -#else /* not ANSI_DECLARATORS */ -void flip(m, b, flipedge) -struct mesh *m; -struct behavior *b; -struct otri *flipedge; /* Handle for the triangle abc. */ -#endif /* not ANSI_DECLARATORS */ { struct otri botleft, botright; @@ -8058,14 +7607,7 @@ struct otri *flipedge; /* Handle for the triangle abc. */ /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void unflip(struct mesh *m, struct behavior *b, struct otri *flipedge) -#else /* not ANSI_DECLARATORS */ -void unflip(m, b, flipedge) -struct mesh *m; -struct behavior *b; -struct otri *flipedge; /* Handle for the triangle abc. */ -#endif /* not ANSI_DECLARATORS */ { struct otri botleft, botright; @@ -8207,23 +7749,10 @@ struct otri *flipedge; /* Handle for the triangle abc. */ /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS enum insertvertexresult insertvertex(struct mesh *m, struct behavior *b, vertex newvertex, struct otri *searchtri, struct osub *splitseg, int segmentflaws, int triflaws) -#else /* not ANSI_DECLARATORS */ -enum insertvertexresult insertvertex(m, b, newvertex, searchtri, splitseg, - segmentflaws, triflaws) -struct mesh *m; -struct behavior *b; -vertex newvertex; -struct otri *searchtri; -struct osub *splitseg; -int segmentflaws; -int triflaws; -#endif /* not ANSI_DECLARATORS */ - { struct otri horiz; struct otri top; @@ -8864,21 +8393,9 @@ int triflaws; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void triangulatepolygon(struct mesh *m, struct behavior *b, struct otri *firstedge, struct otri *lastedge, int edgecount, int doflip, int triflaws) -#else /* not ANSI_DECLARATORS */ -void triangulatepolygon(m, b, firstedge, lastedge, edgecount, doflip, triflaws) -struct mesh *m; -struct behavior *b; -struct otri *firstedge; -struct otri *lastedge; -int edgecount; -int doflip; -int triflaws; -#endif /* not ANSI_DECLARATORS */ - { struct otri testtri; struct otri besttri; @@ -8963,15 +8480,7 @@ int triflaws; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void deletevertex(struct mesh *m, struct behavior *b, struct otri *deltri) -#else /* not ANSI_DECLARATORS */ -void deletevertex(m, b, deltri) -struct mesh *m; -struct behavior *b; -struct otri *deltri; -#endif /* not ANSI_DECLARATORS */ - { struct otri countingtri; struct otri firstedge, lastedge; @@ -9066,14 +8575,7 @@ struct otri *deltri; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void undovertex(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void undovertex(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri fliptri; struct otri botleft, botright, topright; @@ -9213,14 +8715,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void vertexsort(vertex *sortarray, int arraysize) -#else /* not ANSI_DECLARATORS */ -void vertexsort(sortarray, arraysize) -vertex *sortarray; -int arraysize; -#endif /* not ANSI_DECLARATORS */ - { int left, right; int pivot; @@ -9287,16 +8782,7 @@ int arraysize; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void vertexmedian(vertex *sortarray, int arraysize, int median, int axis) -#else /* not ANSI_DECLARATORS */ -void vertexmedian(sortarray, arraysize, median, axis) -vertex *sortarray; -int arraysize; -int median; -int axis; -#endif /* not ANSI_DECLARATORS */ - { int left, right; int pivot; @@ -9365,15 +8851,7 @@ int axis; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void alternateaxes(vertex *sortarray, int arraysize, int axis) -#else /* not ANSI_DECLARATORS */ -void alternateaxes(sortarray, arraysize, axis) -vertex *sortarray; -int arraysize; -int axis; -#endif /* not ANSI_DECLARATORS */ - { int divider; @@ -9429,21 +8907,9 @@ int axis; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void mergehulls(struct mesh *m, struct behavior *b, struct otri *farleft, struct otri *innerleft, struct otri *innerright, struct otri *farright, int axis) -#else /* not ANSI_DECLARATORS */ -void mergehulls(m, b, farleft, innerleft, innerright, farright, axis) -struct mesh *m; -struct behavior *b; -struct otri *farleft; -struct otri *innerleft; -struct otri *innerright; -struct otri *farright; -int axis; -#endif /* not ANSI_DECLARATORS */ - { struct otri leftcand, rightcand; struct otri baseedge; @@ -9756,21 +9222,9 @@ int axis; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void divconqrecurse(struct mesh *m, struct behavior *b, vertex *sortarray, int vertices, int axis, struct otri *farleft, struct otri *farright) -#else /* not ANSI_DECLARATORS */ -void divconqrecurse(m, b, sortarray, vertices, axis, farleft, farright) -struct mesh *m; -struct behavior *b; -vertex *sortarray; -int vertices; -int axis; -struct otri *farleft; -struct otri *farright; -#endif /* not ANSI_DECLARATORS */ - { struct otri midtri, tri1, tri2, tri3; struct otri innerleft, innerright; @@ -9920,15 +9374,7 @@ struct otri *farright; } } -#ifdef ANSI_DECLARATORS long removeghosts(struct mesh *m, struct behavior *b, struct otri *startghost) -#else /* not ANSI_DECLARATORS */ -long removeghosts(m, b, startghost) -struct mesh *m; -struct behavior *b; -struct otri *startghost; -#endif /* not ANSI_DECLARATORS */ - { struct otri searchedge; struct otri dissolveedge; @@ -9983,14 +9429,7 @@ struct otri *startghost; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS long divconqdelaunay(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -long divconqdelaunay(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { vertex *sortarray; struct otri hullleft, hullright; @@ -10044,7 +9483,7 @@ struct behavior *b; /* Form the Delaunay triangulation. */ divconqrecurse(m, b, sortarray, i, 0, &hullleft, &hullright); - trifree((VOID *) sortarray); + trifree((void *) sortarray); return removeghosts(m, b, &hullleft); } @@ -10070,14 +9509,7 @@ struct behavior *b; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void boundingbox(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void boundingbox(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri inftri; /* Handle for the triangular bounding box. */ REAL width; @@ -10136,14 +9568,7 @@ struct behavior *b; #ifndef REDUCED -#ifdef ANSI_DECLARATORS long removebox(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -long removebox(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri deadtriangle; struct otri searchedge; @@ -10215,9 +9640,9 @@ struct behavior *b; } triangledealloc(m, finaledge.tri); - trifree((VOID *) m->infvertex1); /* Deallocate the bounding box vertices. */ - trifree((VOID *) m->infvertex2); - trifree((VOID *) m->infvertex3); + trifree((void *) m->infvertex1); /* Deallocate the bounding box vertices. */ + trifree((void *) m->infvertex2); + trifree((void *) m->infvertex3); return hullsize; } @@ -10235,14 +9660,7 @@ struct behavior *b; #ifndef REDUCED -#ifdef ANSI_DECLARATORS long incrementaldelaunay(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -long incrementaldelaunay(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri starttri; vertex vertexloop; @@ -10284,15 +9702,7 @@ struct behavior *b; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void eventheapinsert(struct event **heap, int heapsize, struct event *newevent) -#else /* not ANSI_DECLARATORS */ -void eventheapinsert(heap, heapsize, newevent) -struct event **heap; -int heapsize; -struct event *newevent; -#endif /* not ANSI_DECLARATORS */ - { REAL eventx, eventy; int eventnum; @@ -10325,15 +9735,7 @@ struct event *newevent; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void eventheapify(struct event **heap, int heapsize, int eventnum) -#else /* not ANSI_DECLARATORS */ -void eventheapify(heap, heapsize, eventnum) -struct event **heap; -int heapsize; -int eventnum; -#endif /* not ANSI_DECLARATORS */ - { struct event *thisevent; REAL eventx, eventy; @@ -10381,15 +9783,7 @@ int eventnum; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void eventheapdelete(struct event **heap, int heapsize, int eventnum) -#else /* not ANSI_DECLARATORS */ -void eventheapdelete(heap, heapsize, eventnum) -struct event **heap; -int heapsize; -int eventnum; -#endif /* not ANSI_DECLARATORS */ - { struct event *moveevent; REAL eventx, eventy; @@ -10424,17 +9818,8 @@ int eventnum; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void createeventheap(struct mesh *m, struct event ***eventheap, struct event **events, struct event **freeevents) -#else /* not ANSI_DECLARATORS */ -void createeventheap(m, eventheap, events, freeevents) -struct mesh *m; -struct event ***eventheap; -struct event **events; -struct event **freeevents; -#endif /* not ANSI_DECLARATORS */ - { vertex thisvertex; int maxevents; @@ -10447,14 +9832,14 @@ struct event **freeevents; traversalinit(&m->vertices); for (i = 0; i < m->invertices; i++) { thisvertex = vertextraverse(m); - (*events)[i].eventptr = (VOID *) thisvertex; + (*events)[i].eventptr = (void *) thisvertex; (*events)[i].xkey = thisvertex[0]; (*events)[i].ykey = thisvertex[1]; eventheapinsert(*eventheap, i, *events + i); } *freeevents = (struct event *) NULL; for (i = maxevents - 1; i >= m->invertices; i--) { - (*events)[i].eventptr = (VOID *) *freeevents; + (*events)[i].eventptr = (void *) *freeevents; *freeevents = *events + i; } } @@ -10463,15 +9848,7 @@ struct event **freeevents; #ifndef REDUCED -#ifdef ANSI_DECLARATORS int rightofhyperbola(struct mesh *m, struct otri *fronttri, vertex newsite) -#else /* not ANSI_DECLARATORS */ -int rightofhyperbola(m, fronttri, newsite) -struct mesh *m; -struct otri *fronttri; -vertex newsite; -#endif /* not ANSI_DECLARATORS */ - { vertex leftvertex, rightvertex; REAL dxa, dya, dxb, dyb; @@ -10502,17 +9879,7 @@ vertex newsite; #ifndef REDUCED -#ifdef ANSI_DECLARATORS REAL circletop(struct mesh *m, vertex pa, vertex pb, vertex pc, REAL ccwabc) -#else /* not ANSI_DECLARATORS */ -REAL circletop(m, pa, pb, pc, ccwabc) -struct mesh *m; -vertex pa; -vertex pb; -vertex pc; -REAL ccwabc; -#endif /* not ANSI_DECLARATORS */ - { REAL xac, yac, xbc, ybc, xab, yab; REAL aclen2, bclen2, ablen2; @@ -10536,17 +9903,8 @@ REAL ccwabc; #ifndef REDUCED -#ifdef ANSI_DECLARATORS void check4deadevent(struct otri *checktri, struct event **freeevents, struct event **eventheap, int *heapsize) -#else /* not ANSI_DECLARATORS */ -void check4deadevent(checktri, freeevents, eventheap, heapsize) -struct otri *checktri; -struct event **freeevents; -struct event **eventheap; -int *heapsize; -#endif /* not ANSI_DECLARATORS */ - { struct event *deadevent; vertex eventvertex; @@ -10556,7 +9914,7 @@ int *heapsize; if (eventvertex != (vertex) NULL) { deadevent = (struct event *) eventvertex; eventnum = deadevent->heapposition; - deadevent->eventptr = (VOID *) *freeevents; + deadevent->eventptr = (void *) *freeevents; *freeevents = deadevent; eventheapdelete(eventheap, *heapsize, eventnum); (*heapsize)--; @@ -10568,17 +9926,8 @@ int *heapsize; #ifndef REDUCED -#ifdef ANSI_DECLARATORS struct splaynode *splay(struct mesh *m, struct splaynode *splaytree, vertex searchpoint, struct otri *searchtri) -#else /* not ANSI_DECLARATORS */ -struct splaynode *splay(m, splaytree, searchpoint, searchtri) -struct mesh *m; -struct splaynode *splaytree; -vertex searchpoint; -struct otri *searchtri; -#endif /* not ANSI_DECLARATORS */ - { struct splaynode *child, *grandchild; struct splaynode *lefttree, *righttree; @@ -10658,7 +10007,7 @@ struct otri *searchtri; lefttree = splay(m, splaytree->lchild, searchpoint, searchtri); righttree = splay(m, splaytree->rchild, searchpoint, searchtri); - pooldealloc(&m->splaynodes, (VOID *) splaytree); + pooldealloc(&m->splaynodes, (void *) splaytree); if (lefttree == (struct splaynode *) NULL) { return righttree; } else if (righttree == (struct splaynode *) NULL) { @@ -10687,17 +10036,8 @@ struct otri *searchtri; #ifndef REDUCED -#ifdef ANSI_DECLARATORS struct splaynode *splayinsert(struct mesh *m, struct splaynode *splayroot, struct otri *newkey, vertex searchpoint) -#else /* not ANSI_DECLARATORS */ -struct splaynode *splayinsert(m, splayroot, newkey, searchpoint) -struct mesh *m; -struct splaynode *splayroot; -struct otri *newkey; -vertex searchpoint; -#endif /* not ANSI_DECLARATORS */ - { struct splaynode *newsplaynode; @@ -10723,23 +10063,10 @@ vertex searchpoint; #ifndef REDUCED -#ifdef ANSI_DECLARATORS struct splaynode *circletopinsert(struct mesh *m, struct behavior *b, struct splaynode *splayroot, struct otri *newkey, vertex pa, vertex pb, vertex pc, REAL topy) -#else /* not ANSI_DECLARATORS */ -struct splaynode *circletopinsert(m, b, splayroot, newkey, pa, pb, pc, topy) -struct mesh *m; -struct behavior *b; -struct splaynode *splayroot; -struct otri *newkey; -vertex pa; -vertex pb; -vertex pc; -REAL topy; -#endif /* not ANSI_DECLARATORS */ - { REAL ccwabc; REAL xac, yac, xbc, ybc; @@ -10764,21 +10091,9 @@ REAL topy; #ifndef REDUCED -#ifdef ANSI_DECLARATORS struct splaynode *frontlocate(struct mesh *m, struct splaynode *splayroot, struct otri *bottommost, vertex searchvertex, struct otri *searchtri, int *farright) -#else /* not ANSI_DECLARATORS */ -struct splaynode *frontlocate(m, splayroot, bottommost, searchvertex, - searchtri, farright) -struct mesh *m; -struct splaynode *splayroot; -struct otri *bottommost; -vertex searchvertex; -struct otri *searchtri; -int *farright; -#endif /* not ANSI_DECLARATORS */ - { int farrightflag; triangle ptr; /* Temporary variable used by onext(). */ @@ -10799,14 +10114,7 @@ int *farright; #ifndef REDUCED -#ifdef ANSI_DECLARATORS long sweeplinedelaunay(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -long sweeplinedelaunay(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct event **eventheap; struct event *events; @@ -10851,7 +10159,7 @@ struct behavior *b; lprevself(righttri); bond(lefttri, righttri); firstvertex = (vertex) eventheap[0]->eventptr; - eventheap[0]->eventptr = (VOID *) freeevents; + eventheap[0]->eventptr = (void *) freeevents; freeevents = eventheap[0]; eventheapdelete(eventheap, heapsize, 0); heapsize--; @@ -10861,7 +10169,7 @@ struct behavior *b; triexit(1); } secondvertex = (vertex) eventheap[0]->eventptr; - eventheap[0]->eventptr = (VOID *) freeevents; + eventheap[0]->eventptr = (void *) freeevents; freeevents = eventheap[0]; eventheapdelete(eventheap, heapsize, 0); heapsize--; @@ -10969,7 +10277,7 @@ struct behavior *b; } } } - nextevent->eventptr = (VOID *) freeevents; + nextevent->eventptr = (void *) freeevents; freeevents = nextevent; if (check4events) { @@ -10983,7 +10291,7 @@ struct behavior *b; newevent->xkey = m->xminextreme; newevent->ykey = circletop(m, leftvertex, midvertex, rightvertex, lefttest); - newevent->eventptr = (VOID *) encode(lefttri); + newevent->eventptr = (void *) encode(lefttri); eventheapinsert(eventheap, heapsize, newevent); heapsize++; setorg(lefttri, newevent); @@ -10998,7 +10306,7 @@ struct behavior *b; newevent->xkey = m->xminextreme; newevent->ykey = circletop(m, leftvertex, midvertex, rightvertex, righttest); - newevent->eventptr = (VOID *) encode(farrighttri); + newevent->eventptr = (void *) encode(farrighttri); eventheapinsert(eventheap, heapsize, newevent); heapsize++; setorg(farrighttri, newevent); @@ -11027,14 +10335,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS long delaunay(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -long delaunay(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { long hulledges; @@ -11104,42 +10405,15 @@ struct behavior *b; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS int reconstruct(struct mesh *m, struct behavior *b, int *trianglelist, REAL *triangleattriblist, REAL *trianglearealist, int elements, int corners, int attribs, int *segmentlist,int *segmentmarkerlist, int numberofsegments) -#else /* not ANSI_DECLARATORS */ -int reconstruct(m, b, trianglelist, triangleattriblist, trianglearealist, - elements, corners, attribs, segmentlist, segmentmarkerlist, - numberofsegments) -struct mesh *m; -struct behavior *b; -int *trianglelist; -REAL *triangleattriblist; -REAL *trianglearealist; -int elements; -int corners; -int attribs; -int *segmentlist; -int *segmentmarkerlist; -int numberofsegments; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS long reconstruct(struct mesh *m, struct behavior *b, char *elefilename, char *areafilename, char *polyfilename, FILE *polyfile) -#else /* not ANSI_DECLARATORS */ -long reconstruct(m, b, elefilename, areafilename, polyfilename, polyfile) -struct mesh *m; -struct behavior *b; -char *elefilename; -char *areafilename; -char *polyfilename; -FILE *polyfile; -#endif /* not ANSI_DECLARATORS */ #endif /* not TRILIBRARY */ @@ -11573,7 +10847,7 @@ FILE *polyfile; } } - trifree((VOID *) vertexarray); + trifree((void *) vertexarray); return hullsize; } @@ -11604,18 +10878,9 @@ FILE *polyfile; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS enum finddirectionresult finddirection(struct mesh *m, struct behavior *b, struct otri *searchtri, vertex searchpoint) -#else /* not ANSI_DECLARATORS */ -enum finddirectionresult finddirection(m, b, searchtri, searchpoint) -struct mesh *m; -struct behavior *b; -struct otri *searchtri; -vertex searchpoint; -#endif /* not ANSI_DECLARATORS */ - { struct otri checktri; vertex startvertex; @@ -11719,19 +10984,9 @@ vertex searchpoint; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void segmentintersection(struct mesh *m, struct behavior *b, struct otri *splittri, struct osub *splitsubseg, vertex endpoint2) -#else /* not ANSI_DECLARATORS */ -void segmentintersection(m, b, splittri, splitsubseg, endpoint2) -struct mesh *m; -struct behavior *b; -struct otri *splittri; -struct osub *splitsubseg; -vertex endpoint2; -#endif /* not ANSI_DECLARATORS */ - { struct osub opposubseg; vertex endpoint1; @@ -11846,18 +11101,8 @@ vertex endpoint2; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS int scoutsegment(struct mesh *m, struct behavior *b, struct otri *searchtri, vertex endpoint2, int newmark) -#else /* not ANSI_DECLARATORS */ -int scoutsegment(m, b, searchtri, endpoint2, newmark) -struct mesh *m; -struct behavior *b; -struct otri *searchtri; -vertex endpoint2; -int newmark; -#endif /* not ANSI_DECLARATORS */ - { struct otri crosstri; struct osub crosssubseg; @@ -11930,18 +11175,8 @@ int newmark; #ifndef REDUCED #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void conformingedge(struct mesh *m, struct behavior *b, vertex endpoint1, vertex endpoint2, int newmark) -#else /* not ANSI_DECLARATORS */ -void conformingedge(m, b, endpoint1, endpoint2, newmark) -struct mesh *m; -struct behavior *b; -vertex endpoint1; -vertex endpoint2; -int newmark; -#endif /* not ANSI_DECLARATORS */ - { struct otri searchtri1, searchtri2; struct osub brokensubseg; @@ -12060,17 +11295,8 @@ int newmark; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void delaunayfixup(struct mesh *m, struct behavior *b, struct otri *fixuptri, int leftside) -#else /* not ANSI_DECLARATORS */ -void delaunayfixup(m, b, fixuptri, leftside) -struct mesh *m; -struct behavior *b; -struct otri *fixuptri; -int leftside; -#endif /* not ANSI_DECLARATORS */ - { struct otri neartri; struct otri fartri; @@ -12180,18 +11406,8 @@ int leftside; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void constrainededge(struct mesh *m, struct behavior *b, struct otri *starttri, vertex endpoint2, int newmark) -#else /* not ANSI_DECLARATORS */ -void constrainededge(m, b, starttri, endpoint2, newmark) -struct mesh *m; -struct behavior *b; -struct otri *starttri; -vertex endpoint2; -int newmark; -#endif /* not ANSI_DECLARATORS */ - { struct otri fixuptri, fixuptri2; struct osub crosssubseg; @@ -12282,17 +11498,8 @@ int newmark; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void insertsegment(struct mesh *m, struct behavior *b, vertex endpoint1, vertex endpoint2, int newmark) -#else /* not ANSI_DECLARATORS */ -void insertsegment(m, b, endpoint1, endpoint2, newmark) -struct mesh *m; -struct behavior *b; -vertex endpoint1; -vertex endpoint2; -int newmark; -#endif /* not ANSI_DECLARATORS */ { struct otri searchtri1, searchtri2; @@ -12394,14 +11601,7 @@ int newmark; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void markhull(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void markhull(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri hulltri; struct otri nexttri; @@ -12440,31 +11640,13 @@ struct behavior *b; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void formskeleton(struct mesh *m, struct behavior *b, int *segmentlist, int *segmentmarkerlist, int numberofsegments) -#else /* not ANSI_DECLARATORS */ -void formskeleton(m, b, segmentlist, segmentmarkerlist, numberofsegments) -struct mesh *m; -struct behavior *b; -int *segmentlist; -int *segmentmarkerlist; -int numberofsegments; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS void formskeleton(struct mesh *m, struct behavior *b, FILE *polyfile, char *polyfilename) -#else /* not ANSI_DECLARATORS */ -void formskeleton(m, b, polyfile, polyfilename) -struct mesh *m; -struct behavior *b; -FILE *polyfile; -char *polyfilename; -#endif /* not ANSI_DECLARATORS */ - #endif /* not TRILIBRARY */ { @@ -12607,14 +11789,7 @@ char *polyfilename; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void infecthull(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void infecthull(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri hulltri; struct otri nexttri; @@ -12689,14 +11864,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void plague(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void plague(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri testtri; struct otri neighbor; @@ -12899,16 +12067,8 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void regionplague(struct mesh *m, struct behavior *b, REAL attribute, REAL area) -#else /* not ANSI_DECLARATORS */ -void regionplague(m, b, attribute, area) -struct mesh *m; -struct behavior *b; -REAL attribute; -REAL area; -#endif /* not ANSI_DECLARATORS */ { struct otri testtri; @@ -13012,18 +12172,8 @@ REAL area; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void carveholes(struct mesh *m, struct behavior *b, REAL *holelist, int holes, REAL *regionlist, int regions) -#else /* not ANSI_DECLARATORS */ -void carveholes(m, b, holelist, holes, regionlist, regions) -struct mesh *m; -struct behavior *b; -REAL *holelist; -int holes; -REAL *regionlist; -int regions; -#endif /* not ANSI_DECLARATORS */ { struct otri searchtri; @@ -13185,7 +12335,7 @@ int regions; pooldeinit(&m->viri); } if (regions > 0) { - trifree((VOID *) regiontris); + trifree((void *) regiontris); } } @@ -13206,14 +12356,7 @@ int regions; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void tallyencs(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void tallyencs(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct osub subsegloop; int dummy; @@ -13267,15 +12410,7 @@ void precisionerror() #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void splitencsegs(struct mesh *m, struct behavior *b, int triflaws) -#else /* not ANSI_DECLARATORS */ -void splitencsegs(m, b, triflaws) -struct mesh *m; -struct behavior *b; -int triflaws; -#endif /* not ANSI_DECLARATORS */ - { struct otri enctri; struct otri testtri; @@ -13479,14 +12614,7 @@ int triflaws; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void tallyfaces(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void tallyfaces(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri triangleloop; @@ -13515,16 +12643,8 @@ struct behavior *b; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void splittriangle(struct mesh *m, struct behavior *b, struct badtriang *badtri) -#else /* not ANSI_DECLARATORS */ -void splittriangle(m, b, badtri) -struct mesh *m; -struct behavior *b; -struct badtriang *badtri; -#endif /* not ANSI_DECLARATORS */ - { struct otri badotri; vertex borg, bdest, bapex; @@ -13644,14 +12764,7 @@ struct badtriang *badtri; #ifndef CDT_ONLY -#ifdef ANSI_DECLARATORS void enforcequality(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void enforcequality(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct badtriang *badtri; int i; @@ -13706,7 +12819,7 @@ struct behavior *b; splitencsegs(m, b, 1); } else { /* Return the bad triangle to the pool. */ - pooldealloc(&m->badtriangles, (VOID *) badtri); + pooldealloc(&m->badtriangles, (void *) badtri); } } } @@ -13743,14 +12856,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void highorder(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void highorder(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri triangleloop, trisym; struct osub checkmark; @@ -13768,7 +12874,7 @@ struct behavior *b; /* order elements. This ensures that the primary nodes (at the */ /* corners of elements) will occur earlier in the output files, and */ /* have lower indices, than the extra nodes. */ - m->vertices.deaditemstack = (VOID *) NULL; + m->vertices.deaditemstack = (void *) NULL; traversalinit(&m->triangles); triangleloop.tri = triangletraverse(m); @@ -13834,15 +12940,7 @@ struct behavior *b; #ifndef TRILIBRARY -#ifdef ANSI_DECLARATORS char *readline(char *string, FILE *infile, char *infilename) -#else /* not ANSI_DECLARATORS */ -char *readline(string, infile, infilename) -char *string; -FILE *infile; -char *infilename; -#endif /* not ANSI_DECLARATORS */ - { char *result; @@ -13878,13 +12976,7 @@ char *infilename; #ifndef TRILIBRARY -#ifdef ANSI_DECLARATORS char *findfield(char *string) -#else /* not ANSI_DECLARATORS */ -char *findfield(string) -char *string; -#endif /* not ANSI_DECLARATORS */ - { char *result; @@ -13919,18 +13011,8 @@ char *string; #ifndef TRILIBRARY -#ifdef ANSI_DECLARATORS void readnodes(struct mesh *m, struct behavior *b, char *nodefilename, char *polyfilename, FILE **polyfile) -#else /* not ANSI_DECLARATORS */ -void readnodes(m, b, nodefilename, polyfilename, polyfile) -struct mesh *m; -struct behavior *b; -char *nodefilename; -char *polyfilename; -FILE **polyfile; -#endif /* not ANSI_DECLARATORS */ - { FILE *infile; vertex vertexloop; @@ -14116,21 +13198,9 @@ FILE **polyfile; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void transfernodes(struct mesh *m, struct behavior *b, REAL *pointlist, REAL *pointattriblist, int *pointmarkerlist, int numberofpoints, int numberofpointattribs) -#else /* not ANSI_DECLARATORS */ -void transfernodes(m, b, pointlist, pointattriblist, pointmarkerlist, - numberofpoints, numberofpointattribs) -struct mesh *m; -struct behavior *b; -REAL *pointlist; -REAL *pointattriblist; -int *pointmarkerlist; -int numberofpoints; -int numberofpointattribs; -#endif /* not ANSI_DECLARATORS */ { vertex vertexloop; @@ -14201,22 +13271,9 @@ int numberofpointattribs; #ifndef TRILIBRARY -#ifdef ANSI_DECLARATORS void readholes(struct mesh *m, struct behavior *b, FILE *polyfile, char *polyfilename, REAL **hlist, int *holes, REAL **rlist, int *regions) -#else /* not ANSI_DECLARATORS */ -void readholes(m, b, polyfile, polyfilename, hlist, holes, rlist, regions) -struct mesh *m; -struct behavior *b; -FILE *polyfile; -char *polyfilename; -REAL **hlist; -int *holes; -REAL **rlist; -int *regions; -#endif /* not ANSI_DECLARATORS */ - { REAL *holelist; REAL *regionlist; @@ -14320,14 +13377,7 @@ int *regions; #ifndef TRILIBRARY -#ifdef ANSI_DECLARATORS void finishfile(FILE *outfile, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void finishfile(outfile, argc, argv) -FILE *outfile; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ { int i; @@ -14354,31 +13404,13 @@ char **argv; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void writenodes(struct mesh *m, struct behavior *b, REAL **pointlist, REAL **pointattriblist, int **pointmarkerlist) -#else /* not ANSI_DECLARATORS */ -void writenodes(m, b, pointlist, pointattriblist, pointmarkerlist) -struct mesh *m; -struct behavior *b; -REAL **pointlist; -REAL **pointattriblist; -int **pointmarkerlist; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS void writenodes(struct mesh *m, struct behavior *b, char *nodefilename, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void writenodes(m, b, nodefilename, argc, argv) -struct mesh *m; -struct behavior *b; -char *nodefilename; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ #endif /* not TRILIBRARY */ @@ -14494,13 +13526,7 @@ char **argv; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void numbernodes(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void numbernodes(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ { vertex vertexloop; @@ -14526,30 +13552,13 @@ struct behavior *b; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void writeelements(struct mesh *m, struct behavior *b, int **trianglelist, REAL **triangleattriblist) -#else /* not ANSI_DECLARATORS */ -void writeelements(m, b, trianglelist, triangleattriblist) -struct mesh *m; -struct behavior *b; -int **trianglelist; -REAL **triangleattriblist; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS void writeelements(struct mesh *m, struct behavior *b, char *elefilename, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void writeelements(m, b, elefilename, argc, argv) -struct mesh *m; -struct behavior *b; -char *elefilename; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ #endif /* not TRILIBRARY */ @@ -14667,36 +13676,14 @@ char **argv; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void writepoly(struct mesh *m, struct behavior *b, int **segmentlist, int **segmentmarkerlist) -#else /* not ANSI_DECLARATORS */ -void writepoly(m, b, segmentlist, segmentmarkerlist) -struct mesh *m; -struct behavior *b; -int **segmentlist; -int **segmentmarkerlist; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS void writepoly(struct mesh *m, struct behavior *b, char *polyfilename, REAL *holelist, int holes, REAL *regionlist, int regions, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void writepoly(m, b, polyfilename, holelist, holes, regionlist, regions, - argc, argv) -struct mesh *m; -struct behavior *b; -char *polyfilename; -REAL *holelist; -int holes; -REAL *regionlist; -int regions; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ #endif /* not TRILIBRARY */ @@ -14813,31 +13800,13 @@ char **argv; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void writeedges(struct mesh *m, struct behavior *b, int **edgelist, int **edgemarkerlist) -#else /* not ANSI_DECLARATORS */ -void writeedges(m, b, edgelist, edgemarkerlist) -struct mesh *m; -struct behavior *b; -int **edgelist; -int **edgemarkerlist; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS void writeedges(struct mesh *m, struct behavior *b, char *edgefilename, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void writeedges(m, b, edgefilename, argc, argv) -struct mesh *m; -struct behavior *b; -char *edgefilename; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ - #endif /* not TRILIBRARY */ { @@ -14967,38 +13936,14 @@ char **argv; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void writevoronoi(struct mesh *m, struct behavior *b, REAL **vpointlist, REAL **vpointattriblist, int **vpointmarkerlist, int **vedgelist, int **vedgemarkerlist, REAL **vnormlist) -#else /* not ANSI_DECLARATORS */ -void writevoronoi(m, b, vpointlist, vpointattriblist, vpointmarkerlist, - vedgelist, vedgemarkerlist, vnormlist) -struct mesh *m; -struct behavior *b; -REAL **vpointlist; -REAL **vpointattriblist; -int **vpointmarkerlist; -int **vedgelist; -int **vedgemarkerlist; -REAL **vnormlist; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS void writevoronoi(struct mesh *m, struct behavior *b, char *vnodefilename, char *vedgefilename, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void writevoronoi(m, b, vnodefilename, vedgefilename, argc, argv) -struct mesh *m; -struct behavior *b; -char *vnodefilename; -char *vedgefilename; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ - #endif /* not TRILIBRARY */ { @@ -15180,29 +14125,10 @@ char **argv; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void writeneighbors(struct mesh *m, struct behavior *b, int **neighborlist) -#else /* not ANSI_DECLARATORS */ -void writeneighbors(m, b, neighborlist) -struct mesh *m; -struct behavior *b; -int **neighborlist; -#endif /* not ANSI_DECLARATORS */ - #else /* not TRILIBRARY */ - -#ifdef ANSI_DECLARATORS void writeneighbors(struct mesh *m, struct behavior *b, char *neighborfilename, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void writeneighbors(m, b, neighborfilename, argc, argv) -struct mesh *m; -struct behavior *b; -char *neighborfilename; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ - #endif /* not TRILIBRARY */ { @@ -15295,18 +14221,8 @@ char **argv; #ifndef TRILIBRARY -#ifdef ANSI_DECLARATORS void writeoff(struct mesh *m, struct behavior *b, char *offfilename, int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -void writeoff(m, b, offfilename, argc, argv) -struct mesh *m; -struct behavior *b; -char *offfilename; -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ - { FILE *outfile; struct otri triangleloop; @@ -15373,14 +14289,7 @@ char **argv; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void quality_statistics(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void quality_statistics(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { struct otri triangleloop; vertex p[3]; @@ -15580,14 +14489,7 @@ struct behavior *b; /* */ /*****************************************************************************/ -#ifdef ANSI_DECLARATORS void statistics(struct mesh *m, struct behavior *b) -#else /* not ANSI_DECLARATORS */ -void statistics(m, b) -struct mesh *m; -struct behavior *b; -#endif /* not ANSI_DECLARATORS */ - { printf("\nStatistics:\n\n"); printf(" Input vertices: %d\n", m->invertices); @@ -15700,26 +14602,12 @@ struct behavior *b; #ifdef TRILIBRARY -#ifdef ANSI_DECLARATORS void triangulate(char *triswitches, struct triangulateio *in, struct triangulateio *out, struct triangulateio *vorout) -#else /* not ANSI_DECLARATORS */ -void triangulate(triswitches, in, out, vorout) -char *triswitches; -struct triangulateio *in; -struct triangulateio *out; -struct triangulateio *vorout; -#endif /* not ANSI_DECLARATORS */ #else /* not TRILIBRARY */ -#ifdef ANSI_DECLARATORS int main(int argc, char **argv) -#else /* not ANSI_DECLARATORS */ -int main(argc, argv) -int argc; -char **argv; -#endif /* not ANSI_DECLARATORS */ #endif /* not TRILIBRARY */ @@ -15979,11 +14867,11 @@ char **argv; #ifndef TRILIBRARY #ifndef CDT_ONLY if (m.regions > 0) { - trifree((VOID *) regionarray); + trifree((void *) regionarray); } #endif /* not CDT_ONLY */ if (m.holes > 0) { - trifree((VOID *) holearray); + trifree((void *) holearray); } if (b.geomview) { writeoff(&m, &b, b.offfilename, argc, argv);