summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Versace <chad.versace@linux.intel.com>2013-11-24 14:25:59 -0800
committerChad Versace <chad.versace@linux.intel.com>2013-11-24 15:31:06 -0800
commit302f2e30acd1fca67d72375c3fb3627e89bcc17e (patch)
tree6a6e3308de88d461de19588daa54bcb5b9b5b620
parenta5cd4c7c47de821c526cab4ac877c5cf738c6a1b (diff)
cgl: Fix warnings -Wtautological-constant-out-of-range-compare
In macro cgl_config.m:ADD_ATTR(), cast the compared value to an int before comparing it to WAFFLE_DONT_CARE (which is itself an int). This fixes tautological comparisons when the compared value is a bool. Fixes 2 warnings like the following: src/waffle/cgl/cgl_config.m:207:5: warning: comparison of constant 'WAFFLE_DONT_CARE' (-1) with expression of type 'const bool' is always true [-Wtautological-constant-out-of-range-compare] ADD_ATTR(kCGLPFASampleBuffers, attrs->sample_buffers); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/waffle/cgl/cgl_config.m:173:21: note: expanded from macro 'ADD_ATTR' if ((value) != WAFFLE_DONT_CARE) { \ ~~~~~~~ ^ ~~~~~~~~~~~~~~~~ Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--src/waffle/cgl/cgl_config.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/waffle/cgl/cgl_config.m b/src/waffle/cgl/cgl_config.m
index b9a79bd..b6dc8d7 100644
--- a/src/waffle/cgl/cgl_config.m
+++ b/src/waffle/cgl/cgl_config.m
@@ -170,7 +170,7 @@ cgl_config_fill_pixel_format_attrs(
// CGL does not have an analogue for EGL_DONT_CARE. Instead, one indicates
// "don't care" by omitting the attribute.
#define ADD_ATTR(name, value) \
- if ((value) != WAFFLE_DONT_CARE) { \
+ if ((int)(value) != WAFFLE_DONT_CARE) { \
pixel_attrs[i++] = (name); \
pixel_attrs[i++] = (value); \
}