Changeset 53634f9 in mainline for kernel/generic/include/macros.h


Ignore:
Timestamp:
2009-01-31T13:24:32Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1e241723
Parents:
896ad9f
Message:

make RANDI a generic macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/macros.h

    r896ad9f r53634f9  
    7777#define STRING_ARG(arg) #arg
    7878
     79/** Pseudorandom generator
     80 *
     81 * A pretty standard linear congruential pseudorandom
     82 * number generator (m = 2^32 or 2^64 depending on architecture).
     83 *
     84 */
     85#define RANDI(seed) \
     86        ({ \
     87                (seed) = 1103515245 * (seed) + 12345; \
     88                (seed); \
     89        })
     90
    7991#endif
    8092
Note: See TracChangeset for help on using the changeset viewer.