Module: Mesa Branch: master Commit: 1dd4505bc1e7cd59119f2a3c092eed847092d611 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1dd4505bc1e7cd59119f2a3c092eed847092d611
Author: Boris Brezillon <[email protected]> Date: Tue Sep 22 08:56:03 2020 +0200 panfrost: gen_pack: Fix gnu-empty-initializer errors Fixes: 1b27817f1755 ("panfrost: gen_pack: Allow empty structs") Signed-off-by: Boris Brezillon <[email protected]> Tested-by: Vinson Lee <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6811> --- src/panfrost/lib/gen_pack.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/panfrost/lib/gen_pack.py b/src/panfrost/lib/gen_pack.py index cf212e9fb1c..c93eacdb1bc 100644 --- a/src/panfrost/lib/gen_pack.py +++ b/src/panfrost/lib/gen_pack.py @@ -378,6 +378,9 @@ class Group(object): if self.count > 1: dim = "%s[%d]" % (dim, self.count) + if len(self.fields) == 0: + print(" int dummy;") + for field in self.fields: if field.exact is not None: continue @@ -692,10 +695,8 @@ class Parser(object): print('#define %-40s\\' % (name + '_header')) if default_fields: print(", \\\n".join(default_fields)) - elif len(self.group.fields) > 0: - print(' 0') else: - print(' ') + print(' 0') print('') def emit_template_struct(self, name, group, opaque_structs): _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
