panfrost: gen_pack: Fix gnu-empty-initializer errors
Fixes: 1b27817f17
("panfrost: gen_pack: Allow empty structs")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6811>
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user