NordicSemiconductor / zcbor

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

Optimizes int types for in memory storage #460

Open dwjbosman opened 1 month ago

dwjbosman commented 1 month ago

When having large arrays of a type that has a small range, the code generator should use the correct integer type to avoid wasting precious memory.

Fix for https://github.com/NordicSemiconductor/zcbor/issues/459

CLAassistant commented 1 month ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

:white_check_mark: oyvindronningstad
:white_check_mark: dwjbosman
:x: Dinne Bosman


Dinne Bosman seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

dwjbosman commented 1 month ago

I have not been able to run the tests!

oyvindronningstad commented 1 week ago

@dwjbosman Thanks for your contribution! I have taken your code and made a number of fixes and improvments to it, which you can find at https://github.com/NordicSemiconductor/zcbor/pull/466. Feel free to grab that commit into this PR, and possibly add you own Signed-off-by line (git commit --amend -s). The commit is based on your work and is in your name as author. If I don't hear from you I will put myself as author so as not to impersonate you, and instead credit you in the commit message.