]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libctf, create: typedefs
authorNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 10:41:45 +0000 (11:41 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 25 Apr 2025 17:07:43 +0000 (18:07 +0100)
Nothing here but adjustment to internal API changes.  Typedefs have no
special properties that need querying, so there are no changes to
ctf-types.c at all.

libctf/ctf-create.c

index 9d02bee7a23d7ada5be365a7c7cc80025d06f712..11b27f0deaed843f7a8b17ae0ef5a12ca663326f 100644 (file)
@@ -1442,7 +1442,6 @@ ctf_add_typedef (ctf_dict_t *fp, uint32_t flag, const char *name,
                 ctf_id_t ref)
 {
   ctf_dtdef_t *dtd;
-  ctf_id_t type;
   ctf_dict_t *tmp = fp;
 
   if (ref == CTF_ERR || ref > CTF_MAX_TYPE)
@@ -1451,17 +1450,17 @@ ctf_add_typedef (ctf_dict_t *fp, uint32_t flag, const char *name,
   if (name == NULL || name[0] == '\0')
     return (ctf_set_typed_errno (fp, ECTF_NONAME));
 
-  if (ref != 0 && ctf_lookup_by_id (&tmp, ref) == NULL)
+  if (ref != 0 && ctf_lookup_by_id (&tmp, ref, NULL) == NULL)
     return CTF_ERR;            /* errno is set for us.  */
 
-  if ((type = ctf_add_generic (fp, flag, name, CTF_K_TYPEDEF, 0,
-                              &dtd)) == CTF_ERR)
+  if ((dtd = ctf_add_generic (fp, flag, name, CTF_K_TYPEDEF, 0, 0, 0,
+                             NULL)) == NULL)
     return CTF_ERR;            /* errno is set for us.  */
 
-  dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_TYPEDEF, flag, 0);
-  dtd->dtd_data.ctt_type = (uint32_t) ref;
+  dtd->dtd_data->ctt_info = CTF_TYPE_INFO (CTF_K_TYPEDEF, 0, 0);
+  dtd->dtd_data->ctt_type = (uint32_t) ref;
 
-  return type;
+  return dtd->dtd_type;
 }
 
 ctf_id_t