--- ray/src/common/mesh.c 2004/03/16 19:56:27 2.18 +++ ray/src/common/mesh.c 2010/12/15 17:27:52 2.22 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: mesh.c,v 2.18 2004/03/16 19:56:27 greg Exp $"; +static const char RCSid[] = "$Id: mesh.c,v 2.22 2010/12/15 17:27:52 greg Exp $"; #endif /* * Mesh support routines @@ -30,11 +30,16 @@ typedef struct { static MESH *mlist = NULL; /* list of loaded meshes */ +static lut_keycmpf_t cvcmp; +static lut_hashf_t cvhash; + static unsigned long -cvhash(cvp) /* hash an encoded vertex */ -MCVERT *cvp; +cvhash(p) /* hash an encoded vertex */ +/* MCVERT *cvp; */ +const void *p; { + const MCVERT *cvp = (const MCVERT *)p; unsigned long hval; if (!(cvp->fl & MT_V)) @@ -49,9 +54,11 @@ MCVERT *cvp; static int -cvcmp(v1, v2) /* compare encoded vertices */ -register MCVERT *v1, *v2; +cvcmp(vv1, vv2) /* compare encoded vertices */ +/* register MCVERT *v1, *v2; */ +const void *vv1, *vv2; { + const MCVERT *v1 = vv1, *v2 = vv2; if (v1->fl != v2->fl) return(1); if (v1->xyz[0] != v2->xyz[0]) @@ -613,7 +620,7 @@ FILE *fp; t2cnt += pp->nj2tris; } fprintf(fp, "Mesh statistics:\n"); - fprintf(fp, "\t%ld materials\n", ms->nmats); + fprintf(fp, "\t%ld materials\n", (long)ms->nmats); fprintf(fp, "\t%d patches (%.2f MBytes)\n", ms->npatches, (ms->npatches*sizeof(MESHPATCH) + vcnt*3*sizeof(uint32) +