diff options
| author | Tyge Løvset <[email protected]> | 2020-09-20 13:37:27 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-09-20 13:37:27 +0200 |
| commit | 84c1716de710d2d9067c9f8a50487e3ab2d6fa42 (patch) | |
| tree | ae5be1a90482b4940a6555ed1ff44c2e518dbe0d /examples/queue.c | |
| parent | 927a1b015b7b934220edf9b5c758eed540f3e510 (diff) | |
| download | STC-modified-84c1716de710d2d9067c9f8a50487e3ab2d6fa42.tar.gz STC-modified-84c1716de710d2d9067c9f8a50487e3ab2d6fa42.zip | |
Possible to redefine STC memory allocator globally.
Diffstat (limited to 'examples/queue.c')
| -rw-r--r-- | examples/queue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/queue.c b/examples/queue.c index e4426884..c56214a7 100644 --- a/examples/queue.c +++ b/examples/queue.c @@ -14,12 +14,12 @@ int main() { cqueue_i queue = cqueue_i_init();
// Push ten million random numbers onto the queue.
- c_forrange (i, int, 0, n)
+ c_forrange (n)
cqueue_i_push(&queue, crand_uniform_i32(&rng, &dist));
// Push or pop on the queue ten million times
printf("%d\n", n);
- c_forrange (i, int, n, 0, -1) {
+ c_forrange (n) { // range uses initial n only.
int r = crand_uniform_i32(&rng, &dist);
if (r & 1)
++n, cqueue_i_push(&queue, r);
|
