summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/books.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-08 16:16:49 +0100
committerTyge Løvset <[email protected]>2023-02-08 17:18:24 +0100
commitc4441f5fc665194fbd7a894a67a64a08c3beac42 (patch)
tree82f231b6e8fcb75625166f98aa785baaa265a3d6 /misc/examples/books.c
parent673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff)
downloadSTC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz
STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'misc/examples/books.c')
-rw-r--r--misc/examples/books.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/books.c b/misc/examples/books.c
index 4695941a..098771ae 100644
--- a/misc/examples/books.c
+++ b/misc/examples/books.c
@@ -8,7 +8,7 @@
// would be `HashMap<String, String>` in this example).
int main()
{
- c_AUTO (cmap_str, book_reviews)
+ c_auto (cmap_str, book_reviews)
{
// Review some books.
cmap_str_emplace(&book_reviews,
@@ -41,7 +41,7 @@ int main()
// Look up the values associated with some keys.
const char* to_find[] = {"Pride and Prejudice", "Alice's Adventure in Wonderland"};
- c_FORRANGE (i, c_ARRAYLEN(to_find)) {
+ c_forrange (i, c_ARRAYLEN(to_find)) {
const cmap_str_value* b = cmap_str_get(&book_reviews, to_find[i]);
if (b)
printf("%s: %s\n", cstr_str(&b->first), cstr_str(&b->second));
@@ -53,7 +53,7 @@ int main()
printf("Review for Jane: %s\n", cstr_str(cmap_str_at(&book_reviews, "Pride and Prejudice")));
// Iterate over everything.
- c_FORPAIR (book, review, cmap_str, book_reviews) {
+ c_forpair (book, review, cmap_str, book_reviews) {
printf("%s: \"%s\"\n", cstr_str(_.book), cstr_str(_.review));
}
}