Ignore:
Timestamp:
Jul 3, 2018, 9:07:31 AM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
9459c01, e3b2474
Parents:
4c3ee8d
Message:

use distribution for SC qualifiers, and inline routines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib.c

    r4c3ee8d rbbe1a87  
    1010// Created On       : Thu Jan 28 17:10:29 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  2 06:15:05 2018
    13 // Update Count     : 448
     12// Last Modified On : Tue Jul  3 08:17:30 2018
     13// Update Count     : 457
    1414//
    1515
     
    249249//---------------------------------------
    250250
    251 extern "C" { void srandom( unsigned int seed ) { srand48( (long int)seed ); } } // override C version
    252 char random( void ) { return (unsigned long int)random(); }
    253 char random( char u ) { return random( (unsigned long int)u ); }
    254 char random( char l, char u ) { return random( (unsigned long int)l, (unsigned long int)u ); }
    255 int random( void ) { return (long int)random(); }
    256 int random( int u ) { return random( (long int)u ); }
    257 int random( int l, int u ) { return random( (long int)l, (long int)u ); }
    258 unsigned int random( void ) { return (unsigned long int)random(); }
    259 unsigned int random( unsigned int u ) { return random( (unsigned long int)u ); }
    260 unsigned int random( unsigned int l, unsigned int u ) { return random( (unsigned long int)l, (unsigned long int)u ); }
    261 extern "C" { long int random( void ) { return mrand48(); } } // override C version
    262 long int random( long int u ) { if ( u < 0 ) return random( u, 0 ); else return random( 0, u ); }
    263 long int random( long int l, long int u ) { assert( l < u ); return lrand48() % (u - l) + l; }
    264 unsigned long int random( void ) { return lrand48(); }
    265 unsigned long int random( unsigned long int u ) { return lrand48() % u; }
    266 unsigned long int random( unsigned long int l, unsigned long int u ) { assert( l < u ); return lrand48() % (u - l) + l; }
     251extern "C" {                                                                                    // override C version
     252        void srandom( unsigned int seed ) { srand48( (long int)seed ); }
     253        long int random( void ) { return mrand48(); }
     254} // extern "C"
     255
    267256float random( void ) { return (float)drand48(); }               // cast otherwise float uses lrand48
    268257double random( void ) { return drand48(); }
Note: See TracChangeset for help on using the changeset viewer.