Skip to content

Commit 839be2a

Browse files
committed
Update to protobuf-c 1.5.2
1 parent aa2498e commit 839be2a

File tree

9 files changed

+28
-53
lines changed

9 files changed

+28
-53
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ The embedded copy of zlib bears the following license:
323323

324324
The embedded copy of protobuf-c bears the following license:
325325

326-
Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors.
326+
Copyright (c) 2008-2025, Dave Benson and the protobuf-c authors.
327327
All rights reserved.
328328

329329
Redistribution and use in source and binary forms, with or without

include/protobuf-c/protobuf-c.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors.
2+
* Copyright (c) 2008-2025, Dave Benson and the protobuf-c authors.
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -34,16 +34,17 @@
3434
*
3535
* This file defines the public API for the `libprotobuf-c` support library.
3636
* This API includes interfaces that can be used directly by client code as well
37-
* as the interfaces used by the code generated by the `protoc-c` compiler.
37+
* as the interfaces used by the code generated by the `protoc-gen-c` compiler
38+
* plugin.
3839
*
3940
* The `libprotobuf-c` support library performs the actual serialization and
4041
* deserialization of Protocol Buffers messages. It interacts with structures,
41-
* definitions, and metadata generated by the `protoc-c` compiler from .proto
42-
* files.
42+
* definitions, and metadata generated by the `protoc-gen-c` compiler plugin
43+
* from .proto files.
4344
*
4445
* \authors Dave Benson and the `protobuf-c` authors.
4546
*
46-
* \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license.
47+
* \copyright 2008-2025. Licensed under the terms of the [BSD-2-Clause] license.
4748
*
4849
* [protobuf-c]: https://github.com/protobuf-c/protobuf-c
4950
* [Protocol Buffers]: https://developers.google.com/protocol-buffers/
@@ -74,7 +75,7 @@
7475
*
7576
* - Identifiers for functions and globals are all lowercase, with camel case
7677
* words separated by single underscores. For example, one of the function
77-
* prototypes generated by `protoc-c` for the above example:
78+
* prototypes generated by `protoc-gen-c` for the above example:
7879
*
7980
~~~{.c}
8081
Foo__Bar__BazBah *
@@ -794,16 +795,16 @@ protobuf_c_version_number(void);
794795
* The version of the protobuf-c headers, represented as a string using the same
795796
* format as protobuf_c_version().
796797
*/
797-
#define PROTOBUF_C_VERSION "1.4.1"
798+
#define PROTOBUF_C_VERSION "1.5.2"
798799

799800
/**
800801
* The version of the protobuf-c headers, represented as an integer using the
801802
* same format as protobuf_c_version_number().
802803
*/
803-
#define PROTOBUF_C_VERSION_NUMBER 1004001
804+
#define PROTOBUF_C_VERSION_NUMBER 1005002
804805

805806
/**
806-
* The minimum protoc-c version which works with the current version of the
807+
* The minimum protoc-gen-c version which works with the current version of the
807808
* protobuf-c headers.
808809
*/
809810
#define PROTOBUF_C_MIN_COMPILER_VERSION 1000000

lib/logsrv/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Makefile: $(srcdir)/Makefile.in
108108

109109
$(devdir)/log_server.pb-c.c: $(srcdir)/log_server.proto
110110
@if [ -n "$(DEVEL)" ]; then \
111-
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \
111+
cmd='protoc --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \
112112
echo "$$cmd"; eval $$cmd; \
113113
cmd='$(scriptdir)/unanon $(devdir)/log_server.pb-c.h $(devdir)/log_server.pb-c.c'; \
114114
echo "$$cmd"; eval $$cmd; \

lib/protobuf-c/Makefile.in

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,6 @@ Makefile: $(srcdir)/Makefile.in
101101
.i.plog:
102102
ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@
103103

