Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Up to 64 bit sized bit strings supported in C code generator #100

Merged
merged 3 commits into from
Dec 17, 2020

Conversation

Futsch1
Copy link
Collaborator

@Futsch1 Futsch1 commented Dec 17, 2020

Closes #99
Bit strings have only been supported up to 32 bits before. This change provides support for 64 bits. Bit strings larger than 32 bits are encoded and decoded using a new dedicated function in the OER generator (decoder_read_long_uint, encoder_append_long_uint).

I chose to not reimplement the existing 32 bit based encoding and decoding functions for ints to avoid the generation of functions with 64 bits in cases where it is not required. Introducing the uint64_t type might be an issue for smaller sized embedded systems, it also comes at a performance cost in these systems. So the existing generated code is unchanged, only bit strings with more than 32 bits in length use these new functions.

In addition, I refactored the generators by moving the strings containing the generated C functions to dedicated modules to make the main generator code more clear.

@Futsch1
Copy link
Collaborator Author

Futsch1 commented Dec 17, 2020

@eerimoq: I will wait with merging the PR until Friday to give you the chance to review/comment/object.

@eerimoq
Copy link
Owner

eerimoq commented Dec 17, 2020

Thanks for implementing this. Much appreciated.

Unfortunately I'm quite busy with the Mys project at the moment so I put my trust in you and @ttt710516. The changes should be fine as long as they don't break any existing functionality.

@Futsch1 Futsch1 merged commit 349eeaa into eerimoq:master Dec 17, 2020
@Futsch1 Futsch1 deleted the larger_bitenums branch December 17, 2020 09:13
@eerimoq
Copy link
Owner

eerimoq commented Dec 17, 2020

I'm out of credits on Travis CI. We should move all testing to Github Actions instead. I can work on this today, unless you want to.

Here is an example: https://github.com/eerimoq/mys/blob/main/.github/workflows/pythonpackage.yml

@eerimoq
Copy link
Owner

eerimoq commented Dec 17, 2020

Now Github Actions is used to test commits and publish releases. I created a new tag, 0.155.0, on master, which has been published to PyPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bit strings for C
2 participants