aakash-sahai / nanopb

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

Change generated pb_field_t definitions to use macros #58

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the nanopb generator makes definitions like this:

    {24, (pb_type_t) ((int) PB_HTYPE_ARRAY | (int) PB_LTYPE_VARINT),
    pb_delta_end(AllTypes, rep_uint64, rep_uint32),
    pb_delta(AllTypes, rep_uint64_count, rep_uint64),
    pb_membersize(AllTypes, rep_uint64[0]),
    pb_membersize(AllTypes, rep_uint64) / pb_membersize(AllTypes, rep_uint64[0]), 0},

It could be better to use C preprocessor macros to generate the data, and have 
the generator create just macro calls:

PB_FIELD_REPEATED_UINT64(AllTypes, rep_uint64, rep_uint32, 0),

This way the pb_field_t definition can later be modified without regenerating 
the .pb.c files (recompilation would still be necessary).

Original issue reported on code.google.com by Petteri.Aimonen on 7 Feb 2013 at 4:27

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

Original comment by Petteri.Aimonen on 16 Feb 2013 at 10:12

GoogleCodeExporter commented 9 years ago
Fix released in nanopb-0.2.0.

Original comment by Petteri.Aimonen on 2 Mar 2013 at 2:39