1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/fmt
bors[bot] 8c2a4b43b3
Merge #19027
19027: sys/fmt: optimize scn_u32_dec scn_u32_hex r=benpicco a=kfessel

### Contribution description

Improves the compilation result for `scn_u32_dec` `scn_u32_hex` especially on `cortex-m` reducing either stack usage and or code size.

This makes use of unsigned int overflow (slightly less better without doing that `hexn`).

See godbolt (original versions got an `o` attached, modified versions got `k`s) all functions are  marked `_S_` defined to `static`

by assigning the global at end the compiled function can be changed (`deco deck  hexo hexk hexkk hexn`)

this PR is `hexkk` and `deck` 

### Testing procedure

run unit-test/test-fmt

```
<RIOT>/tests/unittests$ make tests-fmt
<RIOT>/tests/unittests$ make term
```

### Issues/PRs references

[godbolt](https://godbolt.org/z/MzT1zh4q1)

Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
2023-02-17 20:09:53 +00:00
..
fmt.c Merge #19027 2023-02-17 20:09:53 +00:00
Kconfig sys/fmt/Kconfig: make module available only for testing 2020-12-02 10:14:43 +01:00
Makefile sys/fmt: Added submodule fmt_table 2019-08-20 14:32:49 +02:00
table.c sys/fmt_table: fix infinite loop 2021-01-21 10:03:44 +01:00