| 9 |
|
#include <math.h> |
| 10 |
|
#include "platform.h" |
| 11 |
|
#include "rtio.h" |
| 12 |
– |
#include "resolu.h" |
| 12 |
|
#include "rmatrix.h" |
| 13 |
|
#include "calcomp.h" |
| 14 |
|
#include "paths.h" |
| 591 |
|
RMATRIX *mres = NULL; |
| 592 |
|
for (i = 0; i < nmats; i++) { |
| 593 |
|
if (!rmx_load_row(mop[i].imx.mtx, &mop[i].imx, mop[i].infp)) { |
| 594 |
< |
if (in_nrows <= 0) /* normal end? */ |
| 594 |
> |
if (cur_row > in_nrows) /* unknown #input rows? */ |
| 595 |
|
goto loop_exit; |
| 596 |
|
fprintf(stderr, "%s: read error at row %d\n", |
| 597 |
|
mop[i].inspec, cur_row); |
| 679 |
|
{ |
| 680 |
|
int i; |
| 681 |
|
|
| 682 |
< |
for (i = nmats; i > n2alloc; i--) { |
| 682 |
> |
if (n2alloc == nall) |
| 683 |
> |
return; |
| 684 |
> |
for (i = nall; i > n2alloc; i--) { |
| 685 |
|
rmx_reset(&mop[i].imx); |
| 686 |
|
if (mop[i].rmp != &mop[i].imx) |
| 687 |
|
rmx_free(mop[i].rmp); |
| 691 |
|
fputs("Out of memory in resize_inparr()\n", stderr); |
| 692 |
|
exit(1); |
| 693 |
|
} |
| 694 |
< |
if (n2alloc > nmats) |
| 695 |
< |
memset(mop+nmats, 0, (n2alloc-nmats)*sizeof(ROPMAT)); |
| 694 |
> |
if (n2alloc > nall) |
| 695 |
> |
memset(mop+nall, 0, (n2alloc-nall)*sizeof(ROPMAT)); |
| 696 |
|
nall = n2alloc; |
| 697 |
|
} |
| 698 |
|
|
| 869 |
|
fprintf(stderr, "%s: unsupported output format\n", argv[0]); |
| 870 |
|
return(1); |
| 871 |
|
} |
| 872 |
+ |
doptimize(1); /* optimize definitions */ |
| 873 |
|
/* process & write rows */ |
| 874 |
|
return(combine_input(&mop[nmats], stdout) ? 0 : 1); |
| 875 |
|
stdin_error: |