From e459ba87003b3e0a9eb4c5cf95514cf2d1051cfa Mon Sep 17 00:00:00 2001 From: Cam <16303791+speedyhoon@users.noreply.github.com> Date: Mon, 20 May 2019 16:29:17 +1000 Subject: [PATCH] Fix example code Fix too many arguments to function 'cw_pack_context_init' Fix too many arguments to function 'cw_unpack_context_init' Fix too many closing brackets ')' --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a617aa2..e1885ce 100755 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ void example (void) { cw_pack_context pc; char buffer[20]; - cw_pack_context_init (&pc, buffer, 20, 0, 0); + cw_pack_context_init (&pc, buffer, 20, 0); cw_pack_map_size (&pc, 2); cw_pack_str (&pc, "compact", 7); @@ -42,20 +42,20 @@ void example (void) if (length > 18) ERROR; cw_unpack_context uc; - cw_unpack_context_init (&uc, pc.start, length, 0, 0); + cw_unpack_context_init (&uc, pc.start, length, 0); cw_unpack_next(&uc); if (uc.item.type != CWP_ITEM_MAP || uc.item.as.map.size != 2) ERROR; cw_unpack_next(&uc); - if (uc.item.type != CWP_ITEM_STR || uc.item.as.str.length != 7)) ERROR; + if (uc.item.type != CWP_ITEM_STR || uc.item.as.str.length != 7) ERROR; if (strncmp("compact", uc.item.as.str.start, 7)) ERROR; cw_unpack_next(&uc); if (uc.item.type != CWP_ITEM_BOOLEAN || uc.item.as.boolean != true) ERROR; cw_unpack_next(&uc); - if (uc.item.type != CWP_ITEM_STR || uc.item.as.str.length != 6)) ERROR; + if (uc.item.type != CWP_ITEM_STR || uc.item.as.str.length != 6) ERROR; if (strncmp("schema", uc.item.as.str.start, 6)) ERROR; cw_unpack_next(&uc);