mirror of https://github.com/schoebel/mars
copy: safeguard against strange compiler warnings
This commit is contained in:
parent
0213d4d461
commit
f92a44ecfa
|
@ -524,7 +524,9 @@ restart:
|
||||||
_clear_mref(brick, index, 0);
|
_clear_mref(brick, index, 0);
|
||||||
next_state = COPY_STATE_START;
|
next_state = COPY_STATE_START;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_START;
|
||||||
case COPY_STATE_START:
|
case COPY_STATE_START:
|
||||||
|
label_COPY_STATE_START:
|
||||||
/* This is the relgular starting state.
|
/* This is the relgular starting state.
|
||||||
* It must be zero, automatically entered via memset()
|
* It must be zero, automatically entered via memset()
|
||||||
*/
|
*/
|
||||||
|
@ -561,7 +563,9 @@ restart:
|
||||||
|
|
||||||
next_state = COPY_STATE_START2;
|
next_state = COPY_STATE_START2;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_START2;
|
||||||
case COPY_STATE_START2:
|
case COPY_STATE_START2:
|
||||||
|
label_COPY_STATE_START2:
|
||||||
status = _make_mref(brick, index, 1, NULL,
|
status = _make_mref(brick, index, 1, NULL,
|
||||||
pos, brick->copy_end,
|
pos, brick->copy_end,
|
||||||
_make_flags(true, true));
|
_make_flags(true, true));
|
||||||
|
@ -572,15 +576,19 @@ restart:
|
||||||
}
|
}
|
||||||
next_state = COPY_STATE_READ2;
|
next_state = COPY_STATE_READ2;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_READ2;
|
||||||
case COPY_STATE_READ2:
|
case COPY_STATE_READ2:
|
||||||
|
label_COPY_STATE_READ2:
|
||||||
if (READ_ONCE(st->active[1])) {
|
if (READ_ONCE(st->active[1])) {
|
||||||
/* idempotence: wait by unchanged state */
|
/* idempotence: wait by unchanged state */
|
||||||
goto idle;
|
goto idle;
|
||||||
}
|
}
|
||||||
/* wait for both mrefs to appear */
|
/* wait for both mrefs to appear */
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_READ3;
|
||||||
case COPY_STATE_READ1:
|
case COPY_STATE_READ1:
|
||||||
case COPY_STATE_READ3:
|
case COPY_STATE_READ3:
|
||||||
|
label_COPY_STATE_READ3:
|
||||||
if (READ_ONCE(st->active[0])) {
|
if (READ_ONCE(st->active[0])) {
|
||||||
/* idempotence: wait by unchanged state */
|
/* idempotence: wait by unchanged state */
|
||||||
goto idle;
|
goto idle;
|
||||||
|
@ -644,7 +652,9 @@ restart:
|
||||||
}
|
}
|
||||||
next_state = COPY_STATE_WRITE;
|
next_state = COPY_STATE_WRITE;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_WRITE;
|
||||||
case COPY_STATE_WRITE:
|
case COPY_STATE_WRITE:
|
||||||
|
label_COPY_STATE_WRITE:
|
||||||
if (is_write_limited(brick))
|
if (is_write_limited(brick))
|
||||||
goto idle;
|
goto idle;
|
||||||
/* Obey ordering to get a strict "append" behaviour.
|
/* Obey ordering to get a strict "append" behaviour.
|
||||||
|
@ -703,7 +713,9 @@ restart:
|
||||||
st->writeout = true;
|
st->writeout = true;
|
||||||
next_state = COPY_STATE_WRITTEN;
|
next_state = COPY_STATE_WRITTEN;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_WRITTEN;
|
||||||
case COPY_STATE_WRITTEN:
|
case COPY_STATE_WRITTEN:
|
||||||
|
label_COPY_STATE_WRITTEN:
|
||||||
if (READ_ONCE(st->active[1])) {
|
if (READ_ONCE(st->active[1])) {
|
||||||
/* idempotence: wait by unchanged state */
|
/* idempotence: wait by unchanged state */
|
||||||
MARS_IO("irrelevant\n");
|
MARS_IO("irrelevant\n");
|
||||||
|
@ -721,12 +733,16 @@ restart:
|
||||||
}
|
}
|
||||||
next_state = COPY_STATE_CLEANUP;
|
next_state = COPY_STATE_CLEANUP;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_CLEANUP;
|
||||||
case COPY_STATE_CLEANUP:
|
case COPY_STATE_CLEANUP:
|
||||||
|
label_COPY_STATE_CLEANUP:
|
||||||
_clear_mref(brick, index, 1);
|
_clear_mref(brick, index, 1);
|
||||||
_clear_mref(brick, index, 0);
|
_clear_mref(brick, index, 0);
|
||||||
next_state = COPY_STATE_FINISHED;
|
next_state = COPY_STATE_FINISHED;
|
||||||
/* fallthrough */
|
/* fallthrough */
|
||||||
|
goto label_COPY_STATE_FINISHED;
|
||||||
case COPY_STATE_FINISHED:
|
case COPY_STATE_FINISHED:
|
||||||
|
label_COPY_STATE_FINISHED:
|
||||||
/* Indicate successful completion by remaining in this state.
|
/* Indicate successful completion by remaining in this state.
|
||||||
* Restart of the finite automaton must be done externally.
|
* Restart of the finite automaton must be done externally.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue