X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Fdecl_type.c;h=590c8eea126896150c512456c6cb88272118d9a1;hp=f3b500a935f5c5127142f81b2137b0955ca5c80c;hb=42f44eb5bf4ecd36e26e051fada79d861d0f92d2;hpb=1b6db76e3005344b33ab45b00e7e61386a33932a diff --git a/src/types/decl_type.c b/src/types/decl_type.c index f3b500a..590c8ee 100644 --- a/src/types/decl_type.c +++ b/src/types/decl_type.c @@ -55,6 +55,20 @@ void psi_decl_type_free(struct psi_decl_type **type_ptr) } } +struct psi_decl_type *psi_decl_type_copy(struct psi_decl_type *src) +{ + struct psi_decl_type *dst = calloc(1, sizeof(*dst)); + + dst->type = src->type; + if (src->name) { + dst->name = strdup(src->name); + } + if (src->token) { + dst->token = psi_token_copy(src->token); + } + return dst; +} + struct psi_plist *psi_decl_type_get_args(struct psi_decl_type *dtyp, struct psi_decl_type **real_typ_ptr) { @@ -324,6 +338,8 @@ int psi_decl_type_is_weak(struct psi_decl_type *type) case PSI_T_SHORT: case PSI_T_INT: case PSI_T_LONG: + case PSI_T_UNSIGNED: + case PSI_T_SIGNED: case PSI_T_NAME: return type->type; default: