From 744a80590447619c1c58d7d6a6e780ae6bd29777 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Tue, 25 Sep 2012 12:48:53 +0000 Subject: * 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. --- gdb/alpha-tdep.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'gdb/alpha-tdep.c') diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 5d3affa..e5b75d2 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -475,14 +475,13 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, { struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - int length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; switch (TYPE_CODE (valtype)) { case TYPE_CODE_FLT: - switch (length) + switch (TYPE_LENGTH (valtype)) { case 4: regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, raw_buffer); @@ -505,7 +504,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, break; case TYPE_CODE_COMPLEX: - switch (length) + switch (TYPE_LENGTH (valtype)) { case 8: /* ??? This isn't correct wrt the ABI, but it's what GCC does. */ @@ -531,7 +530,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, default: /* Assume everything else degenerates to an integer. */ regcache_cooked_read_unsigned (regcache, ALPHA_V0_REGNUM, &l); - store_unsigned_integer (valbuf, length, byte_order, l); + store_unsigned_integer (valbuf, TYPE_LENGTH (valtype), byte_order, l); break; } } @@ -544,14 +543,13 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch *gdbarch = get_regcache_arch (regcache); - int length = TYPE_LENGTH (valtype); gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; ULONGEST l; switch (TYPE_CODE (valtype)) { case TYPE_CODE_FLT: - switch (length) + switch (TYPE_LENGTH (valtype)) { case 4: alpha_lds (gdbarch, raw_buffer, valbuf); @@ -575,7 +573,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, break; case TYPE_CODE_COMPLEX: - switch (length) + switch (TYPE_LENGTH (valtype)) { case 8: /* ??? This isn't correct wrt the ABI, but it's what GCC does. */ @@ -603,7 +601,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache, /* Assume everything else degenerates to an integer. */ /* 32-bit values must be sign-extended to 64 bits even if the base data type is unsigned. */ - if (length == 4) + if (TYPE_LENGTH (valtype) == 4) valtype = builtin_type (gdbarch)->builtin_int32; l = unpack_long (valtype, valbuf); regcache_cooked_write_unsigned (regcache, ALPHA_V0_REGNUM, l); -- cgit v1.1