Fix some warning in printf reduced.
authorqwert <qwert@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 18 Jul 2008 14:35:17 +0000 (14:35 +0000)
committerqwert <qwert@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 18 Jul 2008 14:35:17 +0000 (14:35 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1504 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/mware/formatwr.c

index 0a36cee8d5daca793250c0c42463ae93d1ea2343..ac2cbffe376ea28760122f15f617823240f88bbf 100644 (file)
@@ -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 */