mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-15 05:40:35 +01:00
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>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1665>
(cherry picked from commit 0a7763bfce)
This commit is contained in:
parent
b30a07d2da
commit
1be54da781
1 changed files with 7 additions and 4 deletions
|
|
@ -1652,13 +1652,14 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
|
|||
return Success;
|
||||
}
|
||||
|
||||
#define GLX_QUERY_NPROPS 5
|
||||
|
||||
static int
|
||||
DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *ctx;
|
||||
int nProps = 5;
|
||||
int sendBuf[nProps * 2];
|
||||
int sendBuf[GLX_QUERY_NPROPS * 2];
|
||||
int nReplyBytes;
|
||||
int err;
|
||||
|
||||
|
|
@ -1668,8 +1669,8 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
|||
xGLXQueryContextInfoEXTReply reply = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = nProps << 1,
|
||||
.n = nProps
|
||||
.length = GLX_QUERY_NPROPS << 1,
|
||||
.n = GLX_QUERY_NPROPS,
|
||||
};
|
||||
|
||||
nReplyBytes = reply.length << 2;
|
||||
|
|
@ -1704,6 +1705,8 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
|
|||
return Success;
|
||||
}
|
||||
|
||||
#undef GLX_QUERY_NPROPS
|
||||
|
||||
int
|
||||
__glXDisp_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue