broadcom/cle: Fix error path of missing a "type" in the XML.
authorEric Anholt <eric@anholt.net>
Thu, 28 Dec 2017 21:51:36 +0000 (13:51 -0800)
committerEric Anholt <eric@anholt.net>
Sat, 13 Jan 2018 05:51:34 +0000 (21:51 -0800)
We try to emit a #error and continue so that you can debug the missing
type at C compile time, but were missing a couple of definitions in that
path (sigh, python).

src/broadcom/cle/gen_pack_header.py

index a23b69b67586d8bd1eee4eb499ff03f36e1f5c2e..e5762762b234a300025e406c5679a6e45cfee2fd 100644 (file)
@@ -166,6 +166,7 @@ class Field(object):
             return
         else:
             print("#error unhandled type: %s" % self.type)
             return
         else:
             print("#error unhandled type: %s" % self.type)
+            type = "uint32_t"
 
         print("   %-36s %s%s;" % (type, self.name, dim))
 
 
         print("   %-36s %s%s;" % (type, self.name, dim))
 
@@ -362,7 +363,7 @@ class Group(object):
                     args.append(str(field.fractional_size))
                     convert = "__gen_unpack_sfixed"
                 else:
                     args.append(str(field.fractional_size))
                     convert = "__gen_unpack_sfixed"
                 else:
-                    print("/* unhandled field %s, type %s */\n" % (name, field.type))
+                    print("/* unhandled field %s, type %s */\n" % (field.name, field.type))
                     s = None
 
                 print("   values->%s = %s(%s);" % \
                     s = None
 
                 print("   values->%s = %s(%s);" % \