X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=format_check.c;h=5580d9173039bbcfd4e4aa3eb923da8cce9ad37a;hb=b61f7ce7016548248bab93843c2f3fe37a0cab78;hp=f1134e2ace924fa74e78350917568289c96a9729;hpb=9fc7bb03d5232142420b4bff0d82f1a05bd64aba;p=cparser diff --git a/format_check.c b/format_check.c index f1134e2..5580d91 100644 --- a/format_check.c +++ b/format_check.c @@ -21,6 +21,7 @@ #include +#include "adt/strutil.h" #include "adt/util.h" #include "format_check.h" #include "symbol_t.h" @@ -108,7 +109,7 @@ static int internal_check_printf_format(const expression_t *fmt_expr, const call_argument_t *arg, const format_spec_t *spec) { - while (fmt_expr->kind == EXPR_UNARY_CAST_IMPLICIT) { + while (fmt_expr->kind == EXPR_UNARY_CAST) { fmt_expr = fmt_expr->unary.value; } @@ -521,7 +522,7 @@ too_few_args: } } else if (get_unqualified_type(arg_skip) == expected_type_skip) { goto next_arg; - } else if (arg->expression->kind == EXPR_UNARY_CAST_IMPLICIT) { + } else if (arg->expression->kind == EXPR_UNARY_CAST) { expression_t const *const expr = arg->expression->unary.value; type_t *const unprom_type = skip_typeref(expr->base.type); if (get_unqualified_type(unprom_type) == expected_type_skip) { @@ -595,7 +596,7 @@ static void check_scanf_format(const call_argument_t *arg, } const expression_t *fmt_expr = arg->expression; - if (fmt_expr->kind == EXPR_UNARY_CAST_IMPLICIT) { + if (fmt_expr->kind == EXPR_UNARY_CAST) { fmt_expr = fmt_expr->unary.value; } @@ -1003,7 +1004,7 @@ void check_format(const call_expression_t *const call) */ const char *const name = entity->base.symbol->string; for (size_t i = 0; i < lengthof(builtin_table); ++i) { - if (strcmp(name, builtin_table[i].name) == 0) { + if (streq(name, builtin_table[i].name)) { switch (builtin_table[i].fmt_kind) { case FORMAT_PRINTF: check_printf_format(arg, &builtin_table[i]);