From 031a946495a7b5139c2ebf24d363299073924d7e Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 8 Oct 2013 17:33:55 -0400 Subject: [PATCH] gcc warning fix: -Wextra For the "ordered comparison of pointer with integer zero" warning, fix this by comparing (type) -1 against (type) 0 instead of just 0, so if "type" is a pointer type, this pointer type will be applied to the right operand too, thus fixing the warning. Signed-off-by: Mathieu Desnoyers --- include/babeltrace/bitfield.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/babeltrace/bitfield.h b/include/babeltrace/bitfield.h index 40c11614..b7fce093 100644 --- a/include/babeltrace/bitfield.h +++ b/include/babeltrace/bitfield.h @@ -57,7 +57,7 @@ ___v <<= final; \ }) -#define _bt_is_signed_type(type) (((type)(-1)) < 0) +#define _bt_is_signed_type(type) ((type) -1 < (type) 0) #define _bt_unsigned_cast(type, v) \ ({ \ -- 2.34.1