Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r852a2f06 rdd7c6520  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Mar 11 14:35:35 2020
    13 // Update Count     : 860
     12// Last Modified On : Thu Mar  5 15:56:16 2020
     13// Update Count     : 834
    1414//
    1515
     
    534534#define IntegralFMTImpl128( T, SIGNED, CODE, IFMTNP, IFMTP ) \
    535535forall( dtype ostype | ostream( ostype ) ) \
    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 ); */ \
     536static 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 );   \
    544542                sepOff( os ); \
    545                 (ostype &)(os | fmt); \
     543                (ostype &)(os | fmt2); \
    546544        } else { \
    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); \
     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); \
    550548        } /* if */ \
    551 } /* base10_128 */ \
     549} /* base10_128 */                                                \
    552550forall( dtype ostype | ostream( ostype ) ) { \
    553551        ostype & ?|?( ostype & os, _Ostream_Manip(T) f ) { \
     
    566564                                if ( f.base == 'b' | f.base == 'B' ) { \
    567565                                        if ( f.wd > 64 ) fmt.wd = f.wd - 64; \
    568                                         if ( f.flags.pc && f.pc > 64 ) fmt.pc = f.pc - 64; \
    569566                                        fmt2.wd = 64; \
    570567                                        (ostype &)(os | fmt | "" | fmt2); \
     
    572569                                        fmt.val = (unsigned long long int)fmt.val >> 2; \
    573570                                        if ( f.wd > 21 ) fmt.wd = f.wd - 21; \
    574                                         if ( f.flags.pc && f.pc > 21 ) fmt.pc = f.pc - 21; \
    575571                                        fmt2.wd = 1; \
    576572                                        fmt2.val = ((msig & 0x3) << 1) + 1; \
     
    582578                                } else { \
    583579                                        if ( f.flags.left ) { \
    584                                                 if ( f.wd > 16 ) fmt2.wd = f.wd - 16; \
    585                                                 fmt.wd = 16; \
     580                                                if ( f.wd > 16 ) fmt2.wd = f.wd - 16;   \
     581                                                fmt.wd = 16;                                                    \
    586582                                        } else { \
    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; \
     583                                                if ( f.wd > 16 ) fmt.wd = f.wd - 16;    \
     584                                                fmt2.wd = 16;                                                   \
    590585                                        } /* if */ \
    591586                                        (ostype &)(os | fmt | "" | fmt2); \
     
    593588                        } /* if */ \
    594589                } else { \
    595                         if ( CODE == 'd' ) { \
    596                                 if ( f.val < 0 )  { fmt( os, "-" ); sepOff( os ); f.val = -f.val; f.flags.sign = false; } \
    597                         } /* if */ \
    598590                        base10_128( os, f ); \
    599591                } /* if */ \
Note: See TracChangeset for help on using the changeset viewer.