Tools: Fix printing of C_variable with None value
If the variable doesn't have a value, print 0
Change-Id: Ie33d0e43c0fabfc668fa143b55e40c2a4eb2c058
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/tools/modules/c_struct.py b/tools/modules/c_struct.py
index e88bebc..89c02b2 100644
--- a/tools/modules/c_struct.py
+++ b/tools/modules/c_struct.py
@@ -417,7 +417,7 @@
return self._size
def get_value_str(self):
- return hex(self.value)
+ return hex(self.value) if self.value else hex(0)
def __str__(self):
string = "{} {}".format(self.c_type, self.name)