Changeset f6a4917
- Timestamp:
- Aug 25, 2022, 10:43:36 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 51fbba5
- Parents:
- d2f09e4
- Location:
- libcfa/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
rd2f09e4 rf6a4917 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 19 08:15:53202213 // Update Count : 135 212 // Last Modified On : Thu Aug 25 18:05:49 2022 13 // Update Count : 1354 14 14 // 15 15 … … 197 197 fmt( os, "%s", buf ); \ 198 198 if ( isfinite( val ) ) { /* if number, print decimal point when no fraction or exponent */ \ 199 for ( i nt i = 0;; i += 1) { \199 for ( i; 0 ~ @ ) { \ 200 200 if ( i == len ) { fmt( os, "." ); break; } \ 201 201 if ( buf[i] == '.' || buf[i] == 'e' || buf[i] == 'E' ) break; /* decimal point or scientific ? */ \ -
libcfa/src/rational.cfa
rd2f09e4 rf6a4917 10 10 // Created On : Wed Apr 6 17:54:28 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 20 16:30:06 202113 // Update Count : 19 312 // Last Modified On : Thu Aug 25 18:09:58 2022 13 // Update Count : 194 14 14 // 15 15 … … 26 26 // rationals. alternative: https://en.wikipedia.org/wiki/Binary_GCD_algorithm 27 27 static T gcd( T a, T b ) { 28 for ( ;; ) {// Euclid's algorithm28 for () { // Euclid's algorithm 29 29 T r = a % b; 30 30 if ( r == (T){0} ) break; … … 246 246 247 247 // find terms until denom gets too big 248 for ( ;;) {248 for () { 249 249 ai = convert( f ); 250 250 if ( ! (m10 * ai + m11 <= md) ) break; -
libcfa/src/stdlib.cfa
rd2f09e4 rf6a4917 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 -
libcfa/src/stdlib.hfa
rd2f09e4 rf6a4917 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 18 17:57:36 202213 // Update Count : 64 412 // Last Modified On : Thu Aug 25 18:07:06 2022 13 // Update Count : 645 14 14 // 15 15 … … 192 192 memset( (char *)ptr + copy_end, (int)Fill.c, Dim * size - copy_end ); 193 193 } else if ( Fill.tag == 't' ) { 194 for ( i nt i = copy_end; i < Dim * size; i +=size ) {194 for ( i; copy_end ~ Dim * size ~ size ) { 195 195 #pragma GCC diagnostic push 196 196 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
Note: See TracChangeset
for help on using the changeset viewer.