summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-04-08 14:54:30 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-06-11 22:46:00 -0700
commit6be19e8f43086fb4b7fb30a47b89b5f3eed798ef (patch)
tree5e96f8c7bd5881c25f0d15aee948084b0b9cfba5
parent540d5b87a4e24d85ec46620dfedd7bd7979180ea (diff)
Use a #define instead of a magic number
The number of buffers is likely to change in the future, so having this as a define is the right way to go. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 03aebed519986c4dd03e02b3b3d4af1f64595ca7)
-rw-r--r--glx/glxdri2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index c6716703f..f2682d4d9 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -82,6 +82,8 @@ struct __GLXDRIcontext {
__DRIcontext *driContext;
};
+#define MAX_DRAWABLE_BUFFERS 5
+
struct __GLXDRIdrawable {
__GLXdrawable base;
__DRIdrawable *driDrawable;
@@ -90,7 +92,7 @@ struct __GLXDRIdrawable {
/* Dimensions as last reported by DRI2GetBuffers. */
int width;
int height;
- __DRIbuffer buffers[5];
+ __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
int count;
};
@@ -365,7 +367,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
buffers = DRI2GetBuffers(private->base.pDraw,
width, height, attachments, count, out_count);
- if (*out_count > 5) {
+ if (*out_count > MAX_DRAWABLE_BUFFERS) {
*out_count = 0;
return NULL;
}