mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-29 00:01:12 +00:00
Update.
* stdio-common/vfprintf.c: Handle %F format. * stdio-common/printf-parse.h (parse_one_spec): Likewise. Reported by Joseph S. Myers <jsm28@cam.ac.uk>. * stdio-common/tstdiomisc.c: Add test for %F printf format. * po/zh.po: New file.
This commit is contained in:
parent
cf970a3215
commit
6c46718f9f
@ -1,5 +1,13 @@
|
||||
2000-08-22 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* stdio-common/vfprintf.c: Handle %F format.
|
||||
* stdio-common/printf-parse.h (parse_one_spec): Likewise.
|
||||
Reported by Joseph S. Myers <jsm28@cam.ac.uk>.
|
||||
|
||||
* stdio-common/tstdiomisc.c: Add test for %F printf format.
|
||||
|
||||
* po/zh.po: New file.
|
||||
|
||||
* iconvdata/sjis.c: In conversion from UCS4, correct test for
|
||||
enough room in target buffer.
|
||||
Patch by KUSANO Takayuki <AE5T-KSN@asahi-net.or.jp> [PR libc/1865].
|
||||
|
@ -390,6 +390,7 @@ parse_one_spec (const UCHAR_T *format, size_t posn, struct printf_spec *spec,
|
||||
case L'e':
|
||||
case L'E':
|
||||
case L'f':
|
||||
case L'F':
|
||||
case L'g':
|
||||
case L'G':
|
||||
case L'a':
|
||||
|
@ -1,4 +1,8 @@
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
|
||||
int
|
||||
t1 (void)
|
||||
@ -42,6 +46,36 @@ t2 (void)
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
F (void)
|
||||
{
|
||||
char buf[20];
|
||||
wchar_t wbuf[10];
|
||||
int result;
|
||||
|
||||
snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
|
||||
DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
|
||||
result = strcmp (buf, "nan NAN") != 0;
|
||||
printf ("expected \"nan NAN\", got \"%s\"\n", buf);
|
||||
|
||||
snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX, DBL_MAX * DBL_MAX);
|
||||
result |= strcmp (buf, "inf INF") != 0;
|
||||
printf ("expected \"inf INF\", got \"%s\"\n", buf);
|
||||
|
||||
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F",
|
||||
DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
|
||||
DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
|
||||
result |= wcscmp (wbuf, L"nan NAN") != 0;
|
||||
printf ("expected L\"nan NAN\", got L\"%S\"\n", wbuf);
|
||||
|
||||
swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F",
|
||||
DBL_MAX * DBL_MAX, DBL_MAX * DBL_MAX);
|
||||
result |= wcscmp (wbuf, L"inf INF") != 0;
|
||||
printf ("expected L\"inf INF\", got L\"%S\"\n", wbuf);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@ -49,6 +83,7 @@ main (int argc, char *argv[])
|
||||
|
||||
result |= t1 ();
|
||||
result |= t2 ();
|
||||
result |= F ();
|
||||
|
||||
result |= fflush (stdout) == EOF;
|
||||
|
||||
|
@ -284,7 +284,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
/* '8' */ 8, /* '9' */ 8, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
0, /* 'A' */ 26, 0, /* 'C' */ 25,
|
||||
0, /* 'E' */ 19, 0, /* 'G' */ 19,
|
||||
0, /* 'E' */ 19, /* F */ 19, /* 'G' */ 19,
|
||||
0, /* 'I' */ 29, 0, 0,
|
||||
/* 'L' */ 12, 0, 0, 0,
|
||||
0, 0, 0, /* 'S' */ 21,
|
||||
@ -354,7 +354,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
REF (form_unsigned), /* for 'u' */ \
|
||||
REF (form_octal), /* for 'o' */ \
|
||||
REF (form_hexa), /* for 'X', 'x' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'f', 'G', 'g' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'F', 'f', 'G', 'g' */ \
|
||||
REF (form_character), /* for 'c' */ \
|
||||
REF (form_string), /* for 's', 'S' */ \
|
||||
REF (form_pointer), /* for 'p' */ \
|
||||
@ -388,7 +388,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
REF (form_unsigned), /* for 'u' */ \
|
||||
REF (form_octal), /* for 'o' */ \
|
||||
REF (form_hexa), /* for 'X', 'x' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'f', 'G', 'g' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'F', 'f', 'G', 'g' */ \
|
||||
REF (form_character), /* for 'c' */ \
|
||||
REF (form_string), /* for 's', 'S' */ \
|
||||
REF (form_pointer), /* for 'p' */ \
|
||||
@ -422,7 +422,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
REF (form_unsigned), /* for 'u' */ \
|
||||
REF (form_octal), /* for 'o' */ \
|
||||
REF (form_hexa), /* for 'X', 'x' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'f', 'G', 'g' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'F', 'f', 'G', 'g' */ \
|
||||
REF (form_character), /* for 'c' */ \
|
||||
REF (form_string), /* for 's', 'S' */ \
|
||||
REF (form_pointer), /* for 'p' */ \
|
||||
@ -456,7 +456,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
REF (form_unsigned), /* for 'u' */ \
|
||||
REF (form_octal), /* for 'o' */ \
|
||||
REF (form_hexa), /* for 'X', 'x' */ \
|
||||
REF (form_unknown), /* for 'E', 'e', 'f', 'G', 'g' */ \
|
||||
REF (form_unknown), /* for 'E', 'e', 'F', 'f', 'G', 'g' */ \
|
||||
REF (form_unknown), /* for 'c' */ \
|
||||
REF (form_unknown), /* for 's', 'S' */ \
|
||||
REF (form_unknown), /* for 'p' */ \
|
||||
@ -490,7 +490,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
REF (form_unsigned), /* for 'u' */ \
|
||||
REF (form_octal), /* for 'o' */ \
|
||||
REF (form_hexa), /* for 'X', 'x' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'f', 'G', 'g' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'F', 'f', 'G', 'g' */ \
|
||||
REF (form_character), /* for 'c' */ \
|
||||
REF (form_string), /* for 's', 'S' */ \
|
||||
REF (form_pointer), /* for 'p' */ \
|
||||
@ -526,7 +526,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
|
||||
REF (form_unsigned), /* for 'u' */ \
|
||||
REF (form_octal), /* for 'o' */ \
|
||||
REF (form_hexa), /* for 'X', 'x' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'f', 'G', 'g' */ \
|
||||
REF (form_float), /* for 'E', 'e', 'F', 'f', 'G', 'g' */ \
|
||||
REF (form_character), /* for 'c' */ \
|
||||
REF (form_string), /* for 's', 'S' */ \
|
||||
REF (form_pointer), /* for 'p' */ \
|
||||
|
Loading…
Reference in New Issue
Block a user