Changeset 8dc51c8
- Timestamp:
- May 24, 2017, 10:46:56 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 58ed882
- Parents:
- d997f8e
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/stdlib
rd997f8e r8dc51c8 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 9 08:42:44201713 // Update Count : 1 0712 // Last Modified On : Wed May 24 18:06:27 2017 13 // Update Count : 115 14 14 // 15 15 … … 28 28 //--------------------------------------- 29 29 30 extern "C" { void * malloc( size_t ); } // use default C routine for void *31 30 forall( dtype T | sized(T) ) T * malloc( void ); 32 31 forall( dtype T | sized(T) ) T * malloc( char fill ); … … 42 41 forall( dtype T | sized(T) ) T * memalign( size_t alignment ); // deprecated 43 42 forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment ); 44 45 extern "C" {46 void * memset( void * ptr, int fill, size_t size );47 void free( void * ptr );48 } // extern "C"49 43 50 44 forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p ); … … 109 103 double abs( double _Complex ); 110 104 long double abs( long double _Complex ); 111 forall 105 forall( otype T | { void ?{}( T *, zero_t ); int ?<?( T, T ); T -?( T ); } ) 112 106 T abs( T ); 113 107 … … 115 109 116 110 void rand48seed( long int s ); 117 char rand48( );118 int rand48( );119 unsigned int rand48( );120 long int rand48( );121 unsigned long int rand48( );122 float rand48( );123 double rand48( );124 float _Complex rand48( );125 double _Complex rand48( );126 long double _Complex rand48( );111 char rand48( void ); 112 int rand48( void ); 113 unsigned int rand48( void ); 114 long int rand48( void ); 115 unsigned long int rand48( void ); 116 float rand48( void ); 117 double rand48( void ); 118 float _Complex rand48( void ); 119 double _Complex rand48( void ); 120 long double _Complex rand48( void ); 127 121 128 122 //--------------------------------------- -
src/libcfa/stdlib.c
rd997f8e r8dc51c8 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue May 9 08:43:00201713 // Update Count : 19 112 // Last Modified On : Wed May 24 18:13:15 2017 13 // Update Count : 198 14 14 // 15 15 … … 279 279 280 280 void rand48seed( long int s ) { srand48( s ); } 281 char rand48( ) { return mrand48(); }282 int rand48( ) { return mrand48(); }283 unsigned int rand48( ) { return lrand48(); }284 long int rand48( ) { return mrand48(); }285 unsigned long int rand48( ) { return lrand48(); }286 float rand48( ) { return (float)drand48(); }// otherwise float uses lrand48287 double rand48( ) { return drand48(); }288 float _Complex rand48( ) { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); }289 double _Complex rand48( ) { return drand48() + (double _Complex)(drand48() * _Complex_I); }290 long double _Complex rand48( ) { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); }281 char rand48( void ) { return mrand48(); } 282 int rand48( void ) { return mrand48(); } 283 unsigned int rand48( void ) { return lrand48(); } 284 long int rand48( void ) { return mrand48(); } 285 unsigned long int rand48( void ) { return lrand48(); } 286 float rand48( void ) { return (float)drand48(); } // otherwise float uses lrand48 287 double rand48( void ) { return drand48(); } 288 float _Complex rand48( void ) { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); } 289 double _Complex rand48( void ) { return drand48() + (double _Complex)(drand48() * _Complex_I); } 290 long double _Complex rand48( void) { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); } 291 291 292 292 //---------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.