From: Mathieu Desnoyers Date: Tue, 8 Oct 2013 21:33:55 +0000 (-0400) Subject: gcc warning fix: -Wextra X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=refs%2Fheads%2Fstable-1.0;hp=be59aa1005711f38937aaf0f727374b4d092b354 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 --- 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) \ ({ \