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
This commit is contained in:
Petteri Aimonen
2013-04-02 20:01:31 +03:00
parent 214b0eae8a
commit 384e686fe6

View File

@@ -186,7 +186,7 @@ class Field:
return cmp(self.tag, other.tag) return cmp(self.tag, other.tag)
def __str__(self): def __str__(self):
if self.rules == 'OPTIONAL': if self.rules == 'OPTIONAL' and self.allocation == 'STATIC':
result = ' bool has_' + self.name + ';\n' result = ' bool has_' + self.name + ';\n'
elif self.rules == 'REPEATED' and self.allocation == 'STATIC': elif self.rules == 'REPEATED' and self.allocation == 'STATIC':
result = ' size_t ' + self.name + '_count;\n' result = ' size_t ' + self.name + '_count;\n'