Changeset 7f6a7c9 for libcfa/src/stdlib.cfa
- Timestamp:
- Sep 21, 2022, 11:02:15 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 95dab9e
- Parents:
- 428adbc (diff), 0bd46fd (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/stdlib.cfa
r428adbc r7f6a7c9 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 10 22:41:39202213 // Update Count : 60 212 // Last Modified On : Thu Aug 25 22:41:14 2022 13 // Update Count : 604 14 14 // 15 15 … … 35 35 T * anew( size_t dim, TT p ) { 36 36 T * arr = alloc( dim ); 37 for ( unsigned int i = 0; i < dim; i += 1) {37 for ( i; dim ) { 38 38 (arr[i]){ p }; // run constructor 39 39 } // for … … 45 45 if ( arr ) { // ignore null 46 46 size_t dim = malloc_size( arr ) / sizeof( T ); 47 for ( i nt i = dim - 1; i >= 0; i -= 1 ) {// reverse allocation order, must be unsigned47 for ( i; 0 -~= dim - 1 ) { // reverse allocation order, must be unsigned 48 48 ^(arr[i]){}; // run destructor 49 49 } // for … … 56 56 if ( arr ) { // ignore null 57 57 size_t dim = malloc_size( arr ) / sizeof( T ); 58 for ( i nt i = dim - 1; i >= 0; i -= 1 ) {// reverse allocation order, must be unsigned58 for ( i; 0 -~= dim - 1 ) { // reverse allocation order, must be unsigned 59 59 ^(arr[i]){}; // run destructor 60 60 } // for
Note:
See TracChangeset
for help on using the changeset viewer.