Changes in / [1cfdee9:5c08a1a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r1cfdee9 r5c08a1a 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 5 15:56:16202013 // Update Count : 8 3412 // Last Modified On : Wed Mar 11 14:35:35 2020 13 // Update Count : 860 14 14 // 15 15 … … 534 534 #define IntegralFMTImpl128( T, SIGNED, CODE, IFMTNP, IFMTP ) \ 535 535 forall( dtype ostype | ostream( ostype ) ) \ 536 static void base10_128( ostype & os, _Ostream_Manip(T) fmt ) { \ 537 if ( fmt.val > UINT64_MAX ) { \ 538 base10_128( os, fmt.val / P10_UINT64 ); /* recursive */ \ 539 _Ostream_Manip(unsigned long long int) fmt2 @= { (uint64_t)(fmt.val % P10_UINT64), 0, 19, 'u', { .all : 0 } }; \ 540 fmt2.flags.nobsdp = true; \ 541 printf( "fmt2 %c %lld %d\n", fmt2.base, fmt2.val, fmt2.all ); \ 536 static void base10_128( ostype & os, _Ostream_Manip(T) f ) { \ 537 if ( f.val > UINT64_MAX ) { \ 538 unsigned long long int lsig = f.val % P10_UINT64; \ 539 f.val /= P10_UINT64; /* msig */ \ 540 base10_128( os, f ); /* recursion */ \ 541 _Ostream_Manip(unsigned long long int) fmt @= { lsig, 0, 19, 'u', { .all : 0 } }; \ 542 fmt.flags.nobsdp = true; \ 543 /* printf( "fmt1 %c %lld %d\n", fmt.base, fmt.val, fmt.all ); */ \ 542 544 sepOff( os ); \ 543 (ostype &)(os | fmt 2); \545 (ostype &)(os | fmt); \ 544 546 } else { \ 545 printf( "fmt %c %lld %d\n", fmt.base, (unsigned long long int)fmt.val, fmt.all );\546 _Ostream_Manip(SIGNED long long int) x @= { (unsigned long long int)fmt.val, fmt.wd, fmt.pc, fmt.base, { .all : fmt.all } }; \547 (ostype &)(os | x); \547 /* printf( "fmt2 %c %lld %d\n", f.base, (unsigned long long int)f.val, f.all ); */ \ 548 _Ostream_Manip(SIGNED long long int) fmt @= { (SIGNED long long int)f.val, f.wd, f.pc, f.base, { .all : f.all } }; \ 549 (ostype &)(os | fmt); \ 548 550 } /* if */ \ 549 } /* base10_128 */ 551 } /* base10_128 */ \ 550 552 forall( dtype ostype | ostream( ostype ) ) { \ 551 553 ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \ … … 564 566 if ( f.base == 'b' | f.base == 'B' ) { \ 565 567 if ( f.wd > 64 ) fmt.wd = f.wd - 64; \ 568 if ( f.flags.pc && f.pc > 64 ) fmt.pc = f.pc - 64; \ 566 569 fmt2.wd = 64; \ 567 570 (ostype &)(os | fmt | "" | fmt2); \ … … 569 572 fmt.val = (unsigned long long int)fmt.val >> 2; \ 570 573 if ( f.wd > 21 ) fmt.wd = f.wd - 21; \ 574 if ( f.flags.pc && f.pc > 21 ) fmt.pc = f.pc - 21; \ 571 575 fmt2.wd = 1; \ 572 576 fmt2.val = ((msig & 0x3) << 1) + 1; \ … … 578 582 } else { \ 579 583 if ( f.flags.left ) { \ 580 if ( f.wd > 16 ) fmt2.wd = f.wd - 16; 581 fmt.wd = 16; 584 if ( f.wd > 16 ) fmt2.wd = f.wd - 16; \ 585 fmt.wd = 16; \ 582 586 } else { \ 583 if ( f.wd > 16 ) fmt.wd = f.wd - 16; \ 584 fmt2.wd = 16; \ 587 if ( f.wd > 16 ) fmt.wd = f.wd - 16; \ 588 if ( f.flags.pc && f.pc > 16 ) fmt.pc = f.pc - 16; \ 589 fmt2.wd = 16; \ 585 590 } /* if */ \ 586 591 (ostype &)(os | fmt | "" | fmt2); \ … … 588 593 } /* if */ \ 589 594 } else { \ 595 if ( CODE == 'd' ) { \ 596 if ( f.val < 0 ) { fmt( os, "-" ); sepOff( os ); f.val = -f.val; f.flags.sign = false; } \ 597 } /* if */ \ 590 598 base10_128( os, f ); \ 591 599 } /* if */ \
Note: See TracChangeset
for help on using the changeset viewer.