From 8ec57cfcafef05c5ca0bfbb6f1d19a2968d0bf91 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Fri, 2 Jun 2017 17:21:53 -0700 Subject: [PATCH 1/3] Convert Olden/voronoi benchmark --- MultiSource/Benchmarks/Olden/voronoi/args.c | 9 +- .../Benchmarks/Olden/voronoi/defines.h | 71 +++---- MultiSource/Benchmarks/Olden/voronoi/newvor.c | 183 ++++++++---------- MultiSource/Benchmarks/Olden/voronoi/output.c | 41 ++-- MultiSource/Benchmarks/Olden/voronoi/vector.c | 2 + 5 files changed, 152 insertions(+), 154 deletions(-) diff --git a/MultiSource/Benchmarks/Olden/voronoi/args.c b/MultiSource/Benchmarks/Olden/voronoi/args.c index 34650ea80..9be798f98 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/args.c +++ b/MultiSource/Benchmarks/Olden/voronoi/args.c @@ -1,7 +1,9 @@ /* For copyright information, see olden_v1.0/COPYRIGHT */ -#include -#include +#include +#include + +#pragma BOUNDS_CHECKED ON extern int NumNodes,NDim; @@ -15,7 +17,8 @@ int mylog(int num) { return j; } -int dealwithargs(int argc, char *argv[]) { +_Unchecked +int dealwithargs(int argc, _Array_ptr argv : count(argc)) { int size; if (argc > 3) diff --git a/MultiSource/Benchmarks/Olden/voronoi/defines.h b/MultiSource/Benchmarks/Olden/voronoi/defines.h index fadd1d79c..9cb7a50cb 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/defines.h +++ b/MultiSource/Benchmarks/Olden/voronoi/defines.h @@ -1,28 +1,30 @@ /* For copyright information, see olden_v1.0/COPYRIGHT */ -#include +#include + +#pragma BOUNDS_CHECKED ON typedef int BOOLEAN; typedef unsigned long uptrint; struct edge_rec { - struct VERTEX *v; - struct edge_rec *next; + _Ptr v; + _Ptr next; long wasseen; - void *Buffer; + _Array_ptr Buffer; }; struct get_point { - struct VERTEX *v; + _Ptr v; double curmax; int seed; }; -typedef struct edge_rec *EDGE_PTR; -typedef struct VERTEX *VERTEX_PTR; -typedef struct edge_rec *QUAD_EDGE; +typedef _Ptr EDGE_PTR; +typedef _Ptr VERTEX_PTR; +typedef _Array_ptr QUAD_EDGE; struct VEC2 { double x,y; @@ -32,18 +34,18 @@ struct VEC2 { struct VERTEX { struct VEC2 v; - struct VERTEX *left, *right; + _Ptr left, right; }; typedef struct { - QUAD_EDGE left, right; + QUAD_EDGE left : count(4), right : count(4); } EDGE_PAIR; struct EDGE_STACK { int ptr; - QUAD_EDGE *elts ; + _Array_ptr elts : count(stack_size * 2); int stack_size; }; @@ -76,42 +78,43 @@ struct EDGE_STACK { #define rotinv(a) ((QUAD_EDGE) ( (((uptrint) (a) + 3*SIZE) & ANDF) | ((uptrint) (a) & ~ANDF) )) #define base(a) ((QUAD_EDGE) ((uptrint a) & ~ANDF)) -QUAD_EDGE alloc_edge(); -void free_edge(QUAD_EDGE e); -QUAD_EDGE makeedge(); -void splice(); -void swapedge(); -void deleteedge(); -QUAD_EDGE build_delaunay_triangulation(); +QUAD_EDGE alloc_edge(void) : count(4); +void free_edge(QUAD_EDGE e : count(4)); +QUAD_EDGE makeedge(VERTEX_PTR origin, VERTEX_PTR destination) : count(4); +void splice(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)); +void swapedge(QUAD_EDGE e : count(4)); +void deleteedge(QUAD_EDGE e : count(4)); +QUAD_EDGE build_delaunay_triangulation(VERTEX_PTR tree, VERTEX_PTR extra) : count(4); EDGE_PAIR build_delaunay(VERTEX_PTR tree, VERTEX_PTR extra); -EDGE_PAIR do_merge(QUAD_EDGE ldo, QUAD_EDGE ldi, QUAD_EDGE rdi, QUAD_EDGE rdo); -QUAD_EDGE connect_left(); -QUAD_EDGE connect_right(); +EDGE_PAIR do_merge(QUAD_EDGE ldo : count(4), QUAD_EDGE ldi : count(4), QUAD_EDGE rdi : count(4), QUAD_EDGE rdo : count(4)); +QUAD_EDGE connect_left(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4); +QUAD_EDGE connect_right(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4); int myrandom(int seed); -void zero_seen(); -QUAD_EDGE pop_edge(); +void zero_seen(_Ptr my_stack, QUAD_EDGE edge : count(4)); +QUAD_EDGE pop_edge(_Ptr x) : count(4); #define drand(seed) (((double) (seed=myrandom(seed))) / (double) 2147483647) -extern VERTEX_PTR *vp ; -extern struct VERTEX *va ; -extern EDGE_PTR *next ; -extern VERTEX_PTR *org ; +extern _Ptr vp ; +extern _Array_ptr va ; +extern _Ptr next ; +extern _Ptr org ; extern int num_vertices, num_edgeparts, stack_size ; extern int to_lincoln , to_off, to_3d_out, to_color , voronoi , delaunay , interactive , ahost ; -extern char *see; +extern _Array_ptr see; extern int NumNodes, NDim; -void push_ring(struct EDGE_STACK *stack, QUAD_EDGE edge); -void push_edge(struct EDGE_STACK *stack, QUAD_EDGE edge); +void push_ring(_Ptr stack, QUAD_EDGE edge : count(4)); +void push_edge(_Ptr stack, QUAD_EDGE edge : count(4)); BOOLEAN ccw(VERTEX_PTR a, VERTEX_PTR b, VERTEX_PTR c); -int dealwithargs(int argc, char *argv[]); -void output_voronoi_diagram(QUAD_EDGE edge, int nv, struct EDGE_STACK *stack); +_Unchecked +int dealwithargs(int argc, _Array_ptr argv : count(argc)); +void output_voronoi_diagram(QUAD_EDGE edge : count(4), int nv, _Ptr stack); struct get_point get_points(int n, double curmax,int i, int seed, int processor, int numnodes); -struct EDGE_STACK *allocate_stack(int num_vertices); +_Ptr allocate_stack(int num_vertices); double V2_cprod(struct VEC2 u,struct VEC2 v); @@ -121,3 +124,5 @@ struct VEC2 V2_sum(struct VEC2 u, struct VEC2 v); struct VEC2 V2_sub(struct VEC2 u, struct VEC2 v); double V2_magn(struct VEC2 u); struct VEC2 V2_cross(struct VEC2 v); + +#pragma BOUNDS_CHECKED OFF diff --git a/MultiSource/Benchmarks/Olden/voronoi/newvor.c b/MultiSource/Benchmarks/Olden/voronoi/newvor.c index 42da1398b..0ec5cd0d6 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/newvor.c +++ b/MultiSource/Benchmarks/Olden/voronoi/newvor.c @@ -1,30 +1,30 @@ /* For copyright information, see olden_v1.0/COPYRIGHT */ -#include -#include +#include +#include #include "defines.h" #if defined(__linux__) #include #endif +#pragma BOUNDS_CHECKED ON -VERTEX_PTR *vp ; -struct VERTEX *va ; -EDGE_PTR *next ; -VERTEX_PTR *org ; +_Ptr vp ; +_Array_ptr va ; +_Ptr next ; +_Ptr org ; int num_vertices, num_edgeparts, stack_size ; int to_lincoln, to_off, to_3d_out, to_color, voronoi, delaunay, interactive, ahost; -char *see; +_Array_ptr see; int NumNodes, NDim; int flag; -QUAD_EDGE connect_left(a, b) -QUAD_EDGE a,b; +QUAD_EDGE connect_left(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4) { - VERTEX_PTR t1,t2; - register QUAD_EDGE ans,lnexta; + VERTEX_PTR t1 = NULL, t2 = NULL; + register QUAD_EDGE ans : count(4) = NULL, lnexta : count(4) = NULL; /*printf("begin connect_left\n");*/ t1=dest(a); @@ -37,11 +37,10 @@ QUAD_EDGE a,b; return(ans); } -QUAD_EDGE connect_right(a, b) -QUAD_EDGE a,b; +QUAD_EDGE connect_right(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4) { - VERTEX_PTR t1,t2; - register QUAD_EDGE ans, oprevb; + VERTEX_PTR t1 = NULL, t2 = NULL; + register QUAD_EDGE ans : count(4) = NULL, oprevb : count(4) = NULL; /*printf("begin connect_right\n");*/ t1=dest(a); @@ -54,11 +53,10 @@ QUAD_EDGE a,b; return(ans); } -void deleteedge(e) +void deleteedge(QUAD_EDGE e : count(4)) /*disconnects e from the rest of the structure and destroys it. */ -QUAD_EDGE e; { - QUAD_EDGE f; + QUAD_EDGE f = NULL; /*printf("begin delete_edge 0x%x\n",e);*/ f=oprev(e); splice(e, f); @@ -72,13 +70,11 @@ QUAD_EDGE e; /* Top-level Delaunay Triangulation Procedure */ /****************************************************************/ -QUAD_EDGE build_delaunay_triangulation(tree,extra) +QUAD_EDGE build_delaunay_triangulation(VERTEX_PTR tree, VERTEX_PTR extra) : count(4) /* builds delaunay triangulation. va is an array of vertices, from 0 to size. Each vertex consists of a vector and a data pointer. edge is a pointer to an edge on the convex hull of the constructed delaunay triangulation. */ - - VERTEX_PTR tree,extra; { EDGE_PAIR retval; @@ -86,10 +82,9 @@ QUAD_EDGE build_delaunay_triangulation(tree,extra) return retval.left; } -VERTEX_PTR get_low(tree) - register VERTEX_PTR tree; +VERTEX_PTR get_low(register VERTEX_PTR tree) { - register VERTEX_PTR temp; + register VERTEX_PTR temp = NULL; while((temp=tree->left)) tree=temp; /* 3% load penalty */ return tree; } @@ -101,10 +96,10 @@ VERTEX_PTR get_low(tree) EDGE_PAIR build_delaunay(VERTEX_PTR tree, VERTEX_PTR extra) { - QUAD_EDGE a,b,c,ldo,rdi,ldi,rdo; + QUAD_EDGE a = NULL, b = NULL, c = NULL, ldo = NULL, rdi = NULL, ldi = NULL, rdo = NULL; EDGE_PAIR retval; - register VERTEX_PTR maxx, minx; - VERTEX_PTR s1, s2, s3; + register VERTEX_PTR maxx = NULL, minx = NULL; + VERTEX_PTR s1 = NULL, s2 = NULL, s3 = NULL; EDGE_PAIR delleft, delright; @@ -125,7 +120,7 @@ EDGE_PAIR build_delaunay(VERTEX_PTR tree, VERTEX_PTR extra) retval.right = rdo; } else if (!tree) - { + _Unchecked { printf("ERROR: Only 1 point!\n"); exit(-1); } @@ -163,27 +158,27 @@ QUAD_EDGE next_edge, avail_edge; #define NYL NULL -void delete_all_edges() { next_edge= 0; avail_edge = NYL;} +void delete_all_edges(void) { next_edge= 0; avail_edge = NYL;} #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__MINGW32__) #define MEMALIGN_IS_NOT_AVAILABLE #endif /* memalign() on my SGI doesn't work. Thus, I have to write my own */ -void* myalign(int align_size, int alloc_size) +_Array_ptr myalign(int align_size, int alloc_size) : byte_count(alloc_size) { #ifdef MEMALIGN_IS_NOT_AVAILABLE - char* base = (char*)malloc(alloc_size + align_size); + _Array_ptr base : byte_count(alloc_size + align_size) = malloc(alloc_size + align_size); #else - char* base = (char*)memalign(align_size, alloc_size); + _Array_ptr base : byte_count(alloc_size) = (char*)memalign(align_size, alloc_size); #endif - void *Result; - if (base == NULL){ + _Array_ptr Result : byte_count(alloc_size) = NULL; + if (base == NULL) _Unchecked { printf("myalign() failed\n"); exit(-1); } #ifdef MEMALIGN_IS_NOT_AVAILABLE - return (void*)(base + align_size - ((uptrint)base % align_size)); + return (_Array_ptr)(base + align_size - ((uptrint)base % align_size)); #else return base; #endif @@ -191,13 +186,13 @@ void* myalign(int align_size, int alloc_size) -QUAD_EDGE alloc_edge() { - QUAD_EDGE ans; +QUAD_EDGE alloc_edge(void) : count(4) { + QUAD_EDGE ans : count(4) = NULL; if (avail_edge == NYL) { ans = (QUAD_EDGE)myalign(4*(sizeof(struct edge_rec)), 4*(sizeof(struct edge_rec))); - if ((uptrint)ans & ANDF) { + if ((uptrint)ans & ANDF) _Unchecked { printf("Aborting in alloc_edge, ans = 0x%p\n", ans); exit(-1); } @@ -211,7 +206,7 @@ QUAD_EDGE alloc_edge() { return ans; } -void free_edge(QUAD_EDGE e) { +void free_edge(QUAD_EDGE e : count(4)) { e = (QUAD_EDGE) ((uptrint) e ^ ((uptrint) e & ANDF)); onext(e) = avail_edge; avail_edge = e; @@ -223,13 +218,12 @@ void free_edge(QUAD_EDGE e) { /* Geometric primitives */ /****************************************************************/ -BOOLEAN incircle(a,b,c,d) +BOOLEAN incircle(VERTEX_PTR a, VERTEX_PTR b, VERTEX_PTR c, VERTEX_PTR d) /* incircle, as in the Guibas-Stolfi paper. */ - VERTEX_PTR a,b,c,d; { double adx, ady, bdx, bdy, cdx, cdy, dx, dy, anorm, bnorm, cnorm, dnorm; double dret ; - VERTEX_PTR loc_a,loc_b,loc_c,loc_d; + VERTEX_PTR loc_a = NULL, loc_b = NULL, loc_c = NULL, loc_d = NULL; /*if (flag) printf("incircle: 0x%x,0x%x,0x%x,0x%x\n",a,b,c,d);*/ loc_d = d; @@ -252,7 +246,7 @@ BOOLEAN incircle(a,b,c,d) BOOLEAN ccw(VERTEX_PTR a, VERTEX_PTR b, VERTEX_PTR c) { double dret ; double xa,ya,xb,yb,xc,yc; - VERTEX_PTR loc_a,loc_b,loc_c; + VERTEX_PTR loc_a = NULL, loc_b = NULL, loc_c = NULL; loc_a = a; xa=X(loc_a); ya=Y(loc_a); loc_b = b; @@ -269,10 +263,9 @@ BOOLEAN ccw(VERTEX_PTR a, VERTEX_PTR b, VERTEX_PTR c) { /****************************************************************/ /* Quad-edge manipulation primitives */ /****************************************************************/ -QUAD_EDGE makeedge(origin, destination) -VERTEX_PTR origin, destination; +QUAD_EDGE makeedge(VERTEX_PTR origin, VERTEX_PTR destination) : count(4) { - register QUAD_EDGE temp, ans; + register QUAD_EDGE temp : count(4) = NULL, ans : count(4) = NULL; temp = alloc_edge(); ans = temp; @@ -291,11 +284,10 @@ VERTEX_PTR origin, destination; return(ans); } -void splice(a,b) -QUAD_EDGE a, b; +void splice(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) { - QUAD_EDGE alpha, beta, temp; - QUAD_EDGE t1; + QUAD_EDGE alpha : count(4) = NULL, beta : count(4) = NULL, temp : count(4) = NULL; + QUAD_EDGE t1 : count(4) = NULL; /*printf("begin splice 0x%x,0x%x\n",a,b);*/ /*dump_quad(a); dump_quad(b);*/ @@ -318,11 +310,10 @@ QUAD_EDGE a, b; /*printf("End splice\n");*/ } -void swapedge(e) -QUAD_EDGE e; +void swapedge(QUAD_EDGE e : count(4)) { - QUAD_EDGE a,b,syme,lnexttmp; - VERTEX_PTR a1,b1; + QUAD_EDGE a : count(4) = NULL, b : count(4) = NULL, syme : count(4) = NULL, lnexttmp : count(4) = NULL; + VERTEX_PTR a1 = NULL, b1 = NULL; /*printf("begin swapedge\n");*/ a = oprev(e); @@ -346,10 +337,9 @@ QUAD_EDGE e; /****************************************************************/ /*#define valid(l) ccw(orig(basel), dest(l), dest(basel))*/ -int valid(l,basel) - QUAD_EDGE l,basel; +int valid(QUAD_EDGE l, QUAD_EDGE basel) { - register VERTEX_PTR t1,t2,t3; + register VERTEX_PTR t1 = NULL, t2 = NULL, t3 = NULL; /*printf("valid:0x%x,0x%x\n",l,basel);*/ @@ -360,20 +350,19 @@ int valid(l,basel) return ccw(t1,t2,t3); } -void dump_quad(ptr) - QUAD_EDGE ptr; +void dump_quad(QUAD_EDGE ptr : count(4)) { int i; - QUAD_EDGE j; - VERTEX_PTR v; + QUAD_EDGE j : count(4) = NULL; + VERTEX_PTR v = NULL; ptr = (QUAD_EDGE) ((uptrint) ptr & ~ANDF); - printf("Entered DUMP_QUAD: ptr=0x%p\n",ptr); + _Unchecked { printf("Entered DUMP_QUAD: ptr=0x%p\n",ptr); } for (i=0; i<4; i++) { j=onext(((QUAD_EDGE) (ptr+i))); v = orig(j); - printf("DUMP_QUAD: ptr=0x%p onext=0x%p,v=0x%p\n",ptr+i,j,v); + _Unchecked { printf("DUMP_QUAD: ptr=0x%p onext=0x%p,v=0x%p\n",ptr+i,j,v); } } } @@ -382,11 +371,11 @@ void dump_quad(ptr) -EDGE_PAIR do_merge(QUAD_EDGE ldo, QUAD_EDGE ldi, QUAD_EDGE rdi, QUAD_EDGE rdo) +EDGE_PAIR do_merge(QUAD_EDGE ldo : count(4), QUAD_EDGE ldi : count(4), QUAD_EDGE rdi : count(4), QUAD_EDGE rdo : count(4)) { int rvalid, lvalid; - register QUAD_EDGE basel,lcand,rcand,t; - VERTEX_PTR t1,t2; + register QUAD_EDGE basel : count(4) = NULL, lcand : count(4) = NULL, rcand : count(4) = NULL, t : count(4) = NULL; + VERTEX_PTR t1 = NULL, t2 = NULL; /*printf("merge\n");*/ while (1) { @@ -439,7 +428,7 @@ EDGE_PAIR do_merge(QUAD_EDGE ldo, QUAD_EDGE ldi, QUAD_EDGE rdi, QUAD_EDGE rdo) if (t2/*dest(basel)*/ == orig(ldo)) ldo = sym(basel); while (1) { - VERTEX_PTR v1,v2,v3,v4; + VERTEX_PTR v1 = NULL, v2 = NULL, v3 = NULL, v4 = NULL; /*printf("valid site 1,lcand=0x%x,basel=0x%x\n",lcand,basel);*/ /*dump_quad(lcand);*/ @@ -531,20 +520,19 @@ EDGE_PAIR do_merge(QUAD_EDGE ldo, QUAD_EDGE ldi, QUAD_EDGE rdi, QUAD_EDGE rdo) int loop = 0, randum = 1, filein = 0 , fileout = 1, statistics = 0; -void in_order(tree) - VERTEX_PTR tree; +void in_order(VERTEX_PTR tree) { - VERTEX_PTR tleft, tright; + VERTEX_PTR tleft = NULL, tright = NULL; double x, y; if (!tree) { - printf("NULL\n"); + _Unchecked { printf("NULL\n"); } return; } x = X(tree); y = Y(tree); - printf("X=%f, Y=%f\n",x, y); + _Unchecked { printf("X=%f, Y=%f\n",x, y); } tleft = tree->left; in_order(tleft); tright = tree->right; @@ -579,13 +567,14 @@ void print_extra(VERTEX_PTR extra) { double x, y; x = X(extra); y = Y(extra); - printf("X=%f, Y=%f\n",x, y); + _Unchecked { printf("X=%f, Y=%f\n",x, y); } } -int main(int argc, char **argv) { - struct EDGE_STACK *my_stack; +_Unchecked +int main(int argc, _Array_ptr argv : count(argc)) { + _Ptr my_stack = NULL; struct get_point point, extra; - QUAD_EDGE edge; + QUAD_EDGE edge : count(4) = NULL; int n, retained; to_lincoln = to_off = to_3d_out = to_color = 0; voronoi = delaunay = 1; interactive = ahost = 0 ; @@ -597,16 +586,20 @@ int main(int argc, char **argv) { /* delete_all_edges();*/ if (1) { printf("getting %d points\n", n); + _Checked { extra=get_points(1,1.0,n,1023,NumNodes-1,1); point=get_points(n-1,extra.curmax,n-1,extra.seed,0,NumNodes); + } printf("Done getting points\n"); + _Checked { num_vertices = n + 1; my_stack=allocate_stack(num_vertices); if (flag) in_order(point.v); + } if (flag) print_extra(extra.v); printf("Doing voronoi on %d nodes\n", n); - edge=build_delaunay_triangulation(point.v,extra.v); + _Checked{ edge=build_delaunay_triangulation(point.v,extra.v); } if (flag) output_voronoi_diagram(edge,n,my_stack); } @@ -614,29 +607,27 @@ int main(int argc, char **argv) { return 0; } -struct EDGE_STACK *allocate_stack(int num_vertice) +_Ptr allocate_stack(int num_vertice) { - struct EDGE_STACK *my_stack; + _Ptr my_stack = NULL; num_edgeparts = 12*num_vertice; - my_stack = (struct EDGE_STACK *)malloc(sizeof(struct EDGE_STACK)); - my_stack->elts = (QUAD_EDGE *)malloc(num_edgeparts * sizeof(QUAD_EDGE)); + my_stack = (_Ptr)malloc(sizeof(struct EDGE_STACK)); + my_stack->elts = (_Array_ptr)malloc(num_edgeparts * sizeof(QUAD_EDGE)); my_stack->stack_size = num_edgeparts/2; return my_stack; } -void free_all(cont,my_stack) - int cont; - struct EDGE_STACK *my_stack; +void free_all(int cont, _Ptr my_stack) { - free(my_stack->elts); + free((_Array_ptr)my_stack->elts); free(my_stack); } struct get_point get_points(int n, double curmax,int i, int seed, int processor, int numnodes) { - VERTEX_PTR node; + VERTEX_PTR node = NULL; struct get_point point; int j; @@ -680,15 +671,15 @@ struct get_point get_points(int n, double curmax,int i, int seed, /* Graph Traversal Routines */ /****************************************************************/ -QUAD_EDGE pop_edge(struct EDGE_STACK *x) { +QUAD_EDGE pop_edge(_Ptr x) : count(4) { int a=x->ptr--; return (x)->elts[a]; } -void push_edge(struct EDGE_STACK *stack, QUAD_EDGE edge) { +void push_edge(_Ptr stack, QUAD_EDGE edge : count(4)) { register int a; /*printf("pushing edge \n");*/ - if (stack->ptr == stack->stack_size) { + if (stack->ptr == stack->stack_size) _Unchecked { printf("cannot push onto stack: stack is too large\n"); } else { @@ -699,8 +690,8 @@ void push_edge(struct EDGE_STACK *stack, QUAD_EDGE edge) { } } -void push_ring(struct EDGE_STACK *stack, QUAD_EDGE edge) { - QUAD_EDGE nex; +void push_ring(_Ptr stack, QUAD_EDGE edge : count(4)) { + QUAD_EDGE nex : count(4) = NULL; nex = onext(edge); while (nex != edge) { if (seen(nex) == 0) { @@ -711,11 +702,9 @@ void push_ring(struct EDGE_STACK *stack, QUAD_EDGE edge) { } } -void push_nonzero_ring(stack, edge) - struct EDGE_STACK *stack; - QUAD_EDGE edge; +void push_nonzero_ring(_Ptr stack, QUAD_EDGE edge : count(4)) { - QUAD_EDGE nex; + QUAD_EDGE nex : count(4) = NULL; nex = onext(edge); while (nex != edge) { if (seen(nex) != 0) { @@ -726,9 +715,7 @@ void push_nonzero_ring(stack, edge) } } -void zero_seen(my_stack,edge) -QUAD_EDGE edge; -struct EDGE_STACK *my_stack; +void zero_seen(_Ptr my_stack, QUAD_EDGE edge : count(4)) { my_stack->ptr = 0; push_nonzero_ring(my_stack, edge); diff --git a/MultiSource/Benchmarks/Olden/voronoi/output.c b/MultiSource/Benchmarks/Olden/voronoi/output.c index f8c4750f3..186720381 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/output.c +++ b/MultiSource/Benchmarks/Olden/voronoi/output.c @@ -1,22 +1,23 @@ /* For copyright information, see olden_v1.0/COPYRIGHT */ #include "defines.h" -#include +#include -extern struct VEC2 V2_sum(); -extern struct VEC2 V2_sub(); -extern struct VEC2 V2_times(); -extern double V2_cprod(); -extern struct VEC2 V2_cross(); -extern double V2_dot(); -extern double V2_magn(); +#pragma BOUNDS_CHECKED ON + +extern struct VEC2 V2_sum(struct VEC2 u, struct VEC2 v); +extern struct VEC2 V2_sub(struct VEC2 u, struct VEC2 v); +extern struct VEC2 V2_times(double c, struct VEC2 v); +extern double V2_cprod(struct VEC2 u,struct VEC2 v); +extern struct VEC2 V2_cross(struct VEC2 v); +extern double V2_dot(struct VEC2 u, struct VEC2 v); +extern double V2_magn(struct VEC2 u); /****************************************************************/ /* Voronoi Output Routines */ /****************************************************************/ -void plot_dedge(p1, p2) -VERTEX_PTR p1, p2; +void plot_dedge(VERTEX_PTR p1, VERTEX_PTR p2) { double x1,x2,y1,y2; @@ -25,12 +26,12 @@ VERTEX_PTR p1, p2; x2=X(p2); y2=Y(p2); /* plots a Delaunay-triangulation edge on your favorite device. */ + _Unchecked { printf("Dedge %g %g %g %g \n",(float) x1, (float) y1, - (float) x2, (float) y2); + (float) x2, (float) y2); } } -void plot_vedge(p1, p2) - struct VEC2 p1, p2; +void plot_vedge(struct VEC2 p1, struct VEC2 p2) { /* plots a Voronoi-diagram edge on your favorite device. */ @@ -56,7 +57,7 @@ void plot_vedge(p1, p2) if (isnan(p2y)) p2y = copysign(p2y, 1.0); - printf("Vedge %g %g %g %g \n", p1x, p1y, p2x, p2y); + _Unchecked { printf("Vedge %g %g %g %g \n", p1x, p1y, p2x, p2y); } } struct VEC2 circle_center(struct VEC2 a, struct VEC2 b, struct VEC2 c) @@ -85,11 +86,11 @@ struct VEC2 circle_center(struct VEC2 a, struct VEC2 b, struct VEC2 c) } } -int *earray; +_Array_ptr earray; -void output_voronoi_diagram(QUAD_EDGE edge, int nv, struct EDGE_STACK *my_stack) +void output_voronoi_diagram(QUAD_EDGE edge : count(4), int nv, _Ptr my_stack) { - QUAD_EDGE nex, prev, snex, sprev; + QUAD_EDGE nex : count(4) = NULL, prev : count(4) = NULL, snex : count(4) = NULL, sprev : count(4) = NULL; struct VEC2 cvxvec, center; double ln; @@ -102,7 +103,7 @@ void output_voronoi_diagram(QUAD_EDGE edge, int nv, struct EDGE_STACK *my_stack) /* Plot VD edges with one endpoint at infinity. */ do { struct VEC2 v21,v22,v23; - QUAD_EDGE tmp; + QUAD_EDGE tmp : count(4) = NULL; v21=destv(nex); v22=origv(nex); @@ -128,9 +129,9 @@ void output_voronoi_diagram(QUAD_EDGE edge, int nv, struct EDGE_STACK *my_stack) my_stack->ptr = 0; push_ring(my_stack, edge); - printf("mystack_ptr = %d\n",my_stack->ptr); + _Unchecked { printf("mystack_ptr = %d\n",my_stack->ptr); } while (my_stack->ptr != 0) { - VERTEX_PTR v1,v2,v3,v4; + VERTEX_PTR v1 = NULL, v2 = NULL, v3 = NULL, v4 = NULL; double d1,d2; edge = pop_edge(my_stack); diff --git a/MultiSource/Benchmarks/Olden/voronoi/vector.c b/MultiSource/Benchmarks/Olden/voronoi/vector.c index 8fa5917f3..bc8cfe8f3 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/vector.c +++ b/MultiSource/Benchmarks/Olden/voronoi/vector.c @@ -2,6 +2,8 @@ #include "defines.h" +#pragma BOUNDS_CHECKED ON + /**************************************************************** // Vector Routines. // From CMU vision library. From 427eb75d0448d805776e56c1ebeab31be2092471 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Tue, 6 Jun 2017 13:23:08 -0700 Subject: [PATCH 2/3] Few Missed Changes to Voronoi --- MultiSource/Benchmarks/Olden/voronoi/defines.h | 2 +- MultiSource/Benchmarks/Olden/voronoi/newvor.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MultiSource/Benchmarks/Olden/voronoi/defines.h b/MultiSource/Benchmarks/Olden/voronoi/defines.h index 9cb7a50cb..94dc04e3b 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/defines.h +++ b/MultiSource/Benchmarks/Olden/voronoi/defines.h @@ -9,7 +9,7 @@ typedef unsigned long uptrint; struct edge_rec { _Ptr v; - _Ptr next; + _Array_ptr next : count(4); long wasseen; _Array_ptr Buffer; }; diff --git a/MultiSource/Benchmarks/Olden/voronoi/newvor.c b/MultiSource/Benchmarks/Olden/voronoi/newvor.c index 0ec5cd0d6..f61c0aeb7 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/newvor.c +++ b/MultiSource/Benchmarks/Olden/voronoi/newvor.c @@ -96,7 +96,9 @@ VERTEX_PTR get_low(register VERTEX_PTR tree) EDGE_PAIR build_delaunay(VERTEX_PTR tree, VERTEX_PTR extra) { - QUAD_EDGE a = NULL, b = NULL, c = NULL, ldo = NULL, rdi = NULL, ldi = NULL, rdo = NULL; + QUAD_EDGE a : count(4) = NULL, b : count(4) = NULL, c : count(4) = NULL; + QUAD_EDGE ldo : count(4) = NULL, rdi : count(4) = NULL; + QUAD_EDGE ldi : count(4) = NULL, rdo : count(4) = NULL; EDGE_PAIR retval; register VERTEX_PTR maxx = NULL, minx = NULL; VERTEX_PTR s1 = NULL, s2 = NULL, s3 = NULL; @@ -154,7 +156,7 @@ return retval; /****************************************************************/ /* Quad-edge storage allocation */ /****************************************************************/ -QUAD_EDGE next_edge, avail_edge; +QUAD_EDGE next_edge : count(4) = NULL, avail_edge : count(4) = NULL; #define NYL NULL @@ -337,7 +339,7 @@ void swapedge(QUAD_EDGE e : count(4)) /****************************************************************/ /*#define valid(l) ccw(orig(basel), dest(l), dest(basel))*/ -int valid(QUAD_EDGE l, QUAD_EDGE basel) +int valid(QUAD_EDGE l : count(4), QUAD_EDGE basel : count(4)) { register VERTEX_PTR t1 = NULL, t2 = NULL, t3 = NULL; From 504559308dcbc42a5150e963aade2f4c2ba88752 Mon Sep 17 00:00:00 2001 From: Sam Elliott Date: Tue, 6 Jun 2017 14:14:52 -0700 Subject: [PATCH 3/3] Use bit-twiddling macros in bounds on QUAD_EDGE --- .../Benchmarks/Olden/voronoi/defines.h | 30 +++++----- MultiSource/Benchmarks/Olden/voronoi/newvor.c | 58 +++++++++---------- MultiSource/Benchmarks/Olden/voronoi/output.c | 6 +- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/MultiSource/Benchmarks/Olden/voronoi/defines.h b/MultiSource/Benchmarks/Olden/voronoi/defines.h index 94dc04e3b..1d23efe1f 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/defines.h +++ b/MultiSource/Benchmarks/Olden/voronoi/defines.h @@ -9,7 +9,7 @@ typedef unsigned long uptrint; struct edge_rec { _Ptr v; - _Array_ptr next : count(4); + _Array_ptr next : quad_bounds(next); long wasseen; _Array_ptr Buffer; }; @@ -39,7 +39,7 @@ struct VERTEX { typedef struct { - QUAD_EDGE left : count(4), right : count(4); + QUAD_EDGE left : quad_bounds(left), right : quad_bounds(right); } EDGE_PAIR; @@ -76,22 +76,24 @@ struct EDGE_STACK { #define sym(a) ((QUAD_EDGE) (((uptrint) (a)) ^ 2*SIZE)) #define rot(a) ((QUAD_EDGE) ( (((uptrint) (a) + 1*SIZE) & ANDF) | ((uptrint) (a) & ~ANDF) )) #define rotinv(a) ((QUAD_EDGE) ( (((uptrint) (a) + 3*SIZE) & ANDF) | ((uptrint) (a) & ~ANDF) )) -#define base(a) ((QUAD_EDGE) ((uptrint a) & ~ANDF)) +#define base(a) ((QUAD_EDGE) (((uptrint) (a)) & ~ANDF)) + +#define quad_bounds(a) bounds(base(a), base(a) + 4) QUAD_EDGE alloc_edge(void) : count(4); -void free_edge(QUAD_EDGE e : count(4)); +void free_edge(QUAD_EDGE e : quad_bounds(e)); QUAD_EDGE makeedge(VERTEX_PTR origin, VERTEX_PTR destination) : count(4); -void splice(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)); -void swapedge(QUAD_EDGE e : count(4)); -void deleteedge(QUAD_EDGE e : count(4)); +void splice(QUAD_EDGE a : quad_bounds(a), QUAD_EDGE b : quad_bounds(b)); +void swapedge(QUAD_EDGE e : quad_bounds(e)); +void deleteedge(QUAD_EDGE e : quad_bounds(e)); QUAD_EDGE build_delaunay_triangulation(VERTEX_PTR tree, VERTEX_PTR extra) : count(4); EDGE_PAIR build_delaunay(VERTEX_PTR tree, VERTEX_PTR extra); -EDGE_PAIR do_merge(QUAD_EDGE ldo : count(4), QUAD_EDGE ldi : count(4), QUAD_EDGE rdi : count(4), QUAD_EDGE rdo : count(4)); -QUAD_EDGE connect_left(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4); -QUAD_EDGE connect_right(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4); +EDGE_PAIR do_merge(QUAD_EDGE ldo : quad_bounds(ldo), QUAD_EDGE ldi : quad_bounds(ldi), QUAD_EDGE rdi : quad_bounds(rdi), QUAD_EDGE rdo : quad_bounds(rdo)); +QUAD_EDGE connect_left(QUAD_EDGE a : quad_bounds(a), QUAD_EDGE b : quad_bounds(b)) : count(4); +QUAD_EDGE connect_right(QUAD_EDGE a : quad_bounds(a), QUAD_EDGE b : quad_bounds(b)) : count(4); int myrandom(int seed); -void zero_seen(_Ptr my_stack, QUAD_EDGE edge : count(4)); +void zero_seen(_Ptr my_stack, QUAD_EDGE edge : quad_bounds(edge)); QUAD_EDGE pop_edge(_Ptr x) : count(4); #define drand(seed) (((double) (seed=myrandom(seed))) / (double) 2147483647) @@ -106,12 +108,12 @@ extern _Array_ptr see; extern int NumNodes, NDim; -void push_ring(_Ptr stack, QUAD_EDGE edge : count(4)); -void push_edge(_Ptr stack, QUAD_EDGE edge : count(4)); +void push_ring(_Ptr stack, QUAD_EDGE edge : quad_bounds(edge)); +void push_edge(_Ptr stack, QUAD_EDGE edge : quad_bounds(edge)); BOOLEAN ccw(VERTEX_PTR a, VERTEX_PTR b, VERTEX_PTR c); _Unchecked int dealwithargs(int argc, _Array_ptr argv : count(argc)); -void output_voronoi_diagram(QUAD_EDGE edge : count(4), int nv, _Ptr stack); +void output_voronoi_diagram(QUAD_EDGE edge : quad_bounds(edge), int nv, _Ptr stack); struct get_point get_points(int n, double curmax,int i, int seed, int processor, int numnodes); _Ptr allocate_stack(int num_vertices); diff --git a/MultiSource/Benchmarks/Olden/voronoi/newvor.c b/MultiSource/Benchmarks/Olden/voronoi/newvor.c index f61c0aeb7..8cd3a38ce 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/newvor.c +++ b/MultiSource/Benchmarks/Olden/voronoi/newvor.c @@ -21,10 +21,10 @@ int NumNodes, NDim; int flag; -QUAD_EDGE connect_left(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4) +QUAD_EDGE connect_left(QUAD_EDGE a : quad_bounds(a), QUAD_EDGE b : quad_bounds(b)) : count(4) { VERTEX_PTR t1 = NULL, t2 = NULL; - register QUAD_EDGE ans : count(4) = NULL, lnexta : count(4) = NULL; + register QUAD_EDGE ans : quad_bounds(ans) = NULL, lnexta : quad_bounds(lnexta) = NULL; /*printf("begin connect_left\n");*/ t1=dest(a); @@ -37,10 +37,10 @@ QUAD_EDGE connect_left(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4 return(ans); } -QUAD_EDGE connect_right(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count(4) +QUAD_EDGE connect_right(QUAD_EDGE a : quad_bounds(a), QUAD_EDGE b : quad_bounds(b)) : count(4) { VERTEX_PTR t1 = NULL, t2 = NULL; - register QUAD_EDGE ans : count(4) = NULL, oprevb : count(4) = NULL; + register QUAD_EDGE ans : quad_bounds(ans) = NULL, oprevb : quad_bounds(oprevb) = NULL; /*printf("begin connect_right\n");*/ t1=dest(a); @@ -53,7 +53,7 @@ QUAD_EDGE connect_right(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) : count( return(ans); } -void deleteedge(QUAD_EDGE e : count(4)) +void deleteedge(QUAD_EDGE e : quad_bounds(e)) /*disconnects e from the rest of the structure and destroys it. */ { QUAD_EDGE f = NULL; @@ -96,9 +96,9 @@ VERTEX_PTR get_low(register VERTEX_PTR tree) EDGE_PAIR build_delaunay(VERTEX_PTR tree, VERTEX_PTR extra) { - QUAD_EDGE a : count(4) = NULL, b : count(4) = NULL, c : count(4) = NULL; - QUAD_EDGE ldo : count(4) = NULL, rdi : count(4) = NULL; - QUAD_EDGE ldi : count(4) = NULL, rdo : count(4) = NULL; + QUAD_EDGE a : quad_bounds(a) = NULL, b : quad_bounds(b) = NULL, c : quad_bounds(c) = NULL; + QUAD_EDGE ldo : quad_bounds(ldo) = NULL, rdi : quad_bounds(rdi) = NULL; + QUAD_EDGE ldi : quad_bounds(ldi) = NULL, rdo : quad_bounds(rdo) = NULL; EDGE_PAIR retval; register VERTEX_PTR maxx = NULL, minx = NULL; VERTEX_PTR s1 = NULL, s2 = NULL, s3 = NULL; @@ -156,7 +156,7 @@ return retval; /****************************************************************/ /* Quad-edge storage allocation */ /****************************************************************/ -QUAD_EDGE next_edge : count(4) = NULL, avail_edge : count(4) = NULL; +QUAD_EDGE next_edge : quad_bounds(next_edge) = NULL, avail_edge : quad_bounds(avail_edge) = NULL; #define NYL NULL @@ -189,7 +189,7 @@ _Array_ptr myalign(int align_size, int alloc_size) : byte_count(alloc_size QUAD_EDGE alloc_edge(void) : count(4) { - QUAD_EDGE ans : count(4) = NULL; + QUAD_EDGE ans : quad_bounds(ans) = NULL; if (avail_edge == NYL) { ans = (QUAD_EDGE)myalign(4*(sizeof(struct edge_rec)), @@ -208,7 +208,7 @@ QUAD_EDGE alloc_edge(void) : count(4) { return ans; } -void free_edge(QUAD_EDGE e : count(4)) { +void free_edge(QUAD_EDGE e : quad_bounds(e)) { e = (QUAD_EDGE) ((uptrint) e ^ ((uptrint) e & ANDF)); onext(e) = avail_edge; avail_edge = e; @@ -267,7 +267,7 @@ BOOLEAN ccw(VERTEX_PTR a, VERTEX_PTR b, VERTEX_PTR c) { /****************************************************************/ QUAD_EDGE makeedge(VERTEX_PTR origin, VERTEX_PTR destination) : count(4) { - register QUAD_EDGE temp : count(4) = NULL, ans : count(4) = NULL; + register QUAD_EDGE temp : quad_bounds(temp) = NULL, ans : quad_bounds(ans) = NULL; temp = alloc_edge(); ans = temp; @@ -286,10 +286,10 @@ QUAD_EDGE makeedge(VERTEX_PTR origin, VERTEX_PTR destination) : count(4) return(ans); } -void splice(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) +void splice(QUAD_EDGE a : quad_bounds(a), QUAD_EDGE b : quad_bounds(b)) { - QUAD_EDGE alpha : count(4) = NULL, beta : count(4) = NULL, temp : count(4) = NULL; - QUAD_EDGE t1 : count(4) = NULL; + QUAD_EDGE alpha : quad_bounds(alpha) = NULL, beta : quad_bounds(beta) = NULL, temp : quad_bounds(temp) = NULL; + QUAD_EDGE t1 : quad_bounds(t1) = NULL; /*printf("begin splice 0x%x,0x%x\n",a,b);*/ /*dump_quad(a); dump_quad(b);*/ @@ -312,9 +312,9 @@ void splice(QUAD_EDGE a : count(4), QUAD_EDGE b : count(4)) /*printf("End splice\n");*/ } -void swapedge(QUAD_EDGE e : count(4)) +void swapedge(QUAD_EDGE e : quad_bounds(e)) { - QUAD_EDGE a : count(4) = NULL, b : count(4) = NULL, syme : count(4) = NULL, lnexttmp : count(4) = NULL; + QUAD_EDGE a : quad_bounds(a) = NULL, b : quad_bounds(b) = NULL, syme : quad_bounds(syme) = NULL, lnexttmp : quad_bounds(lnexttmp) = NULL; VERTEX_PTR a1 = NULL, b1 = NULL; /*printf("begin swapedge\n");*/ @@ -339,7 +339,7 @@ void swapedge(QUAD_EDGE e : count(4)) /****************************************************************/ /*#define valid(l) ccw(orig(basel), dest(l), dest(basel))*/ -int valid(QUAD_EDGE l : count(4), QUAD_EDGE basel : count(4)) +int valid(QUAD_EDGE l : quad_bounds(l), QUAD_EDGE basel : quad_bounds(basel)) { register VERTEX_PTR t1 = NULL, t2 = NULL, t3 = NULL; @@ -352,10 +352,10 @@ int valid(QUAD_EDGE l : count(4), QUAD_EDGE basel : count(4)) return ccw(t1,t2,t3); } -void dump_quad(QUAD_EDGE ptr : count(4)) +void dump_quad(QUAD_EDGE ptr : quad_bounds(ptr)) { int i; - QUAD_EDGE j : count(4) = NULL; + QUAD_EDGE j : quad_bounds(j) = NULL; VERTEX_PTR v = NULL; ptr = (QUAD_EDGE) ((uptrint) ptr & ~ANDF); @@ -373,10 +373,10 @@ void dump_quad(QUAD_EDGE ptr : count(4)) -EDGE_PAIR do_merge(QUAD_EDGE ldo : count(4), QUAD_EDGE ldi : count(4), QUAD_EDGE rdi : count(4), QUAD_EDGE rdo : count(4)) +EDGE_PAIR do_merge(QUAD_EDGE ldo : quad_bounds(ldo), QUAD_EDGE ldi : quad_bounds(ldi), QUAD_EDGE rdi : quad_bounds(rdi), QUAD_EDGE rdo : quad_bounds(rdo)) { int rvalid, lvalid; - register QUAD_EDGE basel : count(4) = NULL, lcand : count(4) = NULL, rcand : count(4) = NULL, t : count(4) = NULL; + register QUAD_EDGE basel : quad_bounds(basel) = NULL, lcand : quad_bounds(lcand) = NULL, rcand : quad_bounds(rcand) = NULL, t : quad_bounds(t) = NULL; VERTEX_PTR t1 = NULL, t2 = NULL; /*printf("merge\n");*/ @@ -576,7 +576,7 @@ _Unchecked int main(int argc, _Array_ptr argv : count(argc)) { _Ptr my_stack = NULL; struct get_point point, extra; - QUAD_EDGE edge : count(4) = NULL; + QUAD_EDGE edge : quad_bounds(edge) = NULL; int n, retained; to_lincoln = to_off = to_3d_out = to_color = 0; voronoi = delaunay = 1; interactive = ahost = 0 ; @@ -678,7 +678,7 @@ QUAD_EDGE pop_edge(_Ptr x) : count(4) { return (x)->elts[a]; } -void push_edge(_Ptr stack, QUAD_EDGE edge : count(4)) { +void push_edge(_Ptr stack, QUAD_EDGE edge : quad_bounds(edge)) { register int a; /*printf("pushing edge \n");*/ if (stack->ptr == stack->stack_size) _Unchecked { @@ -692,8 +692,8 @@ void push_edge(_Ptr stack, QUAD_EDGE edge : count(4)) { } } -void push_ring(_Ptr stack, QUAD_EDGE edge : count(4)) { - QUAD_EDGE nex : count(4) = NULL; +void push_ring(_Ptr stack, QUAD_EDGE edge : quad_bounds(edge)) { + QUAD_EDGE nex : quad_bounds(nex) = NULL; nex = onext(edge); while (nex != edge) { if (seen(nex) == 0) { @@ -704,9 +704,9 @@ void push_ring(_Ptr stack, QUAD_EDGE edge : count(4)) { } } -void push_nonzero_ring(_Ptr stack, QUAD_EDGE edge : count(4)) +void push_nonzero_ring(_Ptr stack, QUAD_EDGE edge : quad_bounds(edge)) { - QUAD_EDGE nex : count(4) = NULL; + QUAD_EDGE nex : quad_bounds(nex) = NULL; nex = onext(edge); while (nex != edge) { if (seen(nex) != 0) { @@ -717,7 +717,7 @@ void push_nonzero_ring(_Ptr stack, QUAD_EDGE edge : count(4)) } } -void zero_seen(_Ptr my_stack, QUAD_EDGE edge : count(4)) +void zero_seen(_Ptr my_stack, QUAD_EDGE edge : quad_bounds(edge)) { my_stack->ptr = 0; push_nonzero_ring(my_stack, edge); diff --git a/MultiSource/Benchmarks/Olden/voronoi/output.c b/MultiSource/Benchmarks/Olden/voronoi/output.c index 186720381..80460d8bd 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/output.c +++ b/MultiSource/Benchmarks/Olden/voronoi/output.c @@ -88,9 +88,9 @@ struct VEC2 circle_center(struct VEC2 a, struct VEC2 b, struct VEC2 c) _Array_ptr earray; -void output_voronoi_diagram(QUAD_EDGE edge : count(4), int nv, _Ptr my_stack) +void output_voronoi_diagram(QUAD_EDGE edge : quad_bounds(edge), int nv, _Ptr my_stack) { - QUAD_EDGE nex : count(4) = NULL, prev : count(4) = NULL, snex : count(4) = NULL, sprev : count(4) = NULL; + QUAD_EDGE nex : quad_bounds(nex) = NULL, prev : quad_bounds(prev) = NULL, snex : quad_bounds(snex) = NULL, sprev : quad_bounds(sprev) = NULL; struct VEC2 cvxvec, center; double ln; @@ -103,7 +103,7 @@ void output_voronoi_diagram(QUAD_EDGE edge : count(4), int nv, _Ptr