Added size information in generated object dictionnary header files (Objdictgen/gen_cfile.py)
authoretisserant
Tue, 28 Apr 2009 20:23:30 +0200
changeset 547 79a24eb3ba28
parent 546 13701680330c
child 548 ecb8b7c6cf17
Added size information in generated object dictionnary header files (Objdictgen/gen_cfile.py)
objdictgen/gen_cfile.py
--- a/objdictgen/gen_cfile.py	Mon Apr 20 17:42:36 2009 +0200
+++ b/objdictgen/gen_cfile.py	Tue Apr 28 20:23:30 2009 +0200
@@ -230,7 +230,8 @@
                 texts["length"] = values[0]
                 if index in variablelist:
                     texts["name"] = FormatName(entry_infos["name"])
-                    strDeclareHeader += "extern %(subIndexType)s%(type_suffixe)s %(name)s[];\t\t/* Mapped at index 0x%(index)04X, subindex 0x01 - 0x%(length)02X */\n"%texts
+                    texts["values_count"] =  str(len(values)-1)
+                    strDeclareHeader += "extern %(subIndexType)s%(type_suffixe)s %(name)s[%(values_count)s];\t\t/* Mapped at index 0x%(index)04X, subindex 0x01 - 0x%(length)02X */\n"%texts
                     mappedVariableContent += "%(subIndexType)s%(type_suffixe)s %(name)s[] =\t\t/* Mapped at index 0x%(index)04X, subindex 0x01 - 0x%(length)02X */\n  {\n"%texts
                     for subIndex, value in enumerate(values):
                         sep = ","