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>
This commit is contained in:
parent
0d9f3ca7ea
commit
03aebed519
|
@ -82,6 +82,8 @@ struct __GLXDRIcontext {
|
||||||
__DRIcontext *driContext;
|
__DRIcontext *driContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MAX_DRAWABLE_BUFFERS 5
|
||||||
|
|
||||||
struct __GLXDRIdrawable {
|
struct __GLXDRIdrawable {
|
||||||
__GLXdrawable base;
|
__GLXdrawable base;
|
||||||
__DRIdrawable *driDrawable;
|
__DRIdrawable *driDrawable;
|
||||||
|
@ -90,7 +92,7 @@ struct __GLXDRIdrawable {
|
||||||
/* Dimensions as last reported by DRI2GetBuffers. */
|
/* Dimensions as last reported by DRI2GetBuffers. */
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
__DRIbuffer buffers[5];
|
__DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
|
||||||
int count;
|
int count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -407,7 +409,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
|
||||||
|
|
||||||
buffers = DRI2GetBuffers(private->base.pDraw,
|
buffers = DRI2GetBuffers(private->base.pDraw,
|
||||||
width, height, attachments, count, out_count);
|
width, height, attachments, count, out_count);
|
||||||
if (*out_count > 5) {
|
if (*out_count > MAX_DRAWABLE_BUFFERS) {
|
||||||
*out_count = 0;
|
*out_count = 0;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user