Changes in / [e04c5ff:d9b499c]
 Location:
 src/libcfa
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

src/libcfa/stdlib
re04c5ff rd9b499c 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 6 14:28:55201613 // Update Count : 9 912 // Last Modified On : Tue Jul 5 09:56:31 2016 13 // Update Count : 98 14 14 // 15 15 … … 76 76 77 77 forall( otype T  { int ?<?( T, T ); } ) 78 T * bsearch( T key, const T * arr, size_t dimension );78 T * bsearch( const T key, const T * arr, size_t dimension ); 79 79 80 80 forall( otype T  { int ?<?( T, T ); } ) … … 116 116 117 117 forall( otype T  { int ?<?( T, T ); } ) 118 T min( T t1,T t2 );118 T min( const T t1, const T t2 ); 119 119 120 120 forall( otype T  { int ?>?( T, T ); } ) 121 T max( T t1,T t2 );121 T max( const T t1, const T t2 ); 122 122 123 123 forall( otype T  { T min( T, T ); T max( T, T ); } ) 124 T clamp( T value, T min_val,T max_val );124 T clamp( const T value, const T min_val, const T max_val ); 125 125 126 126 forall( otype T ) 
src/libcfa/stdlib.c
re04c5ff rd9b499c 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 6 14:28:57201613 // Update Count : 16 912 // Last Modified On : Thu Jun 30 15:04:25 2016 13 // Update Count : 168 14 14 // 15 15 … … 200 200 201 201 forall( otype T  { int ?<?( T, T ); } ) 202 T * bsearch( T key, const T * arr, size_t dimension ) {202 T * bsearch( const T key, const T * arr, size_t dimension ) { 203 203 int comp( const void * t1, const void * t2 ) { return *(T *)t1 < *(T *)t2 ? 1 : *(T *)t2 < *(T *)t1 ? 1 : 0; } 204 204 return (T *)bsearch( &key, arr, dimension, sizeof(T), comp ); … … 245 245 246 246 forall( otype T  { int ?<?( T, T ); } ) 247 T min( T t1,T t2 ) {247 T min( const T t1, const T t2 ) { 248 248 return t1 < t2 ? t1 : t2; 249 249 } // min 250 250 251 251 forall( otype T  { int ?>?( T, T ); } ) 252 T max( T t1,T t2 ) {252 T max( const T t1, const T t2 ) { 253 253 return t1 > t2 ? t1 : t2; 254 254 } // max 255 255 256 256 forall( otype T  { T min( T, T ); T max( T, T ); } ) 257 T clamp( T value, T min_val,T max_val ) {257 T clamp( const T value, const T min_val, const T max_val ) { 258 258 return max( min_val, min( value, max_val ) ); 259 259 } // clamp
Note: See TracChangeset
for help on using the changeset viewer.