summaryrefslogtreecommitdiffstats
path: root/generator/nanopb_generator.py
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-04-01 16:47:53 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2014-04-01 16:47:53 +0300
commit6c90e824c4e8f54c71645b63b1ea33b1e028cb97 (patch)
tree8f0c3a54dbd789940b5225fde3d24db5f5c37c5f /generator/nanopb_generator.py
parentf4949119ada32e28959e25e46b4f3314805b5ed1 (diff)
Fix compile error when default value given for extension field.
Update issue 111 Status: FixedInGit
Diffstat (limited to 'generator/nanopb_generator.py')
-rwxr-xr-xgenerator/nanopb_generator.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index c32b26ad..0660d20e 100755
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -351,6 +351,8 @@ class Field:
result += '0)'
elif self.pbtype in ['BYTES', 'STRING'] and self.allocation != 'STATIC':
result += '0)' # Arbitrary size default values not implemented
+ elif self.rules == 'OPTEXT':
+ result += '0)' # Default value for extensions is not implemented
else:
result += '&%s_default)' % (self.struct_name + self.name)