X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Fdecl_arg.c;h=9f487c3dba4045ebe714eaf2be6733b8e0fc4dd7;hp=f9ed34766965ac8109b0618947bab22f25632bbc;hb=b0fdc1f1b8ae5ec4d3f47741b523fa6a60ae32bb;hpb=2fa436074ca9a5e87f39b696de832fa2188fcfc6 diff --git a/src/types/decl_arg.c b/src/types/decl_arg.c index f9ed347..9f487c3 100644 --- a/src/types/decl_arg.c +++ b/src/types/decl_arg.c @@ -118,8 +118,10 @@ bool psi_decl_arg_validate(struct psi_data *data, struct psi_decl_arg *arg, if (!psi_decl_type_validate(data, arg->type, NULL, scope)) { if (!arg->var->pointer_level) { data->error(data, arg->type->token, PSI_WARNING, - "Cannot use '%s' as type for '%s'%s%s", arg->type->name, - arg->var->name, *data->last_error ? ": " : "", data->last_error); + "Cannot use '%s' as type for '%s'%s%s", + arg->type->name->val, + arg->var->name->val, + *data->last_error ? ": " : "", data->last_error); return false; } } @@ -139,7 +141,8 @@ bool psi_decl_arg_validate_typedef(struct psi_data *data, def->type->type = PSI_T_POINTER; } else { data->error(data, def->token, PSI_WARNING, - "Type '%s' cannot be aliased to 'void'", def->type->name->val); + "Type '%s' cannot be aliased to 'void'", + def->type->name->val); return false; } } else if (!psi_decl_type_validate(data, def->type, def, scope)) { @@ -160,8 +163,10 @@ bool psi_decl_arg_validate_typedef(struct psi_data *data, break; } data->error(data, def->token, PSI_WARNING, - "Type '%s' cannot be aliased to '%s%s'%s%s", def->var->name, pre, - def->type->name->val, *data->last_error ? ": " : "", data->last_error); + "Type '%s' cannot be aliased to '%s%s'%s%s", + def->var->name->val, pre, + def->type->name->val, + *data->last_error ? ": " : "", data->last_error); return false; } @@ -264,7 +269,7 @@ struct psi_decl_arg *psi_decl_arg_get_by_var(struct psi_decl_var *var, return var->arg = arg; } - if (func && !zend_string_equals(var->name, func->var->name)) { + if (func && zend_string_equals(var->name, func->var->name)) { return var->arg = func; }