Ignore:
Timestamp:
Jun 12, 2019, 4:06:37 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
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:
462a7c7, d60780c
Parents:
aaeacf4 (diff), 6625727 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    raaeacf4 r21300d7  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // iostream.c --
     7// iostream.cfa --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jun  9 16:27:17 2019
    13 // Update Count     : 803
     12// Last Modified On : Wed Jun 12 15:00:31 2019
     13// Update Count     : 819
    1414//
    1515
     
    740740        } // ?|?
    741741
     742        istype & ?|?( istype & is, const char * fmt ) {
     743                fmt( is, fmt, "" );
     744                return is;
     745        } // ?|?
     746
     747        istype & ?|?( istype & is, char * s ) {
     748                fmt( is, "%s", s );
     749                return is;
     750        } // ?|?
     751
    742752        // manipulators
    743753        istype & ?|?( istype & is, istype & (* manip)( istype & ) ) {
     
    767777        // skip xxx
    768778        if ( ! f.s ) {
    769                 // printf( "skip %s\n", f.scanset );
    770                 fmt( is, f.scanset, "" );                                               // no input arguments
     779                //printf( "skip %s %d\n", f.scanset, f.wd );
     780                if ( f.wd != -1 ) for ( f.wd ) fmt( is, "%*c" ); // no input arguments
     781                else fmt( is, f.scanset, "" );
    771782                return is;
    772783        } // if
     
    797808} // ?|?
    798809
     810forall( dtype istype | istream( istype ) )
     811istype & ?|?( istype & is, _Istream_Char f ) {
     812        fmt( is, "%*c" );                                                                       // argument variable unused
     813        return is;
     814} // ?|?
     815
    799816#define InputFMTImpl( T, CODE ) \
    800817forall( dtype istype | istream( istype ) ) \
     
    802819        enum { size = 16 }; \
    803820        char fmtstr[size]; \
    804         if ( f.wd == -1 || strcmp( CODE, "c" ) == 0 ) { /* ignore width with "c" */     \
     821        if ( f.wd == -1 ) { \
    805822                snprintf( fmtstr, size, "%%%s%s", f.ignore ? "*" : "", CODE ); \
    806823        } else { \
     
    812829} // ?|?
    813830
    814 InputFMTImpl( char, "c" )
    815831InputFMTImpl( signed char, "hhi" )
    816832InputFMTImpl( unsigned char, "hhi" )
Note: See TracChangeset for help on using the changeset viewer.