compiler warning cleanup: is_signed_type: compare -1 to 1
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 25 Mar 2021 18:32:40 +0000 (14:32 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 25 Mar 2021 21:39:08 +0000 (17:39 -0400)
commit7eae5d7fb9dea124b0ea0e70d09c1872398dce90
tree5f6e45a0620578a73dcea06509a09ef61078d691
parentf3fc144598abc7d4d291521ff1a660031f77bec4
compiler warning cleanup: is_signed_type: compare -1 to 1

Comparing -1 to 0 triggers compiler warnings (gcc -Wtype-limits and
-Wbool-compare) and Coverity warning "Macro compares unsigned to 0".

Comparing -1 to 1 instead takes care of silencing those warnings while
keeping the same behavior.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I7d3a2d5a813838cef0e7b42d8c80ccf46f27ac62
Reviewed-on: https://review.lttng.org/c/babeltrace/+/5188
CI-Build: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/compat/bitfield.h
This page took 0.024743 seconds and 4 git commands to generate.