diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-10-29 16:24:50 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2013-10-29 16:24:50 +0200 |
commit | 0074deba9a2ff99c877abe1293f72a9ed76f46c1 (patch) | |
tree | d8aa756686c663ddd598e7dcbb06a5495f0d412d /pb_encode.c | |
parent | 4d69cc2f3ef33af9b63495e59127884d48d12fb3 (diff) |
Declare static functions before use.
For compliance with MISRA C rules (issue 91).
Diffstat (limited to 'pb_encode.c')
-rw-r--r-- | pb_encode.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pb_encode.c b/pb_encode.c index e933a0b1..90236524 100644 --- a/pb_encode.c +++ b/pb_encode.c @@ -17,10 +17,21 @@ #define checkreturn __attribute__((warn_unused_result)) #endif +/************************************** + * Declarations internal to this file * + **************************************/ +typedef bool (*pb_encoder_t)(pb_ostream_t *stream, const pb_field_t *field, const void *src) checkreturn; + +static bool checkreturn buf_write(pb_ostream_t *stream, const uint8_t *buf, size_t count); +static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field, const void *pData, size_t count, pb_encoder_t func); +static bool checkreturn encode_field(pb_ostream_t *stream, const pb_field_t *field, const void *pData); +static bool checkreturn default_extension_encoder(pb_ostream_t *stream, const pb_extension_t *extension); +static bool checkreturn encode_extension_field(pb_ostream_t *stream, const pb_field_t *field, const void *pData); + + /* --- Function pointers to field encoders --- * Order in the array must match pb_action_t LTYPE numbering. */ -typedef bool (*pb_encoder_t)(pb_ostream_t *stream, const pb_field_t *field, const void *src) checkreturn; static const pb_encoder_t PB_ENCODERS[PB_LTYPES_COUNT] = { &pb_enc_varint, &pb_enc_svarint, |