From 9dbf5ec9f7844dda9d2473a3168e3f8b0009a66d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 19 Feb 2020 16:00:53 -0500 Subject: [PATCH] glthread: use int instead of size_t where it's OK Reviewed-by: Timothy Arceri Part-of: --- src/mapi/glapi/gen/gl_marshal.py | 2 +- src/mesa/main/glthread.h | 2 +- src/mesa/main/marshal.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 1e5f75da399..c12a086942b 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -237,7 +237,7 @@ class PrintCode(gl_XML.gl_print_base): if p.img_null_flag: size = '({0} ? {1} : 0)'.format(p.name, size) size_terms.append(size) - out('size_t cmd_size = {0};'.format(' + '.join(size_terms))) + out('int cmd_size = {0};'.format(' + '.join(size_terms))) out('{0} *cmd;'.format(struct)) out('debug_print_marshal("{0}");'.format(func.name)) diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h index 59cb95feb4a..3d1c3ef1983 100644 --- a/src/mesa/main/glthread.h +++ b/src/mesa/main/glthread.h @@ -60,7 +60,7 @@ struct glthread_batch struct gl_context *ctx; /** Amount of data used by batch commands, in bytes. */ - size_t used; + int used; /** Data contained in the command buffer. */ uint8_t buffer[MARSHAL_MAX_CMD_SIZE]; diff --git a/src/mesa/main/marshal.h b/src/mesa/main/marshal.h index b2556ca9841..10c508327a7 100644 --- a/src/mesa/main/marshal.h +++ b/src/mesa/main/marshal.h @@ -54,12 +54,12 @@ extern const _mesa_unmarshal_func _mesa_unmarshal_dispatch[NUM_DISPATCH_CMD]; static inline void * _mesa_glthread_allocate_command(struct gl_context *ctx, uint16_t cmd_id, - size_t size) + int size) { struct glthread_state *glthread = ctx->GLThread; struct glthread_batch *next = &glthread->batches[glthread->next]; struct marshal_cmd_base *cmd_base; - const size_t aligned_size = ALIGN(size, 8); + const int aligned_size = ALIGN(size, 8); if (unlikely(next->used + size > MARSHAL_MAX_CMD_SIZE)) { _mesa_glthread_flush_batch(ctx); -- 2.30.2