From 2941e90e041b0d7872a4ea458e77dcc787ca6ff2 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Fri, 24 Aug 2012 20:23:25 +0300 Subject: Reorganize the field decoder interface. This makes the field decoding functions more intuitive to use. The old interface is still present if you specify NANOPB_INTERNALS. Update issue 2 Status: FixedInGit --- tests/decode_unittests.c | 2 ++ tests/test_decode_callbacks.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/decode_unittests.c b/tests/decode_unittests.c index 6ba6d4f..039c9fa 100644 --- a/tests/decode_unittests.c +++ b/tests/decode_unittests.c @@ -1,3 +1,5 @@ +#define NANOPB_INTERNALS + #include #include #include "pb_decode.h" diff --git a/tests/test_decode_callbacks.c b/tests/test_decode_callbacks.c index 714b7bb..95824d1 100644 --- a/tests/test_decode_callbacks.c +++ b/tests/test_decode_callbacks.c @@ -37,7 +37,7 @@ bool print_int32(pb_istream_t *stream, const pb_field_t *field, void *arg) bool print_fixed32(pb_istream_t *stream, const pb_field_t *field, void *arg) { uint32_t value; - if (!pb_dec_fixed32(stream, NULL, &value)) + if (!pb_decode_fixed32(stream, &value)) return false; printf((char*)arg, (long)value); @@ -47,7 +47,7 @@ bool print_fixed32(pb_istream_t *stream, const pb_field_t *field, void *arg) bool print_fixed64(pb_istream_t *stream, const pb_field_t *field, void *arg) { uint64_t value; - if (!pb_dec_fixed64(stream, NULL, &value)) + if (!pb_decode_fixed64(stream, &value)) return false; printf((char*)arg, (long long)value); -- cgit 1.2.3-korg