Skip to content

Commit beb62d2

Browse files
nordic-krchnashif
authored andcommitted
lib: os: cbprintf: Minor fixes
Added missing errno.h include. Fixed Z_CBPRINTF_ARG_SIZE macro for void * and cleaned up macro description. Signed-off-by: Krzysztof Chruscinski <[email protected]>
1 parent 93ff119 commit beb62d2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

include/sys/cbprintf_internal.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef ZEPHYR_INCLUDE_SYS_CBPRINTF_INTERNAL_H_
88
#define ZEPHYR_INCLUDE_SYS_CBPRINTF_INTERNAL_H_
99

10+
#include <errno.h>
1011
#include <stdarg.h>
1112
#include <stddef.h>
1213
#include <stdint.h>
@@ -100,9 +101,7 @@ extern "C" {
100101
/** @brief Get storage size for given argument.
101102
*
102103
* Floats are promoted to double so they use size of double, others int storage
103-
* or it's own storage size if it is bigger than int. Strings are stored in
104-
* the package with 1 byte header indicating if string is stored as pointer or
105-
* by value.
104+
* or it's own storage size if it is bigger than int.
106105
*
107106
* @param x argument.
108107
*
@@ -112,11 +111,7 @@ extern "C" {
112111
_Generic((v), \
113112
float : sizeof(double), \
114113
default : \
115-
_Generic((v), \
116-
void * : 0, \
117-
default : \
118-
sizeof((v)+0) \
119-
) \
114+
sizeof((v)+0) \
120115
)
121116

122117
/** @brief Promote and store argument in the buffer.

0 commit comments

Comments
 (0)