Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r6a33e40 rc8371b5  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jan 19 08:15:53 2022
    13 // Update Count     : 1352
     12// Last Modified On : Sun Oct 10 09:28:17 2021
     13// Update Count     : 1345
    1414//
    1515
     
    5757        ostype & ?|?( ostype & os, signed char sc ) {
    5858                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    59                 fmt( os, "%'hhd", sc );
     59                fmt( os, "%hhd", sc );
    6060                return os;
    6161        } // ?|?
     
    6666        ostype & ?|?( ostype & os, unsigned char usc ) {
    6767                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    68                 fmt( os, "%'hhu", usc );
     68                fmt( os, "%hhu", usc );
    6969                return os;
    7070        } // ?|?
     
    7575        ostype & ?|?( ostype & os, short int si ) {
    7676                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    77                 fmt( os, "%'hd", si );
     77                fmt( os, "%hd", si );
    7878                return os;
    7979        } // ?|?
     
    8484        ostype & ?|?( ostype & os, unsigned short int usi ) {
    8585                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    86                 fmt( os, "%'hu", usi );
     86                fmt( os, "%hu", usi );
    8787                return os;
    8888        } // ?|?
     
    9393        ostype & ?|?( ostype & os, int i ) {
    9494                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    95                 fmt( os, "%'d", i );
     95                fmt( os, "%d", i );
    9696                return os;
    9797        } // ?|?
     
    102102        ostype & ?|?( ostype & os, unsigned int ui ) {
    103103                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    104                 fmt( os, "%'u", ui );
     104                fmt( os, "%u", ui );
    105105                return os;
    106106        } // ?|?
     
    111111        ostype & ?|?( ostype & os, long int li ) {
    112112                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    113                 fmt( os, "%'ld", li );
     113                fmt( os, "%ld", li );
    114114                return os;
    115115        } // ?|?
     
    120120        ostype & ?|?( ostype & os, unsigned long int uli ) {
    121121                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    122                 fmt( os, "%'lu", uli );
     122                fmt( os, "%lu", uli );
    123123                return os;
    124124        } // ?|?
     
    129129        ostype & ?|?( ostype & os, long long int lli ) {
    130130                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    131                 fmt( os, "%'lld", lli );
     131                fmt( os, "%lld", lli );
    132132                return os;
    133133        } // ?|?
     
    138138        ostype & ?|?( ostype & os, unsigned long long int ulli ) {
    139139                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    140                 fmt( os, "%'llu", ulli );
     140                fmt( os, "%llu", ulli );
    141141                return os;
    142142        } // ?|?
     
    205205        ostype & ?|?( ostype & os, float f ) {
    206206                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    207                 PrintWithDP( os, "%'g", f );
     207                PrintWithDP( os, "%g", f );
    208208                return os;
    209209        } // ?|?
     
    214214        ostype & ?|?( ostype & os, double d ) {
    215215                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    216                 PrintWithDP( os, "%'.*lg", d, DBL_DIG );
     216                PrintWithDP( os, "%.*lg", d, DBL_DIG );
    217217                return os;
    218218        } // ?|?
     
    223223        ostype & ?|?( ostype & os, long double ld ) {
    224224                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    225                 PrintWithDP( os, "%'.*Lg", ld, LDBL_DIG );
     225                PrintWithDP( os, "%.*Lg", ld, LDBL_DIG );
    226226                return os;
    227227        } // ?|?
     
    233233                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    234234//              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 ) );
    237237                fmt( os, "i" );
    238238                return os;
     
    245245                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    246246//              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 );
    249249                fmt( os, "i" );
    250250                return os;
     
    257257                if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) );
    258258//              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 );
    261261                fmt( os, "i" );
    262262                return os;
     
    282282                }; // mask
    283283
    284           if ( s == 0p ) { fmt( os, "%s", "0p" ); return os; } // null pointer
    285284          if ( s[0] == '\0' ) { sepOff( os ); return os; } // null string => no separator
    286285
     
    497496                if ( ! f.flags.pc ) memcpy( &fmtstr, IFMTNP, sizeof(IFMTNP) ); \
    498497                else memcpy( &fmtstr, IFMTP, sizeof(IFMTP) ); \
    499                 int star = 5;                                                                   /* position before first '*' */ \
     498                int star = 4;                                                                   /* position before first '*' */ \
    500499\
    501500                /* Insert flags into spaces before '*', from right to left. */ \
     
    504503                if ( f.flags.sign ) { fmtstr[star] = '+'; star -= 1; } \
    505504                if ( f.flags.pad0 && ! f.flags.pc ) { fmtstr[star] = '0'; star -= 1; } \
    506                 fmtstr[star] = '\''; star -= 1;                                 /* locale */ \
    507505                fmtstr[star] = '%'; \
    508506\
     
    523521} // distribution
    524522
    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 " )
     523IntegralFMTImpl( signed char, "     *hh ", "     *.*hh " )
     524IntegralFMTImpl( unsigned char, "     *hh ", "     *.*hh " )
     525IntegralFMTImpl( signed short int, "     *h ", "     *.*h " )
     526IntegralFMTImpl( unsigned short int, "     *h ", "     *.*h " )
     527IntegralFMTImpl( signed int, "     * ", "     *.* " )
     528IntegralFMTImpl( unsigned int, "     * ", "     *.* " )
     529IntegralFMTImpl( signed long int, "     *l ", "     *.*l " )
     530IntegralFMTImpl( unsigned long int, "     *l ", "     *.*l " )
     531IntegralFMTImpl( signed long long int, "     *ll ", "     *.*ll " )
     532IntegralFMTImpl( unsigned long long int, "     *ll ", "     *.*ll " )
    535533
    536534
     
    694692                if ( ! f.flags.pc ) memcpy( &fmtstr, DFMTNP, sizeof(DFMTNP) ); \
    695693                else memcpy( &fmtstr, DFMTP, sizeof(DFMTP) ); \
    696                 int star = 5;                                                                   /* position before first '*' */ \
     694                int star = 4;                                                                   /* position before first '*' */ \
    697695\
    698696                /* Insert flags into spaces before '*', from right to left. */ \
     
    700698                if ( f.flags.sign ) { fmtstr[star] = '+'; star -= 1; } \
    701699                if ( f.flags.pad0 ) { fmtstr[star] = '0'; star -= 1; } \
    702                 fmtstr[star] = '\''; star -= 1;                                 /* locale */ \
    703700                fmtstr[star] = '%'; \
    704701\
     
    718715} // distribution
    719716
    720 FloatingPointFMTImpl( double,      "      * ",  "      *.* " )
    721 FloatingPointFMTImpl( long double, "      *L ", "      *.*L " )
     717FloatingPointFMTImpl( double, "     * ", "     *.* " )
     718FloatingPointFMTImpl( long double, "     *L ", "     *.*L " )
    722719
    723720// *********************************** character ***********************************
Note: See TracChangeset for help on using the changeset viewer.