freedreno/registers: C++ struct casting

Using C style `(struct foo){ ..args..}` at least confuses eclipse, so
for C++ code use `{ ..args.. }` instead.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22646>
This commit is contained in:
Rob Clark 2023-04-23 07:55:55 -07:00 committed by Marge Bot
parent 827363f886
commit 09f19672a0

View file

@ -221,10 +221,10 @@ class Bitset(object):
skip = ""
if reg.array:
print("#define %s(__i, ...) pack_%s(__i, (struct %s) { __VA_ARGS__ })%s\n" %
print("#define %s(__i, ...) pack_%s(__i, __struct_cast(%s) { __VA_ARGS__ })%s\n" %
(prefix, prefix, prefix, skip))
else:
print("#define %s(...) pack_%s((struct %s) { __VA_ARGS__ })%s\n" %
print("#define %s(...) pack_%s(__struct_cast(%s) { __VA_ARGS__ })%s\n" %
(prefix, prefix, prefix, skip))
@ -649,6 +649,12 @@ def main():
print("#include <assert.h>")
print()
print("#ifdef __cplusplus");
print("#define __struct_cast(X)")
print("#else")
print("#define __struct_cast(X) (struct X)")
print("#endif")
try:
p.parse(rnn_path, xml_file)
except Error as e: