44 |
|
static void |
45 |
|
new_kids(TNODE *pn) |
46 |
|
{ |
47 |
< |
pn->kid = (TNODE *)calloc(1<<ttrank, sizeof(TNODE)); |
47 |
> |
pn->kid = (TNODE *)calloc((size_t)1<<ttrank, sizeof(TNODE)); |
48 |
|
if (pn->kid == NULL) |
49 |
|
error(SYSTEM, "out of memory in new_kids"); |
50 |
|
} |
155 |
|
bkmin[j] = bmin[j] + (i>>(ttrank-1-j) & 1); |
156 |
|
val = (ttrank == 3) ? dval3(bkmin[0],bkmin[1],bkmin[2]) |
157 |
|
: dval4(bkmin[0],bkmin[1],bkmin[2],bkmin[3]); |
158 |
< |
printf(" %.4e", val); |
158 |
> |
printf((0.001<=val)&(val<10.) ? " %.7f" : " %.3e", val); |
159 |
|
} |
160 |
|
fputs(" }\n", stdout); |
161 |
|
return; |
201 |
|
|
202 |
|
if ((rowp == NULL) | (n <= 0)) |
203 |
|
return(0); |
204 |
< |
nread = fread(rowp, sizeof(float), n, stdin); |
204 |
> |
nread = getbinary(rowp, sizeof(float), n, stdin); |
205 |
|
if (nread != n) |
206 |
|
error(USER, "unexpected EOF on float input"); |
207 |
|
return(nread); |
227 |
|
if (rowbuf == NULL) |
228 |
|
error(SYSTEM, "out of memory in read_double"); |
229 |
|
} |
230 |
< |
nread = fread(rowbuf, sizeof(double), n, stdin); |
230 |
> |
nread = getbinary(rowbuf, sizeof(double), n, stdin); |
231 |
|
if (nread != n) |
232 |
|
error(USER, "unexpected EOF on double input"); |
233 |
|
for (i = 0; i < nread; i++) |
276 |
|
error(COMMAND, "unsupported input format"); |
277 |
|
break; |
278 |
|
} |
279 |
< |
datarr = (float *)calloc(1<<(log2g*ttrank), sizeof(float)); |
279 |
> |
datarr = (float *)calloc((size_t)1<<(log2g*ttrank), sizeof(float)); |
280 |
|
if (datarr == NULL) |
281 |
|
error(SYSTEM, "out of memory in load_data"); |
282 |
|
if (ttrank == 3) { |