(!1665) glx: DoQueryContext(): use fixed size array instead of variable length
Our array here really is fixed, but it's size is determined by a variable (that's assigned a fix values), unncessarily making it a VLA (even making it const doesn't change that), so giving false alarms when compiling w/ -Wvla or -Werror=vla. Replacing the variable by #define trivially fixes this. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
e6ade4f97d
commit
3e0e188960
|
@ -1654,13 +1654,14 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define GLX_QUERY_NPROPS 5
|
||||||
|
|
||||||
static int
|
static int
|
||||||
DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
||||||
{
|
{
|
||||||
ClientPtr client = cl->client;
|
ClientPtr client = cl->client;
|
||||||
__GLXcontext *ctx;
|
__GLXcontext *ctx;
|
||||||
int nProps = 5;
|
int sendBuf[GLX_QUERY_NPROPS * 2];
|
||||||
int sendBuf[nProps * 2];
|
|
||||||
int nReplyBytes;
|
int nReplyBytes;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
@ -1670,8 +1671,8 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
||||||
xGLXQueryContextInfoEXTReply reply = {
|
xGLXQueryContextInfoEXTReply reply = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = nProps << 1,
|
.length = GLX_QUERY_NPROPS << 1,
|
||||||
.n = nProps
|
.n = GLX_QUERY_NPROPS,
|
||||||
};
|
};
|
||||||
|
|
||||||
nReplyBytes = reply.length << 2;
|
nReplyBytes = reply.length << 2;
|
||||||
|
@ -1706,6 +1707,8 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef GLX_QUERY_NPROPS
|
||||||
|
|
||||||
int
|
int
|
||||||
__glXDisp_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
|
__glXDisp_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue