Ignore:
Timestamp:
Oct 19, 2022, 5:29:12 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
bc899d6
Parents:
82ff4ed1 (diff), 058ece2 (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
  • libcfa/src/containers/array.hfa

    r82ff4ed1 rd191e24  
    2727    // -  Given bug of Trac #247, CFA gives sizeof expressions type unsigned long int, when it
    2828    //    should give them type size_t.
    29     //   
     29    //
    3030    //                          gcc -m32         cfa -m32 given bug         gcc -m64
    3131    // ptrdiff_t                int              int                        long int
     
    3939    }
    4040
     41    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, int i ) {
     42        assert( i < N );
     43        return (Timmed &) a.strides[i];
     44    }
     45
    4146    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned int i ) {
     47        assert( i < N );
     48        return (Timmed &) a.strides[i];
     49    }
     50
     51    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, unsigned int i ) {
    4252        assert( i < N );
    4353        return (Timmed &) a.strides[i];
     
    4959    }
    5060
     61    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, long int i ) {
     62        assert( i < N );
     63        return (Timmed &) a.strides[i];
     64    }
     65
    5166    static inline Timmed & ?[?]( arpk(N, S, Timmed, Tbase) & a, unsigned long int i ) {
     67        assert( i < N );
     68        return (Timmed &) a.strides[i];
     69    }
     70
     71    static inline const Timmed & ?[?]( const arpk(N, S, Timmed, Tbase) & a, unsigned long int i ) {
    5272        assert( i < N );
    5373        return (Timmed &) a.strides[i];
     
    83103    // Make a FOREACH macro
    84104    #define FE_0(WHAT)
    85     #define FE_1(WHAT, X) WHAT(X) 
     105    #define FE_1(WHAT, X) WHAT(X)
    86106    #define FE_2(WHAT, X, ...) WHAT(X)FE_1(WHAT, __VA_ARGS__)
    87107    #define FE_3(WHAT, X, ...) WHAT(X)FE_2(WHAT, __VA_ARGS__)
     
    90110    //... repeat as needed
    91111
    92     #define GET_MACRO(_0,_1,_2,_3,_4,_5,NAME,...) NAME 
     112    #define GET_MACRO(_0,_1,_2,_3,_4,_5,NAME,...) NAME
    93113    #define FOR_EACH(action,...) \
    94114    GET_MACRO(_0,__VA_ARGS__,FE_5,FE_4,FE_3,FE_2,FE_1,FE_0)(action,__VA_ARGS__)
     
    115135}
    116136
    117 #else 
     137#else
    118138
    119139// Workaround form.  Listing all possibilities up to 4 dims.
     
    155175
    156176// Wrapper
    157 struct all_t {} all;
     177extern struct all_t {} all;
    158178forall( [N], S & | sized(S), Te &, result &, Tbase & | { tag(result) enq_( tag(Tbase), tag(N), tag(S), tag(Te) ); } )
    159179static inline result & ?[?]( arpk(N, S, Te, Tbase) & this, all_t ) {
Note: See TracChangeset for help on using the changeset viewer.