mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
@@ -39,80 +39,91 @@
|
||||
#include "glthread.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc)
|
||||
int
|
||||
__glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte * pc)
|
||||
{
|
||||
xGLXSingleReq * const req = (xGLXSingleReq *) pc;
|
||||
xGLXSingleReq *const req = (xGLXSingleReq *) pc;
|
||||
int error;
|
||||
__GLXcontext * const cx = __glXForceCurrent( cl, req->contextTag, & error );
|
||||
__GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
|
||||
ClientPtr client = cl->client;
|
||||
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
if ( cx != NULL ) {
|
||||
const GLenum target = *(GLenum *)(pc + 0);
|
||||
const GLint level = *(GLint *)(pc + 4);
|
||||
GLint compsize = 0;
|
||||
char *answer = NULL, answerBuffer[200];
|
||||
if (cx != NULL) {
|
||||
const GLenum target = *(GLenum *) (pc + 0);
|
||||
const GLint level = *(GLint *) (pc + 4);
|
||||
GLint compsize = 0;
|
||||
char *answer = NULL, answerBuffer[200];
|
||||
|
||||
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
|
||||
CALL_GetTexLevelParameteriv(GET_DISPATCH(),
|
||||
(target, level,
|
||||
GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
|
||||
&compsize));
|
||||
|
||||
if ( compsize != 0 ) {
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer));
|
||||
}
|
||||
if (compsize != 0) {
|
||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||
__glXClearErrorOccured();
|
||||
CALL_GetCompressedTexImageARB(GET_DISPATCH(),
|
||||
(target, level, answer));
|
||||
}
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetTexImageReply *)&__glXReply)->width = compsize;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
}
|
||||
else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetTexImageReply *) & __glXReply)->width = compsize;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
error = Success;
|
||||
error = Success;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc)
|
||||
int
|
||||
__glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl,
|
||||
GLbyte * pc)
|
||||
{
|
||||
xGLXSingleReq * const req = (xGLXSingleReq *) pc;
|
||||
xGLXSingleReq *const req = (xGLXSingleReq *) pc;
|
||||
int error;
|
||||
__GLXcontext * const cx = __glXForceCurrent( cl, bswap_32( req->contextTag ), & error );
|
||||
__GLXcontext *const cx =
|
||||
__glXForceCurrent(cl, bswap_32(req->contextTag), &error);
|
||||
ClientPtr client = cl->client;
|
||||
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
if ( cx != NULL ) {
|
||||
const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) );
|
||||
const GLint level = (GLint ) bswap_32( *(int *)(pc + 4) );
|
||||
GLint compsize = 0;
|
||||
char *answer = NULL, answerBuffer[200];
|
||||
if (cx != NULL) {
|
||||
const GLenum target = (GLenum) bswap_32(*(int *) (pc + 0));
|
||||
const GLint level = (GLint) bswap_32(*(int *) (pc + 4));
|
||||
GLint compsize = 0;
|
||||
char *answer = NULL, answerBuffer[200];
|
||||
|
||||
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
|
||||
CALL_GetTexLevelParameteriv(GET_DISPATCH(),
|
||||
(target, level,
|
||||
GL_TEXTURE_COMPRESSED_IMAGE_SIZE,
|
||||
&compsize));
|
||||
|
||||
if ( compsize != 0 ) {
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
CALL_GetCompressedTexImageARB(GET_DISPATCH(), (target, level, answer));
|
||||
}
|
||||
if (compsize != 0) {
|
||||
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
|
||||
__glXClearErrorOccured();
|
||||
CALL_GetCompressedTexImageARB(GET_DISPATCH(),
|
||||
(target, level, answer));
|
||||
}
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetTexImageReply *)&__glXReply)->width = compsize;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
error = Success;
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
}
|
||||
else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetTexImageReply *) & __glXReply)->width = compsize;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
error = Success;
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user