aboutsummaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-01-16 20:06:54 +0000
committerMark Kettenis <kettenis@gnu.org>2005-01-16 20:06:54 +0000
commit80ad1639f798a968c3a537be68f885f1ed055dec (patch)
tree3d195949fdefcba68fa2c091ab1c3b0a46055bdd /gdb/sparc-tdep.c
parent6212a5e9adf9e354682882f3e809d391e3a945d5 (diff)
downloadgdb-80ad1639f798a968c3a537be68f885f1ed055dec.zip
gdb-80ad1639f798a968c3a537be68f885f1ed055dec.tar.gz
gdb-80ad1639f798a968c3a537be68f885f1ed055dec.tar.bz2
* sparc-tdep.c (sparc_integral_or_pointer_p): Simplify.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index b4051c9..e17e0a7 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -188,6 +188,8 @@ sparc_address_from_register (int regnum)
static int
sparc_integral_or_pointer_p (const struct type *type)
{
+ int len = TYPE_LENGTH (type);
+
switch (TYPE_CODE (type))
{
case TYPE_CODE_INT:
@@ -195,22 +197,14 @@ sparc_integral_or_pointer_p (const struct type *type)
case TYPE_CODE_CHAR:
case TYPE_CODE_ENUM:
case TYPE_CODE_RANGE:
- {
- /* We have byte, half-word, word and extended-word/doubleword
- integral types. The doubleword is an extension to the
- original 32-bit ABI by the SCD 2.4.x. */
- int len = TYPE_LENGTH (type);
- return (len == 1 || len == 2 || len == 4 || len == 8);
- }
- return 1;
+ /* We have byte, half-word, word and extended-word/doubleword
+ integral types. The doubleword is an extension to the
+ original 32-bit ABI by the SCD 2.4.x. */
+ return (len == 1 || len == 2 || len == 4 || len == 8);
case TYPE_CODE_PTR:
case TYPE_CODE_REF:
- {
- /* Allow either 32-bit or 64-bit pointers. */
- int len = TYPE_LENGTH (type);
- return (len == 4 || len == 8);
- }
- return 1;
+ /* Allow either 32-bit or 64-bit pointers. */
+ return (len == 4 || len == 8);
default:
break;
}