Changes in libcfa/src/iostream.cfa [c8371b5:6a33e40]
- File:
-
- 1 edited
-
libcfa/src/iostream.cfa (modified) (24 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
rc8371b5 r6a33e40 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Oct 10 09:28:17 202113 // Update Count : 13 4512 // Last Modified On : Wed Jan 19 08:15:53 2022 13 // Update Count : 1352 14 14 // 15 15 … … 57 57 ostype & ?|?( ostype & os, signed char sc ) { 58 58 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 59 fmt( os, "% hhd", sc );59 fmt( os, "%'hhd", sc ); 60 60 return os; 61 61 } // ?|? … … 66 66 ostype & ?|?( ostype & os, unsigned char usc ) { 67 67 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 68 fmt( os, "% hhu", usc );68 fmt( os, "%'hhu", usc ); 69 69 return os; 70 70 } // ?|? … … 75 75 ostype & ?|?( ostype & os, short int si ) { 76 76 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 77 fmt( os, "% hd", si );77 fmt( os, "%'hd", si ); 78 78 return os; 79 79 } // ?|? … … 84 84 ostype & ?|?( ostype & os, unsigned short int usi ) { 85 85 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 86 fmt( os, "% hu", usi );86 fmt( os, "%'hu", usi ); 87 87 return os; 88 88 } // ?|? … … 93 93 ostype & ?|?( ostype & os, int i ) { 94 94 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 95 fmt( os, "% d", i );95 fmt( os, "%'d", i ); 96 96 return os; 97 97 } // ?|? … … 102 102 ostype & ?|?( ostype & os, unsigned int ui ) { 103 103 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 104 fmt( os, "% u", ui );104 fmt( os, "%'u", ui ); 105 105 return os; 106 106 } // ?|? … … 111 111 ostype & ?|?( ostype & os, long int li ) { 112 112 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 113 fmt( os, "% ld", li );113 fmt( os, "%'ld", li ); 114 114 return os; 115 115 } // ?|? … … 120 120 ostype & ?|?( ostype & os, unsigned long int uli ) { 121 121 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 122 fmt( os, "% lu", uli );122 fmt( os, "%'lu", uli ); 123 123 return os; 124 124 } // ?|? … … 129 129 ostype & ?|?( ostype & os, long long int lli ) { 130 130 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 131 fmt( os, "% lld", lli );131 fmt( os, "%'lld", lli ); 132 132 return os; 133 133 } // ?|? … … 138 138 ostype & ?|?( ostype & os, unsigned long long int ulli ) { 139 139 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 140 fmt( os, "% llu", ulli );140 fmt( os, "%'llu", ulli ); 141 141 return os; 142 142 } // ?|? … … 205 205 ostype & ?|?( ostype & os, float f ) { 206 206 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 207 PrintWithDP( os, "% g", f );207 PrintWithDP( os, "%'g", f ); 208 208 return os; 209 209 } // ?|? … … 214 214 ostype & ?|?( ostype & os, double d ) { 215 215 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 216 PrintWithDP( os, "% .*lg", d, DBL_DIG );216 PrintWithDP( os, "%'.*lg", d, DBL_DIG ); 217 217 return os; 218 218 } // ?|? … … 223 223 ostype & ?|?( ostype & os, long double ld ) { 224 224 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 225 PrintWithDP( os, "% .*Lg", ld, LDBL_DIG );225 PrintWithDP( os, "%'.*Lg", ld, LDBL_DIG ); 226 226 return os; 227 227 } // ?|? … … 233 233 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 234 234 // os | crealf( fc ) | nonl; 235 PrintWithDP( os, "% g", crealf( fc ) );236 PrintWithDP( os, "% +g", cimagf( fc ) );235 PrintWithDP( os, "%'g", crealf( fc ) ); 236 PrintWithDP( os, "%'+g", cimagf( fc ) ); 237 237 fmt( os, "i" ); 238 238 return os; … … 245 245 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 246 246 // os | creal( dc ) | nonl; 247 PrintWithDP( os, "% .*lg", creal( dc ), DBL_DIG );248 PrintWithDP( os, "% +.*lg", cimag( dc ), DBL_DIG );247 PrintWithDP( os, "%'.*lg", creal( dc ), DBL_DIG ); 248 PrintWithDP( os, "%'+.*lg", cimag( dc ), DBL_DIG ); 249 249 fmt( os, "i" ); 250 250 return os; … … 257 257 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 258 258 // os | creall( ldc ) || nonl; 259 PrintWithDP( os, "% .*Lg", creall( ldc ), LDBL_DIG );260 PrintWithDP( os, "% +.*Lg", cimagl( ldc ), LDBL_DIG );259 PrintWithDP( os, "%'.*Lg", creall( ldc ), LDBL_DIG ); 260 PrintWithDP( os, "%'+.*Lg", cimagl( ldc ), LDBL_DIG ); 261 261 fmt( os, "i" ); 262 262 return os; … … 282 282 }; // mask 283 283 284 if ( s == 0p ) { fmt( os, "%s", "0p" ); return os; } // null pointer 284 285 if ( s[0] == '\0' ) { sepOff( os ); return os; } // null string => no separator 285 286 … … 496 497 if ( ! f.flags.pc ) memcpy( &fmtstr, IFMTNP, sizeof(IFMTNP) ); \ 497 498 else memcpy( &fmtstr, IFMTP, sizeof(IFMTP) ); \ 498 int star = 4; /* position before first '*' */ \499 int star = 5; /* position before first '*' */ \ 499 500 \ 500 501 /* Insert flags into spaces before '*', from right to left. */ \ … … 503 504 if ( f.flags.sign ) { fmtstr[star] = '+'; star -= 1; } \ 504 505 if ( f.flags.pad0 && ! f.flags.pc ) { fmtstr[star] = '0'; star -= 1; } \ 506 fmtstr[star] = '\''; star -= 1; /* locale */ \ 505 507 fmtstr[star] = '%'; \ 506 508 \ … … 521 523 } // distribution 522 524 523 IntegralFMTImpl( signed char, " *hh ", "*.*hh " )524 IntegralFMTImpl( unsigned char, " *hh ", "*.*hh " )525 IntegralFMTImpl( signed short int, " *h ", "*.*h " )526 IntegralFMTImpl( unsigned short int, " *h ", "*.*h " )527 IntegralFMTImpl( signed int, " * ", "*.* " )528 IntegralFMTImpl( unsigned int, " * ", "*.* " )529 IntegralFMTImpl( signed long int, " *l ", "*.*l " )530 IntegralFMTImpl( unsigned long int, " *l ", "*.*l " )531 IntegralFMTImpl( signed long long int, " *ll ", "*.*ll " )532 IntegralFMTImpl( unsigned long long int, " *ll ", "*.*ll " )525 IntegralFMTImpl( signed char, " *hh ", " *.*hh " ) 526 IntegralFMTImpl( unsigned char, " *hh ", " *.*hh " ) 527 IntegralFMTImpl( signed short int, " *h ", " *.*h " ) 528 IntegralFMTImpl( unsigned short int, " *h ", " *.*h " ) 529 IntegralFMTImpl( signed int, " * ", " *.* " ) 530 IntegralFMTImpl( unsigned int, " * ", " *.* " ) 531 IntegralFMTImpl( signed long int, " *l ", " *.*l " ) 532 IntegralFMTImpl( unsigned long int, " *l ", " *.*l " ) 533 IntegralFMTImpl( signed long long int, " *ll ", " *.*ll " ) 534 IntegralFMTImpl( unsigned long long int, " *ll ", " *.*ll " ) 533 535 534 536 … … 692 694 if ( ! f.flags.pc ) memcpy( &fmtstr, DFMTNP, sizeof(DFMTNP) ); \ 693 695 else memcpy( &fmtstr, DFMTP, sizeof(DFMTP) ); \ 694 int star = 4; /* position before first '*' */ \696 int star = 5; /* position before first '*' */ \ 695 697 \ 696 698 /* Insert flags into spaces before '*', from right to left. */ \ … … 698 700 if ( f.flags.sign ) { fmtstr[star] = '+'; star -= 1; } \ 699 701 if ( f.flags.pad0 ) { fmtstr[star] = '0'; star -= 1; } \ 702 fmtstr[star] = '\''; star -= 1; /* locale */ \ 700 703 fmtstr[star] = '%'; \ 701 704 \ … … 715 718 } // distribution 716 719 717 FloatingPointFMTImpl( double, " * ", "*.* " )718 FloatingPointFMTImpl( long double, " *L ", "*.*L " )720 FloatingPointFMTImpl( double, " * ", " *.* " ) 721 FloatingPointFMTImpl( long double, " *L ", " *.*L " ) 719 722 720 723 // *********************************** character ***********************************
Note:
See TracChangeset
for help on using the changeset viewer.