Fix two more C99 initialization mistakes using members of same struct
Similar to 34cf559bcf
, use temporary variables instead of
referencing members of the struct being initialized in the middle
of the initialization.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
5884e7dede
commit
fb73f7f40f
|
@ -1056,11 +1056,12 @@ int
|
||||||
ProcXineramaQueryScreens(ClientPtr client)
|
ProcXineramaQueryScreens(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xXineramaQueryScreensReq); */
|
/* REQUEST(xXineramaQueryScreensReq); */
|
||||||
|
CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
||||||
xXineramaQueryScreensReply rep = {
|
xXineramaQueryScreensReply rep = {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo),
|
.length = bytes_to_int32(number * sz_XineramaScreenInfo),
|
||||||
.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens
|
.number = number
|
||||||
};
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||||
|
|
|
@ -135,6 +135,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
xvmcSurfaceInfo info;
|
xvmcSurfaceInfo info;
|
||||||
XvMCAdaptorPtr adaptor = NULL;
|
XvMCAdaptorPtr adaptor = NULL;
|
||||||
XvMCSurfaceInfoPtr surface;
|
XvMCSurfaceInfoPtr surface;
|
||||||
|
int num_surfaces;
|
||||||
|
|
||||||
REQUEST(xvmcListSurfaceTypesReq);
|
REQUEST(xvmcListSurfaceTypesReq);
|
||||||
REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
|
REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
|
||||||
|
@ -154,16 +155,17 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
|
||||||
rep = (xvmcListSurfaceTypesReply) {
|
rep = (xvmcListSurfaceTypesReply) {
|
||||||
.type = X_Reply,
|
.type = X_Reply,
|
||||||
.sequenceNumber = client->sequence,
|
.sequenceNumber = client->sequence,
|
||||||
.num = (adaptor) ? adaptor->num_surfaces : 0,
|
.num = num_surfaces,
|
||||||
.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo)),
|
.length = bytes_to_int32(num_surfaces * sizeof(xvmcSurfaceInfo)),
|
||||||
};
|
};
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
|
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
|
||||||
|
|
||||||
for (i = 0; i < rep.num; i++) {
|
for (i = 0; i < num_surfaces; i++) {
|
||||||
surface = adaptor->surfaces[i];
|
surface = adaptor->surfaces[i];
|
||||||
info.surface_type_id = surface->surface_type_id;
|
info.surface_type_id = surface->surface_type_id;
|
||||||
info.chroma_format = surface->chroma_format;
|
info.chroma_format = surface->chroma_format;
|
||||||
|
|
Loading…
Reference in New Issue