zephyr/lib/os
Nicolas Pitre 533dcaf374 lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats
There might be a sign extension when a long is promoted to
int_value_type and the former type is smaller than the later.
This produces the wrong output if the specified format is unsigned.

Let's avoid this problem by handling signed and unsigned cases
explicitly. When the type already matches int_value_type then the
compiler is smart enough to recognize the redundancy and removes
unneeded duplications automatically, meaning that the code will stay
small when code size matters.

A similar issue also existed in the restricted %llu case.
The fix is the same as above.

Those fixes exposed wrong results in the printk.c test with %llx
so fix that as well.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-09-03 08:17:19 -04:00
..
assert.c
base64.c
bitarray.c sys: introduce bit arrays 2021-05-07 13:36:22 -04:00
cbprintf_complete.c lib: os: cbprintf_complete: fix typo in cbvprintf width comment 2021-04-29 07:14:39 -04:00
cbprintf_nano.c lib/os/cbprintf_nano.c: avoid sign extension on unsigned formats 2021-09-03 08:17:19 -04:00
cbprintf_packaged.c coding guidelines 11.9: fix literal zero as the null-ptr-constant 2021-05-12 21:51:40 -04:00
cbprintf.c
CMakeLists.txt sys: introduce bit arrays 2021-05-07 13:36:22 -04:00
crc7_sw.c
crc8_sw.c
crc16_sw.c
crc32_sw.c
crc32c_sw.c
dec.c
fdtable.c net: socket: Add locking to prevent concurrent access 2021-04-15 07:16:51 -05:00
heap-validate.c lib: os: add final else where missing in heap* 2021-04-28 20:28:19 -04:00
heap.c k_heap: Clamp to a minimum heap size 2021-05-20 17:52:21 -04:00
heap.h heap: create unique variable name 2021-05-25 19:06:06 -04:00
hex.c
json.c json: fix parsing first array-array element 2021-08-30 09:15:58 -04:00
Kconfig power: move reboot functionality to os lib 2021-04-28 20:34:00 -04:00
Kconfig.cbprintf
mpsc_pbuf.c lib: remove redundant check for null 2021-05-26 08:29:20 -05:00
mutex.c
notify.c lib: os: assign sys_notify callback default to NULL... 2021-04-29 07:16:37 -04:00
onoff.c lib: os: add final else where missing in onoff, p4wq, sem 2021-04-28 20:28:19 -04:00
p4wq.c p4wq: add support for per-CPU, per-queue and delayed threads 2021-05-03 17:13:01 -04:00
printk.c logging: Adapt logger to support both versions 2021-04-19 10:59:23 -04:00
rb.c lib: rb: Fix violations to rule 12.1 2021-04-20 15:50:49 -04:00
reboot.c lib: os: reboot: misc cleanup 2021-04-28 20:34:00 -04:00
ring_buffer.c sys: ring_buffer: allow NULL data buffers 2021-04-09 13:19:30 +02:00
sem.c lib: os: add final else where missing in onoff, p4wq, sem 2021-04-28 20:28:19 -04:00
thread_entry.c
timeutil.c
user_work.c