Changeset ffd0ac2 for src/libcfa


Ignore:
Timestamp:
Jan 30, 2018, 2:04:33 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/libcfa
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/iostream

    r2e9aed4 rffd0ac2  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 21 13:55:41 2017
    13 // Update Count     : 145
     12// Last Modified On : Thu Jan 25 13:08:39 2018
     13// Update Count     : 149
    1414//
    1515
     
    124124}; // readable
    125125
     126forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, _Bool & );
     127
    126128forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, char & );
    127129forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, signed char & );
     
    145147forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, long double _Complex & );
    146148
     149// manipulators
     150forall( dtype istype | istream( istype ) ) istype & ?|?( istype &, istype & (*)( istype & ) );
     151forall( dtype istype | istream( istype ) ) istype & endl( istype & is );
     152
    147153struct _Istream_cstrUC { char * s; };
    148154_Istream_cstrUC cstr( char * );
  • src/libcfa/iostream.c

    r2e9aed4 rffd0ac2  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 21 13:55:09 2017
    13 // Update Count     : 427
     12// Last Modified On : Thu Jan 25 13:09:28 2018
     13// Update Count     : 467
    1414//
    1515
     
    1919#include <stdio.h>
    2020#include <stdbool.h>                                                                    // true/false
    21 #include <string.h>                                                                             // strlen
     21//#include <string.h>                                                                           // strlen, strcmp
     22extern int strcmp (const char *__s1, const char *__s2) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
     23extern size_t strlen (const char *__s) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
    2224#include <float.h>                                                                              // DBL_DIG, LDBL_DIG
    2325#include <complex.h>                                                                    // creal, cimag
     
    301303
    302304forall( dtype istype | istream( istype ) )
     305istype & ?|?( 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
     317forall( dtype istype | istream( istype ) )
    303318istype & ?|?( istype & is, char & c ) {
    304319        fmt( is, "%c", &c );                                                            // must pass pointer through varg to fmt
     
    410425} // ?|?
    411426
     427forall( dtype istype | istream( istype ) )
     428istype & ?|?( istype & is, istype & (* manip)( istype & ) ) {
     429        return manip( is );
     430} // ?|?
     431
     432forall( dtype istype | istream( istype ) )
     433istype & endl( istype & is ) {
     434        fmt( is, "%*[ \t\f\n\r\v]" );                                           // ignore whitespace
     435        return is;
     436} // endl
     437
    412438_Istream_cstrUC cstr( char * str ) { return (_Istream_cstrUC){ str }; }
    413439forall( dtype istype | istream( istype ) )
  • src/libcfa/stdlib.c

    r2e9aed4 rffd0ac2  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // algorithm.c --
     7// stdlib.c --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jan  2 12:20:32 2018
    13 // Update Count     : 441
     12// Last Modified On : Wed Jan  3 08:29:29 2018
     13// Update Count     : 444
    1414//
    1515
     
    2424#include <complex.h>                                                                    // _Complex_I
    2525#include <assert.h>
     26
     27//---------------------------------------
    2628
    2729// resize, non-array types
     
    257259//---------------------------------------
    258260
    259 extern "C" { void srandom( unsigned int seed ) { srand48( seed ); } } // override C version
     261extern "C" { void srandom( unsigned int seed ) { srand48( (long int)seed ); } } // override C version
    260262char random( void ) { return (unsigned long int)random(); }
    261263char random( char u ) { return random( (unsigned long int)u ); }
Note: See TracChangeset for help on using the changeset viewer.