=================================================================== RCS file: ch.c,v retrieving revision 1.1 diff -u -r1.1 ch.c --- ch.c 2006/04/11 22:21:29 1.1 +++ ch.c 2006/04/11 23:04:33 @@ -125,7 +125,7 @@ double logb(double); /* on SGI machines: returns floor of log base 2 */ static short vd; -static basis_s tt_basis = {0,1,-1,0,0,0}, +static basis_s tt_basis = {0,1,-1,0,0,{0}}, *tt_basisp = &tt_basis, *infinity_basis; @@ -217,7 +217,7 @@ for (j=0;j<6;j++) do { for (i=0; i<2*rdim && facs[j]*floor(vp[i]/facs[j])==vp[i];i++); - if (h = (i==2*rdim)) { + if (0 != (h = (i==2*rdim))) { hh=1; out *= facs[j]; for (i=0;i<2*rdim; i++) vp[i]/=facs[j]; @@ -235,7 +235,7 @@ for (j=0;j<6;j++) do { for (i=0; i<2*rdim && facs[j]*floor(vp[i]/facs[j])==vp[i];i++); - if (h = (i==2*rdim)) { + if (0 != (h = (i==2*rdim))) { hh=1; out *= facs[j]; for (i=0;i<2*rdim; i++) vp[i]/=facs[j]; @@ -250,9 +250,7 @@ point va = VA(v), vb = VB(v); int i,j; - double dd, - ldetbound = 0, - Sb = 0; + double dd; double scale; basis_s *snibv; neighbor *sni; @@ -506,7 +504,6 @@ double radsq(simplex *s) { - Coord z[MAXDIM]; point n; neighbor *sn; int i; =================================================================== RCS file: fg.c,v retrieving revision 1.1 diff -u -r1.1 fg.c --- fg.c 2006/04/11 22:36:28 1.1 +++ fg.c 2006/04/11 22:58:27 @@ -252,7 +252,7 @@ if (!t) return; printtree_flat_inner(t->right); - printf("%d ", t->key);fflush(stdout); + printf("%d ", (int)t->key);fflush(stdout); printtree_flat_inner(t->left); } @@ -307,7 +307,7 @@ neighbor t, *si, *sj, *sn = s->neigh; fg *fq; - int q,m,Q=1<sn+1 && snkey(sj-1) > snkey(sj); sj--) @@ -408,8 +408,7 @@ static int fa[MAXDIM]; static point fp[MAXDIM]; - int i,th; - point tp; + int i; fa[depth] = site_num(t->key); fp[depth] = t->key; @@ -433,7 +432,6 @@ double fg_hist[100][100], fg_hist_bad[100][100],fg_hist_far[100][100]; void h_fg(Tree *t, int depth, int bad) { - int i; if (!t->fgs->facets) return; if (bad) { fg_hist_bad[depth][t->fgs->facets->size]++; =================================================================== RCS file: GNUmakefile,v retrieving revision 1.1 diff -u -r1.1 GNUmakefile --- GNUmakefile 2006/04/11 21:49:28 1.1 +++ GNUmakefile 2006/04/11 22:57:23 @@ -0,0 +1,39 @@ +# to install executable into $(BINDIR), +# and function library into $(LIBDIR), +# type "make". + +CC = gcc +AR = ar +CFLAGS = -O -Wall -g +OBJS = hull.o ch.o io.o rand.o pointops.o fg.o +HDRS = hull.h points.h pointsites.h stormacs.h +SRC = hull.c ch.c io.c rand.c pointops.c fg.c +PROG = hull +BINDIR = ../bin +LIBDIR = ../lib +LIB = $(LIBDIR)/lib$(PROG).a + +all : $(PROG) rsites + mkdir -p $(BINDIR) + cp $(PROG) $(BINDIR)/. + cp rsites $(BINDIR)/. + +$(PROG) : $(OBJS) hullmain.o + $(CC) $(CFLAGS) $(OBJS) hullmain.o -o $(PROG) -lm + $(AR) rcv $(LIB) $(OBJS) + +rsites : rsites.c + $(CC) $(CFLAGS) -o rsites rsites.c -lm + +clean : + -rm -f $(OBJS) hullmain.o core a.out $(PROG) + +#dependencies generated with gcc -MM +ch.o: ch.c hull.h points.h stormacs.h +fg.o: fg.c hull.h points.h stormacs.h +hull.o: hull.c hull.h points.h stormacs.h +hullmain.o: hullmain.c hull.h points.h stormacs.h +io.o: io.c hull.h points.h stormacs.h +pointops.o: pointops.c points.h +rand.o: rand.c hull.h points.h stormacs.h +rsites.o: rsites.c =================================================================== RCS file: hull.c,v retrieving revision 1.1 diff -u -r1.1 hull.c --- hull.c 2006/04/11 21:53:59 1.1 +++ hull.c 2006/04/11 21:58:09 @@ -64,7 +64,7 @@ pop(t); if (!t || t->visit == vnum) continue; t->visit = vnum; - if (v=(*visit)(t,0)) {return v;} + if (0 != (v=(*visit)(t,0)) ) {return v;} for (i=-1,sn = t->neigh-1;isimp->visit != vnum) && sn->simp && test(t,i,0)) push(sn->simp); @@ -286,6 +286,6 @@ else connect(make_facets(search(root))); } - while (p = get_another_site()) + while (0 != (p = get_another_site())) connect(make_facets(search(root))); } =================================================================== RCS file: hullmain.c,v retrieving revision 1.1 diff -u -r1.1 hullmain.c --- hullmain.c 2006/04/11 21:58:18 1.1 +++ hullmain.c 2006/04/11 22:25:20 @@ -37,7 +37,7 @@ static short vd = 0; static int dim; -FILE *INFILE, *OUTFILE, *DFILE = stderr, *TFILE; +FILE *INFILE, *OUTFILE, *DFILE, *TFILE; long site_numm(site p) { @@ -213,12 +213,11 @@ -void main(int argc, char **argv) { +int main(int argc, char **argv) { long seed = 0; short shuffle = 0, - pine = 0, output = 1, hist = 0, vol = 0, @@ -235,6 +234,7 @@ simplex *root; fg *faces_gr; + DFILE = stderr; mult_up = 1; while ((option = getopt(argc, argv, "i:m:rs:do:X:a:Af:")) != EOF) { @@ -282,12 +282,12 @@ case 'h': hist = 1; break; case 'F': strcpy(ofile, optarg+1); break; default: errline("illegal output option"); - exit(1); + return 1; } break; default : tell_options(); - exit(1); + return 1; } } @@ -319,7 +319,7 @@ if (shuffle) { fprintf(DFILE, "reading sites..."); for (num_sites=0; read_next_site(num_sites); num_sites++); - fprintf(DFILE,"done; num_sites=%d\n", num_sites);fflush(DFILE); + fprintf(DFILE,"done; num_sites=%ld\n", num_sites);fflush(DFILE); fprintf(DFILE,"shuffling..."); init_rand(seed); make_shuffle(); @@ -387,5 +387,5 @@ free_hull_storage(); - exit(0); + return 0; } =================================================================== RCS file: io.c,v retrieving revision 1.1 diff -u -r1.1 io.c --- io.c 2006/04/11 22:33:19 1.1 +++ io.c 2006/04/11 22:35:37 @@ -49,7 +49,7 @@ FILE* efopen(char *file, char *mode) { FILE* fp; - if (fp = fopen(file, mode)) return fp; + if (0 != (fp = fopen(file, mode))) return fp; fprintf(DFILE, "couldn't open file %s mode %s\n",file,mode); exit(1); return NULL; @@ -57,7 +57,7 @@ FILE* epopen(char *com, char *mode) { FILE* fp; - if (fp = popen(com, mode)) return fp; + if (0 != (fp = popen(com, mode))) return fp; fprintf(stderr, "couldn't open stream %s mode %s\n",com,mode); exit(1); return 0; @@ -69,7 +69,7 @@ assert(site_num!=NULL); if (n->vert) - fprintf(F, "%d ", (*site_num)(n->vert)); + fprintf(F, "%ld ", (*site_num)(n->vert)); else fprintf(F, "NULL vert "); fflush(stdout); @@ -167,7 +167,7 @@ sns = sn->simp; if (!sns) { fprintf(DFILE, "check_triang; bad simplex\n"); - print_simplex_f(s, DFILE, &print_neighbor_full); fprintf(DFILE, "site_num(p)=%G\n",site_num(p)); + print_simplex_f(s, DFILE, &print_neighbor_full); fprintf(DFILE, "site_num(p)=%G\n",(double) site_num(p)); return s; } if (!s->peak.vert && sns->peak.vert && i!=-1) { @@ -223,7 +223,7 @@ if (Fin) {F=Fin; if (!v) return;} - for (j=0;jneigh-1;ineigh-1;ibasis); \ }