History log of /rk3399_ARM-atf/lib/libc/snprintf.c (Results 1 – 25 of 29)
Revision Date Author Comments
# 3011e1af 11-May-2023 Joanna Farley <joanna.farley@arm.com>

Merge changes from topic "ms/external_deps" into integration

* changes:
feat(libc): add %c to printf/snprintf
feat(compiler-rt): update source files
chore(libfdt): update to v1.7.0 source files


# 44d9706e 09-May-2023 Maksims Svecovs <maksims.svecovs@arm.com>

feat(libc): add %c to printf/snprintf

Adds %c support for printf and snprintf to print one character. Required
by most recent MbedTLS 3.4.0.

Change-Id: I4d9b2725127a929d58946353324f99ff22b3b28b
Sig

feat(libc): add %c to printf/snprintf

Adds %c support for printf and snprintf to print one character. Required
by most recent MbedTLS 3.4.0.

Change-Id: I4d9b2725127a929d58946353324f99ff22b3b28b
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>

show more ...


# 601e2d43 10-Jan-2023 Manish Pandey <manish.pandey2@arm.com>

Merge changes from topic "bk/warnings" into integration

* changes:
docs: describe the new warning levels
build: add -Wunused-const-variable=2 to W=2
build: include -Wextra in generic builds

Merge changes from topic "bk/warnings" into integration

* changes:
docs: describe the new warning levels
build: add -Wunused-const-variable=2 to W=2
build: include -Wextra in generic builds
docs(porting-guide): update a reference
fix(st-usb): replace redundant checks with asserts
fix(brcm): add braces around bodies of conditionals
fix(renesas): align incompatible function pointers
fix(zynqmp): remove redundant api_version check
fix: remove old-style declarations
fix: unify fallthrough annotations

show more ...


# e138400d 18-Nov-2022 Boyan Karatotev <boyan.karatotev@arm.com>

fix: unify fallthrough annotations

Compiling with -Wimplicit-fallthrough=3 (enabled by -Wextra) produces
many warnings about fallthrough comments either missing or being wrong.
Unify the comments so

fix: unify fallthrough annotations

Compiling with -Wimplicit-fallthrough=3 (enabled by -Wextra) produces
many warnings about fallthrough comments either missing or being wrong.
Unify the comments so we comply with -Wextra.

Note that Coverity recommends against using the __attribute__ directive.
Also, zlib does not build with a higher value of -Wimplicit-fallthrough.
Finally, compilers strip comments before expanding macros. As such,
checkpatch's fallthrough annotation (or higher levels of the flag) isn't
really possible.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I060cf4f8dc04c02cbb45cf4ceb69569a8369ccee

show more ...


# 2aaed860 23-Sep-2022 Joanna Farley <joanna.farley@arm.com>

Merge "refactor(libc): clean up dependencies in libc" into integration


# 885e2683 12-Sep-2022 Claus Pedersen <claustbp@google.com>

refactor(libc): clean up dependencies in libc

- Removing platform dependencies from libc modules.
- Replacing panicking with actual error handling.
- Debug macros are included indirectly from assert

refactor(libc): clean up dependencies in libc

- Removing platform dependencies from libc modules.
- Replacing panicking with actual error handling.
- Debug macros are included indirectly from assert.h. Removing
"platform_def.h" from assert.h and adding "common/debug.h"
where the macros are used.
- Removing hack for fixing PLAT_LOG_LEVEL_ASSERT to 40.
Instead removing assert with expression, as this
does not provide additional information.

Signed-off-by: Claus Pedersen <claustbp@google.com>
Change-Id: Icc201ea7b63c1277e423c1cfd13fd6816c2bc568

show more ...


# a11cbe71 10-May-2022 Madhukar Pappireddy <madhukar.pappireddy@arm.com>

Merge "feat(snprintf): add support for length specifiers" into integration


# 701e94b0 28-Feb-2022 kadabi <kadabi@google.com>

feat(snprintf): add support for length specifiers

Add long, long long and size_t length specifiers to
snprintf similar to vprintf. This will help capturing
all the UART logs into a logbuffer and mak

feat(snprintf): add support for length specifiers

Add long, long long and size_t length specifiers to
snprintf similar to vprintf. This will help capturing
all the UART logs into a logbuffer and makes snprintf
functionally equivalent to vprintf.

Change-Id: Ib9bd20e2b040c9b8755cf7ed7c9b4da555604810
Signed-off-by: Channagoud kadabi <kadabi@google.com>

show more ...


# 8d9c1b3c 16-Feb-2022 Madhukar Pappireddy <madhukar.pappireddy@arm.com>

Merge changes from topic "st-format-signedness" into integration

* changes:
feat(stm32mp1): enable format-signedness warning
fix(stm32mp1): correct types in messages
fix(st-pmic): correct verb

Merge changes from topic "st-format-signedness" into integration

