diff --git a/lib/formats/villas.pb-c.c b/lib/formats/villas.pb-c.c index 500bafdd2..0266a9cd6 100644 --- a/lib/formats/villas.pb-c.c +++ b/lib/formats/villas.pb-c.c @@ -10,7 +10,7 @@ void villas__node__message__init (Villas__Node__Message *message) { - static Villas__Node__Message init_value = VILLAS__NODE__MESSAGE__INIT; + static const Villas__Node__Message init_value = VILLAS__NODE__MESSAGE__INIT; *message = init_value; } size_t villas__node__message__get_packed_size @@ -47,13 +47,15 @@ void villas__node__message__free_unpacked (Villas__Node__Message *message, ProtobufCAllocator *allocator) { + if(!message) + return; assert(message->base.descriptor == &villas__node__message__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } void villas__node__sample__init (Villas__Node__Sample *message) { - static Villas__Node__Sample init_value = VILLAS__NODE__SAMPLE__INIT; + static const Villas__Node__Sample init_value = VILLAS__NODE__SAMPLE__INIT; *message = init_value; } size_t villas__node__sample__get_packed_size @@ -90,13 +92,15 @@ void villas__node__sample__free_unpacked (Villas__Node__Sample *message, ProtobufCAllocator *allocator) { + if(!message) + return; assert(message->base.descriptor == &villas__node__sample__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } void villas__node__timestamp__init (Villas__Node__Timestamp *message) { - static Villas__Node__Timestamp init_value = VILLAS__NODE__TIMESTAMP__INIT; + static const Villas__Node__Timestamp init_value = VILLAS__NODE__TIMESTAMP__INIT; *message = init_value; } size_t villas__node__timestamp__get_packed_size @@ -133,13 +137,15 @@ void villas__node__timestamp__free_unpacked (Villas__Node__Timestamp *message, ProtobufCAllocator *allocator) { + if(!message) + return; assert(message->base.descriptor == &villas__node__timestamp__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } void villas__node__value__init (Villas__Node__Value *message) { - static Villas__Node__Value init_value = VILLAS__NODE__VALUE__INIT; + static const Villas__Node__Value init_value = VILLAS__NODE__VALUE__INIT; *message = init_value; } size_t villas__node__value__get_packed_size @@ -176,6 +182,8 @@ void villas__node__value__free_unpacked (Villas__Node__Value *message, ProtobufCAllocator *allocator) { + if(!message) + return; assert(message->base.descriptor == &villas__node__value__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } diff --git a/lib/formats/villas.pb-c.h b/lib/formats/villas.pb-c.h index 471cce2a0..557064744 100644 --- a/lib/formats/villas.pb-c.h +++ b/lib/formats/villas.pb-c.h @@ -10,7 +10,7 @@ PROTOBUF_C__BEGIN_DECLS #if PROTOBUF_C_VERSION_NUMBER < 1000000 # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. -#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif @@ -67,7 +67,7 @@ struct _Villas__Node__Sample }; #define VILLAS__NODE__SAMPLE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&villas__node__sample__descriptor) \ - , VILLAS__NODE__SAMPLE__TYPE__DATA, 0,0, NULL, 0,NULL } + , VILLAS__NODE__SAMPLE__TYPE__DATA, 0, 0, NULL, 0,NULL } struct _Villas__Node__Timestamp @@ -90,7 +90,8 @@ struct _Villas__Node__Timestamp typedef enum { VILLAS__NODE__VALUE__VALUE__NOT_SET = 0, VILLAS__NODE__VALUE__VALUE_F = 1, - VILLAS__NODE__VALUE__VALUE_I = 2, + VILLAS__NODE__VALUE__VALUE_I = 2 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(VILLAS__NODE__VALUE__VALUE) } Villas__Node__Value__ValueCase; struct _Villas__Node__Value