aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-08-10 12:28:31 +0930
committerAlan Modra <amodra@gmail.com>2019-08-10 17:16:16 +0930
commit988de25b366c74cd62e35f3d5cf63086a964c7aa (patch)
treea1ec5980fb59bb8b0ed849284da047a7a28ba9f0 /ld/ldexp.c
parent36983a93bb338b7cdd6f7d6f9f91dc9ce9815b4e (diff)
downloadgdb-988de25b366c74cd62e35f3d5cf63086a964c7aa.zip
gdb-988de25b366c74cd62e35f3d5cf63086a964c7aa.tar.gz
gdb-988de25b366c74cd62e35f3d5cf63086a964c7aa.tar.bz2
stat_alloc casts
Casts from a void* just clutter the source. * ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop, exp_trinop), (exp_unop, exp_nameop, exp_assop, exp_assert): Remove casts of stat_alloc return value. * ldlang.c (new_statement, new_afile, sort_def_symbol), (lang_memory_region_lookup, lang_memory_region_alias), (ldlang_add_undef, ldlang_add_require_defined, insert_pad), (lang_add_gc_name, lang_new_phdr): Likewise. * lexsup.c (set_segment_start): Likewise.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index daf0f2e..d7d253e 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -198,7 +198,7 @@ new_abs (bfd_vma value)
etree_type *
exp_intop (bfd_vma value)
{
- etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
+ etree_type *new_e = stat_alloc (sizeof (new_e->value));
new_e->type.node_code = INT;
new_e->type.filename = ldlex_filename ();
new_e->type.lineno = lineno;
@@ -211,7 +211,7 @@ exp_intop (bfd_vma value)
etree_type *
exp_bigintop (bfd_vma value, char *str)
{
- etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->value));
+ etree_type *new_e = stat_alloc (sizeof (new_e->value));
new_e->type.node_code = INT;
new_e->type.filename = ldlex_filename ();
new_e->type.lineno = lineno;
@@ -226,7 +226,7 @@ exp_bigintop (bfd_vma value, char *str)
etree_type *
exp_relop (asection *section, bfd_vma value)
{
- etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->rel));
+ etree_type *new_e = stat_alloc (sizeof (new_e->rel));
new_e->type.node_code = REL;
new_e->type.filename = ldlex_filename ();
new_e->type.lineno = lineno;
@@ -1277,8 +1277,8 @@ exp_value_fold (etree_type *tree)
etree_type *
exp_binop (int code, etree_type *lhs, etree_type *rhs)
{
- etree_type *new_e = (etree_type *) stat_alloc (MAX (sizeof (new_e->binary),
- sizeof (new_e->value)));
+ etree_type *new_e = stat_alloc (MAX (sizeof (new_e->binary),
+ sizeof (new_e->value)));
new_e->type.node_code = code;
new_e->type.filename = lhs->type.filename;
new_e->type.lineno = lhs->type.lineno;
@@ -1297,8 +1297,8 @@ exp_binop (int code, etree_type *lhs, etree_type *rhs)
etree_type *
exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
{
- etree_type *new_e = (etree_type *) stat_alloc (MAX (sizeof (new_e->trinary),
- sizeof (new_e->value)));
+ etree_type *new_e = stat_alloc (MAX (sizeof (new_e->trinary),
+ sizeof (new_e->value)));
new_e->type.node_code = code;
new_e->type.filename = cond->type.filename;
new_e->type.lineno = cond->type.lineno;
@@ -1316,8 +1316,8 @@ exp_trinop (int code, etree_type *cond, etree_type *lhs, etree_type *rhs)
etree_type *
exp_unop (int code, etree_type *child)
{
- etree_type *new_e = (etree_type *) stat_alloc (MAX (sizeof (new_e->unary),
- sizeof (new_e->value)));
+ etree_type *new_e = stat_alloc (MAX (sizeof (new_e->unary),
+ sizeof (new_e->value)));
new_e->unary.type.node_code = code;
new_e->unary.type.filename = child->type.filename;
new_e->unary.type.lineno = child->type.lineno;
@@ -1335,7 +1335,7 @@ exp_unop (int code, etree_type *child)
etree_type *
exp_nameop (int code, const char *name)
{
- etree_type *new_e = (etree_type *) stat_alloc (sizeof (new_e->name));
+ etree_type *new_e = stat_alloc (sizeof (new_e->name));
new_e->name.type.node_code = code;
new_e->name.type.filename = ldlex_filename ();
@@ -1354,7 +1354,7 @@ exp_assop (const char *dst,
{
etree_type *n;
- n = (etree_type *) stat_alloc (sizeof (n->assign));
+ n = stat_alloc (sizeof (n->assign));
n->assign.type.node_code = '=';
n->assign.type.filename = src->type.filename;
n->assign.type.lineno = src->type.lineno;
@@ -1396,7 +1396,7 @@ exp_assert (etree_type *exp, const char *message)
{
etree_type *n;
- n = (etree_type *) stat_alloc (sizeof (n->assert_s));
+ n = stat_alloc (sizeof (n->assert_s));
n->assert_s.type.node_code = '!';
n->assert_s.type.filename = exp->type.filename;
n->assert_s.type.lineno = exp->type.lineno;