Changeset c2dfa56a


Ignore:
Timestamp:
Mar 20, 2023, 12:05:20 PM (19 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
e62802f
Parents:
eac318a
Message:

remove SKULLDUGGERY dealing with CFA typedef numbering problem

Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/random.hfa

    reac318a rc2dfa56a  
    1010// Created On       : Fri Jan 14 07:18:11 2022
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Dec 22 20:54:22 2022
    13 // Update Count     : 178
     12// Last Modified On : Mon Mar 20 10:01:40 2023
     13// Update Count     : 180
    1414//
    1515
     
    4444// Define C/CFA PRNG name and random-state.
    4545
    46 // SKULLDUGGERY: typedefs name struct and typedef with the same name to deal with CFA typedef numbering problem.
    47 
    4846#ifdef XOSHIRO256PP
    4947#define PRNG_NAME_64 xoshiro256pp
    5048#define PRNG_STATE_64_T GLUE(PRNG_NAME_64,_t)
    51 typedef struct PRNG_STATE_64_T { uint64_t s0, s1, s2, s3; } PRNG_STATE_64_T;
     49typedef struct { uint64_t s0, s1, s2, s3; } PRNG_STATE_64_T;
    5250#endif // XOSHIRO256PP
    5351
     
    5553#define PRNG_NAME_32 xoshiro128pp
    5654#define PRNG_STATE_32_T GLUE(PRNG_NAME_32,_t)
    57 typedef struct PRNG_STATE_32_T { uint32_t s0, s1, s2, s3; } PRNG_STATE_32_T;
     55typedef struct { uint32_t s0, s1, s2, s3; } PRNG_STATE_32_T;
    5856#endif // XOSHIRO128PP
    5957
     
    8684#define PRNG_NAME_64 kiss_64
    8785#define PRNG_STATE_64_T GLUE(PRNG_NAME_64,_t)
    88 typedef struct PRNG_STATE_64_T { uint64_t z, w, jsr, jcong; } PRNG_STATE_64_T;
     86typedef struct { uint64_t z, w, jsr, jcong; } PRNG_STATE_64_T;
    8987#endif // KISS_^64
    9088
     
    9290#define PRNG_NAME_32 xorwow
    9391#define PRNG_STATE_32_T GLUE(PRNG_NAME_32,_t)
    94 typedef struct PRNG_STATE_32_T { uint32_t a, b, c, d, counter; } PRNG_STATE_32_T;
     92typedef struct { uint32_t a, b, c, d, counter; } PRNG_STATE_32_T;
    9593#endif // XOSHIRO128PP
    9694
     
    130128
    131129#ifndef XOSHIRO256PP
    132 typedef struct xoshiro256pp_t { uint64_t s0, s1, s2, s3; } xoshiro256pp_t;
     130typedef struct { uint64_t s0, s1, s2, s3; } xoshiro256pp_t;
    133131#endif // ! XOSHIRO256PP
    134132
     
    152150static inline void xoshiro256pp_set_seed( xoshiro256pp_t & state, uint64_t seed ) {
    153151        state = (xoshiro256pp_t){ seed, seed, seed, seed };
    154         xoshiro256pp( state );
     152        xoshiro256pp( state );                                                          // prime
    155153} // xoshiro256pp_set_seed
    156154
     
    165163
    166164#ifndef XOSHIRO128PP
    167 typedef struct xoshiro128pp_t { uint32_t s0, s1, s2, s3; } xoshiro128pp_t;
     165typedef struct { uint32_t s0, s1, s2, s3; } xoshiro128pp_t;
    168166#endif // ! XOSHIRO128PP
    169167
     
    272270// The state must be seeded with a nonzero value.
    273271#ifndef KISS_64
    274 typedef struct kiss_64_t { uint64_t z, w, jsr, jcong; } kiss_64_t;
     272typedef struct { uint64_t z, w, jsr, jcong; } kiss_64_t;
    275273#endif // ! KISS_64
    276274
     
    294292// The state array must be initialized to non-zero in the first four words.
    295293#ifndef XORWOW
    296 typedef struct xorwow_t { uint32_t a, b, c, d, counter; } xorwow_t;
     294typedef struct { uint32_t a, b, c, d, counter; } xorwow_t;
    297295#endif // ! XORWOW
    298296
Note: See TracChangeset for help on using the changeset viewer.