diff options
| author | Tyge Lovset <[email protected]> | 2023-02-01 08:38:45 +0100 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-02-01 08:38:45 +0100 |
| commit | 6ce6ef3307e52db5813d3c8d6a2cba52df06daf8 (patch) | |
| tree | 25af4be9fcd5e72778715b83ff312e157ca63b59 /misc/examples/new_queue.c | |
| parent | b677a0c3950b8294ba6458e682a885351273ac08 (diff) | |
| download | STC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.tar.gz STC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.zip | |
Massive update from unsigned sizes and indices to signed.
Diffstat (limited to 'misc/examples/new_queue.c')
| -rw-r--r-- | misc/examples/new_queue.c | 10 |
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)); } } |
