summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/new_queue.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-04 23:35:56 +0100
committerGitHub <[email protected]>2023-02-04 23:35:56 +0100
commitadc47cefc2976768c3f0b773bd26bfd1062e8a53 (patch)
tree4923f88afb0d091d5d39ae03d65a4998a0517652 /misc/examples/new_queue.c
parent0c4c4f8bba17562735b67b2923cd23c773aa53a7 (diff)
parentd2ff84c53aa9bd3857fdf22dcf7cd9398a4780be (diff)
downloadSTC-modified-adc47cefc2976768c3f0b773bd26bfd1062e8a53.tar.gz
STC-modified-adc47cefc2976768c3f0b773bd26bfd1062e8a53.zip
Merge pull request #46 from tylov/newinit
Version 4.1 RC2: signed sizes and indices, cspan with numpy slicing.
Diffstat (limited to 'misc/examples/new_queue.c')
-rw-r--r--misc/examples/new_queue.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/new_queue.c b/misc/examples/new_queue.c
index 828387b5..5c25a229 100644
--- a/misc/examples/new_queue.c
+++ b/misc/examples/new_queue.c
@@ -22,25 +22,25 @@ int point_cmp(const Point* a, const Point* b) {
int main() {
int n = 50000000;
- stc64_t rng = stc64_new(time(NULL));
+ stc64_t rng = stc64_new((uint64_t)time(NULL));
stc64_uniform_t dist = stc64_uniform_new(0, n);
c_AUTO (IQ, Q)
{
// Push 50'000'000 random numbers onto the queue.
c_FORRANGE (n)
- IQ_push(&Q, stc64_uniform(&rng, &dist));
+ IQ_push(&Q, (int)stc64_uniform(&rng, &dist));
// Push or pop on the queue 50 million times
- printf("befor: size %" c_ZU ", capacity %" c_ZU "\n", IQ_size(&Q), IQ_capacity(&Q));
+ printf("befor: size %" c_ZI ", capacity %" c_ZI "\n", IQ_size(&Q), IQ_capacity(&Q));
c_FORRANGE (n) {
- int r = stc64_uniform(&rng, &dist);
+ int r = (int)stc64_uniform(&rng, &dist);
if (r & 3)
IQ_push(&Q, r);
else
IQ_pop(&Q);
}
- printf("after: size %" c_ZU ", capacity %" c_ZU "\n", IQ_size(&Q), IQ_capacity(&Q));
+ printf("after: size %" c_ZI ", capacity %" c_ZI "\n", IQ_size(&Q), IQ_capacity(&Q));
}
}