Changes in libcfa/src/iostream.cfa [4f37255:65240bb]
- File:
-
- 1 edited
-
libcfa/src/iostream.cfa (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r4f37255 r65240bb 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 13 08:07:59201913 // Update Count : 8 2112 // Last Modified On : Fri Jul 12 12:04:13 2019 13 // Update Count : 819 14 14 // 15 15 … … 499 499 if ( ! f.flags.left ) { \ 500 500 buf[i] = '.'; buf[i + 1] = '\0'; \ 501 if ( buf[0] == ' ' ) bufbeg = 1; /* decimal point within width */ \501 if ( buf[0] == ' ' ) bufbeg = 1; /* decimal point within width */ \ 502 502 } else { \ 503 503 for ( i = 0; i < len && buf[i] != ' '; i += 1 ); /* trailing blank ? */ \ … … 546 546 forall( dtype ostype | ostream( ostype ) ) { 547 547 ostype & ?|?( ostype & os, _Ostream_Manip(char) f ) { 548 if ( f.base != 'c' ) { // bespoke binary/octal/hex format548 if ( f.base != 'c' ) { // bespoke binary/octal/hex format 549 549 _Ostream_Manip(unsigned char) fmtuc @= { f.val, f.wd, f.pc, f.base, {'\0'} }; 550 550 fmtuc.flags.pc = f.flags.pc; … … 558 558 559 559 #define CFMTNP "% * " 560 char fmtstr[sizeof(CFMTNP)]; // sizeof includes '\0'560 char fmtstr[sizeof(CFMTNP)]; // sizeof includes '\0' 561 561 memcpy( &fmtstr, CFMTNP, sizeof(CFMTNP) ); 562 int star = 1; // position before first '*'562 int star = 1; // position before first '*' 563 563 564 564 // Insert flags into spaces before '*', from right to left. … … 566 566 fmtstr[star] = '%'; 567 567 568 fmtstr[sizeof(CFMTNP)-2] = f.base; // sizeof includes '\0'568 fmtstr[sizeof(CFMTNP)-2] = f.base; // sizeof includes '\0' 569 569 // printf( "%d %s\n", f.wd, &fmtstr[star] ); 570 570 fmt( os, &fmtstr[star], f.wd, f.val ); … … 631 631 else { 632 632 fprintf( stderr, "invalid Boolean constant\n" ); 633 abort(); // cannot use abort stream633 abort(); 634 634 } // if 635 635 return is; … … 639 639 char temp; 640 640 for () { 641 fmt( is, "%c", &temp ); // must pass pointer through varg to fmt641 fmt( is, "%c", &temp ); // must pass pointer through varg to fmt 642 642 // do not overwrite parameter with newline unless appropriate 643 643 if ( temp != '\n' || getANL( is ) ) { c = temp; break; } … … 773 773 if ( ! f.s ) { 774 774 // printf( "skip %s %d\n", f.scanset, f.wd ); 775 if ( f.wd == -1 ) fmt( is, f.scanset, "" ); // no input arguments775 if ( f.wd == -1 ) fmt( is, f.scanset, "" ); // no input arguments 776 776 else for ( f.wd ) fmt( is, "%*c" ); 777 777 return is;
Note:
See TracChangeset
for help on using the changeset viewer.