From ac8968e5bd5d6d51ae68759b75cfce34df394503 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Mon, 29 Jul 2024 11:20:54 +0200 Subject: [PATCH] reuse argcmp Signed-off-by: Matthias Gatto --- cognac_gen.sh | 6 +++--- main_tpl.c | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cognac_gen.sh b/cognac_gen.sh index 342372d..df068c7 100755 --- a/cognac_gen.sh +++ b/cognac_gen.sh @@ -128,7 +128,7 @@ ${indent_plus} } else { ${indent_plus} TRY(!aa, "$a argument missing\n"); ${indent_plus} s->${snake_a}_str = aa; ${indent_plus} } -$indent_base } else if (!(aret = strcmp(str, "$a[]")) || aret == '=') { +$indent_base } else if (!(aret = argcmp(str, "$a[]")) || aret == '=') { ${indent_plus} TRY(!aa, "$a[] argument missing\n"); ${indent_plus} SET_NEXT(s->${snake_a}, ${convertor}(aa), pa); $indent_base } else @@ -311,7 +311,7 @@ EOF t=$(get_type2 "$s" "$a") snake_n=$(to_snakecase <<< $a) - echo " if ((aret = strcmp(str, \"$a\")) == 0 || aret == '=' || aret == '.') {" + echo " if ((aret = argcmp(str, \"$a\")) == 0 || aret == '=' || aret == '.') {" cli_c_type_parser "$a" "$t" " " done cat <