Changes in src/libcfa/stdlib.c [627f585:a797e2b1]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/stdlib.c
r627f585 ra797e2b1 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // algorithm.c -- 7 // algorithm.c -- 8 8 // 9 9 // Author : Peter A. Buhr … … 78 78 } // posix_memalign 79 79 80 forall( otype T, ttype Params | { void ?{}(T *, Params); } )81 T * new( Params p ) {82 return ((T*)malloc()){ p };83 }84 85 forall( dtype T | { void ^?{}(T *); } )86 void delete( T * ptr ) {87 if ( ptr ) {88 ^ptr{};89 free( ptr );90 }91 }92 93 80 //--------------------------------------- 94 81 … … 154 141 if ( sscanf( ptr, "%Lf%Lfi", &re, &im ) == EOF ) {} 155 142 return re + im * _Complex_I; 156 } 143 } 157 144 158 145 int strto( const char * sptr, char ** eptr, int base ) { … … 226 213 //--------------------------------------- 227 214 228 forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )229 [ T, T ] div( T t1, T t2 ) { return [ t1 / t2, t1 % t2 ]; }215 // forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } ) 216 // [ T, T ] div( T t1, T t2 ) { return [ t1 / t2, t1 % t2 ]; } 230 217 231 218 //---------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.