Changeset b3f9a0cb for src/libcfa
- Timestamp:
- Apr 4, 2016, 1:18:17 PM (10 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, string, stuck-waitfor-destruct, with_gc
- Children:
- afc1045
- Parents:
- 89173242 (diff), 3cfe27f (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. - Location:
- src/libcfa
- Files:
-
- 11 deleted
- 6 edited
-
Makefile.am (modified) (2 diffs)
-
Makefile.in (modified) (1 diff)
-
bfd.h (deleted)
-
bfdlink.h (deleted)
-
builtins.cf (modified) (1 diff)
-
demangle.h (deleted)
-
dialog.h (deleted)
-
evdns.h (deleted)
-
evhttp.h (deleted)
-
evrpc.h (deleted)
-
fcntl.h (deleted)
-
form.h (deleted)
-
gcrypt.h (deleted)
-
iostream.c (modified) (2 diffs)
-
math.h (deleted)
-
stdlib (modified) (4 diffs)
-
stdlib.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/Makefile.am
r89173242 rb3f9a0cb 11 11 ## Created On : Sun May 31 08:54:01 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Wed Feb 3 11:19:35201614 ## Update Count : 11 713 ## Last Modified On : Wed Mar 2 22:59:23 2016 14 ## Update Count : 119 15 15 ############################################################################### 16 16 … … 63 63 libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c} 64 64 65 cheaders = bfd bfdlink demangle dialog evdns evhttp evrpc expat fcntl form gcrypt math65 cheaders = # expat 66 66 cfaheaders = limits 67 67 include_HEADERS = ${cheaders:=.h} ${libs} ${cfaheaders} -
src/libcfa/Makefile.in
r89173242 rb3f9a0cb 215 215 libs = stdlib iostream fstream iterator 216 216 libcfa_a_SOURCES = libcfa-prelude.c ${libs:=.c} 217 cheaders = bfd bfdlink demangle dialog evdns evhttp evrpc expat fcntl form gcrypt math217 cheaders = # expat 218 218 cfaheaders = limits 219 219 include_HEADERS = ${cheaders:=.h} ${libs} ${cfaheaders} -
src/libcfa/builtins.cf
r89173242 rb3f9a0cb 584 584 int __builtin_LINE(); 585 585 extern const char *__PRETTY_FUNCTION__; 586 typedef int wchar_t; -
src/libcfa/iostream.c
r89173242 rb3f9a0cb 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 18:06:35201613 // Update Count : 2 0812 // Last Modified On : Mon Mar 7 13:51:23 2016 13 // Update Count : 227 14 14 // 15 15 … … 133 133 forall( dtype ostype | ostream( ostype ) ) 134 134 ostype * ?|?( ostype *os, const char *cp ) { 135 enum { Open = 1, Close, OpenClose }; 136 static const char mask[256] = { 137 // opening delimiters 138 ['('] : Open, ['['] : Open, ['{'] : Open, 139 ['$'] : Open, [L'£'] : Open, [L'¥'] : Open, [L'¢'] : Open, [L'¿'] : Open, [L'«'] : Open, 140 // closing delimiters 141 [','] : Close, ['.'] : Close, [':'] : Close, [';'] : Close, ['!'] : Close, ['?'] : Close, 142 [')'] : Close, [']'] : Close, ['}'] : Close, 143 ['%'] : Close, [L'»'] : Close, 144 // opening-closing delimiters 145 ['\''] : OpenClose, ['`'] : OpenClose, ['"'] : OpenClose, 146 }; // mask 147 135 148 int len = strlen( cp ); 136 149 // null string => no separator 137 150 if ( len == 0 ) { sepOff( os ); return os; } 138 // first character NOT spacing or specialpunctuation => add left separator139 if ( sepPrt( os ) && isspace( cp[0] ) == 0 && cp[0] != '.' && cp[0] != ',') {151 // first character NOT spacing or closing punctuation => add left separator 152 if ( sepPrt( os ) && isspace( cp[0] ) == 0 && mask[ cp[0] ] != Close && mask[ cp[0] ] != OpenClose ) { 140 153 prtfmt( os, "%s", sepGet( os ) ); 141 154 } // if 142 // last character is spacing or specialpunctuation => turn off separator for next item155 // last character IS spacing or opening punctuation => turn off separator for next item 143 156 unsigned int posn = len - 1; 144 if ( isspace( cp[posn] ) || cp[posn] == ':' || cp[posn] == '$') {157 if ( isspace( cp[posn] ) || mask[ cp[posn] ] == Open || mask[ cp[posn] ] == OpenClose ) { 145 158 sepOff( os ); 146 159 } else { -
src/libcfa/stdlib
r89173242 rb3f9a0cb 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:38:21201613 // Update Count : 6 412 // Last Modified On : Tue Mar 22 22:34:24 2016 13 // Update Count : 69 14 14 // 15 15 … … 19 19 #include <stddef.h> // size_t 20 20 } // extern "C" 21 22 forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill23 forall( otype T ) T * memset( T * ptr ); // remove when default value available24 21 25 22 forall( otype T ) T * malloc( void ); … … 34 31 forall( otype T ) T * memalign( size_t alignment ); // deprecated 35 32 forall( otype T ) int posix_memalign( T ** ptr, size_t alignment ); 33 34 forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill 35 forall( otype T ) T * memset( T * ptr ); // remove when default value available 36 36 37 37 //--------------------------------------- … … 93 93 //--------------------------------------- 94 94 95 void rand seed( long int s );96 char rand om();97 int rand om();98 unsigned int rand om();99 long int rand om();100 unsigned long int rand om();101 float rand om();102 double rand om();103 float _Complex rand om();104 double _Complex rand om();105 long double _Complex rand om();95 void rand48seed( long int s ); 96 char rand48(); 97 int rand48(); 98 unsigned int rand48(); 99 long int rand48(); 100 unsigned long int rand48(); 101 float rand48(); 102 double rand48(); 103 float _Complex rand48(); 104 double _Complex rand48(); 105 long double _Complex rand48(); 106 106 107 107 //--------------------------------------- -
src/libcfa/stdlib.c
r89173242 rb3f9a0cb 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:38:47201613 // Update Count : 14 312 // Last Modified On : Wed Mar 23 13:26:42 2016 13 // Update Count : 146 14 14 // 15 15 … … 26 26 #include <complex.h> // _Complex_I, cabsf, cabs, cabsl 27 27 } // extern "C" 28 29 forall( otype T ) T * memset( T * ptr, unsigned char fill ) { // use default value '\0' for fill30 printf( "memset1\n" );31 return (T *)memset( ptr, (int)fill, malloc_usable_size( ptr ) );32 } // memset33 forall( otype T ) T * memset( T * ptr ) { // remove when default value available34 printf( "memset2\n" );35 return (T *)memset( ptr, 0, malloc_usable_size( ptr ) );36 } // memset37 28 38 29 forall( otype T ) T * malloc( void ) { … … 91 82 } // posix_memalign 92 83 84 forall( otype T ) T * memset( T * ptr, unsigned char fill ) { // use default value '\0' for fill 85 printf( "memset1\n" ); 86 return (T *)memset( ptr, (int)fill, malloc_usable_size( ptr ) ); 87 } // memset 88 forall( otype T ) T * memset( T * ptr ) { // remove when default value available 89 printf( "memset2\n" ); 90 return (T *)memset( ptr, 0, malloc_usable_size( ptr ) ); 91 } // memset 92 93 93 //--------------------------------------- 94 94 … … 243 243 //--------------------------------------- 244 244 245 void rand seed( long int s ) { srand48( s ); }246 char rand om() { return lrand48(); }247 int rand om() { return mrand48(); }248 unsigned int rand om() { return lrand48(); }249 long int rand om() { return mrand48(); }250 unsigned long int rand om() { return lrand48(); }251 float rand om() { return (float)drand48(); } // otherwise float uses lrand48252 double rand om() { return drand48(); }253 float _Complex rand om() { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); }254 double _Complex rand om() { return drand48() + (double _Complex)(drand48() * _Complex_I); }255 long double _Complex rand om() { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); }245 void rand48seed( long int s ) { srand48( s ); } 246 char rand48() { return mrand48(); } 247 int rand48() { return mrand48(); } 248 unsigned int rand48() { return lrand48(); } 249 long int rand48() { return mrand48(); } 250 unsigned long int rand48() { return lrand48(); } 251 float rand48() { return (float)drand48(); } // otherwise float uses lrand48 252 double rand48() { return drand48(); } 253 float _Complex rand48() { return (float)drand48() + (float _Complex)(drand48() * _Complex_I); } 254 double _Complex rand48() { return drand48() + (double _Complex)(drand48() * _Complex_I); } 255 long double _Complex rand48() { return (long double)drand48() + (long double _Complex)(drand48() * _Complex_I); } 256 256 257 257 //---------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.