- Updated msvcrt winetests introduced new printf testcases and new failures - fixed:

- Special qualifiers with short gG formats may even skip all decimal digits, but the separator is applied nonetheless
- Padding spaces on the right caused problems in exponential format, because those are split into two parts, the padding was done in between
- Failing fwprintf test was removed from the tests, so the printf test is passed completely now

svn path=/trunk/; revision=37740
This commit is contained in:
Gregor Schneider
2008-11-29 19:39:53 +00:00
parent c47ab26e82
commit a8e8a546b6
+17 -7
View File
@@ -166,6 +166,7 @@ numberf(char * buf, char * end, double num, char exp_sign, int size, int precisi
int i = 0;
int j = 0;
int ro = 0;
int isize;
double frac, intr;
double p;
@@ -194,6 +195,7 @@ numberf(char * buf, char * end, double num, char exp_sign, int size, int precisi
exp_sign -= 2; // g -> e and G -> E
else
exp_sign = 'f';
if (type & SPECIAL) precision--;
}
if ( exp_sign == 'e' || exp_sign == 'E' )
@@ -210,6 +212,13 @@ numberf(char * buf, char * end, double num, char exp_sign, int size, int precisi
/* size-5 because "e+abc" is going to follow */
buf = numberf(buf, end, num/pow(10.0L,(long double)e), 'f', size-5, precision, type);
isize = 4;
while(*(buf-1) == ' ')
{
isize++;
--buf;
}
if (buf <= end)
*buf = exp_sign;
++buf;
@@ -217,7 +226,7 @@ numberf(char * buf, char * end, double num, char exp_sign, int size, int precisi
ie = (long)e;
type = LEFT | SIGN | PLUS;
buf = number(buf, end, ie, 10, 3, 3, type);
buf = number(buf, end, ie, 10, isize, 3, type);
return buf;
}
@@ -259,16 +268,17 @@ numberf(char * buf, char * end, double num, char exp_sign, int size, int precisi
digits[i] = (int)p + '0';
i--;
}
i = precision;
size -= precision;
if ( precision >= 1 || type & SPECIAL)
{
digits[i++] = '.';
size--;
}
}
if ( precision >= 1 || type & SPECIAL)
{
digits[i++] = '.';
size--;
}
ro = 0;
if ( frac > 0.5 )
{