Age | Commit message (Collapse) | Author | Files | Lines |
|
Adds support for proto3 and POINTER field types to have
fixed length bytes arrays. Also changed the .proto option
to a separate fixed_length:true, while also supporting the old FT_INLINE
option.
Restructured the generator and decoder logic to threat the inline
bytes fields more like "just another field type".
|
|
|
|
Previously the field iterator logic didn't know whether two
oneof fields were part of the same union, or separate. This
caused wrong pointers to be calculated if multiple oneofs were
inside a single message.
This commit fixes this by using dataoffset of PB_SIZE_MAX to
indicate union fields after the first field.
Theoretically PB_SIZE_MAX is also a valid value for data offset,
which could cause errors. Adding a compile-time assert for this
is somewhat difficult. However I consider it extremely unlikely
that there is any platform that could trigger this situation, as
it would require 255 bytes of extra data/padding between two protobuf
oneof fields. On 64-bit architectures the worst case is 16 bytes,
and even esoteric platforms only align to 64 bytes or so. Manual
modification of the generated .pb.h file could trigger this, but
even then it would require pretty bad luck to happen.
|
|
|
|
|
|
|
|
This commit adds a new FT_INLINE allocation type that forces bytes
fields to be inlined into the struct. E.g., pb_byte_t my_bytes[32].
This requires max_size for the bytes field. The FT_INLINE type is
represented as a new LTYPE: FT_LTYPE_FIXED_LENGTH_BYTES.
This commit also updates the documentation with FT_INLINE and
FT_LTYPE_FIXED_LENGTH_BYTES.
Added an AUTHORS file in apparent order of appearance in the git log
history from $(git log --all).
|
|
|
|
|
|
|
|
|
|
This is now handled automatically using shift operations.
|
|
This supports platforms where uint8_t does not exist.
If you are using a custom pb_syshdr.h, this may require adding
definitions for uint_least8_t etc.
|
|
This will still catch the most common bug of long int vs. long long int.
The uint8_t checks do not seem necessary, test for this will be added
in later commit.
|
|
Fixes compilation error with anonymous unions when
it is not the last field in message. Also fixes
extraneous newlines in header file. Cleanup the
pb.h extraneous use of ##.
|
|
|
|
|
|
|
|
Previously unsigned enums would throw errors on decoding if the value
went outside the signed range (issue #164).
Currently only helps for enums defined within the same file, but solving
issue #165 will make it work for multiple files also.
|
|
|
|
|
|
|
|
|
|
Fixes crashes / memory leaks when using pointer type fields.
Also fixes initialization of which_oneof fields.
|
|
Basic test included, should probably add an oneof to the AllTypes test also.
Update issue 131
Status: Started
|
|
Update issue 140
Status: FixedInGit
|
|
|
|
Update issue 136
Status: FixedInGit
|
|
|
|
|
|
|
|
|
|
The version in PB_PROTO_HEADER_VERSION can be bumped whenever there
is a breaking change to the generated files, and it will then alert
to the difference.
Update issue 129
Status: FixedInGit
|
|
Update issue 106
Status: FixedInGit
|
|
This avoids possible namespace conflicts with other macros.
|
|
Update issue 82
Status: FixedInGit
|
|
|
|
|
|
Patch from Jon Read.
Update issue 119
Status: FixedInGit
|
|
|
|
|
|
|
|
|
|
|
|
Update issue 112
Status: FixedInGit
|
|
|
|
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.
|
|
|
|
|
|
|