104-
$(devdir)/log_server.pb-c.c: $(srcdir)/log_server.proto
105-
@if [ -n "$(DEVEL)" ]; then \
106-
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \
107-
echo "$$cmd"; eval $$cmd; \
108-
cmd='$(scriptdir)/unanon $(devdir)/log_server.pb-c.h $(devdir)/log_server.pb-c.c'; \
109-
echo "$$cmd"; eval $$cmd; \
110-
if [ "$(devdir)" == "$(srcdir)" ]; then \
111-
cmd='mv -f $(devdir)/log_server.pb-c.h $(incdir)/log_server.pb-c.h'; \
112-
else \
113-
cmd='mv -f $(devdir)/log_server.pb-c.h $(top_builddir)/log_server.pb-c.h'; \
114-
fi; \
115-
echo "$$cmd"; eval $$cmd; \
116-
fi
117-
118104
libprotobuf-c.la: $(LIBPROTOBUF_C_OBJS)
119105
$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBPROTOBUF_C_OBJS)
120106

lib/protobuf-c/protobuf-c.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008-2022, Dave Benson and the protobuf-c authors.
2+
* Copyright (c) 2008-2025, Dave Benson and the protobuf-c authors.
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -28,14 +28,14 @@
2828
*/
2929

3030
/*! \file
31-
* Support library for `protoc-c` generated code.
31+
* Support library for `protoc-gen-c` generated code.
3232
*
3333
* This file implements the public API used by the code generated
34-
* by `protoc-c`.
34+
* by `protoc-gen-c`.
3535
*
3636
* \authors Dave Benson and the protobuf-c authors
3737
*
38-
* \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license.
38+
* \copyright 2008-2025. Licensed under the terms of the [BSD-2-Clause] license.
3939
*/
4040

4141
/**
@@ -1903,7 +1903,6 @@ pack_buffer_packed_payload(const ProtobufCFieldDescriptor *field,
19031903
for (i = 0; i < count; i++) {
19041904
unsigned len = boolean_pack(((protobuf_c_boolean *) array)[i], scratch);
19051905
buffer->append(buffer, len, scratch);
1906-
rv += len;
19071906
}
19081907
return count;
19091908
default:
@@ -1938,6 +1937,7 @@ repeated_field_pack_to_buffer(const ProtobufCFieldDescriptor *field,
19381937
buffer->append(buffer, rv, scratch);
19391938
tmp = pack_buffer_packed_payload(field, count, array, buffer);
19401939
assert(tmp == payload_len);
1940+
(void)tmp;
19411941
return rv + payload_len;
19421942
} else {
19431943
size_t siz;
@@ -2571,7 +2571,7 @@ parse_required_member(ScannedMember *scanned_member,
25712571

25722572
if (maybe_clear && *pstr != NULL) {
25732573
const char *def = scanned_member->field->default_value;
2574-
if (*pstr != NULL && *pstr != def)
2574+
if (*pstr != def)
25752575
do_free(allocator, *pstr);
25762576
}
25772577
*pstr = do_alloc(allocator, len - pref_len + 1);
@@ -3293,6 +3293,8 @@ protobuf_c_message_unpack(const ProtobufCMessageDescriptor *desc,
32933293
n_unknown * sizeof(ProtobufCMessageUnknownField));
32943294
if (rv->unknown_fields == NULL)
32953295
goto error_cleanup;
3296+
} else {
3297+
rv->unknown_fields = NULL;
32963298
}
32973299

32983300
/* do real parsing */

lib/ssl_compat/Makefile.in

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,6 @@ Makefile: $(srcdir)/Makefile.in
106106
.i.plog:
107107
ifile=$<; rm -f $@; pvs-studio --cfg $(PVS_CFG) --sourcetree-root $(top_srcdir) --skip-cl-exe yes --source-file $${ifile%i}c --i-file $< --output-file $@
108108

