Bug 1686831 - Add support for %F and %G, and properly support %n$E. r=nika,Gankra

%F and %G are the same as %f and %g, but using caps for the exponent
indicator, and for "inf"/"nan" for infinity and NaN.

%n$E is the same as %E, but taking the nth argument.

Differential Revision: https://phabricator.services.mozilla.com/D102695
This commit is contained in:
Mike Hommey 2021-01-27 01:06:22 +00:00
Родитель ae6a8b5554
Коммит 4c520112c0
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -491,8 +491,11 @@ static bool BuildArgArray(const char* fmt, va_list ap, NumArgStateVector& nas) {
break;
case 'e':
case 'E':
case 'f':
case 'F':
case 'g':
case 'G':
nas[cn].type = TYPE_DOUBLE;
break;
@ -825,7 +828,9 @@ bool mozilla::PrintfTarget::vprint(const char* fmt, va_list ap) {
case 'e':
case 'E':
case 'f':
case 'F':
case 'g':
case 'G':
u.d = va_arg(ap, double);
if (!nas.empty()) {
i = fmt - dolPt;