summaryrefslogtreecommitdiff
path: root/libc/stdio/printf.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2002-12-20 19:26:35 +0000
committerManuel Novoa III <mjn3@codepoet.org>2002-12-20 19:26:35 +0000
commitc9d66e44af5c93a1ea5487fd9bff78274be65850 (patch)
tree975bb662b51ac91f8d1434553b936784b175a802 /libc/stdio/printf.c
parentbd6e7b0208c9652717bec30abff2d8dc12eaaca7 (diff)
The big thing is locale dependent collation support.
Also added outdigit support and (legacy) YESSTR/NOSTR support.
Diffstat (limited to 'libc/stdio/printf.c')
-rw-r--r--libc/stdio/printf.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/libc/stdio/printf.c b/libc/stdio/printf.c
index 273bf3621..945d3c38d 100644
--- a/libc/stdio/printf.c
+++ b/libc/stdio/printf.c
@@ -2331,11 +2331,16 @@ static int _do_one_spec(FILE * __restrict stream,
}
if (ppfs->conv_num <= CONV_i) { /* pointer or (un)signed int */
alphacase = __UIM_LOWER;
- if (((base = spec_base[(int)(ppfs->conv_num - CONV_p)]) == 10)
- && (PRINT_INFO_FLAG_VAL(&(ppfs->info),group))
- ) {
- alphacase = __UIM_GROUP;
+#ifndef __LOCALE_C_ONLY
+ if ((base = spec_base[(int)(ppfs->conv_num - CONV_p)]) == 10) {
+ if (PRINT_INFO_FLAG_VAL(&(ppfs->info),group)) {
+ alphacase = __UIM_GROUP;
+ }
+ if (PRINT_INFO_FLAG_VAL(&(ppfs->info),i18n)) {
+ alphacase |= 0x80;
+ }
}
+#endif /* __LOCALE_C_ONLY */
if (ppfs->conv_num <= CONV_u) { /* pointer or unsigned int */
if (ppfs->conv_num == CONV_X) {
alphacase = __UIM_UPPER;
@@ -2350,6 +2355,9 @@ static int _do_one_spec(FILE * __restrict stream,
if (ppfs->info.prec < 0) { /* Ignore '0' flag if prec specified. */
padchar = ppfs->info.pad;
}
+#ifdef __UCLIBC_MJN3_ONLY__
+#warning if using outdigits and/or grouping, how should we interpret precision?
+#endif
s = _uintmaxtostr(buf + sizeof(buf) - 1,
(uintmax_t)
_load_inttype(*argtype & __PA_INTMASK,
@@ -2557,6 +2565,9 @@ static int _do_one_spec(FILE * __restrict stream,
return -1;
}
+#ifdef __UCLIBC_MJN3_ONLY__
+#warning if using outdigits and/or grouping, how should we pad?
+#endif
{
size_t t;