glthread: rename marshal.h/c to glthread_marshal.h and glthread_shaderobj.c
[mesa.git] / src / mapi / glapi / gen / gl_marshal.py
index 02c94dd74dbd31aa72c1f0fe6be3a60ec9fe17d2..da71a1de787097047887167485ae33a547f35fc3 100644 (file)
@@ -31,12 +31,18 @@ import sys
 
 header = """
 #include "api_exec.h"
-#include "context.h"
+#include "glthread_marshal.h"
 #include "dispatch.h"
-#include "glthread.h"
-#include "marshal.h"
 
 #define COMPAT (ctx->API != API_OPENGL_CORE)
+
+static inline int safe_mul(int a, int b)
+{
+    if (a < 0 || b < 0) return -1;
+    if (a == 0 || b == 0) return 0;
+    if (a > INT_MAX / b) return -1;
+    return a * b;
+}
 """
 
 
@@ -68,14 +74,6 @@ class PrintCode(gl_XML.gl_print_base):
 
     def printRealHeader(self):
         print(header)
-        print('static inline int safe_mul(int a, int b)')
-        print('{')
-        print('    if (a < 0 || b < 0) return -1;')
-        print('    if (a == 0 || b == 0) return 0;')
-        print('    if (a > INT_MAX / b) return -1;')
-        print('    return a * b;')
-        print('}')
-        print()
 
     def printRealFooter(self):
         pass
@@ -174,7 +172,7 @@ class PrintCode(gl_XML.gl_print_base):
         out('};')
 
     def print_async_unmarshal(self, func):
-        out('static inline void')
+        out('static void')
         out(('_mesa_unmarshal_{0}(struct gl_context *ctx, '
              'const struct marshal_cmd_{0} *cmd)').format(func.name))
         out('{')
@@ -261,8 +259,6 @@ class PrintCode(gl_XML.gl_print_base):
             out('int cmd_size = {0};'.format(' + '.join(size_terms)))
             out('{0} *cmd;'.format(struct))
 
-            out('debug_print_marshal("{0}");'.format(func.name))
-
             self.validate_count_or_fallback(func)
 
             if func.marshal_fail: