Module: Mesa
Branch: main
Commit: aec9bf7319c1609772b82553413a5a5e933a13e4
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=aec9bf7319c1609772b82553413a5a5e933a13e4

Author: Adam Jackson <[email protected]>
Date:   Mon May 10 18:56:01 2021 -0400

glx: Move __glFreeAttributeState next to its one caller

Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13002>

---

 src/glx/clientattrib.c | 17 -----------------
 src/glx/glxclient.h    |  2 --
 src/glx/indirect_glx.c | 17 +++++++++++++++++
 3 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/src/glx/clientattrib.c b/src/glx/clientattrib.c
index 37f14c541a5..181ad06044c 100644
--- a/src/glx/clientattrib.c
+++ b/src/glx/clientattrib.c
@@ -129,20 +129,3 @@ __indirect_glPopClientAttrib(void)
    }
 }
 #endif
-
-void
-__glFreeAttributeState(struct glx_context * gc)
-{
-   __GLXattribute *sp, **spp;
-
-   for (spp = &gc->attributes.stack[0];
-        spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) {
-      sp = *spp;
-      if (sp) {
-         free((char *) sp);
-      }
-      else {
-         break;
-      }
-   }
-}
diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h
index ad2741bfed0..50aa4d892cb 100644
--- a/src/glx/glxclient.h
+++ b/src/glx/glxclient.h
@@ -443,8 +443,6 @@ glx_context_init(struct glx_context *gc,
       (gc)->error = code;       \
    }
 
-extern void __glFreeAttributeState(struct glx_context *);
-
 /************************************************************************/
 
 /**
diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c
index 4fb4ddecc0d..7b0cf3b7164 100644
--- a/src/glx/indirect_glx.c
+++ b/src/glx/indirect_glx.c
@@ -46,6 +46,23 @@ extern struct _glapi_table *__glXNewIndirectAPI(void);
 */
 static struct _glapi_table *IndirectAPI = NULL;
 
+static void
+__glFreeAttributeState(struct glx_context * gc)
+{
+   __GLXattribute *sp, **spp;
+
+   for (spp = &gc->attributes.stack[0];
+        spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; spp++) {
+      sp = *spp;
+      if (sp) {
+         free((char *) sp);
+      }
+      else {
+         break;
+      }
+   }
+}
+
 static void
 indirect_destroy_context(struct glx_context *gc)
 {

Reply via email to