Changeset 463cb33 for libcfa/src


Ignore:
Timestamp:
Jul 16, 2020, 2:59:56 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
c82af9f
Parents:
519f11c (diff), 3f06c05 (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

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r519f11c r463cb33  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul  8 22:14:20 2020
    13 // Update Count     : 1069
     12// Last Modified On : Thu Jul 16 07:43:31 2020
     13// Update Count     : 1102
    1414//
    1515
     
    970970        } // ?|?
    971971
     972#if defined( __SIZEOF_INT128__ )
     973        istype & ?|?( istype & is, int128 & i128 ) {
     974                return (istype &)(is | (unsigned int128 &)i128);
     975        } // ?|?
     976
     977        istype & ?|?( istype & is, unsigned int128 & ui128 ) {
     978                char s[40];
     979                bool sign = false;
     980
     981                if ( fmt( is, " %[-]", s ) == 1 ) sign = true;  // skip whitespace, negative sign ?
     982                // If the input is too large, the value returned is undefined. If there is no input, no value is returned
     983                if ( fmt( is, "%39[0-9]%*[0-9]", s ) == 1 ) {   // take first 39 characters, ignore remaining
     984                        ui128 = 0;
     985                        for ( unsigned int i = 0; s[i] != '\0'; i += 1 ) {
     986                                ui128 = ui128 * 10 + s[i] - '0';
     987                        } // for
     988                        if ( sign ) ui128 = -ui128;
     989                } else if ( sign ) ungetc( is, '-' );                   // return minus when no digits
     990                return is;
     991        } // ?|?
     992#endif // __SIZEOF_INT128__
    972993
    973994        istype & ?|?( istype & is, float & f ) {
  • libcfa/src/iostream.hfa

    r519f11c r463cb33  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jul 13 22:11:41 2020
    13 // Update Count     : 344
     12// Last Modified On : Thu Jul 16 07:43:32 2020
     13// Update Count     : 348
    1414//
    1515
     
    315315        istype & ?|?( istype &, unsigned int & );
    316316        istype & ?|?( istype &, long int & );
     317        istype & ?|?( istype &, unsigned long int & );
    317318        istype & ?|?( istype &, long long int & );
    318         istype & ?|?( istype &, unsigned long int & );
    319319        istype & ?|?( istype &, unsigned long long int & );
     320#if defined( __SIZEOF_INT128__ )
     321        istype & ?|?( istype &, int128 & );
     322        istype & ?|?( istype &, unsigned int128 & );
     323#endif // __SIZEOF_INT128__
    320324
    321325        istype & ?|?( istype &, float & );
Note: See TracChangeset for help on using the changeset viewer.