Skip to content

Commit

Permalink
Rename max_size member -> size.
Browse files Browse the repository at this point in the history
This is more consistent with the C interface's naming convention.
  • Loading branch information
denravonska authored and PetteriAimonen committed Jan 11, 2024
1 parent 75445fd commit e586761
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generator/nanopb_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ def fields_declaration_cpp_lookup(self, local_defines):

size_define = "%s_size" % (self.name)
if size_define in local_defines:
result += ' static PB_INLINE_CONSTEXPR const pb_size_t max_size = %s;\n' % (size_define)
result += ' static PB_INLINE_CONSTEXPR const pb_size_t size = %s;\n' % (size_define)

result += ' static inline const pb_msgdesc_t* fields() {\n'
result += ' return &%s_msg;\n' % (self.name)
Expand Down
2 changes: 1 addition & 1 deletion tests/cxx_descriptor/message_descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern "C" int main() {
TEST(MessageDescriptor<MyNonEmptyMessage>::fields_array_length ==
MyNonEmptyMessage_msg.field_count);

TEST(MessageDescriptor<MyNonEmptyMessage>::max_size ==
TEST(MessageDescriptor<MyNonEmptyMessage>::size ==
MyNonEmptyMessage_size);

TEST(MessageDescriptor<MyEmptyMessage>::fields() == MyEmptyMessage_fields);
Expand Down

0 comments on commit e586761

Please sign in to comment.