fix gdbinit; postprocessing macros
[m6w6/ext-psi] / src / types / const.c
index 1afbac029c85a09bf25c87394d946640868876c1..627707078b289af3a4365c18234070f55befb08b 100644 (file)
@@ -55,13 +55,15 @@ void psi_const_free(struct psi_const **constant_ptr)
        }
 }
 
-void psi_const_dump(int fd, struct psi_const *cnst)
+void psi_const_dump(struct psi_dump *dump, struct psi_const *cnst)
 {
-       dprintf(fd, "const ");
-       psi_impl_type_dump(fd, cnst->type);
-       dprintf(fd, " %s = ", cnst->name->val);
-       psi_impl_def_val_dump(fd, cnst->val);
-       dprintf(fd, ";");
+       PSI_DUMP(dump, "const ");
+       if (cnst->type) {
+               psi_impl_type_dump(dump, cnst->type);
+       }
+       PSI_DUMP(dump, " %s = ", cnst->name->val);
+       psi_impl_def_val_dump(dump, cnst->val);
+       PSI_DUMP(dump, ";");
 }
 
 bool psi_const_validate(struct psi_data *data, struct psi_const *c,