diff th_printf.c @ 663:284d5b789b7c

Add th_char_t type.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 27 Jan 2020 07:47:26 +0200
parents 7f1efa37288b
children b6b8e7249666
line wrap: on
line diff
--- a/th_printf.c	Mon Jan 27 07:44:44 2020 +0200
+++ b/th_printf.c	Mon Jan 27 07:47:26 2020 +0200
@@ -151,11 +151,11 @@
 
 
 int th_vprintf_put_int_format(th_vprintf_ctx *ctx, th_vprintf_putch vputch,
-    char *buf, int f_flags, int f_width, int f_prec, int f_len, int vret,
+    th_char_t *buf, int f_flags, int f_width, int f_prec, int f_len, int vret,
     BOOL f_neg, BOOL f_unsig, th_vprintf_altfmt_func f_alt)
 {
     int ret = 0, nspacepad, nzeropad, f_altstr_len = 0;
-    char f_sign, *f_altstr;
+    th_char_t f_sign, *f_altstr;
 
     // Special case for value of 0
     if (vret == 0)
@@ -254,7 +254,7 @@
     va_list ap, const int f_radix, int f_flags, int f_width, int f_prec,
     const BOOL f_unsig, th_vprintf_altfmt_func f_alt)
 {
-    char buf[32];
+    th_char_t buf[32];
     int f_len = 0, vret;
     BOOL f_neg = FALSE;
 
@@ -277,7 +277,7 @@
 
 
 int th_vprintf_put_str(th_vprintf_ctx *ctx, th_vprintf_putch vputch,
-    const char *str, int f_flags, const int f_width, const int f_prec)
+    const th_char_t *str, int f_flags, const int f_width, const int f_prec)
 {
     int nspacepad, f_len, ret;
 
@@ -338,7 +338,7 @@
 int th_vprintf_do_format(
     th_vprintf_ctx *ctx, th_vprintf_putch vputch,
     int f_width, int f_prec, int f_flags,
-    const char fmt, va_list ap)
+    const th_char_t fmt, va_list ap)
 {
     int ret;
 
@@ -394,7 +394,7 @@
 #endif
 
         case 's':
-            return th_vprintf_put_str(ctx, vputch, va_arg(ap, char *),
+            return th_vprintf_put_str(ctx, vputch, va_arg(ap, th_char_t *),
                 f_flags, f_width, f_prec);
 
         //case '%':
@@ -404,7 +404,7 @@
 }
 
 
-int th_vprintf_do(th_vprintf_ctx *ctx, th_vprintf_putch vputch, const char *fmt, va_list ap)
+int th_vprintf_do(th_vprintf_ctx *ctx, th_vprintf_putch vputch, const th_char_t *fmt, va_list ap)
 {
     int ret = 0;