mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-27 20:58:52 +00:00
dri3: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -110,10 +110,8 @@ proc_dri3_query_version(ClientPtr client)
|
||||
reply.minorVersion = stuff->minorVersion;
|
||||
}
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&reply.majorVersion);
|
||||
swapl(&reply.minorVersion);
|
||||
}
|
||||
REPLY_FIELD_CARD32(majorVersion);
|
||||
REPLY_FIELD_CARD32(minorVersion);
|
||||
|
||||
return X_SEND_REPLY_SIMPLE(client, reply);
|
||||
}
|
||||
@@ -277,17 +275,16 @@ proc_dri3_buffer_from_pixmap(ClientPtr client)
|
||||
if (fd < 0)
|
||||
return BadPixmap;
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&reply.size);
|
||||
swaps(&reply.width);
|
||||
swaps(&reply.height);
|
||||
swaps(&reply.stride);
|
||||
}
|
||||
if (WriteFdToClient(client, fd, TRUE) < 0) {
|
||||
close(fd);
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
REPLY_FIELD_CARD32(size);
|
||||
REPLY_FIELD_CARD16(width);
|
||||
REPLY_FIELD_CARD16(height);
|
||||
REPLY_FIELD_CARD16(stride);
|
||||
|
||||
return X_SEND_REPLY_SIMPLE(client, reply);
|
||||
}
|
||||
|
||||
@@ -329,6 +326,7 @@ proc_dri3_fd_from_fence(ClientPtr client)
|
||||
xDRI3FDFromFenceReply reply = {
|
||||
.nfd = 1,
|
||||
};
|
||||
|
||||
DrawablePtr drawable;
|
||||
int fd;
|
||||
int status;
|
||||
@@ -387,10 +385,8 @@ proc_dri3_get_supported_modifiers(ClientPtr client)
|
||||
.numScreenModifiers = nscreenmodifiers,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&reply.numWindowModifiers);
|
||||
swapl(&reply.numScreenModifiers);
|
||||
}
|
||||
REPLY_FIELD_CARD32(numWindowModifiers);
|
||||
REPLY_FIELD_CARD32(numScreenModifiers);
|
||||
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
|
||||
}
|
||||
@@ -548,11 +544,9 @@ proc_dri3_buffers_from_pixmap(ClientPtr client)
|
||||
.modifier = modifier,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&reply.width);
|
||||
swaps(&reply.height);
|
||||
swapll(&reply.modifier);
|
||||
}
|
||||
REPLY_FIELD_CARD16(width);
|
||||
REPLY_FIELD_CARD16(height);
|
||||
REPLY_FIELD_CARD64(modifier);
|
||||
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user