From 8f8a23a2c397294ab562c6cf7020679f85b921ec Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Wed, 26 Sep 2012 07:52:48 +0000 Subject: * amd64-tdep.c (amd64_return_value): Use TYPE_LENGTH directly. * bfin-tdep.c (bfin_extract_return_value): Likewise. (bfin_store_return_value): Likewise. * cris-tdep.c (cris_store_return_value): Likewise. (cris_extract_return_value): Likewise. * h8300-tdep.c (h8300_extract_return_value): Likewise. * hppa-tdep.c (hppa64_return_value): Likewise. * lm32-tdep.c (lm32_store_return_value): Likewise. * microblaze-tdep.c (microblaze_store_return_value): Likewise. * spu-tdep.c (spu_value_from_register): Likewise. * vax-tdep.c (vax_return_value): Likewise. --- gdb/cris-tdep.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'gdb/cris-tdep.c') diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 67390379f98..48c8f9432f8 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -1662,20 +1662,20 @@ cris_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); ULONGEST val; - int len = TYPE_LENGTH (type); - if (len <= 4) + if (TYPE_LENGTH (type) <= 4) { /* Put the return value in R10. */ - val = extract_unsigned_integer (valbuf, len, byte_order); + val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order); regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val); } - else if (len <= 8) + else if (TYPE_LENGTH (type) <= 8) { /* Put the return value in R10 and R11. */ val = extract_unsigned_integer (valbuf, 4, byte_order); regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val); - val = extract_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order); + val = extract_unsigned_integer ((char *)valbuf + 4, + TYPE_LENGTH (type) - 4, byte_order); regcache_cooked_write_unsigned (regcache, ARG2_REGNUM, val); } else @@ -1833,21 +1833,21 @@ cris_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); ULONGEST val; - int len = TYPE_LENGTH (type); - if (len <= 4) + if (TYPE_LENGTH (type) <= 4) { /* Get the return value from R10. */ regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val); - store_unsigned_integer (valbuf, len, byte_order, val); + store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, val); } - else if (len <= 8) + else if (TYPE_LENGTH (type) <= 8) { /* Get the return value from R10 and R11. */ regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val); store_unsigned_integer (valbuf, 4, byte_order, val); regcache_cooked_read_unsigned (regcache, ARG2_REGNUM, &val); - store_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order, val); + store_unsigned_integer ((char *)valbuf + 4, TYPE_LENGTH (type) - 4, + byte_order, val); } else error (_("cris_extract_return_value: type length too large")); -- cgit v1.2.1