diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2014-08-04 18:40:40 +0300 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2014-08-04 18:40:40 +0300 |
commit | ec3bff4ba110ffad31fccdbf74c4c180fc041414 (patch) | |
tree | 2404e8ea0d8a7affc79fe6fe8c23bfdad7487f48 /tests/basic_stream/decode_stream.c | |
parent | 1d7f60fec30678ec7403786808026444a4b901e6 (diff) |
Generate #defines for initializing message structures.
Usage like:
MyMessage foo = MyMessage_init_default;
MyMessage_init_default will initialize to default values defined in .proto.
MyMessage_init_zero will initialize to null/zero values. Same results as {}
or {0}, but will avoid compiler warnings by initializing everything explicitly.
Update issue 79
Status: FixedInGit
Diffstat (limited to 'tests/basic_stream/decode_stream.c')
-rw-r--r-- | tests/basic_stream/decode_stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/basic_stream/decode_stream.c b/tests/basic_stream/decode_stream.c index 667bf3c5..798dcc50 100644 --- a/tests/basic_stream/decode_stream.c +++ b/tests/basic_stream/decode_stream.c @@ -12,7 +12,7 @@ bool print_person(pb_istream_t *stream) { int i; - Person person; + Person person = Person_init_zero; if (!pb_decode(stream, Person_fields, &person)) return false; |