[io] Refactor IOStream to use an external printf implementation #199
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Our printf implementation was good for many years, however, a lot of features were missing and our tests, while helpful, weren't complete.
In addition I wanted to refactor IOStream for a long time now, and add some feature options for the AVRs to selectively enable
long long
,float
,ptrdiff
and printf-style formatting.This completely replaces all formatting code with
mpaland/printf
, and cleans up the IOStream class, with only these changes to the behavior:%p
does not print the leading0x
anymore, you have to add it yourself.0
or1
not the leading 7 zeros anymore.stream << modm::bin << (bool)1
prints1
, not00000001
.const char *
array will always print in ascii mode.stream << modm::hex << "Hallo"
printsHallo
, not48616C6C6F00
.%f
,%e
or%g
are ignored and the value is output in scientific notation.Ran unittests on:
cc @se-bi @rleh @chris-durand @strongly-typed