NordicSemiconductor / zcbor

Low footprint C/C++ CBOR library and Python tool providing code generation from CDDL descriptions.
Apache License 2.0
105 stars 34 forks source link

zcbor_decode.c: Streamline value_extract #359

Closed oyvindronningstad closed 9 months ago

oyvindronningstad commented 9 months ago

By changing where the incrementation of the payload pointer happens and extracting the endian-dependent part to its own function.

This also changes things so that state->payload_bak isn't updated unless the function is successful.