--- ray/src/common/mesh.c 2004/02/12 18:55:50 2.17 +++ ray/src/common/mesh.c 2011/02/18 00:40:25 2.23 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: mesh.c,v 2.17 2004/02/12 18:55:50 greg Exp $"; +static const char RCSid[] = "$Id: mesh.c,v 2.23 2011/02/18 00:40:25 greg Exp $"; #endif /* * Mesh support routines @@ -32,9 +32,9 @@ static MESH *mlist = NULL; /* list of loaded meshes * static unsigned long -cvhash(cvp) /* hash an encoded vertex */ -MCVERT *cvp; +cvhash(const char *p) /* hash an encoded vertex */ { + const MCVERT *cvp = (const MCVERT *)p; unsigned long hval; if (!(cvp->fl & MT_V)) @@ -49,9 +49,9 @@ MCVERT *cvp; static int -cvcmp(v1, v2) /* compare encoded vertices */ -register MCVERT *v1, *v2; +cvcmp(const char *vv1, const char *vv2) /* compare encoded vertices */ { + const MCVERT *v1 = (const MCVERT *)vv1, *v2 = (const MCVERT *)vv2; if (v1->fl != v2->fl) return(1); if (v1->xyz[0] != v2->xyz[0]) @@ -546,8 +546,6 @@ register MESH *mp; if (nouvbounds && pp->uv != NULL) return("unreferenced uv coordinates"); } - if (pp->ntris + pp->nj1tris + pp->nj2tris <= 0) - error(WARNING, "no triangles in patch"); if (pp->ntris > 0 && pp->tri == NULL) return("missing patch triangle list"); if (pp->nj1tris > 0 && pp->j1tri == NULL) @@ -615,7 +613,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) +