Fix: counter: cast UINT*_MAX to 64-bit signed type before negative
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 26 Nov 2020 20:29:28 +0000 (15:29 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 26 Nov 2020 20:29:28 +0000 (15:29 -0500)
commitf801323dd7650782241e276d5a2971fc37312fa8
treea79041aaaab1124ef44ba6613d0e512ed39dde96
parentd410bc8d04b373105d94a884fedd07c93c92b741
Fix: counter: cast UINT*_MAX to 64-bit signed type before negative

(long long)-UINT32_MAX leads to value 1 which is not what we expect.
This is due to implicit type promotion from unsigned to signed 32-bit
integer.

Apply this to 8-bit and 16-bit types as well even though they are
not affected by this issue to keep things regular.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/counter/counter-api.h
This page took 0.02538 seconds and 4 git commands to generate.