]> git.lttng.org Git - lttng-ust.git/commitdiff
gcc warning fix: -Wextra
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 8 Oct 2013 21:35:15 +0000 (17:35 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 8 Oct 2013 21:35:46 +0000 (17:35 -0400)
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 <mathieu.desnoyers@efficios.com>
include/lttng/bitfield.h
include/lttng/ust-tracer.h

index 391cf5098969c1a69e81bae44076a32997a4e64b..ef5453c29be2397b225126daa8b2515abdb33c61 100644 (file)
@@ -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)                                     \
 ({                                                                     \
index b4268ac51dc1598864d3246b7c2329b1841c861b..ec30db7446a52608b6d5b0a9267f3184f33b516f 100644 (file)
@@ -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 */
This page took 0.030739 seconds and 4 git commands to generate.