--- ray/src/common/xf.c 1991/12/19 14:45:41 2.2 +++ ray/src/common/xf.c 2020/04/02 20:44:15 2.8 @@ -1,16 +1,15 @@ -/* Copyright (c) 1990 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: xf.c,v 2.8 2020/04/02 20:44:15 greg Exp $"; #endif - /* * xf.c - routines to convert transform arguments into 4X4 matrix. * - * 1/28/86 + * External symbols declared in rtmath.h */ -#include "standard.h" +#include +#include "rtmath.h" +#include "rtio.h" #define d2r(a) ((PI/180.)*(a)) @@ -18,10 +17,7 @@ static char SCCSid[] = "$SunId$ LBL"; int -xf(ret, ac, av) /* get transform specification */ -register XF *ret; -int ac; -char *av[]; +xf(XF *ret, int ac, char *av[]) /* get transform specification */ { MAT4 xfmat, m4; double xfsca, dtmp; @@ -68,7 +64,7 @@ char *av[]; m4[1][0] = -(m4[0][1] = sin(dtmp)); break; default: - return(i); + goto done; } break; @@ -101,7 +97,7 @@ char *av[]; m4[2][2] = -1.0; break; default: - return(i); + goto done; } break; @@ -117,7 +113,7 @@ char *av[]; continue; default: - return(i); + goto done; } multmat4(xfmat, xfmat, m4); @@ -132,10 +128,7 @@ done: int -invxf(ret, ac, av) /* invert transform specification */ -register XF *ret; -int ac; -char *av[]; +invxf(XF *ret, int ac, char *av[]) /* invert transform specification */ { MAT4 xfmat, m4; double xfsca, dtmp; @@ -182,7 +175,7 @@ char *av[]; m4[1][0] = -(m4[0][1] = sin(dtmp)); break; default: - return(i); + goto done; } break; @@ -215,7 +208,7 @@ char *av[]; m4[2][2] = -1.0; break; default: - return(i); + goto done; } break; @@ -231,7 +224,7 @@ char *av[]; break; default: - return(i); + goto done; } multmat4(xfmat, m4, xfmat); /* left multiply */ @@ -246,10 +239,7 @@ done: int -fullxf(fx, ac, av) /* compute both forward and inverse */ -FULLXF *fx; -int ac; -char *av[]; +fullxf(FULLXF *fx, int ac, char *av[]) /* compute both forward and inverse */ { xf(&fx->f, ac, av); return(invxf(&fx->b, ac, av));