summaryrefslogtreecommitdiffhomepage
path: root/examples/priority.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-26 08:08:47 +0200
committerTyge Løvset <[email protected]>2022-09-26 08:08:47 +0200
commitca01dd726e2ed8f8b69f8ff08855e80f4eea7247 (patch)
tree0ce1594c39d18a93212f066fd8c3c2477fc6f22b /examples/priority.c
parentad5be4349232bbba96c0974bc2693ec7331c4b12 (diff)
downloadSTC-modified-ca01dd726e2ed8f8b69f8ff08855e80f4eea7247.tar.gz
STC-modified-ca01dd726e2ed8f8b69f8ff08855e80f4eea7247.zip
DEPRECATED: c_forrange(): replaced with c_forloop(). This uses 'long long' as iter type, i.e. "%lld" printf format.
crange_from() renamed to crange_make(). More docs.
Diffstat (limited to 'examples/priority.c')
-rw-r--r--examples/priority.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/priority.c b/examples/priority.c
index d801c118..452ed9d4 100644
--- a/examples/priority.c
+++ b/examples/priority.c
@@ -16,18 +16,18 @@ int main() {
{
// Push ten million random numbers to priority queue
printf("Push %" PRIuMAX " numbers\n", N);
- c_forrange (N)
+ c_forloop (N)
cpque_i_push(&heap, stc64_uniform(&rng, &dist));
// push some negative numbers too.
c_forlist (i, int, {-231, -32, -873, -4, -343})
cpque_i_push(&heap, *i.ref);
- c_forrange (N)
+ c_forloop (N)
cpque_i_push(&heap, stc64_uniform(&rng, &dist));
puts("Extract the hundred smallest.");
- c_forrange (100) {
+ c_forloop (100) {
printf("%" PRIdMAX " ", *cpque_i_top(&heap));
cpque_i_pop(&heap);
}