* changes:
feat(stm32mp1): enable format-signedness warning
fix(stm32mp1): correct types in messages
fix(st-pmic): correct verbose message
fix(st-sdmmc2): correct cmd_idx type in messages
fix(st-fmc): fix type in message
fix(mtd): correct types in messages
fix(usb): correct type in message
fix(tzc400): correct message with filter
fix(psci): correct parent_node type in messages
fix(libc): correct some messages
fix(fconf): correct image_id type in messages
fix(bl2): correct messages with image_id

show more ...


# a211fde9 14-Feb-2022 Yann Gautier <yann.gautier@st.com>

fix(libc): correct some messages

Replace %d with %u in logs, to avoid warning when
-Wformat-signedness is enabled.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Id058f6fb0fd25ce5f83b

fix(libc): correct some messages

Replace %d with %u in logs, to avoid warning when
-Wformat-signedness is enabled.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Id058f6fb0fd25ce5f83b1be41082403fcb205841

show more ...


# b22f18e3 11-Feb-2022 Joanna Farley <joanna.farley@arm.com>

Merge changes from topic "snprintf-fix" into integration

* changes:
fix(libc): snprintf: include stdint.h
fix(libc): limit snprintf radix value
fix(libc): fix snprintf corner cases


# 410c925a 27-Jan-2022 Andre Przywara <andre.przywara@arm.com>

fix(libc): snprintf: include stdint.h

The snprintf code uses the uintptr_t type, which is defined in stdint.h.
We do not include this header explicitly, but get the definition
indirectly through som

fix(libc): snprintf: include stdint.h

The snprintf code uses the uintptr_t type, which is defined in stdint.h.
We do not include this header explicitly, but get the definition
indirectly through some other header doing so.

However this breaks when snprintf is compiled in isolation (for instance
for unit-testing), so let's add this #include to make things right.

Change-Id: I1299767ee482f5cf1af30c4df2e8f7e596969b41
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

show more ...


# b30dd403 24-Jan-2022 Andre Przywara <andre.przywara@arm.com>

fix(libc): limit snprintf radix value

In our unsigned_num_print() function we first print the integer into a
local buffer, then put this through alignment and padding and output the
result. For this

fix(libc): limit snprintf radix value

In our unsigned_num_print() function we first print the integer into a
local buffer, then put this through alignment and padding and output the
result. For this we use a local buffer, sized by the maximum possible
length of the largest possible number.

However this assumes that the radix is not smaller than 10, which is
indeed the smallest value we pass into this static function at the
moment. To prevent accidents in the future, should we add support for
other radices, add an assert to enforce our assumption.

Unfortunately this cannot be a static assert (CASSERT), since the
compiler is not smart enough to see that the argument is always coming
from a literal.

Change-Id: Ic204462600d9f4c281d899cf9f2c698a0a33a874
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

show more ...


# c1f5a092 21-Dec-2021 Andre Przywara <andre.przywara@arm.com>

fix(libc): fix snprintf corner cases

The number formatting routine in snprintf was trying to be clever with
the buffer handling, but tripped over its own feet: snprintf() users
expect output to be e

fix(libc): fix snprintf corner cases

The number formatting routine in snprintf was trying to be clever with
the buffer handling, but tripped over its own feet: snprintf() users
expect output to be emitted, even if not everything fits into the
buffer. The current code gives up completely when the buffer is too
small.

Fix those issues and simplify the code on the way, by consequently using
the CHECK_AND_PUT_CHAR() macro, which both checks for the buffer size
correctly, but also keeps track of the number of should-be-printed
characters for the return value.

Change-Id: Ifd2b03b9a73f9279abed53081a2d88720ecbdbc1
Signed-off-by: Andre Przywara <andre.przywara@arm.com>

show more ...


# 0b2b83ea 21-Jan-2021 Madhukar Pappireddy <madhukar.pappireddy@arm.com>

Merge changes I2add6b4b,I9b296372,I7af2f1d1 into integration

* changes:
libc/snprintf: use macro to reduce duplicated code
libc/snprintf: add support to print "%" character
libc/printf: add su

Merge changes I2add6b4b,I9b296372,I7af2f1d1 into integration

* changes:
libc/snprintf: use macro to reduce duplicated code
libc/snprintf: add support to print "%" character
libc/printf: add support to print "%" character

show more ...


# 7981c504 20-Jan-2021 Heyi Guo <guoheyi@linux.alibaba.com>

libc/snprintf: use macro to reduce duplicated code

Add macro CHECK_AND_PUT_CHAR to check buffer capacity, save one
character to buffer, and then increase character counter by one in one
single state

libc/snprintf: use macro to reduce duplicated code

Add macro CHECK_AND_PUT_CHAR to check buffer capacity, save one
character to buffer, and then increase character counter by one in one
single statement, so that 4 similar code pieces can be cleaned.

Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com>
Change-Id: I2add6b4bd6c24ea3c0d2499a44924e3e8db0f4d1

