Changeset 124c1b7


Ignore:
Timestamp:
Jul 20, 2020, 3:54:04 PM (14 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast, new-ast-unique-expr
Children:
d9c2284
Parents:
28d73c1 (diff), 7d94bfe3 (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

    r28d73c1 r124c1b7  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jul 16 07:43:31 2020
    13 // Update Count     : 1102
     12// Last Modified On : Mon Jul 20 15:00:37 2020
     13// Update Count     : 1124
    1414//
    1515
     
    167167        #define P10_UINT64 10_000_000_000_000_000_000_ULL       // 19 zeroes
    168168
    169         static void base10_128( ostype & os, unsigned int128 val ) {
     169        static inline void base10_128( ostype & os, unsigned int128 val ) {
     170#if defined(__GNUC__) && __GNUC_PREREQ(7,0)                             // gcc version >= 7
    170171                if ( val > P10_UINT64 ) {
     172#else
     173                if ( (uint64_t)(val >> 64) != 0 || (uint64_t)val > P10_UINT64 ) { // patch gcc 5 & 6 -O3 bug
     174#endif // __GNUC_PREREQ(7,0)
    171175                        base10_128( os, val / P10_UINT64 );                     // recursive
    172176                        fmt( os, "%.19lu", (uint64_t)(val % P10_UINT64) );
     
    176180        } // base10_128
    177181
    178         static void base10_128( ostype & os, int128 val ) {
     182        static inline void base10_128( ostype & os, int128 val ) {
    179183                if ( val < 0 ) {
    180184                        fmt( os, "-" );                                                         // leading negative sign
  • libcfa/src/stdlib.hfa

    r28d73c1 r124c1b7  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul 19 18:29:34 2020
    13 // Update Count     : 463
     12// Last Modified On : Mon Jul 20 14:29:21 2020
     13// Update Count     : 464
    1414//
    1515
     
    6060                if ( unlikely( size == 0 ) || unlikely( ptr == 0p ) ) { // special cases
    6161                        if ( unlikely( size == 0 ) ) free( ptr );
    62                         if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
    63                         else return (T *)memalign( _Alignof(T), sizeof(T) );
     62                        if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( size ); // C malloc
     63                        else return (T *)memalign( _Alignof(T), size ); // C memalign
    6464                } // if
    6565                return (T *)(void *)resize( (void *)ptr, size ); // CFA resize
     
    6969                if ( unlikely( size == 0 ) || unlikely( ptr == 0p ) ) { // special cases
    7070                        if ( unlikely( size == 0 ) ) free( ptr );
    71                         if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc
    72                         else return (T *)memalign( _Alignof(T), sizeof(T) );
     71                        if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( size ); // C malloc
     72                        else return (T *)memalign( _Alignof(T), size ); // C memalign
    7373                } // if
    7474                return (T *)(void *)realloc( (void *)ptr, size ); // C realloc
Note: See TracChangeset for help on using the changeset viewer.