X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmapi%2Fglapi%2Fgen%2Fgl_marshal.py;h=da71a1de787097047887167485ae33a547f35fc3;hb=8a4114b9294c8e8f5bb977be47cc7764c9cdf490;hp=02c94dd74dbd31aa72c1f0fe6be3a60ec9fe17d2;hpb=951c6acb074b18da0e595825fe05c77a0fbee96d;p=mesa.git diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 02c94dd74db..da71a1de787 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -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: