X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Fglx%2Fclientattrib.c;h=37f14c541a5e81ce196b336acbbec8b759cba563;hp=a7dfb5348603444752fe2b4a44741ff519888f48;hb=b4fe0b3ffd825284aa57072c67a019fbc1bf4a1b;hpb=653a83445f94620673f747a4ace6847a2c7fdb4d diff --git a/src/glx/clientattrib.c b/src/glx/clientattrib.c index a7dfb534860..37f14c541a5 100644 --- a/src/glx/clientattrib.c +++ b/src/glx/clientattrib.c @@ -35,10 +35,11 @@ /*****************************************************************************/ +#ifndef GLX_USE_APPLEGL static void do_enable_disable(GLenum array, GLboolean val) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); unsigned index = 0; @@ -68,13 +69,17 @@ __indirect_glDisableClientState(GLenum array) void __indirect_glPushClientAttrib(GLuint mask) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); __GLXattribute **spp = gc->attributes.stackPointer, *sp; if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) { if (!(sp = *spp)) { - sp = (__GLXattribute *) Xmalloc(sizeof(__GLXattribute)); + sp = malloc(sizeof(__GLXattribute)); + if (sp == NULL) { + __glXSetError(gc, GL_OUT_OF_MEMORY); + return; + } *spp = sp; } sp->mask = mask; @@ -96,7 +101,7 @@ __indirect_glPushClientAttrib(GLuint mask) void __indirect_glPopClientAttrib(void) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); __GLXattribute **spp = gc->attributes.stackPointer, *sp; GLuint mask; @@ -123,9 +128,10 @@ __indirect_glPopClientAttrib(void) return; } } +#endif void -__glFreeAttributeState(__GLXcontext * gc) +__glFreeAttributeState(struct glx_context * gc) { __GLXattribute *sp, **spp; @@ -133,7 +139,7 @@ __glFreeAttributeState(__GLXcontext * gc) spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) { sp = *spp; if (sp) { - XFree((char *) sp); + free((char *) sp); } else { break;