Skip to content

sys/fmt: Add print_s64_dec to header#15979

Merged
MrKevinWeiss merged 3 commits intoRIOT-OS:masterfrom
MrKevinWeiss:pr/fix/fmt
Feb 11, 2021
Merged

sys/fmt: Add print_s64_dec to header#15979
MrKevinWeiss merged 3 commits intoRIOT-OS:masterfrom
MrKevinWeiss:pr/fix/fmt

Conversation

@MrKevinWeiss
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss commented Feb 10, 2021

Contribution description

It seems that print_s64_dec is implemented but not exposed in the header.
This PR exposes it and improves coverage of the fmt module.

Testing procedure

make all test -C tests/fmt_print/

CI should pass too.

Issues/PRs references

Split from #15950

@MrKevinWeiss MrKevinWeiss added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: sys Area: System labels Feb 10, 2021
@MrKevinWeiss MrKevinWeiss self-assigned this Feb 10, 2021
@MrKevinWeiss MrKevinWeiss changed the title Pr/fix/fmt sys/fmt: Add print_s64_dec to header Feb 10, 2021
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK. Thanks also for extending the test properly.

@maribu
Copy link
Member

maribu commented Feb 10, 2021

Test output using nucleo-f767zi:

READY
s
START
main(): This is RIOT! (Version: 2021.04-devel-525-g73cd4-kevin)
If you can read this:
4294967295
-2147483648
FA
-2147483648
12345678
123456789ABCDEF0
18446744073709551615
-9223372036854775808
1.23450
Test successful.

@maribu
Copy link
Member

maribu commented Feb 10, 2021

This should make the CI happy :-)

diff --git a/tests/periph_ptp_clock/main.c b/tests/periph_ptp_clock/main.c
index f3afc03b73..22f82464d2 100644
--- a/tests/periph_ptp_clock/main.c
+++ b/tests/periph_ptp_clock/main.c
@@ -46,16 +46,6 @@
 static mutex_t sync_mutex = MUTEX_INIT_LOCKED;
 static atomic_uint_least64_t timestamp;
 
-static inline void print_s64_dec(int64_t _num)
-{
-    uint64_t num = _num;
-    if (_num < 0) {
-        print_str("-");
-        num = -_num;
-    }
-    print_u64_dec(num);
-}
-
 static void speed_adj_cb(void *arg, int chan)
 {
     (void)arg;

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-ACK

@MrKevinWeiss MrKevinWeiss merged commit 3ebe62f into RIOT-OS:master Feb 11, 2021
@MrKevinWeiss MrKevinWeiss deleted the pr/fix/fmt branch February 11, 2021 10:11
@MrKevinWeiss
Copy link
Contributor Author

Thanks for the review!

@kaspar030 kaspar030 added this to the Release 2021.04 milestone Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants