diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2020-06-02 20:23:07 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-07-22 17:57:23 +0100 |
commit | 9943fa3a7320158e209a0339a4022a8165e9d5a6 (patch) | |
tree | dc9c8619f07ca31e8526ffeb87b62ee0bd567764 /libctf | |
parent | afd78bd6f0a30ba57adaea870c05cbbb925cc769 (diff) | |
download | gdb-9943fa3a7320158e209a0339a4022a8165e9d5a6.zip gdb-9943fa3a7320158e209a0339a4022a8165e9d5a6.tar.gz gdb-9943fa3a7320158e209a0339a4022a8165e9d5a6.tar.bz2 |
libctf, create: add explicit casts for variables' and slices' types
This is technically unnecessary -- the compiler is quite capable of
doing the range reduction for us -- but it does mean that all
assignments of a ctf_id_t to its final uint32_t representation now have
appropriate explicit casts.
libctf/
* ctf-create.c (ctf_serialize): Add cast.
(ctf_add_slice): Likewise.
Diffstat (limited to 'libctf')
-rw-r--r-- | libctf/ChangeLog | 5 | ||||
-rw-r--r-- | libctf/ctf-create.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 39cf47d..598b93a 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,10 @@ 2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-create.c (ctf_serialize): Add cast. + (ctf_add_slice): Likewise. + +2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-impl.h (ctf_dtdef_t) <dtu_argv>: Fix type. * ctf-create.c (ctf_add_function): Check for unimplemented type and populate at the same time. Populate one-by-one, not via diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c index f91da6e..bc0ad80 100644 --- a/libctf/ctf-create.c +++ b/libctf/ctf-create.c @@ -373,7 +373,7 @@ ctf_serialize (ctf_file_t *fp) ctf_varent_t *var = &dvarents[i]; ctf_str_add_ref (fp, dvd->dvd_name, &var->ctv_name); - var->ctv_type = dvd->dvd_type; + var->ctv_type = (uint32_t) dvd->dvd_type; } assert (i == nvars); @@ -972,7 +972,7 @@ ctf_add_slice (ctf_file_t *fp, uint32_t flag, ctf_id_t ref, dtd->dtd_data.ctt_info = CTF_TYPE_INFO (CTF_K_SLICE, flag, 0); dtd->dtd_data.ctt_size = clp2 (P2ROUNDUP (ep->cte_bits, CHAR_BIT) / CHAR_BIT); - dtd->dtd_u.dtu_slice.cts_type = ref; + dtd->dtd_u.dtu_slice.cts_type = (uint32_t) ref; dtd->dtd_u.dtu_slice.cts_bits = ep->cte_bits; dtd->dtd_u.dtu_slice.cts_offset = ep->cte_offset; |