Changes in / [d45ed83:4069faad]


Ignore:
Files:
3 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/Makefile.am

    rd45ed83 r4069faad  
    3939#----------------------------------------------------------------------------------------------------------------
    4040if BUILDLIB
    41 headers_nosrc = bitmanip.hfa math.hfa gmp.hfa time_t.hfa bits/align.hfa bits/containers.hfa bits/defs.hfa bits/debug.hfa bits/locks.hfa containers/list.hfa
     41headers_nosrc = bitmanip.hfa math.hfa gmp.hfa time_t.hfa bits/align.hfa bits/containers.hfa bits/defs.hfa bits/debug.hfa bits/locks.hfa
    4242headers = fstream.hfa iostream.hfa iterator.hfa limits.hfa rational.hfa time.hfa stdlib.hfa common.hfa \
    4343          containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa
  • libcfa/src/iostream.cfa

    rd45ed83 r4069faad  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Apr 30 10:50:31 2020
    13 // Update Count     : 1001
     12// Last Modified On : Sun Apr 26 20:31:36 2020
     13// Update Count     : 985
    1414//
    1515
     
    463463                        int bits = high1( f.val );                                      /* position of most significant bit */ \
    464464                        if ( bits == 0 ) bits = 1;                                      /* 0 value => force one bit to print */ \
    465                         int spaces; \
     465                        int spaces = f.wd - bits;                                       /* can be negative */ \
     466                        if ( ! f.flags.nobsdp ) { spaces -= 2; }        /* base prefix takes space */ \
     467                        /* printf( "%d %d\n", bits, spaces ); */ \
    466468                        if ( ! f.flags.left ) {                                         /* right justified ? */ \
    467469                                /* Note, base prefix then zero padding or spacing then prefix. */ \
    468                                 if ( f.flags.pc ) { \
    469                                         spaces = f.wd - f.pc; \
    470                                         if ( ! f.flags.nobsdp ) { spaces -= 2; } /* base prefix takes space */ \
     470                                if ( f.flags.pad0 || f.flags.pc ) { \
     471                                        if ( ! f.flags.nobsdp ) { fmt( os, "0%c", f.base ); } \
     472                                        if ( f.flags.pc ) spaces = f.pc - bits; \
     473                                        if ( spaces > 0 ) fmt( os, "%0*d", spaces, 0 ); /* zero pad */ \
     474                                } else { \
    471475                                        if ( spaces > 0 ) fmt( os, "%*s", spaces, " " ); /* space pad */ \
    472476                                        if ( ! f.flags.nobsdp ) { fmt( os, "0%c", f.base ); } \
    473                                         spaces = f.pc - bits; \
    474                                         if ( spaces > 0 ) fmt( os, "%0*d", spaces, 0 ); /* zero pad */ \
    475                                 } else { \
    476                                         spaces = f.wd - bits; \
    477                                         if ( ! f.flags.nobsdp ) { spaces -= 2; } /* base prefix takes space */ \
    478                                         if ( f.flags.pad0 ) { \
    479                                                 if ( ! f.flags.nobsdp ) { fmt( os, "0%c", f.base ); } \
    480                                                 if ( spaces > 0 ) fmt( os, "%0*d", spaces, 0 ); /* zero pad */ \
    481                                         } else { \
    482                                                 if ( spaces > 0 ) fmt( os, "%*s", spaces, " " ); /* space pad */ \
    483                                                 if ( ! f.flags.nobsdp ) { fmt( os, "0%c", f.base ); } \
    484                                         } /* if */ \
    485477                                } /* if */ \
    486                         } else { \
    487                                 if ( ! f.flags.nobsdp ) fmt( os, "0%c", f.base ); \
    488                                 if ( f.flags.pc ) { \
    489                                         spaces = f.pc - bits; \
    490                                         if ( spaces > 0 ) fmt( os, "%0*d", spaces, 0 ); /* zero pad */ \
    491                                         spaces = f.wd - f.pc; \
    492                                 } else { /* pad0 flag ignored with left flag */ \
    493                                         spaces = f.wd - bits; \
    494                                 } /* if */ \
    495                                 if ( ! f.flags.nobsdp ) { spaces -= 2; } /* base prefix takes space */ \
     478                        } else if ( ! f.flags.nobsdp ) { \
     479                                fmt( os, "0%c", f.base ); \
    496480                        } /* if */ \
    497                         int shift = floor( bits - 1, 4 ); \
     481                        int shift = (bits - 1) / 4 * 4; /* floor( bits - 1, 4 ) */ \
    498482                        typeof( f.val ) temp = f.val; \
    499483                        fmt( os, "%s", shortbin[(temp >> shift) & 0xf] ); \
     
    615599                                                fmt.wd = 0; \
    616600                                                /* if ( fmt2.val > 1 && fmt.flags.pc && fmt.pc > 0 ) fmt.pc -= 1; */ \
    617                                                 /* printf( "L %llo %llo %llo %d %d '%c' %x %llo %d %d '%c' %x\n", msig, lsig, fmt.val, fmt.wd, fmt.pc, fmt.base, fmt.all, fmt2.val, fmt2.wd, fmt2.pc, fmt2.base, fmt2.all ); */ \
     601                                                /* printf( "L %llo %llo %llo %llo %d %d '%c' %x\n", msig, lsig, fmt.val, fmt2.val, fmt.wd, fmt.pc, fmt.base, fmt.all ); */ \
    618602                                                (ostype &)(os | fmt | "" | fmt2); \
    619603                                                sepOff( os ); \
     
    621605                                                int msigd = ceiling( high1( fmt.val ), 3 ) + 1; \
    622606                                                fmt2.wd = f.wd - (fmt.pc > msigd ? fmt.pc : msigd) - 1; \
    623                                                 if ( (int)fmt2.wd < 21 ) fmt2.wd = 21; /* cast deals with negative value */ \
     607                                                if ( fmt2.wd < 21 ) fmt2.wd = 21; \
    624608                                                fmt2.flags.pc = true; fmt2.pc = 21; \
    625609                                        } else { \
     
    628612                                                /*if ( ! fmt.flags.nobsdp && fmt.pc < fmt.wd ) fmt.wd -= 1;*/ \
    629613                                                fmt2.wd = 1; \
    630                                                 /* printf( "R %llo %llo %llo %d %d '%c' %x %llo %d %d '%c' %x\n", msig, lsig, fmt.val, fmt.wd, fmt.pc, fmt.base, fmt.all, fmt2.val, fmt2.wd, fmt2.pc, fmt2.base, fmt2.all ); */ \
     614                                                /* printf( "R %llo %llo %llo %llo %d %d '%c' %x\n", msig, lsig, fmt.val, fmt2.val, fmt.wd, fmt.pc, fmt.base, fmt.all ); */ \
    631615                                                (ostype &)(os | fmt | "" | fmt2); \
    632616                                                sepOff( os ); \
Note: See TracChangeset for help on using the changeset viewer.