From 1db589c13b1406b7f2b21243d3519c656ec454a1 Mon Sep 17 00:00:00 2001 From: bernie Date: Sun, 10 Aug 2008 13:35:07 +0000 Subject: [PATCH] formatwr(): Add 'z' modifier git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1596 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/mware/formatwr.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/bertos/mware/formatwr.c b/bertos/mware/formatwr.c index ac2cbffe..6d725f97 100644 --- a/bertos/mware/formatwr.c +++ b/bertos/mware/formatwr.c @@ -26,7 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2003, 2004, 2005 Develer S.r.l. (http://www.develer.com/) + * Copyright 2003, 2004, 2005, 2008 Develer S.r.l. (http://www.develer.com/) * * --> * @@ -43,10 +43,10 @@ * controlled by giving a -D option a compilation time: * * \code - * -D CONFIG_PRINTF=PRINTF_FULL Full ANSI printf formatter + * -D CONFIG_PRINTF=PRINTF_FULL Full ANSI printf formatter, with some C99 extensions * -D CONFIG_PRINTF=PRINTF_NOFLOAT Exclude support for floats * -D CONFIG_PRINTF=PRINTF_REDUCED Simplified formatter (see below) - * -D CONFIG_PRINTF=PRINTF_NOMODIFIERS Exclude 'l' and 'h' modifiers in reduced version + * -D CONFIG_PRINTF=PRINTF_NOMODIFIERS Exclude 'l', 'z' and 'h' modifiers in reduced version * -D CONFIG_PRINTF=PRINTF_DISABLED No formatter at all * \endcode * @@ -836,13 +836,16 @@ FLOATING_CONVERSION: } #if CONFIG_PRINTF > PRINTF_NOMODIFIERS - /*=================================*/ - /* Optional 'l' or 'h' modifiers ? */ - /*=================================*/ + /* + * Optional 'l', 'z' or 'h' modifiers? + */ l_modifier = h_modifier = false; switch (PGM_READ_CHAR(format)) { case 'l': + case 'z': + /* for the 'z' modifier, we make this assmumption */ + STATIC_ASSERT(sizeof(size_t) == sizeof(long)); l_modifier = true; format++; break; -- 2.25.1