From f736a4877b8a420223c14da06be6ffe48772d44f Mon Sep 17 00:00:00 2001 From: qwert Date: Fri, 18 Jul 2008 14:35:17 +0000 Subject: [PATCH] Fix some warning in printf reduced. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1504 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/mware/formatwr.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bertos/mware/formatwr.c b/bertos/mware/formatwr.c index 0a36cee8..ac2cbffe 100644 --- a/bertos/mware/formatwr.c +++ b/bertos/mware/formatwr.c @@ -899,13 +899,22 @@ FLOATING_CONVERSION: 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 - 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 */ -- 2.25.1