fix build
[m6w6/ext-psi] / src / types / num_exp.c
index ab99dd9174b434a51521ee8a056b8611302ffffb..34624204bec91d0b92f20958766cb0d3d0010249 100644 (file)
  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 <assert.h>
 
@@ -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: