Changeset cbef27b for libcfa/src


Ignore:
Timestamp:
Apr 26, 2019, 4:56:16 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8d63649
Parents:
3898392 (diff), bd405fa (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' into jenkins-sandbox

Location:
libcfa/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/fstream.cfa

    r3898392 rcbef27b  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 28 17:39:53 2019
    13 // Update Count     : 307
     12// Last Modified On : Sat Apr 20 12:03:43 2019
     13// Update Count     : 311
    1414//
    1515
     
    3333        os.nlOnOff = nlOnOff;
    3434        os.prt = prt;
     35        os.sawNL = false;
    3536        sepSet( os, separator );
    3637        sepSetCur( os, sepGet( os ) );
     
    162163void ?{}( ifstream & is, void * file ) {
    163164        is.file = file;
     165        is.nlOnOff = false;
    164166}
    165167
     
    173175        open( is, name, "r" );
    174176}
     177
     178void nlOn( ifstream & os ) { os.nlOnOff = true; }
     179void nlOff( ifstream & os ) { os.nlOnOff = false; }
     180bool getANL( ifstream & os ) { return os.nlOnOff; }
    175181
    176182int fail( ifstream & is ) {
  • libcfa/src/fstream.hfa

    r3898392 rcbef27b  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 24 18:33:41 2018
    13 // Update Count     : 149
     12// Last Modified On : Sat Apr 20 12:03:58 2019
     13// Update Count     : 151
    1414//
    1515
     
    7373struct ifstream {
    7474        void * file;
     75        bool nlOnOff;
    7576}; // ifstream
    7677
    7778// public
     79void nlOn( ifstream & );
     80void nlOff( ifstream & );
     81bool getANL( ifstream & );
    7882int fail( ifstream & is );
    7983int eof( ifstream & is );
  • libcfa/src/gmp.hfa

    r3898392 rcbef27b  
    1010// Created On       : Tue Apr 19 08:43:43 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 23:25:51 2018
    13 // Update Count     : 22
     12// Last Modified On : Sat Apr 20 09:01:52 2019
     13// Update Count     : 24
    1414//
    1515
     
    271271
    272272        void ?|?( ostype & os, Int mp ) {
    273                 (ostype)(os | mp); if ( getANL( os ) ) nl( os );
     273                (ostype)(os | mp); nl( os );
    274274        } // ?|?
    275275} // distribution
  • libcfa/src/iostream.cfa

    r3898392 rcbef27b  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar  4 20:57:24 2019
    13 // Update Count     : 593
     12// Last Modified On : Sat Apr 20 14:02:43 2019
     13// Update Count     : 617
    1414//
    1515
     
    396396
    397397        istype & ?|?( istype & is, char & c ) {
    398                 fmt( is, "%c", &c );                                                    // must pass pointer through varg to fmt
     398                char temp;
     399                for () {
     400                        fmt( is, "%c", &temp );                                                 // must pass pointer through varg to fmt
     401                        // do not overwrite parameter with newline unless appropriate
     402                        if ( temp != '\n' || getANL( is ) ) { c = temp; break; }
     403                        if ( eof( is ) ) break;
     404                } // for
    399405                return is;
    400406        } // ?|?
     
    498504                return is;
    499505        } // nl
     506
     507        istype & nlOn( istype & is ) {
     508                nlOn( is );                                                                             // call void returning
     509                return is;
     510        } // nlOn
     511
     512        istype & nlOff( istype & is ) {
     513                nlOff( is );                                                                    // call void returning
     514                return is;
     515        } // nlOff
    500516} // distribution
    501517
  • libcfa/src/iostream.hfa

    r3898392 rcbef27b  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb 26 16:57:22 2019
    13 // Update Count     : 221
     12// Last Modified On : Sat Apr 20 12:04:07 2019
     13// Update Count     : 226
    1414//
    1515
     
    149149
    150150trait istream( dtype istype ) {
     151        void nlOn( istype & );                                                          // read newline
     152        void nlOff( istype & );                                                         // scan newline
     153        bool getANL( istype & );                                                        // get scan newline (on/off)
    151154        int fail( istype & );
    152155        int eof( istype & );
     
    187190
    188191        // manipulators
     192        istype & nlOn( istype & );
     193        istype & nlOff( istype & );
    189194        istype & ?|?( istype &, istype & (*)( istype & ) );
    190195        istype & nl( istype & is );
  • libcfa/src/stdlib.hfa

    r3898392 rcbef27b  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Dec 17 15:37:45 2018
    13 // Update Count     : 346
     12// Last Modified On : Wed Apr 24 17:35:43 2019
     13// Update Count     : 352
    1414//
    1515
     
    4040        } // malloc
    4141
    42         // T & malloc( void ) {
    43         //      int & p = *(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
    44         //      printf( "& malloc %p\n", &p );
    45         //      return p;
    46         //      //      return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
    47         // } // malloc
    48 
    4942        T * calloc( size_t dim ) {
    5043                return (T *)(void *)calloc( dim, sizeof(T) );   // C calloc
     
    7669        T * alloc( char fill ) {
    7770                T * ptr = (T *)(void *)malloc( (size_t)sizeof(T) );     // C malloc
    78                 return (T *)memset( ptr, (int)fill, sizeof(T) );        // initial with fill value
     71                return (T *)memset( ptr, (int)fill, sizeof(T) ); // initialize with fill value
    7972        } // alloc
    8073
     
    8477
    8578        T * alloc( size_t dim, char fill ) {
    86                 T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc
    87                 return (T *)memset( ptr, (int)fill, dim * sizeof(T) );    // initial with fill value
     79                T * ptr = (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C calloc
     80                return (T *)memset( ptr, (int)fill, dim * sizeof(T) ); // initialize with fill value
    8881        } // alloc
    8982
Note: See TracChangeset for help on using the changeset viewer.