Changeset 38093ae for libcfa/src


Ignore:
Timestamp:
Apr 18, 2024, 8:44:24 PM (21 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
19313be5, cf191ac
Parents:
748c751 (diff), 7a780ad (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:

Resolve conflict

Location:
libcfa/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/string.cfa

    r748c751 r38093ae  
    1010// Created On       : Fri Sep 03 11:00:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Feb  7 21:17:06 2024
    13 // Update Count     : 259
     12// Last Modified On : Mon Apr 15 21:56:28 2024
     13// Update Count     : 260
    1414//
    1515
     
    198198        cstr[len] = '\0';                                                                       // terminate
    199199        _Ostream_Manip(const char *) cf @= { cstr, f.wd, f.pc, f.base, {f.all} };
    200         os | cf | nonl;
    201         return os;
     200        return os | cf | nonl;
    202201} // ?|?
    203202
  • libcfa/src/collections/string_res.cfa

    r748c751 r38093ae  
    1010// Created On       : Fri Sep 03 11:00:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Feb 10 17:47:22 2024
    13 // Update Count     : 83
     12// Last Modified On : Mon Apr 15 21:56:27 2024
     13// Update Count     : 85
    1414//
    1515
     
    200200ofstream & ?|?(ofstream & out, const string_res & s) {
    201201        // CFA string is NOT null terminated, so print exactly lnth characters in a minimum width of 0.
    202         out | wd( 0, s.Handle.lnth, s.Handle.s ) | nonl;
    203         return out;
     202        return out | wd( 0, s.Handle.lnth, s.Handle.s ) | nonl;
    204203}
    205204
  • libcfa/src/stdlib.hfa

    r748c751 r38093ae  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr 12 07:39:15 2024
    13 // Update Count     : 812
     12// Last Modified On : Mon Apr 15 22:11:51 2024
     13// Update Count     : 817
    1414//
    1515
     
    6464        } // calloc
    6565
    66         T * resize( T * ptr, size_t size ) {                            // CFA resize, eliminate return-type cast
     66        T * resize( T * ptr, size_t size ) {                            // CFA resize
    6767                if ( _Alignof(T) <= libAlign() ) return (T *)resize( (void *)ptr, size ); // CFA resize
    6868                else return (T *)resize( (void *)ptr, _Alignof(T), size ); // CFA resize
    6969        } // resize
    7070
    71         T * realloc( T * ptr, size_t size ) {                           // CFA realloc, eliminate return-type cast
     71        T * realloc( T * ptr, size_t size ) {                           // CFA realloc
    7272                if ( _Alignof(T) <= libAlign() ) return (T *)realloc( (void *)ptr, size ); // C realloc
    7373                else return (T *)realloc( (void *)ptr, _Alignof(T), size ); // CFA realloc
     74        } // realloc
     75
     76        T * reallocarray( T * ptr, size_t dim ) {                       // CFA reallocarray
     77                if ( _Alignof(T) <= libAlign() ) return (T *)reallocarray( (void *)ptr, dim, sizeof(T) ); // C reallocarray
     78                else return (T *)reallocarray( (void *)ptr, _Alignof(T), dim ); // CFA reallocarray
    7479        } // realloc
    7580
     
    210215        } // alloc_internal$
    211216
    212         forall( TT... | { T * alloc_internal$( void *, T *, size_t, size_t, S_fill(T), TT ); } ) {
     217        forall( TT ... | { T * alloc_internal$( void *, T *, size_t, size_t, S_fill(T), TT ); } ) {
    213218                T * alloc_internal$( void *, T *, size_t Align, size_t Dim, S_fill(T) Fill, T_resize Resize, TT rest ) {
    214219                return alloc_internal$( Resize, (T*)0p, Align, Dim, Fill, rest);
     
    262267        free( (void *)ptr );                                                            // C free
    263268} // free
    264 static inline forall( T &, TT... | { void free( TT ); } )
     269static inline forall( T &, TT ... | { void free( TT ); } )
    265270void free( T * ptr, TT rest ) {
    266271        free( ptr );
     
    269274
    270275// CFA allocation/deallocation and constructor/destructor, non-array types
    271 static inline forall( T & | sized(T), TT... | { void ?{}( T &, TT ); } )
     276static inline forall( T & | sized(T), TT ... | { void ?{}( T &, TT ); } )
    272277T * new( TT p ) {
    273278        return &(*(T *)malloc()){ p };                                          // run constructor
     
    282287        free( ptr );                                                                            // always call free
    283288} // delete
    284 static inline forall( T &, TT... | { void ^?{}( T & ); void delete( TT ); } )
     289static inline forall( T &, TT ... | { void ^?{}( T & ); void delete( TT ); } )
    285290void delete( T * ptr, TT rest ) {
    286291        delete( ptr );
     
    289294
    290295// CFA allocation/deallocation and constructor/destructor, array types
    291 forall( T & | sized(T), TT... | { void ?{}( T &, TT ); } ) T * anew( size_t dim, TT p );
     296forall( T & | sized(T), TT ... | { void ?{}( T &, TT ); } ) T * anew( size_t dim, TT p );
    292297forall( T & | sized(T) | { void ^?{}( T & ); } ) void adelete( T arr[] );
    293 forall( T & | sized(T) | { void ^?{}( T & ); }, TT... | { void adelete( TT ); } ) void adelete( T arr[], TT rest );
     298forall( T & | sized(T) | { void ^?{}( T & ); }, TT ... | { void adelete( TT ); } ) void adelete( T arr[], TT rest );
    294299//---------------------------------------
    295300
  • libcfa/src/time.hfa

    r748c751 r38093ae  
    1010// Created On       : Wed Mar 14 23:18:57 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Oct  8 09:07:48 2022
    13 // Update Count     : 668
     12// Last Modified On : Thu Apr 18 12:07:21 2024
     13// Update Count     : 670
    1414//
    1515
     
    8484        Duration ?`m( int64_t min ) { return (Duration)@{ min * (60LL * TIMEGRAN) }; }
    8585        Duration ?`m( double min ) { return (Duration)@{ min * (60LL * TIMEGRAN) }; }
    86         Duration ?`h( int64_t hours ) { return (Duration)@{ hours * (60LL * 60LL * TIMEGRAN) }; }
    87         Duration ?`h( double hours ) { return (Duration)@{ hours * (60LL * 60LL * TIMEGRAN) }; }
    88         Duration ?`d( int64_t days ) { return (Duration)@{ days * (24LL * 60LL * 60LL * TIMEGRAN) }; }
    89         Duration ?`d( double days ) { return (Duration)@{ days * (24LL * 60LL * 60LL * TIMEGRAN) }; }
    90         Duration ?`w( int64_t weeks ) { return (Duration)@{ weeks * (7LL * 24LL * 60LL * 60LL * TIMEGRAN) }; }
    91         Duration ?`w( double weeks ) { return (Duration)@{ weeks * (7LL * 24LL * 60LL * 60LL * TIMEGRAN) }; }
     86        Duration ?`h( int64_t hour ) { return (Duration)@{ hour * (60LL * 60LL * TIMEGRAN) }; }
     87        Duration ?`h( double hour ) { return (Duration)@{ hour * (60LL * 60LL * TIMEGRAN) }; }
     88        Duration ?`d( int64_t day ) { return (Duration)@{ day * (24LL * 60LL * 60LL * TIMEGRAN) }; }
     89        Duration ?`d( double day ) { return (Duration)@{ day * (24LL * 60LL * 60LL * TIMEGRAN) }; }
     90        Duration ?`w( int64_t week ) { return (Duration)@{ week * (7LL * 24LL * 60LL * 60LL * TIMEGRAN) }; }
     91        Duration ?`w( double week ) { return (Duration)@{ week * (7LL * 24LL * 60LL * 60LL * TIMEGRAN) }; }
    9292
    9393        int64_t ?`ns( Duration dur ) { return dur.tn; }
Note: See TracChangeset for help on using the changeset viewer.