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>
#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;
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)