10 #define alloca _alloca
13 typedef __int64 LONGLONG
;
14 typedef unsigned __int64 ULONGLONG
;
17 unsigned int mantissa
:23;
18 unsigned int exponent
:8;
23 unsigned int mantissal
:32;
24 unsigned int mantissah
:20;
25 unsigned int exponent
:11;
30 unsigned int mantissal
:32;
31 unsigned int mantissah
:32;
32 unsigned int exponent
:15;
34 unsigned int empty
:16;
38 ssprintf ( const char* fmt
, ... )
42 std::string f
= ssvprintf ( fmt
, arg
);
48 sswprintf ( const wchar_t* fmt
, ... )
52 std::wstring f
= sswvprintf ( fmt
, arg
);
57 #define ZEROPAD 1 /* pad with zero */
58 #define SIGN 2 /* unsigned/signed long */
59 #define PLUS 4 /* show plus */
60 #define SPACE 8 /* space if plus */
61 #define LEFT 16 /* left justified */
62 #define SPECIAL 32 /* 0x */
63 #define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */
64 #define ZEROTRUNC 128 /* truncate zero 's */
68 skip_atoi(const char **s
)
73 i
= i
*10 + *((*s
)++) - '0';
78 skip_wtoi(const wchar_t **s
)
83 i
= i
*10 + *((*s
)++) - L
'0';
89 do_div(LONGLONG
*n
,int base
)
91 int __res
= ((ULONGLONG
) *n
) % (unsigned) base
;
92 *n
= ((ULONGLONG
) *n
) / (unsigned) base
;
98 number(std::string
& f
, LONGLONG num
, int base
, int size
, int precision
,int type
)
101 const char *digits
="0123456789abcdefghijklmnopqrstuvwxyz";
105 digits
= "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
108 if (base
< 2 || base
> 36)
110 c
= (type
& ZEROPAD
) ? '0' : ' ';
117 } else if (type
& PLUS
) {
120 } else if (type
& SPACE
) {
125 if (type
& SPECIAL
) {
134 else while (num
!= 0)
135 tmp
[i
++] = digits
[do_div(&num
,base
)];
139 if (!(type
&(ZEROPAD
+LEFT
)))
159 while (i
< precision
--)
175 wnumber(std::wstring
& f
, LONGLONG num
, int base
, int size
, int precision
,int type
)
177 wchar_t c
,sign
,tmp
[66];
178 const wchar_t *digits
= L
"0123456789abcdefghijklmnopqrstuvwxyz";
182 digits
= L
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
185 if (base
< 2 || base
> 36)
187 c
= (type
& ZEROPAD
) ? L
'0' : L
' ';
194 } else if (type
& PLUS
) {
197 } else if (type
& SPACE
) {
202 if (type
& SPECIAL
) {
211 else while (num
!= 0)
212 tmp
[i
++] = digits
[do_div(&num
,base
)];
216 if (!(type
&(ZEROPAD
+LEFT
)))
236 while (i
< precision
--)
253 numberf(std::string
& f
, double __n
, char exp_sign
, int size
, int precision
, int type
)
255 double exponent
= 0.0;
280 if ( exp_sign
== 'g' || exp_sign
== 'G' || exp_sign
== 'e' || exp_sign
== 'E' ) {
281 ie
= ((unsigned int)n
.n
->exponent
- (unsigned int)0x3ff);
282 exponent
= ie
/3.321928;
285 if ( exp_sign
== 'g' || exp_sign
== 'G' ) {
287 if ( exponent
< -4 || fabs(exponent
) >= precision
)
288 exp_sign
-= 2; // g -> e and G -> E
291 if ( exp_sign
== 'e' || exp_sign
== 'E' ) {
292 frac
= modf(exponent
,&e
);
295 else if ( frac
< -0.5 )
298 result
= numberf(f
,__n
/pow(10.0L,e
),'f',size
-4, precision
, type
);
308 result
= number(f
,ie
, 10,2, 2,type
);
314 if ( exp_sign
== 'f' ) {
315 buf
= (char*)alloca(4096);
320 c
= (type
& ZEROPAD
) ? '0' : ' ';
327 } else if (type
& PLUS
) {
330 } else if (type
& SPACE
) {
336 frac
= modf(__n
,&intr
);
338 // # flags forces a . and prevents trucation of trailing zero's
340 if ( precision
> 0 ) {
341 //frac = modfl(__n,&intr);
345 frac
= modf(frac
, &p
);
346 buf
[i
] = (int)p
+ '0';
357 if ( precision
>= 1 || type
& SPECIAL
) {
368 while ( intr
> 0.0 ) {
375 buf
[i
++] = (int)p
+ '0';
381 while ( j
< i
&& ro
== 1) {
382 if ( buf
[j
] >= '0' && buf
[j
] <= '8' ) {
386 else if ( buf
[j
] == '9' ) {
397 if (!(type
&(ZEROPAD
+LEFT
)))
407 if (!(type
&(ZEROPAD
+LEFT
)))
412 if (type
& SPECIAL
) {
422 if ( type
& ZEROTRUNC
&& ((type
& SPECIAL
) != SPECIAL
) )
425 while ( j
< i
&& ( *tmp
== '0' || *tmp
== '.' ))
432 // while (i < precision--)
447 wnumberf(std::wstring
& f
, double __n
, wchar_t exp_sign
, int size
, int precision
, int type
)
449 double exponent
= 0.0;
458 wchar_t *buf
, *tmp
, sign
, c
, ro
= 0;
469 if ( exp_sign
== L
'g' || exp_sign
== L
'G' || exp_sign
== L
'e' || exp_sign
== L
'E' ) {
470 ie
= ((unsigned int)n
.n
->exponent
- (unsigned int)0x3ff);
471 exponent
= ie
/3.321928;
474 if ( exp_sign
== L
'g' || exp_sign
== L
'G' )
477 if ( exponent
< -4 || fabs(exponent
) >= precision
)
478 exp_sign
-= 2; // g -> e and G -> E
481 if ( exp_sign
== L
'e' || exp_sign
== L
'E' )
483 frac
= modf(exponent
,&e
);
486 else if ( frac
< -0.5 )
489 result
= wnumberf(f
,__n
/pow(10.0L,e
),L
'f',size
-4, precision
, type
);
499 result
= wnumber(f
,ie
, 10,2, 2,type
);
505 if ( exp_sign
== L
'f' )
507 buf
= (wchar_t*)alloca(4096*sizeof(wchar_t));
511 c
= (type
& ZEROPAD
) ? L
'0' : L
' ';
521 else if (type
& PLUS
)
526 else if (type
& SPACE
)
533 frac
= modf(__n
,&intr
);
535 // # flags forces a . and prevents trucation of trailing zero's
537 if ( precision
> 0 ) {
538 //frac = modfl(__n,&intr);
542 frac
= modf(frac
, &p
);
543 buf
[i
] = (int)p
+ L
'0';
554 if ( precision
>= 1 || type
& SPECIAL
) {
565 while ( intr
> 0.0 ) {
572 buf
[i
++] = (int)p
+ L
'0';
578 while ( j
< i
&& ro
== 1) {
579 if ( buf
[j
] >= L
'0' && buf
[j
] <= L
'8' ) {
583 else if ( buf
[j
] == L
'9' ) {
594 if (!(type
&(ZEROPAD
+LEFT
)))
604 if (!(type
&(ZEROPAD
+LEFT
)))
609 if (type
& SPECIAL
) {
619 if ( type
& ZEROTRUNC
&& ((type
& SPECIAL
) != SPECIAL
) )
622 while ( j
< i
&& ( *tmp
== L
'0' || *tmp
== L
'.' ))
641 numberfl(std::string
& f
, long double __n
, char exp_sign
, int size
, int precision
, int type
)
643 long double exponent
= 0.0;
653 long double frac
, intr
;
664 ieee_long_double_t
* n
;
669 if ( exp_sign
== 'g' || exp_sign
== 'G' || exp_sign
== 'e' || exp_sign
== 'E' ) {
670 ie
= ((unsigned int)n
.n
->exponent
- (unsigned int)0x3fff);
671 exponent
= ie
/3.321928;
674 if ( exp_sign
== 'g' || exp_sign
== 'G' ) {
676 if ( exponent
< -4 || fabs(exponent
) >= precision
)
677 exp_sign
-= 2; // g -> e and G -> E
680 if ( exp_sign
== 'e' || exp_sign
== 'E' ) {
681 frac
= modfl(exponent
,&e
);
684 else if ( frac
< -0.5 )
687 result
= numberf(f
,__n
/powl(10.0L,e
),'f',size
-4, precision
, type
);
697 result
= number(f
,ie
, 10,2, 2,type
);
703 if ( exp_sign
== 'f' )
706 buf
= (char*)alloca(4096);
712 c
= (type
& ZEROPAD
) ? '0' : ' ';
721 } else if (type
& PLUS
)
725 } else if (type
& SPACE
)
732 frac
= modfl(__n
,&intr
);
734 // # flags forces a . and prevents trucation of trailing zero's
737 //frac = modfl(__n,&intr);
743 frac
= modfl((long double)frac
, &p
);
744 buf
[i
] = (int)p
+ '0';
756 if ( precision
>= 1 || type
& SPECIAL
)
778 buf
[i
++] = (int)p
+ '0';
784 while ( j
< i
&& ro
== 1) {
785 if ( buf
[j
] >= '0' && buf
[j
] <= '8' )
790 else if ( buf
[j
] == '9' )
802 if (!(type
&(ZEROPAD
+LEFT
)))
812 if (!(type
&(ZEROPAD
+LEFT
)))
817 if (type
& SPECIAL
) {
826 if ( type
& ZEROTRUNC
&& ((type
& SPECIAL
) != SPECIAL
) )
829 while ( j
< i
&& ( *tmp
== '0' || *tmp
== '.' ))
848 wnumberfl(std::wstring
& f
, long double __n
, wchar_t exp_sign
, int size
, int precision
, int type
)
850 long double exponent
= 0.0;
854 wchar_t *buf
, *tmp
, sign
, c
, ro
= 0;
858 long double frac
, intr
;
866 ieee_long_double_t
* n
;
871 if ( exp_sign
== L
'g' || exp_sign
== L
'G' || exp_sign
== L
'e' || exp_sign
== L
'E' ) {
872 ie
= ((unsigned int)n
.n
->exponent
- (unsigned int)0x3fff);
873 exponent
= ie
/3.321928;
876 if ( exp_sign
== L
'g' || exp_sign
== L
'G' ) {
878 if ( exponent
< -4 || fabs(exponent
) >= precision
)
879 exp_sign
-= 2; // g -> e and G -> E
882 if ( exp_sign
== L
'e' || exp_sign
== L
'E' ) {
883 frac
= modfl(exponent
,&e
);
886 else if ( frac
< -0.5 )
889 result
= wnumberf(f
,__n
/powl(10.0L,e
),L
'f',size
-4, precision
, type
);
899 result
= wnumber(f
,ie
, 10,2, 2,type
);
905 if ( exp_sign
== L
'f' )
908 buf
= (wchar_t*)alloca(4096*sizeof(wchar_t));
914 c
= (type
& ZEROPAD
) ? L
'0' : L
' ';
923 } else if (type
& PLUS
)
927 } else if (type
& SPACE
)
934 frac
= modfl(__n
,&intr
);
936 // # flags forces a . and prevents trucation of trailing zero's
939 //frac = modfl(__n,&intr);
945 frac
= modfl((long double)frac
, &p
);
946 buf
[i
] = (int)p
+ L
'0';
958 if ( precision
>= 1 || type
& SPECIAL
)
980 buf
[i
++] = (int)p
+ L
'0';
986 while ( j
< i
&& ro
== 1) {
987 if ( buf
[j
] >= L
'0' && buf
[j
] <= L
'8' )
992 else if ( buf
[j
] == L
'9' )
1004 if (!(type
&(ZEROPAD
+LEFT
)))
1014 if (!(type
&(ZEROPAD
+LEFT
)))
1019 if (type
& SPECIAL
) {
1028 if ( type
& ZEROTRUNC
&& ((type
& SPECIAL
) != SPECIAL
) )
1031 while ( j
< i
&& ( *tmp
== L
'0' || *tmp
== L
'.' ))
1050 do_string(std::string
& f
, const char* s
, int len
, int field_width
, int precision
, int flags
)
1063 while ((unsigned int)len
< (unsigned int)precision
&& s
[len
])
1068 if ((unsigned int)len
> (unsigned int)precision
)
1072 if (!(flags
& LEFT
))
1073 while (len
< field_width
--)
1078 for (i
= 0; i
< len
; ++i
)
1083 while (len
< field_width
--)
1092 do_wstring(std::wstring
& f
, const wchar_t* s
, int len
, int field_width
, int precision
, int flags
)
1105 while ((unsigned int)len
< (unsigned int)precision
&& s
[len
])
1110 if ((unsigned int)len
> (unsigned int)precision
)
1114 if (!(flags
& LEFT
))
1115 while (len
< field_width
--)
1120 for (i
= 0; i
< len
; ++i
)
1125 while (len
< field_width
--)
1134 stringw(std::string
& f
, const wchar_t* sw
, int len
, int field_width
, int precision
, int flags
)
1147 while ((unsigned int)len
< (unsigned int)precision
&& sw
[len
])
1152 if ((unsigned int)len
> (unsigned int)precision
)
1156 if (!(flags
& LEFT
))
1157 while (len
< field_width
--)
1162 for (i
= 0; i
< len
; ++i
)
1164 #define MY_MB_CUR_MAX 1
1165 char mb
[MY_MB_CUR_MAX
];
1167 mbcount
= wctomb(mb
, *sw
++);
1172 for (j
= 0; j
< mbcount
; j
++)
1178 while (len
< field_width
--)
1187 wstringa(std::wstring
& f
, const char* sa
, int len
, int field_width
, int precision
, int flags
)
1200 while ((unsigned int)len
< (unsigned int)precision
&& sa
[len
])
1205 if ((unsigned int)len
> (unsigned int)precision
)
1209 if (!(flags
& LEFT
))
1210 while (len
< field_width
--)
1215 for (i
= 0; i
< len
;)
1219 mbcount
= mbtowc(&w
, sa
, len
-i
);
1226 while (len
< field_width
--)
1234 #define _isnanl _isnan
1235 #define _finitel _finite
1238 ssvprintf ( const char *fmt
, va_list args
)
1242 long double _ldouble
;
1249 int flags
; /* flags to number() */
1251 int field_width
; /* width of output field */
1252 int precision
; /* min. # of digits for integers; max
1253 number of chars for from string */
1254 int qualifier
= 0; /* 'h', 'l', 'L' or 'I64' for integer fields */
1256 for (; *fmt
; ++fmt
)
1267 ++fmt
; /* this also skips first '%' */
1269 case '-': flags
|= LEFT
; goto repeat
;
1270 case '+': flags
|= PLUS
; goto repeat
;
1271 case ' ': flags
|= SPACE
; goto repeat
;
1272 case '#': flags
|= SPECIAL
; goto repeat
;
1273 case '0': flags
|= ZEROPAD
; goto repeat
;
1276 /* get field width */
1279 field_width
= skip_atoi(&fmt
);
1280 else if (*fmt
== '*') {
1282 /* it's the next argument */
1283 field_width
= va_arg(args
, int);
1284 if (field_width
< 0) {
1285 field_width
= -field_width
;
1290 /* get the precision */
1295 precision
= skip_atoi(&fmt
);
1296 else if (*fmt
== '*') {
1298 /* it's the next argument */
1299 precision
= va_arg(args
, int);
1305 /* get the conversion qualifier */
1307 // %Z can be just stand alone or as size_t qualifier
1308 if ( *fmt
== 'Z' ) {
1310 switch ( *(fmt
+1)) {
1323 } else if (*fmt
== 'h' || *fmt
== 'l' || *fmt
== 'L' || *fmt
== 'w') {
1326 } else if (*fmt
== 'I' && *(fmt
+1) == '6' && *(fmt
+2) == '4') {
1331 // go fine with ll instead of L
1332 if ( *fmt
== 'l' ) {
1342 if (!(flags
& LEFT
))
1343 while (--field_width
> 0)
1347 if (qualifier
== 'l' || qualifier
== 'w')
1349 f
+= (char)(unsigned char)(wchar_t) va_arg(args
,int);
1353 f
+= (char)(unsigned char) va_arg(args
,int);
1355 while (--field_width
> 0)
1362 if (!(flags
& LEFT
))
1363 while (--field_width
> 0)
1367 if (qualifier
== 'h')
1369 f
+= (char)(unsigned char) va_arg(args
,int);
1373 f
+= (char)(unsigned char)(wchar_t) va_arg(args
,int);
1375 while (--field_width
> 0)
1382 if (qualifier
== 'l' || qualifier
== 'w') {
1383 /* print unicode string */
1384 sw
= va_arg(args
, wchar_t *);
1385 result
= stringw(f
, sw
, -1, field_width
, precision
, flags
);
1387 /* print ascii string */
1388 s
= va_arg(args
, char *);
1389 result
= do_string(f
, s
, -1, field_width
, precision
, flags
);
1393 assert(!"TODO FIXME handle error better");
1399 if (qualifier
== 'h') {
1400 /* print ascii string */
1401 s
= va_arg(args
, char *);
1402 result
= do_string(f
, s
, -1, field_width
, precision
, flags
);
1404 /* print unicode string */
1405 sw
= va_arg(args
, wchar_t *);
1406 result
= stringw(f
, sw
, -1, field_width
, precision
, flags
);
1410 assert(!"TODO FIXME handle error better");
1416 if (qualifier == 'w') {
1417 // print counted unicode string
1418 PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING);
1419 if ((pus == NULL) || (pus->Buffer == NULL)) {
1424 len = pus->Length / sizeof(WCHAR);
1426 result = stringw(f, sw, len, field_width, precision, flags);
1428 // print counted ascii string
1429 PANSI_STRING pas = va_arg(args, PANSI_STRING);
1430 if ((pas == NULL) || (pas->Buffer == NULL)) {
1437 result = string(f, s, -1, field_width, precision, flags);
1448 if (qualifier
== 'l' || qualifier
== 'L' ) {
1449 _ldouble
= va_arg(args
, long double);
1451 if ( _isnanl(_ldouble
) )
1455 else if ( !_finitel(_ldouble
) )
1462 if ( precision
== -1 )
1464 result
= numberfl(f
,_ldouble
,*fmt
,field_width
,precision
,flags
);
1467 assert(!"TODO FIXME handle error better");
1472 _double
= (double)va_arg(args
, double);
1474 if ( _isnan(_double
) )
1478 else if ( !_finite(_double
) )
1487 if ( precision
== -1 )
1489 result
= numberf(f
,_double
,*fmt
,field_width
,precision
,flags
);
1492 assert(!"TODO FIXME handle error better");
1500 if (field_width
== -1) {
1501 field_width
= 2*sizeof(void *);
1505 (unsigned long) va_arg(args
, void *), 16,
1506 field_width
, precision
, flags
);
1509 assert(!"TODO FIXME handle error better");
1515 if (qualifier
== 'l') {
1516 long * ip
= va_arg(args
, long *);
1519 int * ip
= va_arg(args
, int *);
1524 /* integer number formats - set up the flags and "break" */
1559 if (qualifier
== 'I')
1560 num
= va_arg(args
, ULONGLONG
);
1561 else if (qualifier
== 'l') {
1563 num
= va_arg(args
, long);
1565 num
= va_arg(args
, unsigned long);
1567 else if (qualifier
== 'h') {
1569 num
= va_arg(args
, int);
1571 num
= va_arg(args
, unsigned int);
1573 else if (flags
& SIGN
)
1574 num
= va_arg(args
, int);
1576 num
= va_arg(args
, unsigned int);
1577 result
= number(f
, num
, base
, field_width
, precision
, flags
);
1580 assert(!"TODO FIXME handle error better");
1589 sswvprintf ( const wchar_t* fmt
, va_list args
)
1593 long double _ldouble
;
1600 int flags
; /* flags to number() */
1602 int field_width
; /* width of output field */
1603 int precision
; /* min. # of digits for integers; max
1604 number of chars for from string */
1605 int qualifier
= 0; /* 'h', 'l', 'L' or 'I64' for integer fields */
1607 for (; *fmt
; ++fmt
)
1618 ++fmt
; /* this also skips first '%' */
1620 case L
'-': flags
|= LEFT
; goto repeat
;
1621 case L
'+': flags
|= PLUS
; goto repeat
;
1622 case L
' ': flags
|= SPACE
; goto repeat
;
1623 case L
'#': flags
|= SPECIAL
; goto repeat
;
1624 case L
'0': flags
|= ZEROPAD
; goto repeat
;
1627 /* get field width */
1630 field_width
= skip_wtoi(&fmt
);
1631 else if (*fmt
== L
'*') {
1633 /* it's the next argument */
1634 field_width
= va_arg(args
, int);
1635 if (field_width
< 0) {
1636 field_width
= -field_width
;
1641 /* get the precision */
1646 precision
= skip_wtoi(&fmt
);
1647 else if (*fmt
== L
'*') {
1649 /* it's the next argument */
1650 precision
= va_arg(args
, int);
1656 /* get the conversion qualifier */
1658 // %Z can be just stand alone or as size_t qualifier
1659 if ( *fmt
== L
'Z' ) {
1661 switch ( *(fmt
+1)) {
1674 } else if (*fmt
== L
'h' || *fmt
== L
'l' || *fmt
== L
'L' || *fmt
== L
'w') {
1677 } else if (*fmt
== L
'I' && *(fmt
+1) == L
'6' && *(fmt
+2) == L
'4') {
1682 // go fine with ll instead of L
1683 if ( *fmt
== L
'l' ) {
1693 if (!(flags
& LEFT
))
1694 while (--field_width
> 0)
1698 if ( qualifier
== L
'h' )
1700 f
+= (wchar_t)(char)(unsigned char) va_arg(args
,int);
1704 f
+= (wchar_t) va_arg(args
,int);
1706 while (--field_width
> 0)
1713 if (!(flags
& LEFT
))
1714 while (--field_width
> 0)
1718 if (qualifier
== L
'l' || qualifier
== L
'w')
1720 f
+= (wchar_t) va_arg(args
,int);
1724 f
+= (wchar_t)(char)(unsigned char) va_arg(args
,int);
1726 while (--field_width
> 0)
1733 if (qualifier
== L
'h') {
1734 /* print ascii string */
1735 sa
= va_arg(args
, char *);
1736 result
= wstringa(f
, sa
, -1, field_width
, precision
, flags
);
1738 /* print unicode string */
1739 s
= va_arg(args
, wchar_t *);
1740 result
= do_wstring(f
, s
, -1, field_width
, precision
, flags
);
1744 assert(!"TODO FIXME handle error better");
1750 if (qualifier
== L
'l' || qualifier
== L
'w') {
1751 /* print unicode string */
1752 s
= va_arg(args
, wchar_t *);
1753 result
= do_wstring(f
, s
, -1, field_width
, precision
, flags
);
1755 /* print ascii string */
1756 sa
= va_arg(args
, char *);
1757 result
= wstringa(f
, sa
, -1, field_width
, precision
, flags
);
1761 assert(!"TODO FIXME handle error better");
1771 if (qualifier
== L
'l' || qualifier
== L
'L' )
1773 _ldouble
= va_arg(args
, long double);
1775 if ( _isnanl(_ldouble
) )
1779 else if ( !_finitel(_ldouble
) )
1786 if ( precision
== -1 )
1788 result
= wnumberfl(f
,_ldouble
,*fmt
,field_width
,precision
,flags
);
1791 assert(!"TODO FIXME handle error better");
1796 _double
= (double)va_arg(args
, double);
1798 if ( _isnan(_double
) )
1802 else if ( !_finite(_double
) )
1811 if ( precision
== -1 )
1813 result
= wnumberf(f
,_double
,*fmt
,field_width
,precision
,flags
);
1816 assert(!"TODO FIXME handle error better");
1824 if (field_width
== -1) {
1825 field_width
= 2*sizeof(void *);
1829 (unsigned long) va_arg(args
, void *), 16,
1830 field_width
, precision
, flags
);
1833 assert(!"TODO FIXME handle error better");
1839 if (qualifier
== L
'l') {
1840 long * ip
= va_arg(args
, long *);
1843 int * ip
= va_arg(args
, int *);
1848 /* integer number formats - set up the flags and "break" */
1883 if (qualifier
== L
'I')
1884 num
= va_arg(args
, ULONGLONG
);
1885 else if (qualifier
== L
'l') {
1887 num
= va_arg(args
, long);
1889 num
= va_arg(args
, unsigned long);
1891 else if (qualifier
== L
'h') {
1893 num
= va_arg(args
, int);
1895 num
= va_arg(args
, unsigned int);
1897 else if (flags
& SIGN
)
1898 num
= va_arg(args
, int);
1900 num
= va_arg(args
, unsigned int);
1901 result
= wnumber(f
, num
, base
, field_width
, precision
, flags
);
1904 assert(!"TODO FIXME handle error better");