summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/queues/queue.c
diff options
context:
space:
mode:
authortylov <[email protected]>2023-07-21 00:37:28 +0200
committertylov <[email protected]>2023-07-21 00:37:28 +0200
commit2d67f4040f6eecd41f1b864b43c62823ed75aff0 (patch)
tree084ce603dc4edfa1ccad3aabab5b671a817bc67e /misc/examples/queues/queue.c
parent900295256d825fc323149cd223c49787f32a3696 (diff)
downloadSTC-modified-2d67f4040f6eecd41f1b864b43c62823ed75aff0.tar.gz
STC-modified-2d67f4040f6eecd41f1b864b43c62823ed75aff0.zip
Renamed badly abbreviated names in crand.h.
Moved coroutine.h from algo subfolder to stc. Updated coroutine.h and docs.
Diffstat (limited to 'misc/examples/queues/queue.c')
-rw-r--r--misc/examples/queues/queue.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc/examples/queues/queue.c b/misc/examples/queues/queue.c
index 56b5beb9..913524cc 100644
--- a/misc/examples/queues/queue.c
+++ b/misc/examples/queues/queue.c
@@ -7,20 +7,20 @@
int main(void) {
int n = 100000000;
- crand_unif_t dist;
+ crand_uniform_t dist;
crand_t rng = crand_init(1234);
- dist = crand_unif_init(0, n);
+ dist = crand_uniform_init(0, n);
cqueue_i queue = {0};
// Push ten million random numbers onto the queue.
c_forrange (n)
- cqueue_i_push(&queue, (int)crand_unif(&rng, &dist));
+ cqueue_i_push(&queue, (int)crand_uniform(&rng, &dist));
// Push or pop on the queue ten million times
printf("%d\n", n);
c_forrange (n) { // forrange uses initial n only.
- int r = (int)crand_unif(&rng, &dist);
+ int r = (int)crand_uniform(&rng, &dist);
if (r & 1)
++n, cqueue_i_push(&queue, r);
else