Skip to content

Commit 604c9ac

Browse files
nordic-krchgalak
authored andcommitted
tests: lib: cbprintf_package: Minor cleanup
Adding static to local functions. Using void * for %p argument which often triggered compilation warning. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 9280b90 commit 604c9ac

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/lib/cbprintf_package/src/test.inc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static char static_buf[512];
3737
static char runtime_buf[512];
3838
static char compare_buf[128];
3939

40-
void dump(const char *desc, uint8_t *package, size_t len)
40+
static void dump(const char *desc, uint8_t *package, size_t len)
4141
{
4242
printk("%s package %p:\n", desc, package);
4343
for (size_t i = 0; i < len; i++) {
@@ -46,7 +46,7 @@ void dump(const char *desc, uint8_t *package, size_t len)
4646
printk("\n");
4747
}
4848

49-
void unpack(const char *desc, struct out_buffer *buf,
49+
static void unpack(const char *desc, struct out_buffer *buf,
5050
uint8_t *package, size_t len)
5151
{
5252
cbpprintf((cbprintf_cb)out, buf, package);
@@ -105,6 +105,7 @@ void test_cbprintf_package(void)
105105
unsigned short us = 0x1234;
106106
unsigned long ul = 0xaabbaabb;
107107
unsigned long long ull = 0xaabbaabbaabb;
108+
void *vp = NULL;
108109

109110

110111
/* tests to exercize different element alignments */
@@ -115,7 +116,7 @@ void test_cbprintf_package(void)
115116
TEST_PACKAGING("test %d %hd %hhd", i, s, sc);
116117
TEST_PACKAGING("test %ld %llx %hhu %hu %u", li, lli, uc, us, ui);
117118
TEST_PACKAGING("test %lu %llu", ul, ull);
118-
TEST_PACKAGING("test %c %p", c, &c);
119+
TEST_PACKAGING("test %c %p", c, vp);
119120

120121
if (IS_ENABLED(CONFIG_CBPRINTF_FP_SUPPORT)) {
121122
float f = -1.234;

0 commit comments

Comments
 (0)