Mesa (master): glthread: don't declare pointers with const in unmarshal functions

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 17 12:20:50 UTC 2021


Module: Mesa
Branch: master
Commit: 0b6739ef8072edeac457f27434972edff14d18c0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0b6739ef8072edeac457f27434972edff14d18c0

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Thu Feb 11 22:50:55 2021 -0500

glthread: don't declare pointers with const in unmarshal functions

so that GL functions with a non-const pointer don't print a warning when
we call them, such as glGetTexImage with a PBO where the pointer is really
just an offset.

Reviewed-by: Zoltán Böszörményi <zboszor at gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>

---

 src/mapi/glapi/gen/gl_marshal.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py
index 95a22bd9b1b..590e036f9f8 100644
--- a/src/mapi/glapi/gen/gl_marshal.py
+++ b/src/mapi/glapi/gen/gl_marshal.py
@@ -251,7 +251,7 @@ class PrintCode(gl_XML.gl_print_base):
                     p_decl = '{0} {1} = cmd->{1};'.format(
                             p.type_string(), p.name)
 
-                if not p_decl.startswith('const '):
+                if not p_decl.startswith('const ') and p.count:
                     # Declare all local function variables as const, even if
                     # the original parameter is not const.
                     p_decl = 'const ' + p_decl



More information about the mesa-commit mailing list