Changeset 6e50a6b for libcfa/src
- Timestamp:
- Jun 18, 2021, 12:20:59 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c7d8696a
- Parents:
- dcbfcbc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/array.hfa
rdcbfcbc r6e50a6b 1 1 2 2 3 // a type whose size is n 4 #define Z(n) char[n] 5 6 // the inverse of Z(-) 7 #define z(N) sizeof(N) 8 9 forall( T & ) struct tag {}; 3 forall( __CFA_tysys_id_only_X & ) struct tag {}; 10 4 #define ttag(T) ((tag(T)){}) 11 #define ztag(n) ttag( Z(n))5 #define ztag(n) ttag(n) 12 6 13 7 … … 18 12 forall( [N], S & | sized(S), Timmed &, Tbase & ) { 19 13 struct arpk { 20 S strides[ z(N)];14 S strides[N]; 21 15 }; 22 16 … … 56 50 57 51 static inline size_t ?`len( arpk(N, S, Timmed, Tbase) & a ) { 58 return z(N);52 return N; 59 53 } 60 54 61 55 // workaround #226 (and array relevance thereof demonstrated in mike102/otype-slow-ndims.cfa) 62 56 static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) { 63 void ?{}( S (&inner)[ z(N)] ) {}57 void ?{}( S (&inner)[N] ) {} 64 58 ?{}(this.strides); 65 59 } 66 60 static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) { 67 void ^?{}( S (&inner)[ z(N)] ) {}61 void ^?{}( S (&inner)[N] ) {} 68 62 ^?{}(this.strides); 69 63 }
Note: See TracChangeset
for help on using the changeset viewer.