Changeset ac9ba12
- Timestamp:
- Jul 6, 2020, 4:47:01 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6437ce4
- Parents:
- 82bbaf4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r82bbaf4 rac9ba12 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Jul 5 08:14:07202013 // Update Count : 106 312 // Last Modified On : Mon Jul 6 08:49:48 2020 13 // Update Count : 1064 14 14 // 15 15 … … 674 674 base_128( os, val / power, power, f, maxdig, bits, cnt + 1 ); // recursive 675 675 f.val = val % power; 676 if ( cnt == 1 && f.flags.left ) { wd = f.wd; f.wd = maxdig; } // copy f.wd a cross printing of middle value676 if ( cnt == 1 && f.flags.left ) { wd = f.wd; f.wd = maxdig; } // copy f.wd and reset for printing middle chunk 677 677 (ostype &)(os | f); 678 678 if ( cnt == 1 ) { 679 if ( f.flags.left ) { wd -= maxdig; f.wd = wd < 0 ? 1 : wd; } 679 if ( f.flags.left ) { wd -= maxdig; f.wd = wd < 0 ? 1 : wd; } // update and restore f.wd for printing end chunk 680 680 sepOff( os ); // no seperator between chunks 681 681 } // if 682 } else { 682 } else { // print start chunk 683 683 f.val = val; 684 684 // f.pc is unsigned => use wd … … 693 693 if ( cnt != 0 ) { // value >= 2^64 ? 694 694 unsigned int dig, bs = 0; 695 // compute size of prefix base and digits695 // compute size of prefix digits and base 696 696 if ( f.base == 'd' || f.base == 'u' ) { // no base prefix 697 697 dig = ceil( log10( f.val ) ); // use floating-point … … 717 717 (ostype &)(os | f); 718 718 719 // remaining middle and end chunks are padded with 0s on the left 719 720 if ( ! f.flags.left ) { f.flags.pad0 = true; f.flags.pc = false; } // left pad with 0s 720 721 else { f.pc = maxdig; f.flags.pc = true; } // left pad with precision 722 721 723 if ( cnt != 0 ) sepOff( os ); // no seperator between chunks 722 f.wd = wd; 723 f.flags.sign = false; // no +/- sign724 f.flags.nobsdp = true; // no base prefix724 f.wd = wd; // reset f.wd for next chunk 725 f.flags.sign = false; // no leading +/- sign 726 f.flags.nobsdp = true; // no leading base prefix 725 727 } // if 726 728 } // base_128
Note: See TracChangeset
for help on using the changeset viewer.