test-loop: increment a variable outside of spice_assert

spice_assert is a macro and covscan reports that:
  Argument "++twice_remove_called" of spice_assert() has a side effect.

Doesn't matter if there is a side effects or not,
it's a good practice and it makes covscan happy, so
increment the variable one line above.

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Uri Lublin 2019-08-22 18:53:12 +03:00 committed by Frediano Ziglio
parent e9c8b25904
commit a9d53f3cd1

View File

@ -78,7 +78,8 @@ static SpiceTimer *twice_timers_remove[2] = { NULL, NULL };
static int twice_remove_called = 0;
static void timer_not_twice_remove(void *opaque)
{
spice_assert(++twice_remove_called == 1);
++twice_remove_called;
spice_assert(twice_remove_called == 1);
/* delete timers, should not have another call */
core->timer_remove(twice_timers_remove[0]);