Selaa lähdekoodia

broadcom/xml: Throw an #error in XML-based codegen for a >1bit bool

I've debugged two nasty errors now due to copy-and-pasting a bool type
when writing a uint field.  Make sure I don't do that again.
tags/18.0-branchpoint
Eric Anholt 8 vuotta sitten
vanhempi
commit
443e1984d2
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3
    0
      src/broadcom/cle/gen_pack_header.py

+ 3
- 0
src/broadcom/cle/gen_pack_header.py Näytä tiedosto

@@ -111,6 +111,9 @@ class Field(object):
self.end = self.start + int(attrs["size"]) - 1
self.type = attrs["type"]

if self.type == 'bool' and self.start != self.end:
print("#error Field {} has bool type but more than one bit of size".format(self.name));

if "prefix" in attrs:
self.prefix = safe_name(attrs["prefix"]).upper()
else:

Loading…
Peruuta
Tallenna