Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/stdlib.hfa

    r2210cfc raa0a1ad  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jan 10 17:03:18 2022
    13 // Update Count     : 619
     12// Last Modified On : Sun Jan  2 22:53:57 2022
     13// Update Count     : 594
    1414//
    1515
     
    2121#include <stdlib.h>                                                                             // *alloc, strto*, ato*
    2222#include <heap.hfa>
    23 
    2423
    2524// Reduce includes by explicitly defining these routines.
     
    392391}; // PRNG
    393392
    394 uint32_t prng( PRNG & prng ) __attribute__(( warn_unused_result )); // [0,UINT_MAX]
     393extern uint32_t prng( PRNG & prng ) __attribute__(( warn_unused_result )); // [0,UINT_MAX]
    395394static inline {
    396395        void set_seed( PRNG & prng, uint32_t seed_ ) with( prng ) { state = seed = seed_; } // set seed
     
    403402} // distribution
    404403
    405 void set_seed( uint32_t seed_ ) OPTIONAL_THREAD;
    406 uint32_t get_seed() __attribute__(( warn_unused_result ));
    407 uint32_t prng( void ) __attribute__(( warn_unused_result )) OPTIONAL_THREAD; // [0,UINT_MAX]
     404extern void set_seed( uint32_t seed );                                  // set per thread seed
     405extern uint32_t get_seed();                                                             // get seed
     406extern uint32_t prng( void ) __attribute__(( warn_unused_result )); // [0,UINT_MAX]
    408407static inline {
    409         uint32_t prng( uint32_t u ) __attribute__(( warn_unused_result )) { return prng() % u; } // [0,u)
    410         uint32_t prng( uint32_t l, uint32_t u ) __attribute__(( warn_unused_result )) { return prng( u - l + 1 ) + l; } // [l,u]
     408        uint32_t prng( uint32_t u ) __attribute__(( warn_unused_result ));
     409        uint32_t prng( uint32_t u ) { return prng() % u; }      // [0,u)
     410        uint32_t prng( uint32_t l, uint32_t u ) __attribute__(( warn_unused_result ));
     411        uint32_t prng( uint32_t l, uint32_t u ) { return prng( u - l + 1 ) + l; } // [l,u]
    411412} // distribution
    412413
Note: See TracChangeset for help on using the changeset viewer.