aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx')
-rw-r--r--xorg-server/glx/glthread.c204
-rw-r--r--xorg-server/glx/glxext.c4
-rw-r--r--xorg-server/glx/glxserver.h1
-rw-r--r--xorg-server/glx/indirect_program.c22
-rw-r--r--xorg-server/glx/indirect_texture_compression.c8
5 files changed, 8 insertions, 231 deletions
diff --git a/xorg-server/glx/glthread.c b/xorg-server/glx/glthread.c
deleted file mode 100644
index fd4c6cc09..000000000
--- a/xorg-server/glx/glthread.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.1
- *
- * Copyright (C) 1999-2006 Brian Paul 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, sublicense,
- * 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-/*
- * XXX There's probably some work to do in order to make this file
- * truly reusable outside of Mesa.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#include <X11/Xfuncproto.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "glthread.h"
-
-/*
- * This file should still compile even when THREADS is not defined.
- * This is to make things easier to deal with on the makefile scene..
- */
-#ifdef THREADS
-#include <errno.h>
-
-/*
- * Error messages
- */
-#define INIT_TSD_ERROR "_glthread_: failed to allocate key for thread specific data"
-#define GET_TSD_ERROR "_glthread_: failed to get thread specific data"
-#define SET_TSD_ERROR "_glthread_: thread failed to set thread specific data"
-
-/*
- * Magic number to determine if a TSD object has been initialized.
- * Kind of a hack but there doesn't appear to be a better cross-platform
- * solution.
- */
-#define INIT_MAGIC 0xff8adc98
-
-/*
- * POSIX Threads -- The best way to go if your platform supports them.
- * Solaris >= 2.5 have POSIX threads, IRIX >= 6.4 reportedly
- * has them, and many of the free Unixes now have them.
- * Be sure to use appropriate -mt or -D_REENTRANT type
- * compile flags when building.
- */
-#ifdef PTHREADS
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
- return (unsigned long) pthread_self();
-}
-
-void
-_glthread_InitTSD(_glthread_TSD * tsd)
-{
- if (pthread_key_create(&tsd->key, NULL /*free */ ) != 0) {
- perror(INIT_TSD_ERROR);
- exit(-1);
- }
- tsd->initMagic = INIT_MAGIC;
-}
-
-void *
-_glthread_GetTSD(_glthread_TSD * tsd)
-{
- if (tsd->initMagic != (int) INIT_MAGIC) {
- _glthread_InitTSD(tsd);
- }
- return pthread_getspecific(tsd->key);
-}
-
-void
-_glthread_SetTSD(_glthread_TSD * tsd, void *ptr)
-{
- if (tsd->initMagic != (int) INIT_MAGIC) {
- _glthread_InitTSD(tsd);
- }
- if (pthread_setspecific(tsd->key, ptr) != 0) {
- perror(SET_TSD_ERROR);
- exit(-1);
- }
-}
-
-#endif /* PTHREADS */
-
-/*
- * Win32 Threads. The only available option for Windows 95/NT.
- * Be sure that you compile using the Multithreaded runtime, otherwise
- * bad things will happen.
- */
-#ifdef WIN32_THREADS
-
-void
-FreeTSD(_glthread_TSD * p)
-{
- if (p->initMagic == INIT_MAGIC) {
- TlsFree(p->key);
- p->initMagic = 0;
- }
-}
-
-void
-InsteadOf_exit(int nCode)
-{
- DWORD dwErr = GetLastError();
-}
-
-unsigned long
-_glthread_GetID(void)
-{
- return GetCurrentThreadId();
-}
-
-void
-_glthread_InitTSD(_glthread_TSD * tsd)
-{
- tsd->key = TlsAlloc();
- if (tsd->key == TLS_OUT_OF_INDEXES) {
- perror("Mesa:_glthread_InitTSD");
- InsteadOf_exit(-1);
- }
- tsd->initMagic = INIT_MAGIC;
-}
-
-void *
-_glthread_GetTSD(_glthread_TSD * tsd)
-{
- if (tsd->initMagic != INIT_MAGIC) {
- _glthread_InitTSD(tsd);
- }
- return TlsGetValue(tsd->key);
-}
-
-void
-_glthread_SetTSD(_glthread_TSD * tsd, void *ptr)
-{
- /* the following code assumes that the _glthread_TSD has been initialized
- to zero at creation */
- if (tsd->initMagic != INIT_MAGIC) {
- _glthread_InitTSD(tsd);
- }
- if (TlsSetValue(tsd->key, ptr) == 0) {
- perror("Mesa:_glthread_SetTSD");
- InsteadOf_exit(-1);
- }
-}
-
-#endif /* WIN32_THREADS */
-
-#else /* THREADS */
-
-/*
- * no-op functions
- */
-
-_X_EXPORT unsigned long
-_glthread_GetID(void)
-{
- return 0;
-}
-
-void
-_glthread_InitTSD(_glthread_TSD * tsd)
-{
- (void) tsd;
-}
-
-void *
-_glthread_GetTSD(_glthread_TSD * tsd)
-{
- (void) tsd;
- return NULL;
-}
-
-void
-_glthread_SetTSD(_glthread_TSD * tsd, void *ptr)
-{
- (void) tsd;
- (void) ptr;
-}
-
-#endif /* THREADS */
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index 6a34ac299..c9b8cc5b3 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -554,9 +554,9 @@ __glXsetGetProcAddress(glx_gpa_proc get_proc_address)
void *__glGetProcAddress(const char *proc)
{
- void *ret = _get_proc_address(proc);
+ void *ret = (void *) _get_proc_address(proc);
- return ret ? ret : NoopDDA;
+ return ret ? ret : (void *) NoopDDA;
}
/*
diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h
index 7f36e5f5e..3f2ae3593 100644
--- a/xorg-server/glx/glxserver.h
+++ b/xorg-server/glx/glxserver.h
@@ -46,7 +46,6 @@
#include <resource.h>
#include <scrnintstr.h>
-#define GL_GLEXT_PROTOTYPES /* we want prototypes */
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glxproto.h>
diff --git a/xorg-server/glx/indirect_program.c b/xorg-server/glx/indirect_program.c
index fa4a2408b..d503262c2 100644
--- a/xorg-server/glx/indirect_program.c
+++ b/xorg-server/glx/indirect_program.c
@@ -122,25 +122,3 @@ __glXDispSwap_GetProgramStringARB(struct __GLXclientStateRec *cl, GLbyte * pc)
return DoGetProgramString(cl, pc, get_program, get_program_string, True);
}
-
-int
-__glXDisp_GetProgramStringNV(struct __GLXclientStateRec *cl, GLbyte * pc)
-{
- PFNGLGETPROGRAMIVARBPROC get_program =
- __glGetProcAddress("glGetProgramivARB");
- PFNGLGETPROGRAMSTRINGARBPROC get_program_string =
- __glGetProcAddress("glGetProgramStringARB");
-
- return DoGetProgramString(cl, pc, get_program, get_program_string, False);
-}
-
-int
-__glXDispSwap_GetProgramStringNV(struct __GLXclientStateRec *cl, GLbyte * pc)
-{
- PFNGLGETPROGRAMIVARBPROC get_program =
- __glGetProcAddress("glGetProgramivARB");
- PFNGLGETPROGRAMSTRINGARBPROC get_program_string =
- __glGetProcAddress("glGetProgramStringARB");
-
- return DoGetProgramString(cl, pc, get_program, get_program_string, True);
-}
diff --git a/xorg-server/glx/indirect_texture_compression.c b/xorg-server/glx/indirect_texture_compression.c
index 94de47dd6..2018de6ae 100644
--- a/xorg-server/glx/indirect_texture_compression.c
+++ b/xorg-server/glx/indirect_texture_compression.c
@@ -54,9 +54,11 @@ __glXDisp_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
&compsize);
if (compsize != 0) {
+ PFNGLGETCOMPRESSEDTEXIMAGEARBPROC GetCompressedTexImageARB =
+ __glGetProcAddress("glGetCompressedTexImageARB");
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
__glXClearErrorOccured();
- glGetCompressedTexImageARB(target, level, answer);
+ GetCompressedTexImageARB(target, level, answer);
}
if (__glXErrorOccured()) {
@@ -96,9 +98,11 @@ __glXDispSwap_GetCompressedTexImage(struct __GLXclientStateRec *cl, GLbyte * pc)
&compsize);
if (compsize != 0) {
+ PFNGLGETCOMPRESSEDTEXIMAGEARBPROC GetCompressedTexImageARB =
+ __glGetProcAddress("glGetCompressedTexImageARB");
__GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1);
__glXClearErrorOccured();
- glGetCompressedTexImageARB(target, level, answer);
+ GetCompressedTexImageARB(target, level, answer);
}
if (__glXErrorOccured()) {