From: Mathieu Desnoyers Date: Tue, 8 Oct 2013 21:35:15 +0000 (-0400) Subject: gcc warning fix: -Wextra X-Git-Tag: v2.3.1~8 X-Git-Url: http://git.lttng.org/?p=lttng-ust.git;a=commitdiff_plain;h=6f0f3216eb57ce0eda0f0f1195d9f7181bac7d83 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/lttng/bitfield.h b/include/lttng/bitfield.h index 391cf509..ef5453c2 100644 --- a/include/lttng/bitfield.h +++ b/include/lttng/bitfield.h @@ -56,7 +56,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) \ ({ \ diff --git a/include/lttng/ust-tracer.h b/include/lttng/ust-tracer.h index b4268ac5..ec30db74 100644 --- a/include/lttng/ust-tracer.h +++ b/include/lttng/ust-tracer.h @@ -45,6 +45,6 @@ #define lttng_alignof(type) 1 #endif -#define lttng_is_signed_type(type) (((type)(-1)) < 0) +#define lttng_is_signed_type(type) ((type) -1 < (type) 0) #endif /* _LTTNG_UST_TRACER_H */