You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/06/02 09:18:28 UTC
[incubator-nuttx] 02/02: Implement "j" modifier for printf format
This is an automated email from the ASF dual-hosted git repository.
jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 86b7c20b7d090c5720e297829757323253b2ba0c
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Jun 2 13:51:12 2020 +0900
Implement "j" modifier for printf format
It's a part of C99 and commonly used these days.
---
libs/libc/stdio/lib_libvsprintf.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/libs/libc/stdio/lib_libvsprintf.c b/libs/libc/stdio/lib_libvsprintf.c
index e1101d8..7a0f018 100644
--- a/libs/libc/stdio/lib_libvsprintf.c
+++ b/libs/libc/stdio/lib_libvsprintf.c
@@ -410,6 +410,18 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
}
}
+ if (c == 'j')
+ {
+ /* Same as long long if available. Otherwise, long. */
+
+#ifdef CONFIG_LIBC_LONG_LONG
+ flags |= FL_REPD_TYPE;
+#endif
+ flags |= FL_LONG;
+ flags &= ~FL_SHORT;
+ continue;
+ }
+
if (c == 'l')
{
if ((flags & FL_LONG) != 0)