fix enum dump; fix float formats; fix dumps
[m6w6/ext-psi] / src / types / decl_struct.c
index c2b8cc1779806b8582d150dcc30e87d11a2cf1a7..d17895a1beece66708fa212e5069140cfa123e91 100644 (file)
@@ -31,7 +31,7 @@
 struct psi_decl_struct* psi_decl_struct_init(zend_string *name,
                struct psi_plist *args)
 {
-       struct psi_decl_struct *s = calloc(1, sizeof(*s));
+       struct psi_decl_struct *s = pecalloc(1, sizeof(*s), 1);
        s->name = zend_string_copy(name);
        s->args = args;
        return s;
@@ -55,14 +55,14 @@ void psi_decl_struct_free(struct psi_decl_struct **s_ptr)
        }
 }
 
-void psi_decl_struct_dump(int fd, struct psi_decl_struct *strct)
+void psi_decl_struct_dump(struct psi_dump *dump, struct psi_decl_struct *strct)
 {
-       dprintf(fd, "struct %s::(%zu, %zu)", strct->name->val, strct->align,
+       PSI_DUMP(dump, "struct %s::(%zu, %zu)", strct->name->val, strct->align,
                        strct->size);
        if (psi_plist_count(strct->args)) {
-               psi_decl_type_dump_args_with_layout(fd, strct->args, 0);
+               psi_decl_type_dump_args_with_layout(dump, strct->args, 0);
        } else {
-               dprintf(fd, ";");
+               PSI_DUMP(dump, ";");
        }
 }