diff options
| author | Tyge Løvset <[email protected]> | 2020-12-28 18:18:48 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-12-28 18:18:48 +0100 |
| commit | 74a75b3a8d155ea155358674d3bf8251658183a5 (patch) | |
| tree | 19886986b9ce6943b826311cda40f67ebc8dd7b1 /stc/cqueue.h | |
| parent | 83b7be31a1d0fc0be4e013dbfc97bb6cdc3600db (diff) | |
| download | STC-modified-74a75b3a8d155ea155358674d3bf8251658183a5.tar.gz STC-modified-74a75b3a8d155ea155358674d3bf8251658183a5.zip | |
Reverted crand.h API back to rename crand_* to stc64_*, and crand_next() -> stc64_rand().
Diffstat (limited to 'stc/cqueue.h')
| -rw-r--r-- | stc/cqueue.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/stc/cqueue.h b/stc/cqueue.h index f16e1aeb..cb4b0563 100644 --- a/stc/cqueue.h +++ b/stc/cqueue.h @@ -32,19 +32,19 @@ int main() {
int n = 10000000;
- crand_t rng = crand_init(1234);
- crand_uniform_t dist = crand_uniform_init(rng, 0, n);
+ stc64_t rng = stc64_init(1234);
+ stc64_uniform_t dist = stc64_uniform_init(rng, 0, n);
cqueue_i queue = cqueue_i_init();
// Push ten million random numbers onto the queue.
for (int i=0; i<n; ++i)
- cqueue_i_push(&queue, crand_uniform(&dist));
+ cqueue_i_push(&queue, stc64_uniform(&dist));
// Push or pop on the queue ten million times
printf("%d\n", n);
for (int i=n; i>0; --i) {
- int r = crand_uniform(&dist);
+ int r = stc64_uniform(&dist);
if (r & 1)
++n, cqueue_i_push(&queue, r);
else
|
