diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-25 21:27:12 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-25 21:27:12 -0500 |
| commit | e36f0587b10476065fba1e8a038d9dfaabe63445 (patch) | |
| tree | ba6c13e8f4d62ae8f86a324920ff353e6793ebbd /src | |
| parent | f08219300025bac2b719d00171738327937b58ea (diff) | |
compile without warnings under -Wall -Wextra
Diffstat (limited to 'src')
| -rw-r--r-- | src/nonstd/_printf.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/nonstd/_printf.h b/src/nonstd/_printf.h index fa132367..95a4c94c 100644 --- a/src/nonstd/_printf.h +++ b/src/nonstd/_printf.h @@ -90,14 +90,6 @@ int (__printf)(struct io_options *opt, const char * format, va_list arg) } for (i = 0; format[i] != 0; i++) { - if (format[i] != '%') { - if (nout < (int)n) { - s[nout] = format[i]; - } - nout++; - continue; - } - /* // zero of more flags "-+ #0" // optional width "*" or decimal integer @@ -113,6 +105,14 @@ int (__printf)(struct io_options *opt, const char * format, va_list arg) int base = 10; enum { def, hh, h, l, ll, j, z, t, L } length = def; + if (format[i] != '%') { + if (nout < (int)n) { + s[nout] = format[i]; + } + nout++; + continue; + } + while (step == 0) { i++; switch (format[i]) { @@ -197,7 +197,11 @@ int (__printf)(struct io_options *opt, const char * format, va_list arg) case hh: argint = (signed char)va_arg(arg, int); break; case h: argint = (short int)va_arg(arg, int); break; case l: argint = va_arg(arg, long int); break; + + #if defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ case ll: argint = va_arg(arg, long long int); break; + #endif + case j: argint = va_arg(arg, intmax_t); break; case z: argint = va_arg(arg, size_t); break; case t: argint = va_arg(arg, ptrdiff_t); break; |
