[Mesa-dev] [PATCH v3 1/3] Fix missing initializer warning in sid_tables.h by adding appropriate default fields in sid_tables.py

Benedikt Schemmer ben at besd.de
Sun Jun 11 17:17:12 UTC 2017


Fix missing initializer warning in sid_tables.h by adding appropriate designated initializers in sid_tables.py

---
 src/amd/common/sid_tables.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/amd/common/sid_tables.py b/src/amd/common/sid_tables.py
index fd88d3c9d5..691d766b08 100644
--- a/src/amd/common/sid_tables.py
+++ b/src/amd/common/sid_tables.py
@@ -266,11 +266,13 @@ struct si_packet3 {
                         while value[1] >= len(values_offsets):
                             values_offsets.append(-1)
                         values_offsets[value[1]] = strings.add(strip_prefix(value[0]))
-                    print '\t{%s, %s(~0u), %s, %s},' % (
-                        strings.add(field.name), field.s_name,
+                    print '\t{.name_offset\t= %s,\r\n\t .mask\t\t\t= %s(~0u), \
+                           \r\n\t .num_values\t= %s,\r\n\t .values_offset\t= %s},' \
+                           % (strings.add(field.name), field.s_name,
                         len(values_offsets), strings_offsets.add(values_offsets))
                 else:
-                    print '\t{%s, %s(~0u)},' % (strings.add(field.name), field.s_name)
+                    print '\t{.name_offset\t= %s,\r\n\t .mask\t\t\t= %s(~0u)},' \
+                           % (strings.add(field.name), field.s_name)
                 fields_idx += 1

     print '};'
@@ -279,10 +281,13 @@ struct si_packet3 {
     print 'static const struct si_reg sid_reg_table[] = {'
     for reg in regs:
         if len(reg.fields):
-            print '\t{%s, %s, %s, %s},' % (strings.add(reg.name), reg.r_name,
+            print '\t{.name_offset\t= %s,\r\n\t .offset\t\t= %s, \
+                   \r\n\t .num_fields\t= %s,\r\n\t .fields_offset\t= %s},' \
+                   % (strings.add(reg.name), reg.r_name,
                 len(reg.fields), reg.fields_idx if reg.own_fields else reg.fields_owner.fields_idx)
         else:
-            print '\t{%s, %s},' % (strings.add(reg.name), reg.r_name)
+            print '\t{.name_offset\t= %s,\r\n\t .offset\t\t= %s},' \
+                   % (strings.add(reg.name), reg.r_name)
     print '};'
     print

-- 
2.11.0




More information about the mesa-dev mailing list