summaryrefslogtreecommitdiff
path: root/gdb/h8300-tdep.c
diff options
context:
space:
mode:
authorsiddhesh <siddhesh>2012-09-25 12:48:52 +0000
committersiddhesh <siddhesh>2012-09-25 12:48:52 +0000
commit9cc9d25ec1e90f30c80c00434e614a0b9bd065f0 (patch)
treec571d6b5a84283aa3ea562dcc6a03994b2ae04ed /gdb/h8300-tdep.c
parentaae428f949972193f49fbf38a02696eb0d45cb20 (diff)
downloadgdb-9cc9d25ec1e90f30c80c00434e614a0b9bd065f0.tar.gz
* ada-valprint.c (ada_val_print_1): Eliminate single-use
variable LEN. * alpha-tdep.c (alpha_extract_return_value): Use TYPE_LENGTH directly. (alpha_store_return_value): Likewise. * amd64-tdep.c (amd64_classify_aggregate): Likewise. (amd64_push_arguments): Likewise. * ax-gdb.c (gen_trace_static_fields): Likewise. (gen_traced_pop): Likewise. * bfin-tdep.c (bfin_push_dummy_call): Likewise. * breakpoint.c (update_watchpoint): Likewise. * findcmd.c (parse_find_args): Use local variable for type instead of length. * findvar.c (default_read_var_value): Use TYPE_LENGTH directly. * h8300-tdep.c (h8300h_extract_return_value): Likewise. (h8300_store_return_value): Likewise. * i386-darwin-tdep.c (i386_darwin_push_dummy_call): Likewise. Use i386_darwin_arg_type_alignment directly. * infcall.c (call_function_by_hand): Use TYPE_LENGTH directly. * lm32-tdep.c (lm32_push_dummy_call): Likewise. * m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise. (m68hc11_extract_return_value): Likewise. * mep-tdep.c (mep_push_dummy_call): Likewise. * printcmd.c (float_type_from_length): Likewise. * s390-tdep.c (s390_value_from_register): Likewise. * stack.c (read_frame_arg): Likewise. * tracepoint.c (encode_actions_1): Likewise. * valops.c (value_fetch_lazy): Use local variable for type instead of length. Use TYPE_LENGTH directly. * value.c (value_contents_equal): Use TYPE_LENGTH directly.
Diffstat (limited to 'gdb/h8300-tdep.c')
-rw-r--r--gdb/h8300-tdep.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index bcb769e4246..4e98a8f7128 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -785,16 +785,15 @@ h8300h_extract_return_value (struct type *type, struct regcache *regcache,
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int len = TYPE_LENGTH (type);
ULONGEST c;
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
case 2:
case 4:
regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c);
- store_unsigned_integer (valbuf, len, byte_order, c);
+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c);
break;
case 8: /* long long is now 8 bytes. */
if (TYPE_CODE (type) == TYPE_CODE_INT)
@@ -852,18 +851,17 @@ h8300_store_return_value (struct type *type, struct regcache *regcache,
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int len = TYPE_LENGTH (type);
ULONGEST val;
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
case 2: /* short... */
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val);
break;
case 4: /* long, float */
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM,
(val >> 16) & 0xffff);
regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, val & 0xffff);
@@ -882,19 +880,18 @@ h8300h_store_return_value (struct type *type, struct regcache *regcache,
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int len = TYPE_LENGTH (type);
ULONGEST val;
- switch (len)
+ switch (TYPE_LENGTH (type))
{
case 1:
case 2:
case 4: /* long, float */
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val);
break;
case 8:
- val = extract_unsigned_integer (valbuf, len, byte_order);
+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM,
(val >> 32) & 0xffffffff);
regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM,