summaryrefslogtreecommitdiff
path: root/GL/glx
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-01-09 15:27:34 -0800
committerIan Romanick <idr@us.ibm.com>2007-01-09 15:27:34 -0800
commitda09964a931cc64d05ab571bf545fdad35a6d395 (patch)
tree74df8983ff0ab97a7881b8d4c0fdc3df74aa4cb3 /GL/glx
parente1f73d220873fa091695e46b7fcd008663a95a6f (diff)
parente3aa6ad201eb20862c11c000e76206e317a96dc9 (diff)
Merge branch 'origin' into pci-rework
Conflicts: hw/xfree86/int10/generic.c
Diffstat (limited to 'GL/glx')
-rw-r--r--GL/glx/glxbyteorder.h56
-rw-r--r--GL/glx/glxcmds.c18
-rw-r--r--GL/glx/indirect_dispatch.c1
-rw-r--r--GL/glx/indirect_dispatch_swap.c14
-rw-r--r--GL/glx/indirect_program.c15
-rw-r--r--GL/glx/indirect_reqsize.c700
-rw-r--r--GL/glx/indirect_reqsize.h18
-rw-r--r--GL/glx/indirect_texture_compression.c15
-rw-r--r--GL/glx/indirect_util.c18
-rw-r--r--GL/glx/swap_interval.c15
10 files changed, 432 insertions, 438 deletions
diff --git a/GL/glx/glxbyteorder.h b/GL/glx/glxbyteorder.h
new file mode 100644
index 000000000..b9d738dba
--- /dev/null
+++ b/GL/glx/glxbyteorder.h
@@ -0,0 +1,56 @@
+/*
+ * (C) Copyright IBM Corporation 2006, 2007
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sub license,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, THE AUTHORS, AND/OR THEIR SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
+ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file glxbyteorder.h
+ * Platform glue for handling byte-ordering issues in GLX protocol.
+ *
+ * \author Ian Romanick <idr@us.ibm.com>
+ */
+#if !defined(__GLXBYTEORDER_H__)
+#define __GLXBYTEORDER_H__
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#if HAVE_BYTESWAP_H
+#include <byteswap.h>
+#elif defined(USE_SYS_ENDIAN_H)
+#include <sys/endian.h>
+#else
+#define bswap_16(value) \
+ ((((value) & 0xff) << 8) | ((value) >> 8))
+
+#define bswap_32(value) \
+ (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \
+ (uint32_t)bswap_16((uint16_t)((value) >> 16)))
+
+#define bswap_64(value) \
+ (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \
+ << 32) | \
+ (uint64_t)bswap_32((uint32_t)((value) >> 32)))
+#endif
+
+#endif /* !defined(__GLXBYTEORDER_H__) */
diff --git a/GL/glx/glxcmds.c b/GL/glx/glxcmds.c
index ccdf3fa00..6273edc56 100644
--- a/GL/glx/glxcmds.c
+++ b/GL/glx/glxcmds.c
@@ -441,6 +441,7 @@ static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
__GLcontextModes *modes;
__GLXdrawable *pGlxDraw;
__GLXpixmap *drawPixmap = NULL;
+ int rc;
/* This is the GLX 1.3 case - the client passes in a GLXWindow and
* we just return the __GLXdrawable. The first time a GLXPixmap
@@ -466,8 +467,8 @@ static int GetDrawableOrPixmap( __GLXcontext *glxc, GLXDrawable drawId,
* GLXWindow with the same XID as an X Window, so we wont get any
* resource ID clashes. Effectively, the X Window is now also a
* GLXWindow. */
- pDraw = (DrawablePtr) LookupDrawable(drawId, client);
- if (pDraw) {
+ rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixUnknownAccess);
+ if (rc == Success) {
if (pDraw->type == DRAWABLE_WINDOW) {
VisualID vid = wVisual((WindowPtr)pDraw);
@@ -1199,12 +1200,12 @@ static int ValidateCreateDrawable(ClientPtr client,
ScreenPtr pScreen;
VisualPtr pVisual;
__GLXscreen *pGlxScreen;
- int i;
+ int i, rc;
LEGAL_NEW_RESOURCE(glxDrawableId, client);
- pDraw = (DrawablePtr) LookupDrawable(drawablId, client);
- if (!pDraw || pDraw->type != type) {
+ rc = dixLookupDrawable(&pDraw, drawablId, client, 0, DixUnknownAccess);
+ if (rc != Success || pDraw->type != type) {
client->errorValue = drawablId;
return type == DRAWABLE_WINDOW ? BadWindow : BadPixmap;
}
@@ -2034,10 +2035,11 @@ int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
XID drawable = req->drawable;
int barrier = req->barrier;
- DrawablePtr pDraw = (DrawablePtr) LookupDrawable(drawable, client);
- int screen;
+ DrawablePtr pDraw;
+ int screen, rc;
- if (pDraw && (pDraw->type == DRAWABLE_WINDOW)) {
+ rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixUnknownAccess);
+ if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) {
screen = pDraw->pScreen->myNum;
if (__glXSwapBarrierFuncs &&
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc) {
diff --git a/GL/glx/indirect_dispatch.c b/GL/glx/indirect_dispatch.c
index d86dedfd5..00a9f9659 100644
--- a/GL/glx/indirect_dispatch.c
+++ b/GL/glx/indirect_dispatch.c
@@ -33,6 +33,7 @@
#include "indirect_size_get.h"
#include "indirect_dispatch.h"
#include "glxserver.h"
+#include "glxbyteorder.h"
#include "indirect_util.h"
#include "singlesize.h"
#include "glapitable.h"
diff --git a/GL/glx/indirect_dispatch_swap.c b/GL/glx/indirect_dispatch_swap.c
index 136f0d010..c0bb71cc4 100644
--- a/GL/glx/indirect_dispatch_swap.c
+++ b/GL/glx/indirect_dispatch_swap.c
@@ -28,24 +28,12 @@
#include <X11/Xmd.h>
#include <GL/gl.h>
#include <GL/glxproto.h>
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
-#include <byteswap.h>
-#elif defined(__OpenBSD__)
-#include <sys/endian.h>
-#define bswap_16 __swap16
-#define bswap_32 __swap32
-#define bswap_64 __swap64
-#else
-#include <sys/endian.h>
-#define bswap_16 bswap16
-#define bswap_32 bswap32
-#define bswap_64 bswap64
-#endif
#include <inttypes.h>
#include "indirect_size.h"
#include "indirect_size_get.h"
#include "indirect_dispatch.h"
#include "glxserver.h"
+#include "glxbyteorder.h"
#include "indirect_util.h"
#include "singlesize.h"
#include "glapitable.h"
diff --git a/GL/glx/indirect_program.c b/GL/glx/indirect_program.c
index 8d5f0e60f..d23a0a9e6 100644
--- a/GL/glx/indirect_program.c
+++ b/GL/glx/indirect_program.c
@@ -35,6 +35,7 @@
#endif
#include "glxserver.h"
+#include "glxbyteorder.h"
#include "glxext.h"
#include "singlesize.h"
#include "unpack.h"
@@ -46,20 +47,6 @@
#include "dispatch.h"
#include "glapioffsets.h"
-#if defined(__linux__) || defined (__GLIBC__) || defined (__GNU__)
-#include <byteswap.h>
-#elif defined(__OpenBSD__)
-#include <sys/endian.h>
-#define bswap_16 __swap16
-#define bswap_32 __swap32
-#define bswap_64 __swap64
-#else
-#include <sys/endian.h>
-#define bswap_16 bswap16
-#define bswap_32 bswap32
-#define bswap_64 bswap64
-#endif
-
static int DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte *pc,
unsigned get_programiv_offset, unsigned get_program_string_offset,
Bool do_swap);
diff --git a/GL/glx/indirect_reqsize.c b/GL/glx/indirect_reqsize.c
index d3e2bc516..954eecd97 100644
--- a/GL/glx/indirect_reqsize.c
+++ b/GL/glx/indirect_reqsize.c
@@ -28,16 +28,10 @@
#include <GL/gl.h>
#include "glxserver.h"
+#include "glxbyteorder.h"
#include "indirect_size.h"
#include "indirect_reqsize.h"
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
-# include <byteswap.h>
-# define SWAP_32(v) do { (v) = bswap_32(v); } while(0)
-#else
-# define SWAP_32(v) do { char tmp; swapl(&v, tmp); } while(0)
-#endif
-
#define __GLX_PAD(x) (((x) + 3) & ~3)
#if defined(__CYGWIN__) || defined(__MINGW32__)
@@ -56,15 +50,15 @@
int
-__glXCallListsReqSize( const GLbyte * pc, Bool swap )
+__glXCallListsReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 0);
- GLenum type = * (GLenum *)(pc + 4);
+ GLsizei n = *(GLsizei *) (pc + 0);
+ GLenum type = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( n );
- SWAP_32( type );
+ n = bswap_32(n);
+ type = bswap_32(type);
}
compsize = __glCallLists_size(type);
@@ -72,22 +66,22 @@ __glXCallListsReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXBitmapReqSize( const GLbyte * pc, Bool swap )
+__glXBitmapReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLsizei width = *(GLsizei *)(pc + 20);
- GLsizei height = *(GLsizei *)(pc + 24);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLsizei width = *(GLsizei *) (pc + 20);
+ GLsizei height = *(GLsizei *) (pc + 24);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( width );
- SWAP_32( height );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ width = bswap_32(width);
+ height = bswap_32(height);
}
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1,
@@ -96,13 +90,13 @@ __glXBitmapReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXFogfvReqSize( const GLbyte * pc, Bool swap )
+__glXFogfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 0);
+ GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glFogfv_size(pname);
@@ -110,13 +104,13 @@ __glXFogfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXLightfvReqSize( const GLbyte * pc, Bool swap )
+__glXLightfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glLightfv_size(pname);
@@ -124,13 +118,13 @@ __glXLightfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXLightModelfvReqSize( const GLbyte * pc, Bool swap )
+__glXLightModelfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 0);
+ GLenum pname = *(GLenum *) (pc + 0);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glLightModelfv_size(pname);
@@ -138,13 +132,13 @@ __glXLightModelfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXMaterialfvReqSize( const GLbyte * pc, Bool swap )
+__glXMaterialfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glMaterialfv_size(pname);
@@ -152,18 +146,18 @@ __glXMaterialfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXPolygonStippleReqSize( const GLbyte * pc, Bool swap )
+__glXPolygonStippleReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
}
return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1,
@@ -172,13 +166,13 @@ __glXPolygonStippleReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexParameterfvReqSize( const GLbyte * pc, Bool swap )
+__glXTexParameterfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glTexParameterfv_size(pname);
@@ -186,26 +180,26 @@ __glXTexParameterfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexImage1DReqSize( const GLbyte * pc, Bool swap )
+__glXTexImage1DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei width = *(GLsizei *)(pc + 32);
- GLenum format = * (GLenum *)(pc + 44);
- GLenum type = * (GLenum *)(pc + 48);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei width = *(GLsizei *) (pc + 32);
+ GLenum format = *(GLenum *) (pc + 44);
+ GLenum type = *(GLenum *) (pc + 48);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
@@ -214,28 +208,28 @@ __glXTexImage1DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexImage2DReqSize( const GLbyte * pc, Bool swap )
+__glXTexImage2DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei width = *(GLsizei *)(pc + 32);
- GLsizei height = *(GLsizei *)(pc + 36);
- GLenum format = * (GLenum *)(pc + 44);
- GLenum type = * (GLenum *)(pc + 48);
-
- if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( height );
- SWAP_32( format );
- SWAP_32( type );
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei width = *(GLsizei *) (pc + 32);
+ GLsizei height = *(GLsizei *) (pc + 36);
+ GLenum format = *(GLenum *) (pc + 44);
+ GLenum type = *(GLenum *) (pc + 48);
+
+ if (swap) {
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ height = bswap_32(height);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
@@ -244,13 +238,13 @@ __glXTexImage2DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexEnvfvReqSize( const GLbyte * pc, Bool swap )
+__glXTexEnvfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glTexEnvfv_size(pname);
@@ -258,13 +252,13 @@ __glXTexEnvfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexGendvReqSize( const GLbyte * pc, Bool swap )
+__glXTexGendvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glTexGendv_size(pname);
@@ -272,13 +266,13 @@ __glXTexGendvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexGenfvReqSize( const GLbyte * pc, Bool swap )
+__glXTexGenfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glTexGenfv_size(pname);
@@ -286,50 +280,50 @@ __glXTexGenfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXPixelMapfvReqSize( const GLbyte * pc, Bool swap )
+__glXPixelMapfvReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei mapsize = *(GLsizei *)(pc + 4);
+ GLsizei mapsize = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( mapsize );
+ mapsize = bswap_32(mapsize);
}
return __GLX_PAD((mapsize * 4));
}
int
-__glXPixelMapusvReqSize( const GLbyte * pc, Bool swap )
+__glXPixelMapusvReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei mapsize = *(GLsizei *)(pc + 4);
+ GLsizei mapsize = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( mapsize );
+ mapsize = bswap_32(mapsize);
}
return __GLX_PAD((mapsize * 2));
}
int
-__glXDrawPixelsReqSize( const GLbyte * pc, Bool swap )
+__glXDrawPixelsReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLsizei width = *(GLsizei *)(pc + 20);
- GLsizei height = *(GLsizei *)(pc + 24);
- GLenum format = * (GLenum *)(pc + 28);
- GLenum type = * (GLenum *)(pc + 32);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLsizei width = *(GLsizei *) (pc + 20);
+ GLsizei height = *(GLsizei *) (pc + 24);
+ GLenum format = *(GLenum *) (pc + 28);
+ GLenum type = *(GLenum *) (pc + 32);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( width );
- SWAP_32( height );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ width = bswap_32(width);
+ height = bswap_32(height);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, 0, width, height, 1,
@@ -338,38 +332,38 @@ __glXDrawPixelsReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXPrioritizeTexturesReqSize( const GLbyte * pc, Bool swap )
+__glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 0);
+ GLsizei n = *(GLsizei *) (pc + 0);
if (swap) {
- SWAP_32( n );
+ n = bswap_32(n);
}
return __GLX_PAD((n * 4) + (n * 4));
}
int
-__glXTexSubImage1DReqSize( const GLbyte * pc, Bool swap )
+__glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei width = *(GLsizei *)(pc + 36);
- GLenum format = * (GLenum *)(pc + 44);
- GLenum type = * (GLenum *)(pc + 48);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei width = *(GLsizei *) (pc + 36);
+ GLenum format = *(GLenum *) (pc + 44);
+ GLenum type = *(GLenum *) (pc + 48);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
@@ -378,28 +372,28 @@ __glXTexSubImage1DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexSubImage2DReqSize( const GLbyte * pc, Bool swap )
+__glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei width = *(GLsizei *)(pc + 36);
- GLsizei height = *(GLsizei *)(pc + 40);
- GLenum format = * (GLenum *)(pc + 44);
- GLenum type = * (GLenum *)(pc + 48);
-
- if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( height );
- SWAP_32( format );
- SWAP_32( type );
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei width = *(GLsizei *) (pc + 36);
+ GLsizei height = *(GLsizei *) (pc + 40);
+ GLenum format = *(GLenum *) (pc + 44);
+ GLenum type = *(GLenum *) (pc + 48);
+
+ if (swap) {
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ height = bswap_32(height);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
@@ -408,26 +402,26 @@ __glXTexSubImage2DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXColorTableReqSize( const GLbyte * pc, Bool swap )
+__glXColorTableReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei width = *(GLsizei *)(pc + 28);
- GLenum format = * (GLenum *)(pc + 32);
- GLenum type = * (GLenum *)(pc + 36);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei width = *(GLsizei *) (pc + 28);
+ GLenum format = *(GLenum *) (pc + 32);
+ GLenum type = *(GLenum *) (pc + 36);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
@@ -436,13 +430,13 @@ __glXColorTableReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXColorTableParameterfvReqSize( const GLbyte * pc, Bool swap )
+__glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glColorTableParameterfv_size(pname);
@@ -450,26 +444,26 @@ __glXColorTableParameterfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXColorSubTableReqSize( const GLbyte * pc, Bool swap )
+__glXColorSubTableReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei count = *(GLsizei *)(pc + 28);
- GLenum format = * (GLenum *)(pc + 32);
- GLenum type = * (GLenum *)(pc + 36);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei count = *(GLsizei *) (pc + 28);
+ GLenum format = *(GLenum *) (pc + 32);
+ GLenum type = *(GLenum *) (pc + 36);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( count );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ count = bswap_32(count);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, count, 1, 1,
@@ -478,26 +472,26 @@ __glXColorSubTableReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXConvolutionFilter1DReqSize( const GLbyte * pc, Bool swap )
+__glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei width = *(GLsizei *)(pc + 28);
- GLenum format = * (GLenum *)(pc + 36);
- GLenum type = * (GLenum *)(pc + 40);
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei width = *(GLsizei *) (pc + 28);
+ GLenum format = *(GLenum *) (pc + 36);
+ GLenum type = *(GLenum *) (pc + 40);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, 1, 1,
@@ -506,28 +500,28 @@ __glXConvolutionFilter1DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXConvolutionFilter2DReqSize( const GLbyte * pc, Bool swap )
+__glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
+ GLint row_length = *(GLint *) (pc + 4);
GLint image_height = 0;
- GLint skip_images = 0;
- GLint skip_rows = * (GLint *)(pc + 8);
- GLint alignment = * (GLint *)(pc + 16);
- GLenum target = * (GLenum *)(pc + 20);
- GLsizei width = *(GLsizei *)(pc + 28);
- GLsizei height = *(GLsizei *)(pc + 32);
- GLenum format = * (GLenum *)(pc + 36);
- GLenum type = * (GLenum *)(pc + 40);
-
- if (swap) {
- SWAP_32( row_length );
- SWAP_32( skip_rows );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( height );
- SWAP_32( format );
- SWAP_32( type );
+ GLint skip_images = 0;
+ GLint skip_rows = *(GLint *) (pc + 8);
+ GLint alignment = *(GLint *) (pc + 16);
+ GLenum target = *(GLenum *) (pc + 20);
+ GLsizei width = *(GLsizei *) (pc + 28);
+ GLsizei height = *(GLsizei *) (pc + 32);
+ GLenum format = *(GLenum *) (pc + 36);
+ GLenum type = *(GLenum *) (pc + 40);
+
+ if (swap) {
+ row_length = bswap_32(row_length);
+ skip_rows = bswap_32(skip_rows);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ height = bswap_32(height);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, 1,
@@ -536,13 +530,13 @@ __glXConvolutionFilter2DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXConvolutionParameterfvReqSize( const GLbyte * pc, Bool swap )
+__glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 4);
+ GLenum pname = *(GLenum *) (pc + 4);
GLsizei compsize;
if (swap) {
- SWAP_32( pname );
+ pname = bswap_32(pname);
}
compsize = __glConvolutionParameterfv_size(pname);
@@ -550,32 +544,32 @@ __glXConvolutionParameterfvReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexImage3DReqSize( const GLbyte * pc, Bool swap )
+__glXTexImage3DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
- GLint image_height = * (GLint *)(pc + 8);
- GLint skip_rows = * (GLint *)(pc + 16);
- GLint skip_images = * (GLint *)(pc + 20);
- GLint alignment = * (GLint *)(pc + 32);
- GLenum target = * (GLenum *)(pc + 36);
- GLsizei width = *(GLsizei *)(pc + 48);
- GLsizei height = *(GLsizei *)(pc + 52);
- GLsizei depth = *(GLsizei *)(pc + 56);
- GLenum format = * (GLenum *)(pc + 68);
- GLenum type = * (GLenum *)(pc + 72);
+ GLint row_length = *(GLint *) (pc + 4);
+ GLint image_height = *(GLint *) (pc + 8);
+ GLint skip_rows = *(GLint *) (pc + 16);
+ GLint skip_images = *(GLint *) (pc + 20);
+ GLint alignment = *(GLint *) (pc + 32);
+ GLenum target = *(GLenum *) (pc + 36);
+ GLsizei width = *(GLsizei *) (pc + 48);
+ GLsizei height = *(GLsizei *) (pc + 52);
+ GLsizei depth = *(GLsizei *) (pc + 56);
+ GLenum format = *(GLenum *) (pc + 68);
+ GLenum type = *(GLenum *) (pc + 72);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( image_height );
- SWAP_32( skip_rows );
- SWAP_32( skip_images );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( height );
- SWAP_32( depth );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ image_height = bswap_32(image_height);
+ skip_rows = bswap_32(skip_rows);
+ skip_images = bswap_32(skip_images);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ height = bswap_32(height);
+ depth = bswap_32(depth);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, depth,
@@ -584,32 +578,32 @@ __glXTexImage3DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXTexSubImage3DReqSize( const GLbyte * pc, Bool swap )
+__glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap)
{
- GLint row_length = * (GLint *)(pc + 4);
- GLint image_height = * (GLint *)(pc + 8);
- GLint skip_rows = * (GLint *)(pc + 16);
- GLint skip_images = * (GLint *)(pc + 20);
- GLint alignment = * (GLint *)(pc + 32);
- GLenum target = * (GLenum *)(pc + 36);
- GLsizei width = *(GLsizei *)(pc + 60);
- GLsizei height = *(GLsizei *)(pc + 64);
- GLsizei depth = *(GLsizei *)(pc + 68);
- GLenum format = * (GLenum *)(pc + 76);
- GLenum type = * (GLenum *)(pc + 80);
+ GLint row_length = *(GLint *) (pc + 4);
+ GLint image_height = *(GLint *) (pc + 8);
+ GLint skip_rows = *(GLint *) (pc + 16);
+ GLint skip_images = *(GLint *) (pc + 20);
+ GLint alignment = *(GLint *) (pc + 32);
+ GLenum target = *(GLenum *) (pc + 36);
+ GLsizei width = *(GLsizei *) (pc + 60);
+ GLsizei height = *(GLsizei *) (pc + 64);
+ GLsizei depth = *(GLsizei *) (pc + 68);
+ GLenum format = *(GLenum *) (pc + 76);
+ GLenum type = *(GLenum *) (pc + 80);
if (swap) {
- SWAP_32( row_length );
- SWAP_32( image_height );
- SWAP_32( skip_rows );
- SWAP_32( skip_images );
- SWAP_32( alignment );
- SWAP_32( target );
- SWAP_32( width );
- SWAP_32( height );
- SWAP_32( depth );
- SWAP_32( format );
- SWAP_32( type );
+ row_length = bswap_32(row_length);
+ image_height = bswap_32(image_height);
+ skip_rows = bswap_32(skip_rows);
+ skip_images = bswap_32(skip_images);
+ alignment = bswap_32(alignment);
+ target = bswap_32(target);
+ width = bswap_32(width);
+ height = bswap_32(height);
+ depth = bswap_32(depth);
+ format = bswap_32(format);
+ type = bswap_32(type);
}
return __glXImageSize(format, type, target, width, height, depth,
@@ -618,221 +612,221 @@ __glXTexSubImage3DReqSize( const GLbyte * pc, Bool swap )
}
int
-__glXDrawBuffersARBReqSize( const GLbyte * pc, Bool swap )
+__glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 0);
+ GLsizei imageSize = *(GLsizei *) (pc + 20);
if (swap) {
- SWAP_32( n );
+ imageSize = bswap_32(imageSize);
}
- return __GLX_PAD((n * 4));
+ return __GLX_PAD(imageSize);
}
int
-__glXPointParameterfvEXTReqSize( const GLbyte * pc, Bool swap )
+__glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap)
{
- GLenum pname = * (GLenum *)(pc + 0);
- GLsizei compsize;
+ GLsizei imageSize = *(GLsizei *) (pc + 24);
if (swap) {
- SWAP_32( pname );
+ imageSize = bswap_32(imageSize);
}
- compsize = __glPointParameterfvEXT_size(pname);
- return __GLX_PAD((compsize * 4));
+ return __GLX_PAD(imageSize);
}
int
-__glXCompressedTexImage3DARBReqSize( const GLbyte * pc, Bool swap )
+__glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei imageSize = *(GLsizei *)(pc + 28);
+ GLsizei imageSize = *(GLsizei *) (pc + 28);
if (swap) {
- SWAP_32( imageSize );
+ imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
-__glXCompressedTexImage2DARBReqSize( const GLbyte * pc, Bool swap )
+__glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei imageSize = *(GLsizei *)(pc + 24);
+ GLsizei imageSize = *(GLsizei *) (pc + 36);
if (swap) {
- SWAP_32( imageSize );
+ imageSize = bswap_32(imageSize);
}
return __GLX_PAD(imageSize);
}
int
-__glXCompressedTexImage1DARBReqSize( const GLbyte * pc, Bool swap )
+__glXProgramStringARBReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei imageSize = *(GLsizei *)(pc + 20);
+ GLsizei len = *(GLsizei *) (pc + 8);
if (swap) {
- SWAP_32( imageSize );
+ len = bswap_32(len);
}
- return __GLX_PAD(imageSize);
+ return __GLX_PAD(len);
}
int
-__glXCompressedTexSubImage3DARBReqSize( const GLbyte * pc, Bool swap )
+__glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei imageSize = *(GLsizei *)(pc + 36);
+ GLsizei n = *(GLsizei *) (pc + 0);
if (swap) {
- SWAP_32( imageSize );
+ n = bswap_32(n);
}
- return __GLX_PAD(imageSize);
+ return __GLX_PAD((n * 4));
}
int
-__glXLoadProgramNVReqSize( const GLbyte * pc, Bool swap )
+__glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei len = *(GLsizei *)(pc + 8);
+ GLenum pname = *(GLenum *) (pc + 0);
+ GLsizei compsize;
if (swap) {
- SWAP_32( len );
+ pname = bswap_32(pname);
}
- return __GLX_PAD(len);
+ compsize = __glPointParameterfvEXT_size(pname);
+ return __GLX_PAD((compsize * 4));
}
int
-__glXProgramParameters4dvNVReqSize( const GLbyte * pc, Bool swap )
+__glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLuint num = * (GLuint *)(pc + 8);
+ GLuint num = *(GLuint *) (pc + 8);
if (swap) {
- SWAP_32( num );
+ num = bswap_32(num);
}
return __GLX_PAD((num * 32));
}
int
-__glXProgramParameters4fvNVReqSize( const GLbyte * pc, Bool swap )
+__glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLuint num = * (GLuint *)(pc + 8);
+ GLuint num = *(GLuint *) (pc + 8);
if (swap) {
- SWAP_32( num );
+ num = bswap_32(num);
}
return __GLX_PAD((num * 16));
}
int
-__glXVertexAttribs1dvNVReqSize( const GLbyte * pc, Bool swap )
+__glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 4);
+ GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( n );
+ n = bswap_32(n);
}
return __GLX_PAD((n * 8));
}
int
-__glXVertexAttribs2dvNVReqSize( const GLbyte * pc, Bool swap )
+__glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 4);
+ GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( n );
+ n = bswap_32(n);
}
return __GLX_PAD((n * 16));
}
int
-__glXVertexAttribs3dvNVReqSize( const GLbyte * pc, Bool swap )
+__glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 4);
+ GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( n );
+ n = bswap_32(n);
}
return __GLX_PAD((n * 24));
}
int
-__glXVertexAttribs3fvNVReqSize( const GLbyte * pc, Bool swap )
+__glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 4);
+ GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( n );
+ n = bswap_32(n);
}
return __GLX_PAD((n * 12));
}
int
-__glXVertexAttribs3svNVReqSize( const GLbyte * pc, Bool swap )
+__glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 4);
+ GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( n );
+ n = bswap_32(n);
}
return __GLX_PAD((n * 6));
}
int
-__glXVertexAttribs4dvNVReqSize( const GLbyte * pc, Bool swap )
+__glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei n = *(GLsizei *)(pc + 4);
+ GLsizei n = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( n );
+ n = bswap_32(n);
}
return __GLX_PAD((n * 32));
}
int
-__glXProgramNamedParameter4fvNVReqSize( const GLbyte * pc, Bool swap )
+__glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap)
{
- GLsizei len = *(GLsizei *)(pc + 4);
+ GLsizei len = *(GLsizei *) (pc + 4);
if (swap) {
- SWAP_32( len );
+ len = bswap_32(len);
}
return __GLX_PAD(len);
}
-ALIAS( Fogiv, Fogfv )
-ALIAS( Lightiv, Lightfv )
-ALIAS( LightModeliv, LightModelfv )
-ALIAS( Materialiv, Materialfv )
-ALIAS( TexParameteriv, TexParameterfv )
-ALIAS( TexEnviv, TexEnvfv )
-ALIAS( TexGeniv, TexGenfv )
-ALIAS( PixelMapuiv, PixelMapfv )
-ALIAS( ColorTableParameteriv, ColorTableParameterfv )
-ALIAS( ConvolutionParameteriv, ConvolutionParameterfv )
-ALIAS( CompressedTexSubImage2DARB, CompressedTexImage3DARB )
-ALIAS( CompressedTexSubImage1DARB, CompressedTexImage1DARB )
-ALIAS( RequestResidentProgramsNV, DrawBuffersARB )
-ALIAS( VertexAttribs1fvNV, PixelMapfv )
-ALIAS( VertexAttribs1svNV, PixelMapusv )
-ALIAS( VertexAttribs2fvNV, VertexAttribs1dvNV )
-ALIAS( VertexAttribs2svNV, PixelMapfv )
-ALIAS( VertexAttribs4fvNV, VertexAttribs2dvNV )
-ALIAS( VertexAttribs4svNV, VertexAttribs1dvNV )
-ALIAS( VertexAttribs4ubvNV, PixelMapfv )
-ALIAS( PointParameterivNV, PointParameterfvEXT )
-ALIAS( ProgramStringARB, LoadProgramNV )
-ALIAS( ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB )
-ALIAS( DeleteRenderbuffersEXT, DrawBuffersARB )
-ALIAS( DeleteFramebuffersEXT, DrawBuffersARB )
+ALIAS(Fogiv, Fogfv)
+ ALIAS(Lightiv, Lightfv)
+ ALIAS(LightModeliv, LightModelfv)
+ ALIAS(Materialiv, Materialfv)
+ ALIAS(TexParameteriv, TexParameterfv)
+ ALIAS(TexEnviv, TexEnvfv)
+ ALIAS(TexGeniv, TexGenfv)
+ ALIAS(PixelMapuiv, PixelMapfv)
+ ALIAS(ColorTableParameteriv, ColorTableParameterfv)
+ ALIAS(ConvolutionParameteriv, ConvolutionParameterfv)
+ ALIAS(CompressedTexSubImage1DARB, CompressedTexImage1DARB)
+ ALIAS(CompressedTexSubImage2DARB, CompressedTexImage3DARB)
+ ALIAS(LoadProgramNV, ProgramStringARB)
+ ALIAS(RequestResidentProgramsNV, DrawBuffersARB)
+ ALIAS(VertexAttribs1fvNV, PixelMapfv)
+ ALIAS(VertexAttribs1svNV, PixelMapusv)
+ ALIAS(VertexAttribs2fvNV, VertexAttribs1dvNV)
+ ALIAS(VertexAttribs2svNV, PixelMapfv)
+ ALIAS(VertexAttribs4fvNV, VertexAttribs2dvNV)
+ ALIAS(VertexAttribs4svNV, VertexAttribs1dvNV)
+ ALIAS(VertexAttribs4ubvNV, PixelMapfv)
+ ALIAS(PointParameterivNV, PointParameterfvEXT)
+ ALIAS(ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB)
+ ALIAS(DeleteFramebuffersEXT, DrawBuffersARB)
+ ALIAS(DeleteRenderbuffersEXT, DrawBuffersARB)
diff --git a/GL/glx/indirect_reqsize.h b/GL/glx/indirect_reqsize.h
index 23bc41c78..26211ee5c 100644
--- a/GL/glx/indirect_reqsize.h
+++ b/GL/glx/indirect_reqsize.h
@@ -83,14 +83,15 @@ extern PURE HIDDEN int __glXConvolutionParameterivReqSize(const GLbyte *pc, Bool
extern PURE HIDDEN int __glXSeparableFilter2DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexImage3DReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXCompressedTexSubImage1DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexSubImage2DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXLoadProgramNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap);
@@ -109,11 +110,10 @@ extern PURE HIDDEN int __glXVertexAttribs4fvNVReqSize(const GLbyte *pc, Bool swa
extern PURE HIDDEN int __glXVertexAttribs4svNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXVertexAttribs4ubvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXPointParameterivNVReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXProgramNamedParameter4dvNVReqSize(const GLbyte *pc, Bool swap);
-extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap);
extern PURE HIDDEN int __glXDeleteFramebuffersEXTReqSize(const GLbyte *pc, Bool swap);
+extern PURE HIDDEN int __glXDeleteRenderbuffersEXTReqSize(const GLbyte *pc, Bool swap);
# undef HIDDEN
# undef PURE
diff --git a/GL/glx/indirect_texture_compression.c b/GL/glx/indirect_texture_compression.c
index 35af1d235..3c09663fc 100644
--- a/GL/glx/indirect_texture_compression.c
+++ b/GL/glx/indirect_texture_compression.c
@@ -29,6 +29,7 @@
#endif
#include "glxserver.h"
+#include "glxbyteorder.h"
#include "glxext.h"
#include "singlesize.h"
#include "unpack.h"
@@ -39,20 +40,6 @@
#include "glthread.h"
#include "dispatch.h"
-#if defined(__linux__) || defined (__GLIBC__) || defined (__GNU__)
-#include <byteswap.h>
-#elif defined(__OpenBSD__)
-#include <sys/endian.h>
-#define bswap_16 __swap16
-#define bswap_32 __swap32
-#define bswap_64 __swap64
-#else
-#include <sys/endian.h>
-#define bswap_16 bswap16
-#define bswap_32 bswap32
-#define bswap_64 bswap64
-#endif
-
int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *pc)
{
xGLXSingleReq * const req = (xGLXSingleReq *) pc;
diff --git a/GL/glx/indirect_util.c b/GL/glx/indirect_util.c
index 09b7ab87c..58c194c99 100644
--- a/GL/glx/indirect_util.c
+++ b/GL/glx/indirect_util.c
@@ -23,29 +23,21 @@
* SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include <string.h>
#include <X11/Xmd.h>
#include <GL/gl.h>
#include <GL/glxproto.h>
-#if defined(__linux__) || defined (__GLIBC__) || defined(__GNU__)
-#include <byteswap.h>
-#elif defined(__OpenBSD__)
-#include <sys/endian.h>
-#define bswap_16 __swap16
-#define bswap_32 __swap32
-#define bswap_64 __swap64
-#else
-#include <sys/endian.h>
-#define bswap_16 bswap16
-#define bswap_32 bswap32
-#define bswap_64 bswap64
-#endif
#include <inttypes.h>
#include "indirect_size.h"
#include "indirect_size_get.h"
#include "indirect_dispatch.h"
#include "glxserver.h"
+#include "glxbyteorder.h"
#include "singlesize.h"
#include "glapitable.h"
#include "glapi.h"
diff --git a/GL/glx/swap_interval.c b/GL/glx/swap_interval.c
index c4137c1aa..24abd69fa 100644
--- a/GL/glx/swap_interval.c
+++ b/GL/glx/swap_interval.c
@@ -39,20 +39,7 @@
#include "glthread.h"
#include "dispatch.h"
#include "glapioffsets.h"
-
-#if defined(__linux__) || defined (__GLIBC__) || defined (__GNU__)
-#include <byteswap.h>
-#elif defined(__OpenBSD__)
-#include <sys/endian.h>
-#define bswap_16 __swap16
-#define bswap_32 __swap32
-#define bswap_64 __swap64
-#else
-#include <sys/endian.h>
-#define bswap_16 bswap16
-#define bswap_32 bswap32
-#define bswap_64 bswap64
-#endif
+#include "glxbyteorder.h"
static int DoSwapInterval(__GLXclientState *cl, GLbyte *pc, int do_swap);