diff th_printf1.c @ 361:ad9719373fe3

Simplify th_printf_vbuf*() helpers.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Feb 2016 11:53:08 +0200
parents cda5a2aebbb6
children 4b1b2e9d073f
line wrap: on
line diff
--- a/th_printf1.c	Thu Feb 25 11:51:52 2016 +0200
+++ b/th_printf1.c	Thu Feb 25 11:53:08 2016 +0200
@@ -7,11 +7,9 @@
  */
 
 static int TH_PFUNC_NAME (char *buf, const int len, int *pos,
-    TH_PFUNC_TYPE_S pval, const int f_radix, const int f_flags,
-    const int f_prec, const BOOL f_unsig, BOOL *f_neg)
+    TH_PFUNC_TYPE_S pval, const int f_radix, const BOOL f_upcase,
+    const BOOL f_unsig, BOOL *f_neg)
 {
-    const BOOL f_upcase = f_flags & TH_PF_UPCASE;
-
     if (f_radix > 16)
         return EOF;
 
@@ -27,8 +25,8 @@
     // Render the value to a string in buf (reversed)
     TH_PFUNC_TYPE_U val = pval;
 
-    // Special case for value of 0 and precision 0
-    if (val == 0 && f_prec == 0)
+    // Special case for value of 0
+    if (val == 0)
         return 0;
 
     *pos = 0;