Get rid of pb_bytes_ptr_t, just allocate pb_bytes_array_t dynamically.
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 15 Mar 2014 06:45:58 +0000 (08:45 +0200)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 15 Mar 2014 06:45:58 +0000 (08:45 +0200)
commit9be2cfe968b4223f9d416aecd483f3b999bbab71
treea13eb74ba8f6ac70fe3e63e89457f46be4df90c1
parent9c196b89ba04733529edfe970af6307a34de1662
Get rid of pb_bytes_ptr_t, just allocate pb_bytes_array_t dynamically.

This makes the internal logic much simpler, and also keeps the datatypes
more similar between STATIC/POINTER cases. It will still be a bit cumbersome
to use because of variable length array member. Macros PB_BYTES_ARRAY_T(n) and
PB_BYTES_ARRAY_T_ALLOCSIZE(n) have been added to make life a bit easier.

This has the drawback that it is no longer as easy to use externally allocated
byte array as input for bytes field in pointer mode. However, this is still
easy to do using callbacks, so it shouldn't be a large issue.
generator/nanopb_generator.py
pb.h
pb_decode.c
pb_encode.c
tests/alltypes_pointer/SConscript
tests/alltypes_pointer/decode_alltypes_pointer.c
tests/alltypes_pointer/encode_alltypes_pointer.c