- Timestamp:
- Oct 30, 2017, 6:18:06 PM (7 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:
- 9f865d1
- Parents:
- bd7f401
- Location:
- src/libcfa
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/stdlib
rbd7f401 rbfc0f40 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 23 20:29:47201713 // Update Count : 2 2412 // Last Modified On : Mon Oct 30 17:30:09 2017 13 // Update Count : 242 14 14 // 15 15 … … 27 27 // allocation, non-array types 28 28 static inline forall( dtype T | sized(T) ) T * malloc( void ) { 29 // printf( "X1\n" );29 // printf( "* malloc\n" ); 30 30 return (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 31 31 } // malloc 32 33 // static inline forall( dtype T | sized(T) ) T & malloc( void ) { 34 // int & p = *(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 35 // printf( "& malloc %p\n", &p ); 36 // return p; 37 // // return (T &)*(T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc 38 // } // malloc 32 39 33 40 extern "C" { void * calloc( size_t dim, size_t size ); } // default C routine … … 208 215 void rand48seed( long int s ); 209 216 char rand48( void ); 217 char rand48( char l, char u ); 210 218 int rand48( void ); 211 219 unsigned int rand48( void ); 220 unsigned int rand48( unsigned int u ); 221 unsigned int rand48( unsigned int l, unsigned int u ); 212 222 long int rand48( void ); 213 223 unsigned long int rand48( void ); 224 unsigned long int rand48( unsigned long int u ); 225 unsigned long int rand48( unsigned long int l, unsigned long int u ); 214 226 float rand48( void ); 215 227 double rand48( void ); -
src/libcfa/stdlib.c
rbd7f401 rbfc0f40 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 23 20:30:44 201713 // Update Count : 29 212 // Last Modified On : Mon Oct 30 17:53:04 2017 13 // Update Count : 295 14 14 // 15 15 … … 277 277 void rand48seed( long int s ) { srand48( s ); } 278 278 char rand48( void ) { return mrand48(); } 279 char rand48( char l, char u ) { return lrand48() % (u - l) + l; } 279 280 int rand48( void ) { return mrand48(); } 280 281 unsigned int rand48( void ) { return lrand48(); } 282 unsigned int rand48( unsigned int u ) { return lrand48() % u; } 283 unsigned int rand48( unsigned int l, unsigned int u ) { return lrand48() % (u - l) + l; } 281 284 long int rand48( void ) { return mrand48(); } 282 285 unsigned long int rand48( void ) { return lrand48(); } 286 unsigned long int rand48( unsigned long int u ) { return lrand48() % u; } 287 unsigned long int rand48( unsigned long int l, unsigned long int u ) { return lrand48() % (u - l) + l; } 283 288 float rand48( void ) { return (float)drand48(); } // otherwise float uses lrand48 284 289 double rand48( void ) { return drand48(); }
Note: See TracChangeset
for help on using the changeset viewer.