summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/functor.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-03-27 19:57:09 +0200
committerTyge Løvset <[email protected]>2023-03-27 19:57:09 +0200
commite35036deef4fc8f17cc9221e2e666dfdb832ba78 (patch)
treeb41e45015be7454ef3f82092b558da6b365d6a57 /misc/examples/functor.c
parentede39bc98a758674485796174ea860515ec281e6 (diff)
downloadSTC-modified-e35036deef4fc8f17cc9221e2e666dfdb832ba78.tar.gz
STC-modified-e35036deef4fc8f17cc9221e2e666dfdb832ba78.zip
More RAII cleanup in examples. Also removed gauss1.c and new_deq.c
Diffstat (limited to 'misc/examples/functor.c')
-rw-r--r--misc/examples/functor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc/examples/functor.c b/misc/examples/functor.c
index 8952c710..f37e41d5 100644
--- a/misc/examples/functor.c
+++ b/misc/examples/functor.c
@@ -43,14 +43,16 @@ static bool int_lambda(const int* x, const int* y) { return (*x ^ 1) < (*y ^ 1);
int main()
{
- const int data[] = {1,8,5,6,3,4,0,9,7,2}, n = c_ARRAYLEN(data);
+ const int data[] = {1,8,5,6,3,4,0,9,7,2}, n = c_arraylen(data);
printf("data: \t");
- c_forrange (i, n) printf("%d ", data[i]);
+ c_forrange (i, n)
+ printf("%d ", data[i]);
puts("");
IPQueue q1 = {ipque_init(), int_less}; // Max priority queue
IPQueue minq1 = {ipque_init(), int_greater}; // Min priority queue
IPQueue q5 = {ipque_init(), int_lambda}; // Using lambda to compare elements.
+
c_forrange (i, n)
ipque_push(&q1.Q, data[i]);
print_queue("q1", q1);