summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-04-02 20:01:31 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-04-02 20:01:31 +0300
commit384e686fe6d7b7088cdbc4b44bc988eba3a21945 (patch)
tree46a35add2ffa5fd2e0a75d7a6e43c9b12b2fda47 /generator
parent214b0eae8aa011fa8b3e8a3dcc784f8d423aeffb (diff)
Do not generate has_ fields for callback fields.
The arg field can be used to store the field presence from inside the callback. Furthermore, having the has_ field for encoding callbacks would be more annoying than useful. Update issue 70 Status: FixedInGit
Diffstat (limited to 'generator')
-rw-r--r--generator/nanopb_generator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py
index 5ef4ab7a..5366f1bd 100644
--- a/generator/nanopb_generator.py
+++ b/generator/nanopb_generator.py
@@ -186,7 +186,7 @@ class Field:
return cmp(self.tag, other.tag)
def __str__(self):
- if self.rules == 'OPTIONAL':
+ if self.rules == 'OPTIONAL' and self.allocation == 'STATIC':
result = ' bool has_' + self.name + ';\n'
elif self.rules == 'REPEATED' and self.allocation == 'STATIC':
result = ' size_t ' + self.name + '_count;\n'