X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Fdecl_type.c;h=1445c353ebe2ec8fa719498d9616114473bc836f;hp=164f33ffc0953ca210e47a0f1a57230dc68ea878;hb=12964ebafbb9090db90faa09fba4140bdffff0eb;hpb=a0f437f26cd0f121ee911a55327a68a3544bf15f diff --git a/src/types/decl_type.c b/src/types/decl_type.c index 164f33f..1445c35 100644 --- a/src/types/decl_type.c +++ b/src/types/decl_type.c @@ -289,7 +289,7 @@ bool psi_decl_type_validate(struct psi_data *data, struct psi_decl_type *type, return true; } -void psi_decl_type_dump_args_with_layout(int fd, struct psi_plist *args, +void psi_decl_type_dump_args_with_layout(struct psi_dump *dump, struct psi_plist *args, unsigned level) { size_t i = 0; @@ -326,30 +326,17 @@ void psi_decl_type_dump(struct psi_dump *dump, struct psi_decl_type *t, unsigned return; case PSI_T_ENUM: - PSI_DUMP(dump, "enum "); if (psi_decl_type_is_anon(t->name, "enum")) { - size_t i = 0, c = psi_plist_count(t->real.enm->items); - struct psi_decl_enum_item *item; - - PSI_DUMP(dump, "{\n"); - ++level; - while (psi_plist_get(t->real.enm->items, i++, &item)) { - PSI_DUMP(dump, "%s", psi_t_indent(level)); - psi_decl_enum_item_dump(dump, item); - if (i < c) { - PSI_DUMP(dump, "%s\n", i < c ? "," : ""); - } - } - --level; - PSI_DUMP(dump, "%s\n} ", psi_t_indent(level)); + psi_decl_enum_dump(dump, t->real.enm, level); return; } + PSI_DUMP(dump, "enum "); break; case PSI_T_STRUCT: PSI_DUMP(dump, "struct "); if (psi_decl_type_is_anon(t->name, "struct")) { - psi_decl_type_dump_args_with_layout(fd, t->real.strct->args, level); + psi_decl_type_dump_args_with_layout(dump, t->real.strct->args, level); return; } break; @@ -357,7 +344,7 @@ void psi_decl_type_dump(struct psi_dump *dump, struct psi_decl_type *t, unsigned case PSI_T_UNION: PSI_DUMP(dump, "union "); if (psi_decl_type_is_anon(t->name, "union")) { - psi_decl_type_dump_args_with_layout(fd, t->real.unn->args, level); + psi_decl_type_dump_args_with_layout(dump, t->real.unn->args, level); return; } break;