From 842d52633d650286ce62490362f8dfa356e17800 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Sun, 14 Aug 2011 20:11:05 +0000 Subject: More documentation, small improvements git-svn-id: https://svn.kapsi.fi/jpa/nanopb@955 e3a754e5-d11d-0410-8d38-ebb782a927b9 --- generator/nanopb_generator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'generator/nanopb_generator.py') diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index 6aff3155..e62d04f1 100644 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -204,7 +204,7 @@ class Field: if prev_field_name is None: result += ' offsetof(%s, %s),' % (self.struct_name, self.name) else: - result += ' pb_delta(%s, %s, %s),' % (self.struct_name, self.name, prev_field_name) + result += ' pb_delta_end(%s, %s, %s),' % (self.struct_name, self.name, prev_field_name) if self.htype == 'PB_HTYPE_OPTIONAL': result += '\n pb_delta(%s, has_%s, %s),' % (self.struct_name, self.name, self.name) @@ -279,11 +279,11 @@ class Message: return result def fields_declaration(self): - result = 'extern const pb_field_t %s_fields[%d];' % (self.name, len(self.fields)) + result = 'extern const pb_field_t %s_fields[%d];' % (self.name, len(self.fields) + 1) return result def fields_definition(self): - result = 'const pb_field_t %s_fields[%d] = {\n' % (self.name, len(self.fields)) + result = 'const pb_field_t %s_fields[%d] = {\n' % (self.name, len(self.fields) + 1) prev = None for field in self.ordered_fields: @@ -291,7 +291,7 @@ class Message: result += ',\n\n' prev = field.name - result = result[:-3] + '\n};' + result += ' PB_LAST_FIELD\n};' return result def iterate_messages(desc, names = Names()): -- cgit 1.2.3-korg