mirror of
https://github.com/schoebel/mars
synced 2024-12-11 09:15:48 +00:00
copy: fix error attribution to progress
This commit is contained in:
parent
3a790eadfc
commit
4e8f5d42e1
@ -673,15 +673,21 @@ int _run_copy(struct copy_brick *brick)
|
|||||||
for (pos = brick->copy_last; pos < brick->copy_end || brick->append_mode > 1; pos = ((pos / COPY_CHUNK) + 1) * COPY_CHUNK) {
|
for (pos = brick->copy_last; pos < brick->copy_end || brick->append_mode > 1; pos = ((pos / COPY_CHUNK) + 1) * COPY_CHUNK) {
|
||||||
int index = GET_INDEX(pos);
|
int index = GET_INDEX(pos);
|
||||||
struct copy_state *st = &GET_STATE(brick, index);
|
struct copy_state *st = &GET_STATE(brick, index);
|
||||||
|
int this_progress;
|
||||||
|
|
||||||
if (max-- <= 0) {
|
if (max-- <= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
st->prev = prev;
|
st->prev = prev;
|
||||||
prev = index;
|
prev = index;
|
||||||
|
if (st->active[0] & st->active[1])
|
||||||
|
break;
|
||||||
|
|
||||||
// call the finite state automaton
|
// call the finite state automaton
|
||||||
if (!(st->active[0] | st->active[1])) {
|
this_progress = _next_state(brick, index, pos);
|
||||||
progress += _next_state(brick, index, pos);
|
if (this_progress < 0)
|
||||||
}
|
break;
|
||||||
|
progress += this_progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the resulting state: can we advance the copy_last pointer?
|
// check the resulting state: can we advance the copy_last pointer?
|
||||||
|
Loading…
Reference in New Issue
Block a user