X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Ftypes%2Freturn_exp.c;h=6a43c8a5f3961b5620cf56621981df1e51cdf6f5;hb=698841dfdd4d70d24e0b7af25ac7100bc2cb26a4;hp=78e1aa56e96e5ea0f990fa80d0ce391cd8c844af;hpb=2fa436074ca9a5e87f39b696de832fa2188fcfc6;p=m6w6%2Fext-psi diff --git a/src/types/return_exp.c b/src/types/return_exp.c index 78e1aa5..6a43c8a 100644 --- a/src/types/return_exp.c +++ b/src/types/return_exp.c @@ -23,14 +23,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ -#include "php_psi_stdinc.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +# include "php_config.h" +#endif #include "data.h" #include "call.h" struct psi_return_exp *psi_return_exp_init(struct psi_decl_var *func, struct psi_plist *args, struct psi_set_exp *set) { - struct psi_return_exp *exp = calloc(1, sizeof(*exp)); + struct psi_return_exp *exp = pecalloc(1, sizeof(*exp), 1); exp->func = func; exp->args = args; @@ -60,30 +64,30 @@ void psi_return_exp_free(struct psi_return_exp **exp_ptr) } } -void psi_return_exp_dump(int fd, struct psi_return_exp *exp) +void psi_return_exp_dump(struct psi_dump *dump, struct psi_return_exp *exp) { if (exp->func) { - psi_decl_var_dump(fd, exp->func); - dprintf(fd, "("); + psi_decl_var_dump(dump, exp->func); + PSI_DUMP(dump, "("); if (exp->args) { size_t i = 0; struct psi_decl_var *arg; while (psi_plist_get(exp->args, i++, &arg)) { if (i > 1) { - dprintf(fd, ", "); + PSI_DUMP(dump, ", "); } - psi_decl_var_dump(fd, arg); + psi_decl_var_dump(dump, arg); } } - dprintf(fd, ")"); + PSI_DUMP(dump, ")"); } if (exp->set) { if (exp->func) { - dprintf(fd, " as "); + PSI_DUMP(dump, " as "); } - psi_set_exp_dump(fd, exp->set, 1, 1); + psi_set_exp_dump(dump, exp->set, 1, 1); } } @@ -106,7 +110,7 @@ static inline bool psi_return_exp_validate_decl_args(struct psi_data *data, if (exp->args) { if (psi_plist_count(exp->args) != psi_plist_count(impl->decl->args)) { data->error(data, exp->token, PSI_WARNING, - "Argument count of return statement of implementation '%s'" + "Argument count of return statement of implementation '%s' " "does not match argument count of declaration '%s'", impl->func->name->val, impl->decl->func->var->name->val); return false;