--- ray/src/px/pinterp.c 1992/03/23 16:50:26 2.3 +++ ray/src/px/pinterp.c 1992/09/24 21:33:52 2.8 @@ -12,8 +12,6 @@ static char SCCSid[] = "$SunId$ LBL"; #include "standard.h" -#include - #include #include "view.h" @@ -34,7 +32,7 @@ static char SCCSid[] = "$SunId$ LBL"; #define PACKSIZ 256 /* max. calculation packet size */ -#define RTCOM "rtrace -h- -ovl -fff" +#define RTCOM "rtrace -h- -ovl -fff " #define ABS(x) ((x)>0?(x):-(x)) @@ -161,7 +159,9 @@ char *argv[]; vresolu = atoi(argv[++i]); break; case 'p': /* pixel aspect */ - check(2,"f"); + if (argv[i][2] != 'a') + goto badopt; + check(3,"f"); pixaspect = atof(argv[++i]); break; case 'v': /* view file */ @@ -197,10 +197,11 @@ char *argv[]; } normaspect(viewaspect(&ourview), &pixaspect, &hresolu, &vresolu); /* allocate frame */ - ourpict = (COLR *)malloc(hresolu*vresolu*sizeof(COLR)); - ourzbuf = (float *)calloc(hresolu*vresolu,sizeof(float)); + ourpict = (COLR *)bmalloc(hresolu*vresolu*sizeof(COLR)); + ourzbuf = (float *)bmalloc(hresolu*vresolu*sizeof(float)); if (ourpict == NULL || ourzbuf == NULL) syserror(); + bzero((char *)ourzbuf, hresolu*vresolu*sizeof(float)); /* get input */ for ( ; i < argc; i += 2) addpicture(argv[i], argv[i+1]); @@ -243,8 +244,6 @@ userr: headline(s) /* process header string */ char *s; { - static char *altname[] = {VIEWSTR,"rpict","rview","pinterp",NULL}; - register char **an; char fmt[32]; if (isformat(s)) { @@ -259,12 +258,8 @@ char *s; theirexp *= exposval(s); return; } - for (an = altname; *an != NULL; an++) - if (!strncmp(*an, s, strlen(*an))) { - if (sscanview(&theirview, s+strlen(*an)) > 0) - gotview++; - break; - } + if (isview(s) && sscanview(&theirview, s) > 0) + gotview++; }