Xext: switch to byte counting functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
aa19d35512
commit
7b9e84e320
10
Xext/mbuf.c
10
Xext/mbuf.c
|
@ -430,7 +430,7 @@ ProcCreateImageBuffers (client)
|
||||||
int len, nbuf, i, err, rc;
|
int len, nbuf, i, err, rc;
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE (xMbufCreateImageBuffersReq);
|
REQUEST_AT_LEAST_SIZE (xMbufCreateImageBuffersReq);
|
||||||
len = stuff->length - (sizeof(xMbufCreateImageBuffersReq) >> 2);
|
len = stuff->length - bytes_to_int32(sizeof(xMbufCreateImageBuffersReq));
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess);
|
||||||
|
@ -498,7 +498,7 @@ ProcDisplayImageBuffers (client)
|
||||||
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE (xMbufDisplayImageBuffersReq);
|
REQUEST_AT_LEAST_SIZE (xMbufDisplayImageBuffersReq);
|
||||||
nbuf = stuff->length - (sizeof (xMbufDisplayImageBuffersReq) >> 2);
|
nbuf = stuff->length - bytes_to_int32(sizeof (xMbufDisplayImageBuffersReq));
|
||||||
if (!nbuf)
|
if (!nbuf)
|
||||||
return Success;
|
return Success;
|
||||||
minDelay = stuff->minDelay;
|
minDelay = stuff->minDelay;
|
||||||
|
@ -592,7 +592,7 @@ ProcSetMBufferAttributes (client)
|
||||||
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
|
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
|
||||||
if (!pMultibuffers)
|
if (!pMultibuffers)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
len = stuff->length - (sizeof (xMbufSetMBufferAttributesReq) >> 2);
|
len = stuff->length - bytes_to_int32(sizeof (xMbufSetMBufferAttributesReq));
|
||||||
vmask = stuff->valueMask;
|
vmask = stuff->valueMask;
|
||||||
if (len != Ones (vmask))
|
if (len != Ones (vmask))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
@ -687,7 +687,7 @@ ProcSetBufferAttributes (client)
|
||||||
pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType);
|
pMultibuffer = (MultibufferPtr) LookupIDByType (stuff->buffer, MultibufferResType);
|
||||||
if (!pMultibuffer)
|
if (!pMultibuffer)
|
||||||
return MultibufferErrorBase + MultibufferBadBuffer;
|
return MultibufferErrorBase + MultibufferBadBuffer;
|
||||||
len = stuff->length - (sizeof (xMbufSetBufferAttributesReq) >> 2);
|
len = stuff->length - bytes_to_int32(sizeof (xMbufSetBufferAttributesReq));
|
||||||
vmask = stuff->valueMask;
|
vmask = stuff->valueMask;
|
||||||
if (len != Ones (vmask))
|
if (len != Ones (vmask))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
@ -787,7 +787,7 @@ ProcGetBufferInfo (client)
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.length = nInfo * (sizeof (xMbufBufferInfo) >> 2);
|
rep.length = nInfo * bytes_to_int32(sizeof (xMbufBufferInfo));
|
||||||
rep.normalInfo = nInfo;
|
rep.normalInfo = nInfo;
|
||||||
rep.stereoInfo = 0;
|
rep.stereoInfo = 0;
|
||||||
if (client->swapped)
|
if (client->swapped)
|
||||||
|
|
|
@ -669,7 +669,7 @@ Bool PanoramiXCreateConnectionBlock(void)
|
||||||
length += (depth->nVisuals * sizeof(xVisualType));
|
length += (depth->nVisuals * sizeof(xVisualType));
|
||||||
}
|
}
|
||||||
|
|
||||||
connSetupPrefix.length = length >> 2;
|
connSetupPrefix.length = bytes_to_int32(length);
|
||||||
|
|
||||||
for (i = 0; i < PanoramiXNumDepths; i++)
|
for (i = 0; i < PanoramiXNumDepths; i++)
|
||||||
xfree(PanoramiXDepths[i].vids);
|
xfree(PanoramiXDepths[i].vids);
|
||||||
|
@ -1053,7 +1053,7 @@ ProcXineramaQueryScreens(ClientPtr client)
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
||||||
rep.length = rep.number * sz_XineramaScreenInfo >> 2;
|
rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
int n;
|
int n;
|
||||||
swaps (&rep.sequenceNumber, n);
|
swaps (&rep.sequenceNumber, n);
|
||||||
|
|
|
@ -74,7 +74,7 @@ int PanoramiXCreateWindow(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
|
REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
|
||||||
|
|
||||||
len = client->req_len - (sizeof(xCreateWindowReq) >> 2);
|
len = client->req_len - bytes_to_int32(sizeof(xCreateWindowReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ int PanoramiXChangeWindowAttributes(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
|
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
|
||||||
|
|
||||||
len = client->req_len - (sizeof(xChangeWindowAttributesReq) >> 2);
|
len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq));
|
||||||
if (Ones(stuff->valueMask) != len)
|
if (Ones(stuff->valueMask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ int PanoramiXConfigureWindow(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
|
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
|
||||||
|
|
||||||
len = client->req_len - (sizeof(xConfigureWindowReq) >> 2);
|
len = client->req_len - bytes_to_int32(sizeof(xConfigureWindowReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ int PanoramiXCreateGC(ClientPtr client)
|
||||||
REQUEST_AT_LEAST_SIZE(xCreateGCReq);
|
REQUEST_AT_LEAST_SIZE(xCreateGCReq);
|
||||||
|
|
||||||
client->errorValue = stuff->gc;
|
client->errorValue = stuff->gc;
|
||||||
len = client->req_len - (sizeof(xCreateGCReq) >> 2);
|
len = client->req_len - bytes_to_int32(sizeof(xCreateGCReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
@ -813,7 +813,7 @@ int PanoramiXChangeGC(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xChangeGCReq);
|
REQUEST_AT_LEAST_SIZE(xChangeGCReq);
|
||||||
|
|
||||||
len = client->req_len - (sizeof(xChangeGCReq) >> 2);
|
len = client->req_len - bytes_to_int32(sizeof(xChangeGCReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
@ -1299,7 +1299,7 @@ int PanoramiXPolyPoint(ClientPtr client)
|
||||||
return (result == BadValue) ? BadGC : result;
|
return (result == BadValue) ? BadGC : result;
|
||||||
|
|
||||||
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
||||||
npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
|
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
|
||||||
if (npoint > 0) {
|
if (npoint > 0) {
|
||||||
origPts = xalloc(npoint * sizeof(xPoint));
|
origPts = xalloc(npoint * sizeof(xPoint));
|
||||||
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
||||||
|
@ -1359,7 +1359,7 @@ int PanoramiXPolyLine(ClientPtr client)
|
||||||
return (result == BadValue) ? BadGC : result;
|
return (result == BadValue) ? BadGC : result;
|
||||||
|
|
||||||
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
||||||
npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
|
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
|
||||||
if (npoint > 0){
|
if (npoint > 0){
|
||||||
origPts = xalloc(npoint * sizeof(xPoint));
|
origPts = xalloc(npoint * sizeof(xPoint));
|
||||||
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
|
||||||
|
@ -1605,7 +1605,7 @@ int PanoramiXFillPoly(ClientPtr client)
|
||||||
|
|
||||||
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
|
||||||
|
|
||||||
count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
|
count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
locPts = xalloc(count * sizeof(DDXPointRec));
|
locPts = xalloc(count * sizeof(DDXPointRec));
|
||||||
memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec));
|
memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec));
|
||||||
|
@ -1895,7 +1895,7 @@ int PanoramiXGetImage(ClientPtr client)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi.length = (length + 3) >> 2;
|
xgi.length = bytes_to_int32(length);
|
||||||
|
|
||||||
if (widthBytesLine == 0 || h == 0)
|
if (widthBytesLine == 0 || h == 0)
|
||||||
linesPerBuf = 0;
|
linesPerBuf = 0;
|
||||||
|
|
|
@ -875,7 +875,7 @@ ScreenSaverSetAttributes (ClientPtr client)
|
||||||
if (ret != Success)
|
if (ret != Success)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
|
len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
if (!stuff->width || !stuff->height)
|
if (!stuff->width || !stuff->height)
|
||||||
|
@ -1267,7 +1267,7 @@ ProcScreenSaverSetAttributes (ClientPtr client)
|
||||||
if (status != Success)
|
if (status != Success)
|
||||||
return (status == BadValue) ? BadDrawable : status;
|
return (status == BadValue) ? BadDrawable : status;
|
||||||
|
|
||||||
len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
|
len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
|
||||||
if (Ones(stuff->mask) != len)
|
if (Ones(stuff->mask) != len)
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
|
||||||
|
|
|
@ -450,9 +450,9 @@ ProcSecurityGenerateAuthorization(
|
||||||
/* check request length */
|
/* check request length */
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
||||||
len = SIZEOF(xSecurityGenerateAuthorizationReq) >> 2;
|
len = bytes_to_int32(SIZEOF(xSecurityGenerateAuthorizationReq));
|
||||||
len += (stuff->nbytesAuthProto + (unsigned)3) >> 2;
|
len += bytes_to_int32(stuff->nbytesAuthProto);
|
||||||
len += (stuff->nbytesAuthData + (unsigned)3) >> 2;
|
len += bytes_to_int32(stuff->nbytesAuthData);
|
||||||
values = ((CARD32 *)stuff) + len;
|
values = ((CARD32 *)stuff) + len;
|
||||||
len += Ones(stuff->valueMask);
|
len += Ones(stuff->valueMask);
|
||||||
if (client->req_len != len)
|
if (client->req_len != len)
|
||||||
|
@ -520,7 +520,7 @@ ProcSecurityGenerateAuthorization(
|
||||||
}
|
}
|
||||||
|
|
||||||
protoname = (char *)&stuff[1];
|
protoname = (char *)&stuff[1];
|
||||||
protodata = protoname + ((stuff->nbytesAuthProto + (unsigned)3) >> 2);
|
protodata = protoname + bytes_to_int32(stuff->nbytesAuthProto);
|
||||||
|
|
||||||
/* call os layer to generate the authorization */
|
/* call os layer to generate the authorization */
|
||||||
|
|
||||||
|
@ -580,7 +580,7 @@ ProcSecurityGenerateAuthorization(
|
||||||
/* tell client the auth id and data */
|
/* tell client the auth id and data */
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.length = (authdata_len + 3) >> 2;
|
rep.length = bytes_to_int32(authdata_len);
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.authId = authId;
|
rep.authId = authId;
|
||||||
rep.dataLength = authdata_len;
|
rep.dataLength = authdata_len;
|
||||||
|
@ -688,10 +688,10 @@ SProcSecurityGenerateAuthorization(
|
||||||
swaps(&stuff->nbytesAuthProto, n);
|
swaps(&stuff->nbytesAuthProto, n);
|
||||||
swaps(&stuff->nbytesAuthData, n);
|
swaps(&stuff->nbytesAuthData, n);
|
||||||
swapl(&stuff->valueMask, n);
|
swapl(&stuff->valueMask, n);
|
||||||
values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
|
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
|
||||||
((stuff->nbytesAuthData + (unsigned)3) >> 2);
|
bytes_to_int32(stuff->nbytesAuthData);
|
||||||
if (values_offset >
|
if (values_offset >
|
||||||
stuff->length - (sz_xSecurityGenerateAuthorizationReq >> 2))
|
stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
values = (CARD32 *)(&stuff[1]) + values_offset;
|
values = (CARD32 *)(&stuff[1]) + values_offset;
|
||||||
nvalues = (((CARD32 *)stuff) + stuff->length) - values;
|
nvalues = (((CARD32 *)stuff) + stuff->length) - values;
|
||||||
|
|
|
@ -1069,7 +1069,7 @@ ProcShapeGetRectangles (ClientPtr client)
|
||||||
}
|
}
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.length = (nrects * sizeof (xRectangle)) >> 2;
|
rep.length = bytes_to_int32(nrects * sizeof (xRectangle));
|
||||||
rep.ordering = YXBanded;
|
rep.ordering = YXBanded;
|
||||||
rep.nrects = nrects;
|
rep.nrects = nrects;
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
|
|
12
Xext/sync.c
12
Xext/sync.c
|
@ -1179,7 +1179,7 @@ ProcSyncListSystemCounters(ClientPtr client)
|
||||||
{
|
{
|
||||||
char *name = SysCounterList[i]->pSysCounterInfo->name;
|
char *name = SysCounterList[i]->pSysCounterInfo->name;
|
||||||
/* pad to 4 byte boundary */
|
/* pad to 4 byte boundary */
|
||||||
len += (sz_xSyncSystemCounter + strlen(name) + 3) & ~3;
|
len += pad_to_int32(sz_xSyncSystemCounter + strlen(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len)
|
if (len)
|
||||||
|
@ -1189,7 +1189,7 @@ ProcSyncListSystemCounters(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.length = len >> 2;
|
rep.length = bytes_to_int32(len);
|
||||||
|
|
||||||
if (client->swapped)
|
if (client->swapped)
|
||||||
{
|
{
|
||||||
|
@ -1223,7 +1223,7 @@ ProcSyncListSystemCounters(ClientPtr client)
|
||||||
pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
|
pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
|
||||||
strncpy(pname_in_reply, psci->name, namelen);
|
strncpy(pname_in_reply, psci->name, namelen);
|
||||||
walklist = (xSyncSystemCounter *) (((char *)walklist) +
|
walklist = (xSyncSystemCounter *) (((char *)walklist) +
|
||||||
((sz_xSyncSystemCounter + namelen + 3) & ~3));
|
pad_to_int32(sz_xSyncSystemCounter + namelen));
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteToClient(client, sizeof(rep), (char *) &rep);
|
WriteToClient(client, sizeof(rep), (char *) &rep);
|
||||||
|
@ -1600,7 +1600,7 @@ ProcSyncCreateAlarm(ClientPtr client)
|
||||||
LEGAL_NEW_RESOURCE(stuff->id, client);
|
LEGAL_NEW_RESOURCE(stuff->id, client);
|
||||||
|
|
||||||
vmask = stuff->valueMask;
|
vmask = stuff->valueMask;
|
||||||
len = client->req_len - (sizeof(xSyncCreateAlarmReq) >> 2);
|
len = client->req_len - bytes_to_int32(sizeof(xSyncCreateAlarmReq));
|
||||||
/* the "extra" call to Ones accounts for the presence of 64 bit values */
|
/* the "extra" call to Ones accounts for the presence of 64 bit values */
|
||||||
if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
|
if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
@ -1681,7 +1681,7 @@ ProcSyncChangeAlarm(ClientPtr client)
|
||||||
return (status == BadValue) ? SyncErrorBase + XSyncBadAlarm : status;
|
return (status == BadValue) ? SyncErrorBase + XSyncBadAlarm : status;
|
||||||
|
|
||||||
vmask = stuff->valueMask;
|
vmask = stuff->valueMask;
|
||||||
len = client->req_len - (sizeof(xSyncChangeAlarmReq) >> 2);
|
len = client->req_len - bytes_to_int32(sizeof(xSyncChangeAlarmReq));
|
||||||
/* the "extra" call to Ones accounts for the presence of 64 bit values */
|
/* the "extra" call to Ones accounts for the presence of 64 bit values */
|
||||||
if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
|
if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
|
||||||
return BadLength;
|
return BadLength;
|
||||||
|
@ -1720,7 +1720,7 @@ ProcSyncQueryAlarm(ClientPtr client)
|
||||||
return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc;
|
return (rc == BadValue) ? SyncErrorBase + XSyncBadAlarm : rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.length = (sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)) >> 2;
|
rep.length = bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply));
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
|
||||||
pTrigger = &pAlarm->trigger;
|
pTrigger = &pAlarm->trigger;
|
||||||
|
|
|
@ -629,7 +629,7 @@ ProcXF86BigfontQueryFont(
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
reply->type = X_Reply;
|
reply->type = X_Reply;
|
||||||
reply->length = (rlength - sizeof(xGenericReply)) >> 2;
|
reply->length = bytes_to_int32(rlength - sizeof(xGenericReply));
|
||||||
reply->sequenceNumber = client->sequence;
|
reply->sequenceNumber = client->sequence;
|
||||||
reply->minBounds = pFont->info.ink_minbounds;
|
reply->minBounds = pFont->info.ink_minbounds;
|
||||||
reply->maxBounds = pFont->info.ink_maxbounds;
|
reply->maxBounds = pFont->info.ink_maxbounds;
|
||||||
|
|
|
@ -75,7 +75,7 @@ ProcXResQueryClients (ClientPtr client)
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.num_clients = num_clients;
|
rep.num_clients = num_clients;
|
||||||
rep.length = rep.num_clients * sz_xXResClient >> 2;
|
rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient);
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
int n;
|
int n;
|
||||||
swaps (&rep.sequenceNumber, n);
|
swaps (&rep.sequenceNumber, n);
|
||||||
|
@ -144,7 +144,7 @@ ProcXResQueryClientResources (ClientPtr client)
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.num_types = num_types;
|
rep.num_types = num_types;
|
||||||
rep.length = rep.num_types * sz_xXResType >> 2;
|
rep.length = bytes_to_int32(rep.num_types * sz_xXResType);
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
int n;
|
int n;
|
||||||
swaps (&rep.sequenceNumber, n);
|
swaps (&rep.sequenceNumber, n);
|
||||||
|
|
|
@ -1283,7 +1283,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.length = (len + 3) >> 2;
|
rep.length = bytes_to_int32(len);
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.context_len = len;
|
rep.context_len = len;
|
||||||
|
|
||||||
|
@ -1510,8 +1510,8 @@ SELinuxPopulateItem(SELinuxListItemRec *i, PrivateRec **privPtr, CARD32 id,
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
i->id = id;
|
i->id = id;
|
||||||
i->octx_len = (strlen(i->octx) + 4) >> 2;
|
i->octx_len = bytes_to_int32(strlen(i->octx) + 1);
|
||||||
i->dctx_len = (strlen(i->dctx) + 4) >> 2;
|
i->dctx_len = bytes_to_int32(strlen(i->dctx) + 1);
|
||||||
|
|
||||||
*size += i->octx_len + i->dctx_len + 3;
|
*size += i->octx_len + i->dctx_len + 3;
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -423,12 +423,12 @@ ProcXvQueryAdaptors(ClientPtr client)
|
||||||
pa = pxvs->pAdaptors;
|
pa = pxvs->pAdaptors;
|
||||||
while (na--)
|
while (na--)
|
||||||
{
|
{
|
||||||
totalSize += (strlen(pa->name) + 3) & ~3;
|
totalSize += pad_to_int32(strlen(pa->name));
|
||||||
totalSize += pa->nFormats * sz_xvFormat;
|
totalSize += pa->nFormats * sz_xvFormat;
|
||||||
pa++;
|
pa++;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.length = totalSize >> 2;
|
rep.length = bytes_to_int32(totalSize);
|
||||||
|
|
||||||
_WriteQueryAdaptorsReply(client, &rep);
|
_WriteQueryAdaptorsReply(client, &rep);
|
||||||
|
|
||||||
|
@ -498,11 +498,11 @@ ProcXvQueryEncodings(ClientPtr client)
|
||||||
totalSize = ne * sz_xvEncodingInfo;
|
totalSize = ne * sz_xvEncodingInfo;
|
||||||
while (ne--)
|
while (ne--)
|
||||||
{
|
{
|
||||||
totalSize += (strlen(pe->name) + 3) & ~3;
|
totalSize += pad_to_int32(strlen(pe->name));
|
||||||
pe++;
|
pe++;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.length = totalSize >> 2;
|
rep.length = bytes_to_int32(totalSize);
|
||||||
|
|
||||||
_WriteQueryEncodingsReply(client, &rep);
|
_WriteQueryEncodingsReply(client, &rep);
|
||||||
|
|
||||||
|
@ -923,7 +923,7 @@ ProcXvQueryPortAttributes(ClientPtr client)
|
||||||
for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
|
for(i = 0, pAtt = pPort->pAdaptor->pAttributes;
|
||||||
i < pPort->pAdaptor->nAttributes; i++, pAtt++)
|
i < pPort->pAdaptor->nAttributes; i++, pAtt++)
|
||||||
{
|
{
|
||||||
rep.text_size += (strlen(pAtt->name) + 1 + 3) & ~3L;
|
rep.text_size += pad_to_int32(strlen(pAtt->name) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.length = (pPort->pAdaptor->nAttributes * sz_xvAttributeInfo)
|
rep.length = (pPort->pAdaptor->nAttributes * sz_xvAttributeInfo)
|
||||||
|
@ -939,7 +939,7 @@ ProcXvQueryPortAttributes(ClientPtr client)
|
||||||
Info.flags = pAtt->flags;
|
Info.flags = pAtt->flags;
|
||||||
Info.min = pAtt->min_value;
|
Info.min = pAtt->min_value;
|
||||||
Info.max = pAtt->max_value;
|
Info.max = pAtt->max_value;
|
||||||
Info.size = (size + 3) & ~3L;
|
Info.size = pad_to_int32(size);
|
||||||
|
|
||||||
_WriteAttributeInfo(client, &Info);
|
_WriteAttributeInfo(client, &Info);
|
||||||
|
|
||||||
|
@ -999,7 +999,7 @@ ProcXvPutImage(ClientPtr client)
|
||||||
size = (*pPort->pAdaptor->ddQueryImageAttributes)(client,
|
size = (*pPort->pAdaptor->ddQueryImageAttributes)(client,
|
||||||
pPort, pImage, &width, &height, NULL, NULL);
|
pPort, pImage, &width, &height, NULL, NULL);
|
||||||
size += sizeof(xvPutImageReq);
|
size += sizeof(xvPutImageReq);
|
||||||
size = (size + 3) >> 2;
|
size = bytes_to_int32(size);
|
||||||
|
|
||||||
if((width < stuff->width) || (height < stuff->height))
|
if((width < stuff->width) || (height < stuff->height))
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
@ -1203,7 +1203,7 @@ ProcXvListImageFormats(ClientPtr client)
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.num_formats = pPort->pAdaptor->nImages;
|
rep.num_formats = pPort->pAdaptor->nImages;
|
||||||
rep.length = pPort->pAdaptor->nImages * sz_xvImageFormatInfo >> 2;
|
rep.length = bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo);
|
||||||
|
|
||||||
_WriteListImageFormatsReply(client, &rep);
|
_WriteListImageFormatsReply(client, &rep);
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
rep.num = (adaptor) ? adaptor->num_surfaces : 0;
|
rep.num = (adaptor) ? adaptor->num_surfaces : 0;
|
||||||
rep.length = rep.num * sizeof(xvmcSurfaceInfo) >> 2;
|
rep.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo));
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char*)&rep);
|
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char*)&rep);
|
||||||
|
|
||||||
|
@ -519,7 +519,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
||||||
if(surface->compatible_subpictures)
|
if(surface->compatible_subpictures)
|
||||||
rep.num = surface->compatible_subpictures->num_xvimages;
|
rep.num = surface->compatible_subpictures->num_xvimages;
|
||||||
|
|
||||||
rep.length = rep.num * sizeof(xvImageFormatInfo) >> 2;
|
rep.length = bytes_to_int32(rep.num * sizeof(xvImageFormatInfo));
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char*)&rep);
|
WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char*)&rep);
|
||||||
|
|
||||||
|
@ -588,8 +588,8 @@ ProcXvMCGetDRInfo(ClientPtr client)
|
||||||
rep.major = pScreenPriv->major;
|
rep.major = pScreenPriv->major;
|
||||||
rep.minor = pScreenPriv->minor;
|
rep.minor = pScreenPriv->minor;
|
||||||
rep.patchLevel = pScreenPriv->patchLevel;
|
rep.patchLevel = pScreenPriv->patchLevel;
|
||||||
rep.nameLen = (strlen(pScreenPriv->clientDriverName) + 4) >> 2;
|
rep.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1);
|
||||||
rep.busIDLen = (strlen(pScreenPriv->busID) + 4) >> 2;
|
rep.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1);
|
||||||
|
|
||||||
rep.length = rep.nameLen + rep.busIDLen;
|
rep.length = rep.nameLen + rep.busIDLen;
|
||||||
rep.nameLen <<=2;
|
rep.nameLen <<=2;
|
||||||
|
|
Loading…
Reference in New Issue