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;
}
}
-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);
}
}
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;