Changeset 0f9e4403 for src/libcfa/stdlib
- Timestamp:
- Apr 15, 2016, 12:03:11 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 29ad0ac
- Parents:
- c5833e8 (diff), 37f0da8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/stdlib
rc5833e8 r0f9e4403 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 5 15:21:18201613 // Update Count : 6112 // Last Modified On : Wed Apr 13 14:45:53 2016 13 // Update Count : 85 14 14 // 15 15 … … 20 20 } // extern "C" 21 21 22 forall( type T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill 23 forall( type T ) T * memset( T * ptr ); // remove when default value available 22 //--------------------------------------- 24 23 25 forall( type T ) T * malloc( void ); 26 forall( type T ) T * malloc( char fill ); 27 forall( type T ) T * malloc( size_t size ); 28 forall( type T ) T * malloc( T * ptr, size_t size ); 29 forall( type T ) T * malloc( T * ptr, size_t size, unsigned char fill ); 30 forall( type T ) T * calloc( size_t size ); 31 forall( type T ) T * realloc( T * ptr, size_t size ); 32 forall( type T ) T * realloc( T * ptr, size_t size, unsigned char fill ); 24 extern "C" { 25 #ifndef EXIT_FAILURE 26 #define EXIT_FAILURE 1 // failing exit status 27 #define EXIT_SUCCESS 0 // successful exit status 28 #endif // ! EXIT_FAILURE 29 void exit( int rc ); 30 } // extern "C" 33 31 34 forall( type T ) T * aligned_alloc( size_t alignment ); 35 forall( type T ) T * memalign( size_t alignment ); // deprecated 36 forall( type T ) int posix_memalign( T ** ptr, size_t alignment ); 32 //--------------------------------------- 33 34 extern "C" { 35 void * malloc( size_t ); // use default C routine for void * 36 } // extern "C" 37 forall( otype T ) T * malloc( void ); 38 forall( otype T ) T * malloc( char fill ); 39 forall( otype T ) T * malloc( T * ptr, size_t size ); 40 forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill ); 41 extern "C" { 42 void * calloc( size_t nmemb, size_t size ); // use default C routine for void * 43 } // extern "C" 44 forall( otype T ) T * calloc( size_t nmemb ); 45 extern "C" { 46 void * realloc( void * ptr, size_t size ); // use default C routine for void * 47 } // extern "C" 48 forall( otype T ) T * realloc( T * ptr, size_t size ); 49 forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill ); 50 51 forall( otype T ) T * aligned_alloc( size_t alignment ); 52 forall( otype T ) T * memalign( size_t alignment ); // deprecated 53 forall( otype T ) int posix_memalign( T ** ptr, size_t alignment ); 54 55 forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill 56 forall( otype T ) T * memset( T * ptr ); // remove when default value available 37 57 38 58 //--------------------------------------- … … 66 86 //--------------------------------------- 67 87 68 forall( type T | { int ?<?( T, T ); } )88 forall( otype T | { int ?<?( T, T ); } ) 69 89 T * bsearch( const T key, const T * arr, size_t dimension ); 70 90 71 forall( type T | { int ?<?( T, T ); } )91 forall( otype T | { int ?<?( T, T ); } ) 72 92 void qsort( const T * arr, size_t dimension ); 73 93 74 94 //--------------------------------------- 75 95 76 forall( type T | { T ?/?( T, T ); T ?%?( T, T ); } )96 forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } ) 77 97 [ T, T ] div( T t1, T t2 ); 78 98 … … 81 101 char abs( char ); 82 102 extern "C" { 83 int abs( int ); // use default C routine for int84 } // extern 103 int abs( int ); // use default C routine for int 104 } // extern "C" 85 105 long int abs( long int ); 86 106 long long int abs( long long int ); … … 94 114 //--------------------------------------- 95 115 96 void randseed( long int s);97 char random(); 98 int random(); 99 unsigned int random(); 100 long int random();101 unsigned long int random(); 102 float random();103 double random(); 104 float _Complex random(); 105 double _Complex random(); 106 long double _Complex random();116 float floor( float ); 117 extern "C" { 118 double floor( double ); // use C routine for double 119 } // extern "C" 120 long double floor( long double ); 121 122 float ceil( float ); 123 extern "C" { 124 double ceil( double ); // use C routine for double 125 } // extern "C" 126 long double ceil( long double ); 107 127 108 128 //--------------------------------------- 109 129 110 forall( type T | { int ?<?( T, T ); } ) 130 void rand48seed( long int s ); 131 char rand48(); 132 int rand48(); 133 unsigned int rand48(); 134 long int rand48(); 135 unsigned long int rand48(); 136 float rand48(); 137 double rand48(); 138 float _Complex rand48(); 139 double _Complex rand48(); 140 long double _Complex rand48(); 141 142 //--------------------------------------- 143 144 forall( otype T | { int ?<?( T, T ); } ) 111 145 T min( const T t1, const T t2 ); 112 146 113 forall( type T | { int ?>?( T, T ); } )147 forall( otype T | { int ?>?( T, T ); } ) 114 148 T max( const T t1, const T t2 ); 115 149 116 forall( type T )150 forall( otype T ) 117 151 void swap( T * t1, T * t2 ); 118 152
Note:
See TracChangeset
for help on using the changeset viewer.