show more ...


# c6546154 27-Oct-2020 Heyi Guo <guoheyi@linux.alibaba.com>

libc/snprintf: add support to print "%" character

Enable snprintf()/vsnprintf() in TF-A to print "%" character as C
standard, which may be used in platform porting to print percentage
information.

libc/snprintf: add support to print "%" character

Enable snprintf()/vsnprintf() in TF-A to print "%" character as C
standard, which may be used in platform porting to print percentage
information.

Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com>
Change-Id: I9b296372a1002046eabac1df5e8eb99a27efd4a8

show more ...


# ddf04313 11-Sep-2020 Mark Dykes <mardyk01@review.trustedfirmware.org>

Merge "libc: Add support for vsnprintf()" into integration


# 77648689 09-Sep-2020 Madhukar Pappireddy <madhukar.pappireddy@arm.com>

libc: Add support for vsnprintf()

It uses the existing implementation of snprintf() function

Change-Id: Ie59418564c2e415222e819cf322c34e9a4d1f336
Signed-off-by: Madhukar Pappireddy <madhukar.pappir

libc: Add support for vsnprintf()

It uses the existing implementation of snprintf() function

Change-Id: Ie59418564c2e415222e819cf322c34e9a4d1f336
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>

show more ...


# c6a2ca0a 27-Aug-2020 Manish Pandey <manish.pandey2@arm.com>

Merge "Add support for hexadecimal and pointer format specifiers to snprintf()" into integration


# 524eecc6 21-Aug-2020 Javier Almansa Sobrino <javier.almansasobrino@arm.com>

Add support for hexadecimal and pointer format specifiers to snprintf()

The current implementation of snprintf() does not support pointer and
hexadecimal format specifiers, which can be needed, for

Add support for hexadecimal and pointer format specifiers to snprintf()

The current implementation of snprintf() does not support pointer and
hexadecimal format specifiers, which can be needed, for instance, for
DTB manipulations.

This patch adds that functionality by borrowing some code from the
printf() implementation.

Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I2076ea46693a73a04890982bf20e3c633c2767fb

show more ...


# 9a207532 04-Jan-2019 Antonio Niño Díaz <antonio.ninodiaz@arm.com>

Merge pull request #1726 from antonio-nino-diaz-arm/an/includes

Sanitise includes across codebase


# 09d40e0e 14-Dec-2018 Antonio Nino Diaz <antonio.ninodiaz@arm.com>

Sanitise includes across codebase

Enforce full include path for includes. Deprecate old paths.

The following folders inside include/lib have been left unchanged:

- include/lib/cpus/${ARCH}
- inclu

Sanitise includes across codebase

Enforce full include path for includes. Deprecate old paths.

The following folders inside include/lib have been left unchanged:

- include/lib/cpus/${ARCH}
- include/lib/el3_runtime/${ARCH}

The reason for this change is that having a global namespace for
includes isn't a good idea. It defeats one of the advantages of having
folders and it introduces problems that are sometimes subtle (because
you may not know the header you are actually including if there are two
of them).

For example, this patch had to be created because two headers were
called the same way: e0ea0928d5b7 ("Fix gpio includes of mt8173 platform
to avoid collision."). More recently, this patch has had similar
problems: 46f9b2c3a282 ("drivers: add tzc380 support").

This problem was introduced in commit 4ecca33988b9 ("Move include and
source files to logical locations"). At that time, there weren't too
many headers so it wasn't a real issue. However, time has shown that
this creates problems.

Platforms that want to preserve the way they include headers may add the
removed paths to PLAT_INCLUDES, but this is discouraged.

Change-Id: I39dc53ed98f9e297a5966e723d1936d6ccf2fc8f
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>

show more ...


# 3ed87a49 03-Oct-2018 Soby Mathew <soby.mathew@arm.com>

Merge pull request #1584 from danielboulby-arm/db/Switches

Ensure the flow through switch statements is clear


# a08a2014 22-Jun-2018 Daniel Boulby <daniel.boulby@arm.com>

Ensure the flow through switch statements is clear

Ensure case clauses:
* Terminate with an unconditional break, return or goto statement.
* Use conditional break, return or goto statements as l

Ensure the flow through switch statements is clear

Ensure case clauses:
* Terminate with an unconditional break, return or goto statement.
* Use conditional break, return or goto statements as long as the end
of the case clause is unreachable; such case clauses must terminate
with assert(0) /* Unreachable */ or an unconditional __dead2 function
call
* Only fallthough when doing otherwise would result in less
readable/maintainable code; such case clauses must terminate with a
/* Fallthrough */ comment to make it clear this is the case and
indicate that a fallthrough is intended.

This reduces the chance of bugs appearing due to unintended flow through a
switch statement

Change-Id: I70fc2d1f4fd679042397dec12fd1982976646168
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>

show more ...


12