Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/stdlib.hfa

    raa0a1ad r2210cfc  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jan  2 22:53:57 2022
    13 // Update Count     : 594
     12// Last Modified On : Mon Jan 10 17:03:18 2022
     13// Update Count     : 619
    1414//
    1515
     
    2121#include <stdlib.h>                                                                             // *alloc, strto*, ato*
    2222#include <heap.hfa>
     23
    2324
    2425// Reduce includes by explicitly defining these routines.
     
    391392}; // PRNG
    392393
    393 extern uint32_t prng( PRNG & prng ) __attribute__(( warn_unused_result )); // [0,UINT_MAX]
     394uint32_t prng( PRNG & prng ) __attribute__(( warn_unused_result )); // [0,UINT_MAX]
    394395static inline {
    395396        void set_seed( PRNG & prng, uint32_t seed_ ) with( prng ) { state = seed = seed_; } // set seed
     
    402403} // distribution
    403404
    404 extern void set_seed( uint32_t seed );                                  // set per thread seed
    405 extern uint32_t get_seed();                                                             // get seed
    406 extern uint32_t prng( void ) __attribute__(( warn_unused_result )); // [0,UINT_MAX]
     405void set_seed( uint32_t seed_ ) OPTIONAL_THREAD;
     406uint32_t get_seed() __attribute__(( warn_unused_result ));
     407uint32_t prng( void ) __attribute__(( warn_unused_result )) OPTIONAL_THREAD; // [0,UINT_MAX]
    407408static inline {
    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]
     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]
    412411} // distribution
    413412
Note: See TracChangeset for help on using the changeset viewer.