From 0074deba9a2ff99c877abe1293f72a9ed76f46c1 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Tue, 29 Oct 2013 16:24:50 +0200 Subject: Declare static functions before use. For compliance with MISRA C rules (issue 91). --- pb_encode.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pb_encode.c') 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, -- cgit 1.2.3-korg