diff --git a/include/arrow.h b/include/arrow.h index 20cbdc086eefab026c8e9ae26443b359ca2b30da..abb92b218d1ad1d0dfae3853ce4b75b60cd1d928 100644 --- a/include/arrow.h +++ b/include/arrow.h @@ -27,11 +27,9 @@ extern void _arrow_dealloc (struct _arrow_mem *); #define _arrow_reset(self) {(self)->_reg._first = 1;} inline _Bool _arrow_step(struct _arrow_mem *self) { - if (self->_reg._first) { - self->_reg._first = 0; - return 1; - } - return 0; + _Bool old = self->_reg._first; + self->_reg._first = 0; + return old; } #endif diff --git a/include/arrow_spec.h b/include/arrow_spec.h index 06b717c1b9ba3751dd0daf00bb085a30541e80a2..d07f8b5e42a6e5bca8e0a9c0b76bb53551f1e547 100644 --- a/include/arrow_spec.h +++ b/include/arrow_spec.h @@ -67,12 +67,10 @@ extern void _arrow_dealloc (struct _arrow_mem *); inline _Bool _arrow_step(struct _arrow_mem *self) /*@ ghost (struct _arrow_mem_ghost \ghost *mem) */ { - if (self->_reg._first) { - self->_reg._first = 0; - //@ ghost mem->_reg._first = 0; - return 1; - } - return 0; + _Bool old = self->_reg._first; + self->_reg._first = 0; + //@ ghost mem->_reg._first = 0; + return old; } /*@ ghost