Skip to content

Commit 0ee7db4

Browse files
committed
Fixed static functions
1 parent eebbab3 commit 0ee7db4

File tree

17 files changed

+95
-90
lines changed

17 files changed

+95
-90
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
protobluff-1.1.1 (2020-02-23)
2+
3+
* Fixed compilation error when including in C++ units
4+
15
protobluff-1.1.0 (2019-07-11)
26

37
* Fixed generator compatibility issues with protobuf 3.6+

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
AC_PREREQ(2.69)
2626

27-
AC_INIT([protobluff], [1.1.0], [[email protected]])
27+
AC_INIT([protobluff], [1.1.1], [[email protected]])
2828
AM_INIT_AUTOMAKE([subdir-objects foreign])
2929

3030
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
@@ -48,7 +48,7 @@ AC_CONFIG_MACRO_DIR([m4])
4848

4949
# Library versioning as <current:revision:age> - also remember to synchronize
5050
# this value with the version info in the core/common.h header file.
51-
AC_SUBST([VERSION_INFO], [5:1:0])
51+
AC_SUBST([VERSION_INFO], [5:1:1])
5252

5353
# Checks for programs
5454
AC_PROG_AWK

docs/guide/messages.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,31 @@ and look like this (excerpt):
5959
``` c
6060
...
6161
/* Person : create */
62-
PB_WARN_UNUSED_RESULT
63-
PB_INLINE pb_message_t
62+
PB_INLINE PB_WARN_UNUSED_RESULT
63+
pb_message_t
6464
person_create(pb_journal_t *journal) {
6565
return pb_message_create(&person_descriptor, journal);
6666
}
6767

6868
/* Person : destroy */
69-
PB_INLINE void
69+
PB_INLINE
70+
void
7071
person_destroy(pb_message_t *message) {
7172
assert(pb_message_descriptor(message) == &person_descriptor);
7273
return pb_message_destroy(message);
7374
}
7475

7576
/* Person.name : get */
76-
PB_WARN_UNUSED_RESULT
77-
PB_INLINE pb_error_t
77+
PB_INLINE PB_WARN_UNUSED_RESULT
78+
pb_error_t
7879
person_get_name(pb_message_t *message, pb_string_t *value) {
7980
assert(pb_message_descriptor(message) == &person_descriptor);
8081
return pb_message_get(message, 1, value);
8182
}
8283

8384
/* Person.name : put */
84-
PB_WARN_UNUSED_RESULT
85-
PB_INLINE pb_error_t
85+
PB_INLINE PB_WARN_UNUSED_RESULT
86+
pb_error_t
8687
person_put_name(pb_message_t *message, const pb_string_t *value) {
8788
assert(pb_message_descriptor(message) == &person_descriptor);
8889
return pb_message_put(message, 1, value);

include/protobluff/core/allocator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ typedef struct pb_allocator_t {
7070
* \param[in] size Bytes to be allocated
7171
* \return Memory block
7272
*/
73-
PB_WARN_UNUSED_RESULT
74-
PB_INLINE void *
73+
PB_INLINE PB_WARN_UNUSED_RESULT
74+
void *
7575
pb_allocator_allocate(pb_allocator_t *allocator, size_t size) {
7676
assert(allocator && size);
7777
return allocator->proc.allocate(allocator->data, size);
@@ -85,8 +85,8 @@ pb_allocator_allocate(pb_allocator_t *allocator, size_t size) {
8585
* \param[in] size Bytes to be allocated
8686
* \return Memory block
8787
*/
88-
PB_WARN_UNUSED_RESULT
89-
PB_INLINE void *
88+
PB_INLINE PB_WARN_UNUSED_RESULT
89+
void *
9090
pb_allocator_resize(pb_allocator_t *allocator, void *block, size_t size) {
9191
assert(allocator && size);
9292
return allocator->proc.resize(allocator->data, block, size);

include/protobluff/core/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Current ABI version as a single integer to test binary compatibility in
3434
* the generated header files: current * 10^6 + revision * 10^3 + age
3535
*/
36-
#define PB_VERSION (5 * 1000000) + (0 * 1000) + 0
36+
#define PB_VERSION (5 * 1000000) + (1 * 1000) + 1
3737

3838
/*
3939
* Agnostic C-linkage classifier for extern functions when compiling from C++

include/protobluff/core/descriptor.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ pb_descriptor_extension(const pb_descriptor_t *descriptor) {
329329
* \param[in] descriptor Descriptor
330330
* \return Descriptor iterator
331331
*/
332-
PB_WARN_UNUSED_RESULT
333-
PB_INLINE pb_descriptor_iter_t
332+
PB_INLINE PB_WARN_UNUSED_RESULT
333+
pb_descriptor_iter_t
334334
pb_descriptor_iter_create(const pb_descriptor_t *descriptor) {
335335
assert(descriptor);
336336
pb_descriptor_iter_t it = {
@@ -356,8 +356,8 @@ pb_descriptor_iter_destroy(pb_descriptor_iter_t *it) {
356356
* \param[in,out] it Descriptor iterator
357357
* \return Test result
358358
*/
359-
PB_WARN_UNUSED_RESULT
360-
PB_INLINE int
359+
PB_INLINE PB_WARN_UNUSED_RESULT
360+
int
361361
pb_descriptor_iter_begin(pb_descriptor_iter_t *it) {
362362
assert(it);
363363
return !pb_descriptor_empty(it->descriptor)
@@ -371,8 +371,8 @@ pb_descriptor_iter_begin(pb_descriptor_iter_t *it) {
371371
* \param[in,out] it Descriptor iterator
372372
* \return Test result
373373
*/
374-
PB_WARN_UNUSED_RESULT
375-
PB_INLINE int
374+
PB_INLINE PB_WARN_UNUSED_RESULT
375+
int
376376
pb_descriptor_iter_end(pb_descriptor_iter_t *it) {
377377
assert(it);
378378
return !pb_descriptor_empty(it->descriptor)
@@ -386,8 +386,8 @@ pb_descriptor_iter_end(pb_descriptor_iter_t *it) {
386386
* \param[in,out] it Descriptor iterator
387387
* \return Test result
388388
*/
389-
PB_WARN_UNUSED_RESULT
390-
PB_INLINE int
389+
PB_INLINE PB_WARN_UNUSED_RESULT
390+
int
391391
pb_descriptor_iter_prev(pb_descriptor_iter_t *it) {
392392
assert(it && it->pos != SIZE_MAX);
393393
assert(!pb_descriptor_empty(it->descriptor));
@@ -402,8 +402,8 @@ pb_descriptor_iter_prev(pb_descriptor_iter_t *it) {
402402
* \param[in,out] it Descriptor iterator
403403
* \return Test result
404404
*/
405-
PB_WARN_UNUSED_RESULT
406-
PB_INLINE int
405+
PB_INLINE PB_WARN_UNUSED_RESULT
406+
int
407407
pb_descriptor_iter_next(pb_descriptor_iter_t *it) {
408408
assert(it && it->pos != SIZE_MAX);
409409
assert(!pb_descriptor_empty(it->descriptor));
@@ -496,8 +496,8 @@ pb_enum_descriptor_empty(const pb_enum_descriptor_t *descriptor) {
496496
* \param[in] descriptor Enum descriptor
497497
* \return Enum descriptor iterator
498498
*/
499-
PB_WARN_UNUSED_RESULT
500-
PB_INLINE pb_enum_descriptor_iter_t
499+
PB_INLINE PB_WARN_UNUSED_RESULT
500+
pb_enum_descriptor_iter_t
501501
pb_enum_descriptor_iter_create(const pb_enum_descriptor_t *descriptor) {
502502
assert(descriptor);
503503
pb_enum_descriptor_iter_t it = {
@@ -523,8 +523,8 @@ pb_enum_descriptor_iter_destroy(pb_enum_descriptor_iter_t *it) {
523523
* \param[in,out] it Enum descriptor iterator
524524
* \return Test result
525525
*/
526-
PB_WARN_UNUSED_RESULT
527-
PB_INLINE int
526+
PB_INLINE PB_WARN_UNUSED_RESULT
527+
int
528528
pb_enum_descriptor_iter_begin(pb_enum_descriptor_iter_t *it) {
529529
assert(it);
530530
return !pb_enum_descriptor_empty(it->descriptor)
@@ -538,8 +538,8 @@ pb_enum_descriptor_iter_begin(pb_enum_descriptor_iter_t *it) {
538538
* \param[in,out] it Enum descriptor iterator
539539
* \return Test result
540540
*/
541-
PB_WARN_UNUSED_RESULT
542-
PB_INLINE int
541+
PB_INLINE PB_WARN_UNUSED_RESULT
542+
int
543543
pb_enum_descriptor_iter_end(pb_enum_descriptor_iter_t *it) {
544544
assert(it);
545545
return !pb_enum_descriptor_empty(it->descriptor)
@@ -553,8 +553,8 @@ pb_enum_descriptor_iter_end(pb_enum_descriptor_iter_t *it) {
553553
* \param[in,out] it Enum descriptor iterator
554554
* \return Test result
555555
*/
556-
PB_WARN_UNUSED_RESULT
557-
PB_INLINE int
556+
PB_INLINE PB_WARN_UNUSED_RESULT
557+
int
558558
pb_enum_descriptor_iter_prev(pb_enum_descriptor_iter_t *it) {
559559
assert(it && it->pos != SIZE_MAX);
560560
assert(!pb_enum_descriptor_empty(it->descriptor));
@@ -569,8 +569,8 @@ pb_enum_descriptor_iter_prev(pb_enum_descriptor_iter_t *it) {
569569
* \param[in,out] it Enum descriptor iterator
570570
* \return Test result
571571
*/
572-
PB_WARN_UNUSED_RESULT
573-
PB_INLINE int
572+
PB_INLINE PB_WARN_UNUSED_RESULT
573+
int
574574
pb_enum_descriptor_iter_next(pb_enum_descriptor_iter_t *it) {
575575
assert(it && it->pos != SIZE_MAX);
576576
assert(!pb_enum_descriptor_empty(it->descriptor));
@@ -637,8 +637,8 @@ pb_oneof_descriptor_empty(const pb_oneof_descriptor_t *descriptor) {
637637
* \param[in] descriptor Oneof descriptor
638638
* \return Oneof descriptor iterator
639639
*/
640-
PB_WARN_UNUSED_RESULT
641-
PB_INLINE pb_oneof_descriptor_iter_t
640+
PB_INLINE PB_WARN_UNUSED_RESULT
641+
pb_oneof_descriptor_iter_t
642642
pb_oneof_descriptor_iter_create(const pb_oneof_descriptor_t *descriptor) {
643643
assert(descriptor);
644644
pb_oneof_descriptor_iter_t it = {
@@ -664,8 +664,8 @@ pb_oneof_descriptor_iter_destroy(pb_oneof_descriptor_iter_t *it) {
664664
* \param[in,out] it Oneof descriptor iterator
665665
* \return Test result
666666
*/
667-
PB_WARN_UNUSED_RESULT
668-
PB_INLINE int
667+
PB_INLINE PB_WARN_UNUSED_RESULT
668+
int
669669
pb_oneof_descriptor_iter_begin(pb_oneof_descriptor_iter_t *it) {
670670
assert(it);
671671
return !pb_oneof_descriptor_empty(it->descriptor)
@@ -679,8 +679,8 @@ pb_oneof_descriptor_iter_begin(pb_oneof_descriptor_iter_t *it) {
679679
* \param[in,out] it Oneof descriptor iterator
680680
* \return Test result
681681
*/
682-
PB_WARN_UNUSED_RESULT
683-
PB_INLINE int
682+
PB_INLINE PB_WARN_UNUSED_RESULT
683+
int
684684
pb_oneof_descriptor_iter_end(pb_oneof_descriptor_iter_t *it) {
685685
assert(it);
686686
return !pb_oneof_descriptor_empty(it->descriptor)
@@ -694,8 +694,8 @@ pb_oneof_descriptor_iter_end(pb_oneof_descriptor_iter_t *it) {
694694
* \param[in,out] it Oneof descriptor iterator
695695
* \return Test result
696696
*/
697-
PB_WARN_UNUSED_RESULT
698-
PB_INLINE int
697+
PB_INLINE PB_WARN_UNUSED_RESULT
698+
int
699699
pb_oneof_descriptor_iter_prev(pb_oneof_descriptor_iter_t *it) {
700700
assert(it && it->pos != SIZE_MAX);
701701
assert(!pb_oneof_descriptor_empty(it->descriptor));
@@ -710,8 +710,8 @@ pb_oneof_descriptor_iter_prev(pb_oneof_descriptor_iter_t *it) {
710710
* \param[in,out] it Oneof descriptor iterator
711711
* \return Test result
712712
*/
713-
PB_WARN_UNUSED_RESULT
714-
PB_INLINE int
713+
PB_INLINE PB_WARN_UNUSED_RESULT
714+
int
715715
pb_oneof_descriptor_iter_next(pb_oneof_descriptor_iter_t *it) {
716716
assert(it && it->pos != SIZE_MAX);
717717
assert(!pb_oneof_descriptor_empty(it->descriptor));

include/protobluff/util/validator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ pb_validator_check(
5757
* \param[in] descriptor Descriptor
5858
* \return Validator
5959
*/
60-
PB_WARN_UNUSED_RESULT
61-
PB_INLINE pb_validator_t
60+
PB_INLINE PB_WARN_UNUSED_RESULT
61+
pb_validator_t
6262
pb_validator_create(const pb_descriptor_t *descriptor) {
6363
assert(descriptor);
6464
pb_validator_t validator = {

src/core/buffer.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ pb_buffer_grow(
5656
* \param[in] size Raw data size
5757
* \return Buffer
5858
*/
59-
PB_WARN_UNUSED_RESULT
60-
PB_INLINE pb_buffer_t
59+
PB_INLINE PB_WARN_UNUSED_RESULT
60+
pb_buffer_t
6161
pb_buffer_create_zero_copy_internal(uint8_t data[], size_t size) {
6262
pb_buffer_t buffer = {
6363
.allocator = &allocator_zero_copy,
@@ -72,8 +72,8 @@ pb_buffer_create_zero_copy_internal(uint8_t data[], size_t size) {
7272
*
7373
* \return Buffer
7474
*/
75-
PB_WARN_UNUSED_RESULT
76-
PB_INLINE pb_buffer_t
75+
PB_INLINE PB_WARN_UNUSED_RESULT
76+
pb_buffer_t
7777
pb_buffer_create_invalid(void) {
7878
pb_buffer_t buffer = {};
7979
return buffer;

src/core/encoder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737
*
3838
* \return Encoder
3939
*/
40-
PB_WARN_UNUSED_RESULT
41-
PB_INLINE pb_encoder_t
40+
PB_INLINE PB_WARN_UNUSED_RESULT
41+
pb_encoder_t
4242
pb_encoder_create_invalid(void) {
4343
pb_encoder_t encoder = {
4444
.descriptor = NULL,

src/core/stream.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ pb_stream_skip_jump[];
8484
* \param[in] buffer Buffer
8585
* \return Stream
8686
*/
87-
PB_WARN_UNUSED_RESULT
88-
PB_INLINE pb_stream_t
87+
PB_INLINE PB_WARN_UNUSED_RESULT
88+
pb_stream_t
8989
pb_stream_create(const pb_buffer_t *buffer) {
9090
assert(buffer);
9191
assert(pb_buffer_valid(buffer));
@@ -103,8 +103,8 @@ pb_stream_create(const pb_buffer_t *buffer) {
103103
* \param[in] offset Offset
104104
* \return Stream
105105
*/
106-
PB_WARN_UNUSED_RESULT
107-
PB_INLINE pb_stream_t
106+
PB_INLINE PB_WARN_UNUSED_RESULT
107+
pb_stream_t
108108
pb_stream_create_at(const pb_buffer_t *buffer, size_t offset) {
109109
assert(buffer);
110110
assert(pb_buffer_valid(buffer));
@@ -194,8 +194,8 @@ pb_stream_empty(const pb_stream_t *stream) {
194194
* \param[out] value Pointer receiving value
195195
* \return Error code
196196
*/
197-
PB_WARN_UNUSED_RESULT
198-
PB_INLINE pb_error_t
197+
PB_INLINE PB_WARN_UNUSED_RESULT
198+
pb_error_t
199199
pb_stream_read(pb_stream_t *stream, pb_type_t type, void *value) {
200200
assert(pb_stream_read_jump[type]);
201201
return pb_stream_read_jump[type](stream, type, value);
@@ -208,8 +208,8 @@ pb_stream_read(pb_stream_t *stream, pb_type_t type, void *value) {
208208
* \param[in] wiretype Wiretype
209209
* \return Error code
210210
*/
211-
PB_WARN_UNUSED_RESULT
212-
PB_INLINE pb_error_t
211+
PB_INLINE PB_WARN_UNUSED_RESULT
212+
pb_error_t
213213
pb_stream_skip(pb_stream_t *stream, pb_wiretype_t wiretype) {
214214
assert(pb_stream_skip_jump[wiretype]);
215215
return pb_stream_skip_jump[wiretype](stream);

0 commit comments

Comments
 (0)