iamandi / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

Generate #define for initializing structures #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
nanopb-generator.py could generate a #define that would initialize a structure 
to default values. For example:

#define Person_PhoneNumber_defaults {"", false, Person_PhoneType_HOME}
Person_PhoneNumber phone = Person_PhoneNumber_defaults;

Currently this is mostly achieved by = {}, but that initializes everything to 
zero.

Original issue reported on code.google.com by Petteri.Aimonen on 16 Jul 2013 at 8:02

GoogleCodeExporter commented 9 years ago
This issue was updated by revision ec3bff4ba110.

Original comment by Petteri.Aimonen on 4 Aug 2014 at 3:42

GoogleCodeExporter commented 9 years ago
Fix released in nanopb 0.2.9.

Original comment by Petteri.Aimonen on 9 Aug 2014 at 7:28