projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
proc: Split cooperative scheduler in coop.c
[bertos.git]
/
bertos
/
mware
/
formatwr.c
diff --git
a/bertos/mware/formatwr.c
b/bertos/mware/formatwr.c
index 0a36cee8d5daca793250c0c42463ae93d1ea2343..6d725f971f6fa9808bfda8d2d46a35cef7e2fd82 100644
(file)
--- 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.
*
* 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
* 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_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
*
* -D CONFIG_PRINTF=PRINTF_DISABLED No formatter at all
* \endcode
*
@@
-836,13
+836,16
@@
FLOATING_CONVERSION:
}
#if CONFIG_PRINTF > PRINTF_NOMODIFIERS
}
#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':
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;
l_modifier = true;
format++;
break;
@@
-899,13
+902,22
@@
FLOATING_CONVERSION:
CONVERSION_LOOP:
#if CONFIG_PRINTF > PRINTF_NOMODIFIERS
if (h_modifier)
CONVERSION_LOOP:
#if CONFIG_PRINTF > PRINTF_NOMODIFIERS
if (h_modifier)
- u_val = (format_flag == 'd') ?
- (short)va_arg(ap, int) : (unsigned short)va_arg(ap, int);
+ {
+ if (format_flag == 'd')
+ u_val = (short)va_arg(ap, int);
+ else
+ u_val = (unsigned short)va_arg(ap, int);
+ }
else if (l_modifier)
u_val = va_arg(ap, long);
else
else if (l_modifier)
u_val = va_arg(ap, long);
else
- u_val = (format_flag == 'd') ?
- va_arg(ap,int) : va_arg(ap,unsigned int);
+ {
+ if (format_flag == 'd')
+ u_val = va_arg(ap, int);
+ else
+ u_val = va_arg(ap, unsigned int);
+ }
+
#else /* CONFIG_PRINTF > PRINTF_NOMODIFIERS */
u_val = va_arg(ap,int);
#endif /* CONFIG_PRINTF > PRINTF_NOMODIFIERS */
#else /* CONFIG_PRINTF > PRINTF_NOMODIFIERS */
u_val = va_arg(ap,int);
#endif /* CONFIG_PRINTF > PRINTF_NOMODIFIERS */