109-
$(devdir)/log_server.pb-c.c: $(srcdir)/log_server.proto
110-
@if [ -n "$(DEVEL)" ]; then \
111-
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/log_server.proto'; \
112-
echo "$$cmd"; eval $$cmd; \
113-
cmd='$(scriptdir)/unanon $(devdir)/log_server.pb-c.h $(devdir)/log_server.pb-c.c'; \
114-
echo "$$cmd"; eval $$cmd; \
115-
if [ "$(devdir)" == "$(srcdir)" ]; then \
116-
cmd='mv -f $(devdir)/log_server.pb-c.h $(incdir)/log_server.pb-c.h'; \
117-
else \
118-
cmd='mv -f $(devdir)/log_server.pb-c.h $(top_builddir)/log_server.pb-c.h'; \
119-
fi; \
120-
echo "$$cmd"; eval $$cmd; \
121-
fi
122-
123109
libssl_compat.la: $(LIBSSL_COMPAT_OBJS) $(LT_LIBS)
124110
$(LIBTOOL) $(LTFLAGS) --mode=link $(CC) -o $@ $(LIBSSL_COMPAT_OBJS) $(LT_LIBS)
125111

scripts/unanon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env perl
22
#
3-
# Post-process files generated by protoc-c to remove anonymous unions.
3+
# Post-process files generated by protoc to remove anonymous unions.
44
# Works on the generated files but probably little else.
55

66
use warnings;

src/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Makefile: $(srcdir)/Makefile.in
203203

204204
$(devdir)/intercept.pb-c.c: $(srcdir)/intercept.proto
205205
@if [ -n "$(DEVEL)" ]; then \
206-
cmd='protoc-c --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/intercept.proto'; \
206+
cmd='protoc --c_out=$(devdir) --proto_path=$(srcdir) $(srcdir)/intercept.proto'; \
207207
echo "$$cmd"; eval $$cmd; \
208208
cmd='$(scriptdir)/unanon $(devdir)/intercept.pb-c.h $(devdir)/intercept.pb-c.c'; \
209209
echo "$$cmd"; eval $$cmd; \

src/intercept.pb-c.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static const ProtobufCFieldDescriptor intercept_request__field_descriptors[2] =
378378
offsetof(InterceptRequest, u.policy_check_req),
379379
&policy_check_request__descriptor,
380380
NULL,
381-
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
381+
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
382382
0,NULL,NULL /* reserved1,reserved2, etc */
383383
},
384384
{
@@ -390,7 +390,7 @@ static const ProtobufCFieldDescriptor intercept_request__field_descriptors[2] =
390390
offsetof(InterceptRequest, u.hello),
391391
&intercept_hello__descriptor,
392392
NULL,
393-
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
393+
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
394394
0,NULL,NULL /* reserved1,reserved2, etc */
395395
},
396396
};
@@ -774,7 +774,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
774774
offsetof(InterceptResponse, u.hello_resp),
775775
&hello_response__descriptor,
776776
NULL,
777-
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
777+
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
778778
0,NULL,NULL /* reserved1,reserved2, etc */
779779
},
780780
{
@@ -786,7 +786,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
786786
offsetof(InterceptResponse, u.accept_msg),
787787
&policy_accept_message__descriptor,
788788
NULL,
789-
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
789+
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
790790
0,NULL,NULL /* reserved1,reserved2, etc */
791791
},
792792
{
@@ -798,7 +798,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
798798
offsetof(InterceptResponse, u.reject_msg),
799799
&policy_reject_message__descriptor,
800800
NULL,
801-
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
801+
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
802802
0,NULL,NULL /* reserved1,reserved2, etc */
803803
},
804804
{
@@ -810,7 +810,7 @@ static const ProtobufCFieldDescriptor intercept_response__field_descriptors[4] =
810810
offsetof(InterceptResponse, u.error_msg),
811811
&policy_error_message__descriptor,
812812
NULL,
813-
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
813+
PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
814814
0,NULL,NULL /* reserved1,reserved2, etc */
815815
},
816816
};

0 commit comments

Comments
 (0)