summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cqueue.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-04-08 22:37:06 +0200
committerGitHub <[email protected]>2023-04-08 22:37:06 +0200
commit43120f2863a67db416ec3b379eb820e2704cafb7 (patch)
treef3b9917940f94c1582bc39ea6f56b735295ec861 /include/stc/cqueue.h
parente8be14dfc894eeac859f0287d4d5b4f4745c0585 (diff)
parent6426ac05eb8c4dc1ab22aae2eb4139f9671981b7 (diff)
downloadSTC-modified-43120f2863a67db416ec3b379eb820e2704cafb7.tar.gz
STC-modified-43120f2863a67db416ec3b379eb820e2704cafb7.zip
Merge pull request #53 from tylov/dev42
Version 4.2 RC
Diffstat (limited to 'include/stc/cqueue.h')
-rw-r--r--include/stc/cqueue.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/stc/cqueue.h b/include/stc/cqueue.h
index 67909f8e..1934305a 100644
--- a/include/stc/cqueue.h
+++ b/include/stc/cqueue.h
@@ -22,7 +22,7 @@
*/
// STC queue
/*
-#include <stc/crandom.h>
+#include <stc/crand.h>
#include <stdio.h>
#define i_key int
@@ -30,19 +30,19 @@
int main() {
int n = 10000000;
- stc64_t rng = stc64_new(1234);
- stc64_uniform_t dist = stc64_uniform_new(0, n);
+ crand_t rng = crand_init(1234);
+ crand_unif_t dist = crand_unif_init(0, n);
c_auto (cqueue_int, Q)
{
// Push ten million random numbers onto the queue.
for (int i=0; i<n; ++i)
- cqueue_int_push(&Q, stc64_uniform(&rng, &dist));
+ cqueue_int_push(&Q, crand_unif(&rng, &dist));
// Push or pop on the queue ten million times
printf("before: size, capacity: %d, %d\n", n, cqueue_int_size(&Q), cqueue_int_capacity(&Q));
for (int i=n; i>0; --i) {
- int r = stc64_uniform(&rng, &dist);
+ int r = crand_unif(&rng, &dist);
if (r & 1)
++n, cqueue_int_push(&Q, r);
else