18 |
|
#include "triangulate.h" |
19 |
|
#include "platform.h" |
20 |
|
|
21 |
< |
#define MAXRCARG 512 |
21 |
> |
#ifndef MAXRCARG |
22 |
> |
#define MAXRCARG 10000 |
23 |
> |
#endif |
24 |
|
|
25 |
|
char *progname; /* global argv[0] */ |
26 |
|
|
141 |
|
if (ac-- <= 0) |
142 |
|
return(NULL); |
143 |
|
if (verbose < 0) { /* turn off warnings */ |
144 |
< |
strcpy(cp, "-w- "); |
145 |
< |
cp += 4; |
144 |
> |
strcpy(cp, "-w "); |
145 |
> |
cp += 3; |
146 |
|
} |
147 |
< |
while (ac-- > 0) { |
148 |
< |
strcpy(cp, *av++); |
149 |
< |
while (*cp) cp++; |
148 |
< |
*cp++ = ' '; |
149 |
< |
if (cp >= oconvbuf+(sizeof(oconvbuf)-32)) |
147 |
> |
while (ac-- > 0) { /* copy each argument */ |
148 |
> |
int len = strlen(*av); |
149 |
> |
if (cp+len+4 >= oconvbuf+sizeof(oconvbuf)) |
150 |
|
goto overrun; |
151 |
+ |
if (matchany(*av, SPECIALS)) { |
152 |
+ |
*cp++ = QUOTCHAR; |
153 |
+ |
strcpy(cp, *av++); |
154 |
+ |
cp += len; |
155 |
+ |
*cp++ = QUOTCHAR; |
156 |
+ |
} else { |
157 |
+ |
strcpy(cp, *av++); |
158 |
+ |
cp += len; |
159 |
+ |
} |
160 |
+ |
*cp++ = ' '; |
161 |
|
} |
162 |
|
/* receiver goes last */ |
163 |
|
if (matchany(recv, SPECIALS)) { |
669 |
|
projsa[i] = -DOT(sp->snrm, rdir) * sp->area; |
670 |
|
tarea += projsa[i] *= (double)(projsa[i] > FTINY); |
671 |
|
} |
672 |
< |
if (tarea <= FTINY) { /* wrong side of sender? */ |
672 |
> |
if (tarea < 0) { /* wrong side of sender? */ |
673 |
|
fputs(progname, stderr); |
674 |
|
fputs(": internal - sample behind all sender elements!\n", |
675 |
|
stderr); |
770 |
|
} |
771 |
|
while (n--) { /* stratified sampling */ |
772 |
|
SDmultiSamp(samp3, 3, (n+frandom())/sampcnt); |
773 |
+ |
if (row >= RowMax-1) /* avoid crowding at zenith */ |
774 |
+ |
samp3[1] *= samp3[1]; |
775 |
|
alt = (row+samp3[1])*RAH; |
776 |
|
azi = (2.*PI)*(col+samp3[2]-.5)/rnaz(row); |
777 |
|
duvw[2] = cos(alt); /* measured from horizon */ |
778 |
|
duvw[0] = tsin(azi)*duvw[2]; |
779 |
< |
duvw[1] = tcos(azi)*duvw[2]; |
779 |
> |
duvw[1] = -tcos(azi)*duvw[2]; |
780 |
|
duvw[2] = sqrt(1. - duvw[2]*duvw[2]); |
781 |
|
for (i = 3; i--; ) |
782 |
|
orig_dir[1][i] = -duvw[0]*p->udir[i] - |
1244 |
|
na = 0; |
1245 |
|
continue; |
1246 |
|
case 'w': /* options without arguments */ |
1247 |
< |
if (argv[a][2] != '+') verbose = -1; |
1247 |
> |
if (!argv[a][2] || strchr("+1tTyY", argv[a][2]) == NULL) |
1248 |
> |
verbose = -1; |
1249 |
> |
break; |
1250 |
|
case 'V': |
1251 |
|
case 'u': |
1252 |
|
case 'h': |