summaryrefslogtreecommitdiffstats
path: root/pb_encode.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@npb.mail.kapsi.fi>2011-11-10 16:19:55 +0000
committerPetteri Aimonen <jpa@npb.mail.kapsi.fi>2011-11-10 16:19:55 +0000
commit13b6988b642e786efb5aaaba0601d25a65f80091 (patch)
tree9f575a875ea4a5f4d9f3816c9318ed812b3dbd06 /pb_encode.c
parent85e0afd894daf851baca8ecd50ebae3cdba40e65 (diff)
Fix some compiler warnings in strict C89 mode
Contributed by Michael Poole. git-svn-id: https://svn.kapsi.fi/jpa/nanopb@1004 e3a754e5-d11d-0410-8d38-ebb782a927b9
Diffstat (limited to 'pb_encode.c')
-rw-r--r--pb_encode.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/pb_encode.c b/pb_encode.c
index 58e03a68..317e31ef 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -149,15 +149,14 @@ bool checkreturn pb_encode(pb_ostream_t *stream, const pb_field_t fields[], cons
while (field->tag != 0)
{
+ pb_encoder_t func = PB_ENCODERS[PB_LTYPE(field->type)];
pData = (const char*)pData + prev_size + field->data_offset;
pSize = (const char*)pData + field->size_offset;
prev_size = field->data_size;
if (PB_HTYPE(field->type) == PB_HTYPE_ARRAY)
prev_size *= field->array_size;
-
- pb_encoder_t func = PB_ENCODERS[PB_LTYPE(field->type)];
-
+
switch (PB_HTYPE(field->type))
{
case PB_HTYPE_REQUIRED: