summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2011-08-26 10:53:43 -0700
committerIan Romanick <ian.d.romanick@intel.com>2011-09-09 12:01:51 -0700
commit1a8111aea43b714609a20c1cb841ca58ae10dd83 (patch)
tree6c8d115fa30ed403944da98452c1bc6feb943d62 /src/mesa
parented3040f3baa468a0e16ea1ae2e5202c18d838c8f (diff)
downloadexternal_mesa3d-1a8111aea43b714609a20c1cb841ca58ae10dd83.zip
external_mesa3d-1a8111aea43b714609a20c1cb841ca58ae10dd83.tar.gz
external_mesa3d-1a8111aea43b714609a20c1cb841ca58ae10dd83.tar.bz2
intel: Silence "intel/intel_fbo.h:105:4: warning: comparison of unsigned expression < 0 is always false"
The test was of an enum, attIndex, which should be unsigned. The explicit check for < 0 was replaced with a cast to unsigned in an assertion that attIndex is less than the size of the array it will be used to index. Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h
index 2487994..e12d0fd 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.h
+++ b/src/mesa/drivers/dri/intel/intel_fbo.h
@@ -29,7 +29,9 @@
#define INTEL_FBO_H
#include <stdbool.h>
+#include <assert.h>
#include "main/formats.h"
+#include "intel_context.h"
#include "intel_screen.h"
struct intel_context;
@@ -101,9 +103,7 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, gl_buffer_index attIndex)
struct gl_renderbuffer *rb;
struct intel_renderbuffer *irb;
- /* XXX: Who passes -1 to intel_get_renderbuffer? */
- if (attIndex < 0)
- return NULL;
+ assert((unsigned)attIndex < ARRAY_SIZE(fb->Attachment));
rb = fb->Attachment[attIndex].Renderbuffer;
if (!rb)