trace: C++20 compatibility

With the new standard, volatile variables cannot be incremented,
decremented, or modified by compound assignments (e.g., +=).

Issue #4869
This commit is contained in:
Norman Feske 2023-05-15 17:32:20 +02:00 committed by Christian Helmuth
parent 1dac048413
commit f679864c23
3 changed files with 4 additions and 4 deletions

View File

@ -185,7 +185,7 @@ class Genode::Trace::Simple_buffer
* the new head
*/
size_t *old_head_len = &_head_entry()->len;
_num_entries++;
_num_entries = _num_entries + 1;
/* advance head offset, wrap when next entry does not fit into buffer */
_head_offset += sizeof(_Entry) + len;

View File

@ -145,7 +145,7 @@ class Genode::Trace::Control
void trace()
{
_policy_version++;
_policy_version = _policy_version + 1;
enable();
}

View File

@ -81,7 +81,7 @@ Trace::Simple_buffer &Trace::Partitioned_buffer::_switch_producer()
* consumer may still switch partitions at this point but not continue
* reading until we set the new head entry
*/
_lost_entries += _producer()._num_entries;
_lost_entries = _lost_entries + _producer()._num_entries;
switched = true;
}
}
@ -92,7 +92,7 @@ Trace::Simple_buffer &Trace::Partitioned_buffer::_switch_producer()
/* XXX _wrapped only needed for testing */
if (State::Producer::get(_state) == PRIMARY)
_wrapped++;
_wrapped = _wrapped + 1;
Genode::memory_barrier();
_consumer_lock = SPINLOCK_UNLOCKED;