Ignore:
Timestamp:
Jul 14, 2019, 11:46:01 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7dc2e57b
Parents:
ec72861
Message:

formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    rec72861 r4f37255  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 12 12:04:13 2019
    13 // Update Count     : 819
     12// Last Modified On : Sat Jul 13 08:07:59 2019
     13// Update Count     : 821
    1414//
    1515
     
    499499                                if ( ! f.flags.left ) { \
    500500                                        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 */ \
    502502                                } else { \
    503503                                        for ( i = 0; i < len && buf[i] != ' '; i += 1 ); /* trailing blank ? */ \
     
    546546forall( dtype ostype | ostream( ostype ) ) {
    547547        ostype & ?|?( ostype & os, _Ostream_Manip(char) f ) {
    548                 if ( f.base != 'c' ) {                                                          // bespoke binary/octal/hex format
     548                if ( f.base != 'c' ) {                                                  // bespoke binary/octal/hex format
    549549                        _Ostream_Manip(unsigned char) fmtuc @= { f.val, f.wd, f.pc, f.base, {'\0'} };
    550550                        fmtuc.flags.pc = f.flags.pc;
     
    558558
    559559                #define CFMTNP "% * "
    560                 char fmtstr[sizeof(CFMTNP)];                                            // sizeof includes '\0'
     560                char fmtstr[sizeof(CFMTNP)];                                    // sizeof includes '\0'
    561561                memcpy( &fmtstr, CFMTNP, sizeof(CFMTNP) );
    562                 int star = 1;                                                                           // position before first '*'
     562                int star = 1;                                                                   // position before first '*'
    563563
    564564                // Insert flags into spaces before '*', from right to left.
     
    566566                fmtstr[star] = '%';
    567567
    568                 fmtstr[sizeof(CFMTNP)-2] = f.base;                                      // sizeof includes '\0'
     568                fmtstr[sizeof(CFMTNP)-2] = f.base;                              // sizeof includes '\0'
    569569                // printf( "%d %s\n", f.wd, &fmtstr[star] );
    570570                fmt( os, &fmtstr[star], f.wd, f.val );
     
    631631                else {
    632632                        fprintf( stderr, "invalid Boolean constant\n" );
    633                         abort();
     633                        abort();                                                                        // cannot use abort stream
    634634                } // if
    635635                return is;
     
    639639                char temp;
    640640                for () {
    641                         fmt( is, "%c", &temp );                                                 // must pass pointer through varg to fmt
     641                        fmt( is, "%c", &temp );                                         // must pass pointer through varg to fmt
    642642                        // do not overwrite parameter with newline unless appropriate
    643643                        if ( temp != '\n' || getANL( is ) ) { c = temp; break; }
     
    773773        if ( ! f.s ) {
    774774                // printf( "skip %s %d\n", f.scanset, f.wd );
    775                 if ( f.wd == -1 ) fmt( is, f.scanset, "" ); // no input arguments
     775                if ( f.wd == -1 ) fmt( is, f.scanset, "" );             // no input arguments
    776776                else for ( f.wd ) fmt( is, "%*c" );
    777777                return is;
Note: See TracChangeset for help on using the changeset viewer.