The previous use of a dictionary instead of a list led to typedefs being generated in wrong order.
Change-Id: Iee6ff73f920883ce6e599180c1b47fe997c1702e
Signed-off-by: Ole Troan <ot@cisco.com>
]))
print("")
print("")
- for t in parser.types_by_json[j].values():
+ for t in parser.types_by_json[j]:
try:
print("%s" % t.get_c_def())
print("")
print("")
function_attrs = "static inline "
- for t in parser.types_by_json[j].values():
+ for t in parser.types_by_json[j]:
print("#ifndef defined_inline_%s" % t.get_c_name())
print("#define defined_inline_%s" % t.get_c_name())
print("%s%s" % (function_attrs, t.get_swap_to_be_func_def()))
def parse_json_file(self, path):
self.logger.info("Parsing json api file: `%s'" % path)
self.json_files.append(path)
- self.types_by_json[path] = {}
+ self.types_by_json[path] = []
self.messages_by_json[path] = {}
with open(path) as f:
j = json.load(f)
self.exceptions.append(e)
continue
self.types[type_.name] = type_
- self.types_by_json[path][type_.name] = type_
+ self.types_by_json[path].append(type_)
self.logger.debug("Parsed type: %s" % type_)
for m in j['messages']:
try: