X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Fnum_exp.c;h=34624204bec91d0b92f20958766cb0d3d0010249;hp=ab99dd9174b434a51521ee8a056b8611302ffffb;hb=1124354f4666e9d10d9ad3acfa45fdba3b99cfc6;hpb=a7ac1c0a3c855321f21682c127a4b707de33a303 diff --git a/src/types/num_exp.c b/src/types/num_exp.c index ab99dd9..3462420 100644 --- a/src/types/num_exp.c +++ b/src/types/num_exp.c @@ -23,7 +23,11 @@ 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 @@ -31,6 +35,7 @@ #include "context.h" #include "call.h" #include "calc.h" +#include "debug.h" struct psi_num_exp *psi_num_exp_init_ternary(token_t op, struct psi_num_exp *cond, struct psi_num_exp *truthy, @@ -380,30 +385,31 @@ struct psi_plist *psi_num_exp_tokens(struct psi_num_exp *exp, return list; } -void psi_num_exp_dump(int fd, struct psi_num_exp *exp) +void psi_num_exp_dump(struct psi_dump *dump, struct psi_num_exp *exp) { switch (exp->op) { case PSI_T_NUMBER: - psi_number_dump(fd, exp->data.n); + psi_number_dump(dump, exp->data.n); break; case PSI_T_CAST: - dprintf(fd, "("); - psi_decl_type_dump(1, exp->data.c.typ, 0); - dprintf(fd, ")"); + PSI_DUMP(dump, "("); + psi_decl_type_dump(dump, exp->data.c.typ, 0); + PSI_DUMP(dump, ")"); + psi_num_exp_dump(dump, exp->data.c.num); break; case PSI_T_NOT: case PSI_T_TILDE: unary: - dprintf(fd, "%s", psi_num_exp_op_tok(exp->op)); - psi_num_exp_dump(fd, exp->data.u); + PSI_DUMP(dump, "%s", psi_num_exp_op_tok(exp->op)); + psi_num_exp_dump(dump, exp->data.u); break; case PSI_T_LPAREN: - dprintf(fd, "("); - psi_num_exp_dump(fd, exp->data.u); - dprintf(fd, ")"); + PSI_DUMP(dump, "("); + psi_num_exp_dump(dump, exp->data.u); + PSI_DUMP(dump, ")"); break; case PSI_T_PLUS: @@ -429,17 +435,17 @@ void psi_num_exp_dump(int fd, struct psi_num_exp *exp) case PSI_T_CMP_GE: case PSI_T_RCHEVR: case PSI_T_LCHEVR: - psi_num_exp_dump(fd, exp->data.b.lhs); - dprintf(fd, " %s ", psi_num_exp_op_tok(exp->op)); - psi_num_exp_dump(fd, exp->data.b.rhs); + psi_num_exp_dump(dump, exp->data.b.lhs); + PSI_DUMP(dump, " %s ", psi_num_exp_op_tok(exp->op)); + psi_num_exp_dump(dump, exp->data.b.rhs); break; case PSI_T_IIF: - psi_num_exp_dump(fd, exp->data.t.cond); - dprintf(fd, " ? "); - psi_num_exp_dump(fd, exp->data.t.truthy); - dprintf(fd, " : "); - psi_num_exp_dump(fd, exp->data.t.falsy); + psi_num_exp_dump(dump, exp->data.t.cond); + PSI_DUMP(dump, " ? "); + psi_num_exp_dump(dump, exp->data.t.truthy); + PSI_DUMP(dump, " : "); + psi_num_exp_dump(dump, exp->data.t.falsy); break; default: