Add options controller helper function generation. Preserve existing
behavior of not generating pack/unpack functions for sub-messages if
option is not explicitly set.
Fixes#240Fixes#442
google::protobuf::Message::Reflection has been removed in newer versions
of protobuf. The replacement is google::protobuf::Reflection.
protobuf in commit 779f61c6a3ce02a119e28e802f229e61b69b9046 ("Integrate
recent changes from google3.", from August 2008) changed the following
in message.h:
@@ -336,7 +337,8 @@ class LIBPROTOBUF_EXPORT Message {
// Introspection ---------------------------------------------------
- class Reflection; // Defined below.
+ // Typedef for backwards-compatibility.
+ typedef google::protobuf::Reflection Reflection;
The "typedef for backwards-compatibility" apparently lasted ten years
until protobuf commit 6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3
("Down-integrate from google3.", from August 2018) which finally removed
the typedef:
@@ -327,8 +344,6 @@ class LIBPROTOBUF_EXPORT Message : public MessageLite {
// Introspection ---------------------------------------------------
- // Typedef for backwards-compatibility.
- typedef google::protobuf::Reflection Reflection;
This commit updates the only use of this typedef (in the test suite) to
directly refer to the replacement, google::protobuf::Reflection. This
fixes the build failure in the test suite.
This makes __free_unpacked() consistent with free(), and simplifies
callers by allowing them to indiscriminately free message objects
without regard to whether they have been allocated or not.
Fix a few casts where ints were cast to uints unnecessarily
Fixes#199. Previously, enums were treated as uint32's, but they need to
be treated as int32's instead.
t: Add a few test cases with negative enum values
warning: assigning to 'uint8_t *' (aka 'unsigned char *')
from 'char *' converts between pointers to integer types
with different sign [-Wpointer-sign]
added check that repeated fields vectors are not NULL
fixed repeated field quantity type: it's "size_t", not "unsigned"
cleaner code, no cast porn
all covered with tests
i'm confused as to why these fields exist, since the typical
implementation of a "temporary alloc" would be something like alloca(),
and alloca() is usually just inlined code that adjusts the stack
pointer, which is not a function whose address could be taken.
this breaks the API/ABI and will require a note in the ChangeLog.
possibly we could revisit the idea of "temporary allocations" by using
C99 variable length arrays. this would have the advantage of being
standardized, unlike alloca().
of the same field on the wire (Fixes#91)
t/generated-code2/test-generated-code2.c: add a test case for merging
messages
t/test-full.proto: expand message definitions to test for merging nested
messages