version 1.3, 1997/02/25 00:05:13 |
version 1.4, 2001/11/19 19:02:18 |
|
|
wwupdate1(top, bot) |
wwupdate1(top, bot) |
{ |
{ |
int i; |
int i; |
register j; |
int j; |
char *touched; |
char *touched; |
struct ww_update *upd; |
struct ww_update *upd; |
char check_clreos = 0; |
char check_clreos = 0; |
|
|
|
|
wwnupdate++; |
wwnupdate++; |
{ |
{ |
register char *t1 = wwtouched + top, *t2 = wwtouched + bot; |
char *t1 = wwtouched + top, *t2 = wwtouched + bot; |
register n; |
int n; |
|
|
while (!*t1++) |
while (!*t1++) |
if (t1 == t2) |
if (t1 == t2) |
|
|
for (i = scan_top, touched = &wwtouched[i], upd = &wwupd[i]; |
for (i = scan_top, touched = &wwtouched[i], upd = &wwupd[i]; |
i < scan_bot; |
i < scan_bot; |
i++, touched++, upd++) { |
i++, touched++, upd++) { |
register gain = 0; |
int gain = 0; |
register best_gain = 0; |
int best_gain = 0; |
register best_col; |
int best_col; |
register union ww_char *ns, *os; |
union ww_char *ns, *os; |
|
|
if (wwinterrupt()) |
if (wwinterrupt()) |
return; |
return; |
|
|
upd->gain = gain; |
upd->gain = gain; |
} |
} |
if (check_clreos) { |
if (check_clreos) { |
register struct ww_update *u; |
struct ww_update *u; |
register gain = 0; |
int gain = 0; |
register best_gain = 0; |
int best_gain = 0; |
int best_row; |
int best_row; |
register simple_gain = 0; |
int simple_gain = 0; |
char didit = 0; |
char didit = 0; |
|
|
/* |
/* |
|
|
* undefined when u->best_gain is 0 so we can't use it. |
* undefined when u->best_gain is 0 so we can't use it. |
*/ |
*/ |
for (j = scan_bot - 1, u = wwupd + j; j >= top; j--, u--) { |
for (j = scan_bot - 1, u = wwupd + j; j >= top; j--, u--) { |
register g = gain + u->best_gain; |
int g = gain + u->best_gain; |
|
|
if (g > best_gain) { |
if (g > best_gain) { |
best_gain = g; |
best_gain = g; |
|
|
wwnupdclreosline += wwnrow - i; |
wwnupdclreosline += wwnrow - i; |
u = wwupd + i; |
u = wwupd + i; |
while (i < scan_bot) { |
while (i < scan_bot) { |
register union ww_char *os = &wwos[i][j]; |
union ww_char *os = &wwos[i][j]; |
|
|
for (j = wwncol - j; --j >= 0;) |
for (j = wwncol - j; --j >= 0;) |
os++->c_w = ' '; |
os++->c_w = ' '; |
|
|
simple: |
simple: |
for (i = top, touched = &wwtouched[i], upd = &wwupd[i]; i < bot; |
for (i = top, touched = &wwtouched[i], upd = &wwupd[i]; i < bot; |
i++, touched++, upd++) { |
i++, touched++, upd++) { |
register union ww_char *os, *ns; |
union ww_char *os, *ns; |
char didit; |
char didit; |
|
|
if (!*touched) |
if (!*touched) |
|
|
ns = wwns[i]; |
ns = wwns[i]; |
os = wwos[i]; |
os = wwos[i]; |
for (j = 0; j < wwncol;) { |
for (j = 0; j < wwncol;) { |
register char *p, *q; |
char *p, *q; |
char m; |
char m; |
int c; |
int c; |
register n; |
int n; |
char buf[512]; /* > wwncol */ |
char buf[512]; /* > wwncol */ |
union ww_char lastc; |
union ww_char lastc; |
|
|