Changeset ffd0ac2 for src/libcfa
- Timestamp:
- Jan 30, 2018, 2:04:33 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:
- 42be3c3
- Parents:
- 2e9aed4 (diff), 5a73f0f (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:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream
r2e9aed4 rffd0ac2 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 21 13:55:41 201713 // Update Count : 14 512 // Last Modified On : Thu Jan 25 13:08:39 2018 13 // Update Count : 149 14 14 // 15 15 … … 124 124 }; // readable 125 125 126 forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, _Bool & ); 127 126 128 forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, char & ); 127 129 forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, signed char & ); … … 145 147 forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, long double _Complex & ); 146 148 149 // manipulators 150 forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, istype & (*)( istype & ) ); 151 forall( dtype istype | istream( istype ) ) istype & endl( istype & is ); 152 147 153 struct _Istream_cstrUC { char * s; }; 148 154 _Istream_cstrUC cstr( char * ); -
src/libcfa/iostream.c
r2e9aed4 rffd0ac2 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 21 13:55:09 201713 // Update Count : 4 2712 // Last Modified On : Thu Jan 25 13:09:28 2018 13 // Update Count : 467 14 14 // 15 15 … … 19 19 #include <stdio.h> 20 20 #include <stdbool.h> // true/false 21 #include <string.h> // strlen 21 //#include <string.h> // strlen, strcmp 22 extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); 23 extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); 22 24 #include <float.h> // DBL_DIG, LDBL_DIG 23 25 #include <complex.h> // creal, cimag … … 301 303 302 304 forall( dtype istype | istream( istype ) ) 305 istype & ?|?( istype & is, _Bool & b ) { 306 char val[6]; 307 fmt( is, "%5s", val ); 308 if ( strcmp( val, "true" ) == 0 ) b = true; 309 else if ( strcmp( val, "false" ) == 0 ) b = false; 310 else { 311 fprintf( stderr, "invalid _Bool constant\n" ); 312 abort(); 313 } // if 314 return is; 315 } // ?|? 316 317 forall( dtype istype | istream( istype ) ) 303 318 istype & ?|?( istype & is, char & c ) { 304 319 fmt( is, "%c", &c ); // must pass pointer through varg to fmt … … 410 425 } // ?|? 411 426 427 forall( dtype istype | istream( istype ) ) 428 istype & ?|?( istype & is, istype & (* manip)( istype & ) ) { 429 return manip( is ); 430 } // ?|? 431 432 forall( dtype istype | istream( istype ) ) 433 istype & endl( istype & is ) { 434 fmt( is, "%*[ \t\f\n\r\v]" ); // ignore whitespace 435 return is; 436 } // endl 437 412 438 _Istream_cstrUC cstr( char * str ) { return (_Istream_cstrUC){ str }; } 413 439 forall( dtype istype | istream( istype ) ) -
src/libcfa/stdlib.c
r2e9aed4 rffd0ac2 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // algorithm.c --7 // stdlib.c -- 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jan 2 12:20:32201813 // Update Count : 44 112 // Last Modified On : Wed Jan 3 08:29:29 2018 13 // Update Count : 444 14 14 // 15 15 … … 24 24 #include <complex.h> // _Complex_I 25 25 #include <assert.h> 26 27 //--------------------------------------- 26 28 27 29 // resize, non-array types … … 257 259 //--------------------------------------- 258 260 259 extern "C" { void srandom( unsigned int seed ) { srand48( seed ); } } // override C version261 extern "C" { void srandom( unsigned int seed ) { srand48( (long int)seed ); } } // override C version 260 262 char random( void ) { return (unsigned long int)random(); } 261 263 char random( char u ) { return random( (unsigned long int)u ); }
Note: See TracChangeset
for help on using the changeset viewer.