summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/coread.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-05-03 16:45:37 +0200
committerTyge Løvset <[email protected]>2023-05-03 16:45:37 +0200
commit6b23e35287f26dad63abd755c5f365b443e025a3 (patch)
treec13c80d539efa1edbf7bc7d829f0e3d53e07e3b5 /misc/examples/coread.c
parente4efe2f9cc87e70e981ee75ec5c4d6db4cb60c49 (diff)
downloadSTC-modified-6b23e35287f26dad63abd755c5f365b443e025a3.tar.gz
STC-modified-6b23e35287f26dad63abd755c5f365b443e025a3.zip
Reverted from cco_await_with(promise, ret) to cco_await(promise, ret).
Diffstat (limited to 'misc/examples/coread.c')
-rw-r--r--misc/examples/coread.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/misc/examples/coread.c b/misc/examples/coread.c
index d5385a87..38447c44 100644
--- a/misc/examples/coread.c
+++ b/misc/examples/coread.c
@@ -11,19 +11,19 @@ struct file_read {
cstr line;
};
-bool file_read(struct file_read* U)
+bool file_read(struct file_read* g)
{
- cco_begin(U)
- U->fp = fopen(U->filename, "r");
- U->line = cstr_init();
+ cco_begin(g)
+ g->fp = fopen(g->filename, "r");
+ g->line = cstr_init();
- while (cstr_getline(&U->line, U->fp))
+ while (cstr_getline(&g->line, g->fp))
cco_yield(false);
cco_final: // this label is required.
printf("finish\n");
- cstr_drop(&U->line);
- fclose(U->fp);
+ cstr_drop(&g->line);
+ fclose(g->fp);
cco_end(true);
}