Ignore:
Timestamp:
Aug 25, 2017, 10:38:34 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
800d275
Parents:
af08051 (diff), 3eab308c (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
  • src/libcfa/iostream.c

    raf08051 r28e58fd  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug  9 16:46:51 2017
    13 // Update Count     : 401
     12// Last Modified On : Thu Aug 24 08:41:53 2017
     13// Update Count     : 405
    1414//
    1515
     
    271271
    272272forall( dtype istype | istream( istype ) )
    273 istype * ?|?( istype * is, char * c ) {
    274         fmt( is, "%c", c );
    275         return is;
    276 } // ?|?
    277 
    278 forall( dtype istype | istream( istype ) )
    279 istype * ?|?( istype * is, short int * si ) {
    280         fmt( is, "%hd", si );
    281         return is;
    282 } // ?|?
    283 
    284 forall( dtype istype | istream( istype ) )
    285 istype * ?|?( istype * is, unsigned short int * usi ) {
    286         fmt( is, "%hu", usi );
    287         return is;
    288 } // ?|?
    289 
    290 forall( dtype istype | istream( istype ) )
    291 istype * ?|?( istype * is, int * i ) {
    292         fmt( is, "%d", i );
    293         return is;
    294 } // ?|?
    295 
    296 forall( dtype istype | istream( istype ) )
    297 istype * ?|?( istype * is, unsigned int * ui ) {
    298         fmt( is, "%u", ui );
    299         return is;
    300 } // ?|?
    301 
    302 forall( dtype istype | istream( istype ) )
    303 istype * ?|?( istype * is, long int * li ) {
    304         fmt( is, "%ld", li );
    305         return is;
    306 } // ?|?
    307 
    308 forall( dtype istype | istream( istype ) )
    309 istype * ?|?( istype * is, unsigned long int * ulli ) {
    310         fmt( is, "%lu", ulli );
    311         return is;
    312 } // ?|?
    313 
    314 forall( dtype istype | istream( istype ) )
    315 istype * ?|?( istype * is, long long int * lli ) {
    316         fmt( is, "%lld", lli );
    317         return is;
    318 } // ?|?
    319 
    320 forall( dtype istype | istream( istype ) )
    321 istype * ?|?( istype * is, unsigned long long int * ulli ) {
    322         fmt( is, "%llu", ulli );
    323         return is;
    324 } // ?|?
    325 
    326 
    327 forall( dtype istype | istream( istype ) )
    328 istype * ?|?( istype * is, float * f ) {
    329         fmt( is, "%f", f );
    330         return is;
    331 } // ?|?
    332 
    333 forall( dtype istype | istream( istype ) )
    334 istype * ?|?( istype * is, double * d ) {
    335         fmt( is, "%lf", d );
    336         return is;
    337 } // ?|?
    338 
    339 forall( dtype istype | istream( istype ) )
    340 istype * ?|?( istype * is, long double * ld ) {
    341         fmt( is, "%Lf", ld );
    342         return is;
    343 } // ?|?
    344 
    345 
    346 forall( dtype istype | istream( istype ) )
    347 istype * ?|?( istype * is, float _Complex * fc ) {
     273istype * ?|?( istype * is, char & c ) {
     274        fmt( is, "%c", &c );                                                            // must pass pointer through varg to fmt
     275        return is;
     276} // ?|?
     277
     278forall( dtype istype | istream( istype ) )
     279istype * ?|?( istype * is, short int & si ) {
     280        fmt( is, "%hd", &si );
     281        return is;
     282} // ?|?
     283
     284forall( dtype istype | istream( istype ) )
     285istype * ?|?( istype * is, unsigned short int & usi ) {
     286        fmt( is, "%hu", &usi );
     287        return is;
     288} // ?|?
     289
     290forall( dtype istype | istream( istype ) )
     291istype * ?|?( istype * is, int & i ) {
     292        fmt( is, "%d", &i );
     293        return is;
     294} // ?|?
     295
     296forall( dtype istype | istream( istype ) )
     297istype * ?|?( istype * is, unsigned int & ui ) {
     298        fmt( is, "%u", &ui );
     299        return is;
     300} // ?|?
     301
     302forall( dtype istype | istream( istype ) )
     303istype * ?|?( istype * is, long int & li ) {
     304        fmt( is, "%ld", &li );
     305        return is;
     306} // ?|?
     307
     308forall( dtype istype | istream( istype ) )
     309istype * ?|?( istype * is, unsigned long int & ulli ) {
     310        fmt( is, "%lu", &ulli );
     311        return is;
     312} // ?|?
     313
     314forall( dtype istype | istream( istype ) )
     315istype * ?|?( istype * is, long long int & lli ) {
     316        fmt( is, "%lld", &lli );
     317        return is;
     318} // ?|?
     319
     320forall( dtype istype | istream( istype ) )
     321istype * ?|?( istype * is, unsigned long long int & ulli ) {
     322        fmt( is, "%llu", &ulli );
     323        return is;
     324} // ?|?
     325
     326
     327forall( dtype istype | istream( istype ) )
     328istype * ?|?( istype * is, float & f ) {
     329        fmt( is, "%f", &f );
     330        return is;
     331} // ?|?
     332
     333forall( dtype istype | istream( istype ) )
     334istype * ?|?( istype * is, double & d ) {
     335        fmt( is, "%lf", &d );
     336        return is;
     337} // ?|?
     338
     339forall( dtype istype | istream( istype ) )
     340istype * ?|?( istype * is, long double & ld ) {
     341        fmt( is, "%Lf", &ld );
     342        return is;
     343} // ?|?
     344
     345
     346forall( dtype istype | istream( istype ) )
     347istype * ?|?( istype * is, float _Complex & fc ) {
    348348        float re, im;
    349349        fmt( is, "%g%gi", &re, &im );
    350         *fc = re + im * _Complex_I;
    351         return is;
    352 } // ?|?
    353 
    354 forall( dtype istype | istream( istype ) )
    355 istype * ?|?( istype * is, double _Complex * dc ) {
     350        fc = re + im * _Complex_I;
     351        return is;
     352} // ?|?
     353
     354forall( dtype istype | istream( istype ) )
     355istype * ?|?( istype * is, double _Complex & dc ) {
    356356        double re, im;
    357357        fmt( is, "%lf%lfi", &re, &im );
    358         *dc = re + im * _Complex_I;
    359         return is;
    360 } // ?|?
    361 
    362 forall( dtype istype | istream( istype ) )
    363 istype * ?|?( istype * is, long double _Complex * ldc ) {
     358        dc = re + im * _Complex_I;
     359        return is;
     360} // ?|?
     361
     362forall( dtype istype | istream( istype ) )
     363istype * ?|?( istype * is, long double _Complex & ldc ) {
    364364        long double re, im;
    365365        fmt( is, "%Lf%Lfi", &re, &im );
    366         *ldc = re + im * _Complex_I;
     366        ldc = re + im * _Complex_I;
    367367        return is;
    368368} // ?|?
Note: See TracChangeset for help on using the changeset viewer.