gdb/
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index 9e8cd659cad25071ba9499a7bba2353649227a94..7a669f125e0b57d4634e54135118eb067aafb93d 100644 (file)
@@ -346,13 +346,12 @@ float_type_from_length (struct type *type)
 {
   struct gdbarch *gdbarch = get_type_arch (type);
   const struct builtin_type *builtin = builtin_type (gdbarch);
-  unsigned int len = TYPE_LENGTH (type);
 
-  if (len == TYPE_LENGTH (builtin->builtin_float))
+  if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_float))
     type = builtin->builtin_float;
-  else if (len == TYPE_LENGTH (builtin->builtin_double))
+  else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_double))
     type = builtin->builtin_double;
-  else if (len == TYPE_LENGTH (builtin->builtin_long_double))
+  else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_long_double))
     type = builtin->builtin_long_double;
 
   return type;
@@ -2267,7 +2266,6 @@ ui_printf (char *arg, struct ui_file *stream)
 
              /* Parameter data.  */
              struct type *param_type = value_type (val_args[i]);
-             unsigned int param_len = TYPE_LENGTH (param_type);
              struct gdbarch *gdbarch = get_type_arch (param_type);
              enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
 
@@ -2329,8 +2327,8 @@ ui_printf (char *arg, struct ui_file *stream)
 
              /* Conversion between different DFP types.  */
              if (TYPE_CODE (param_type) == TYPE_CODE_DECFLOAT)
-               decimal_convert (param_ptr, param_len, byte_order,
-                                dec, dfp_len, byte_order);
+               decimal_convert (param_ptr, TYPE_LENGTH (param_type),
+                                byte_order, dec, dfp_len, byte_order);
              else
                /* If this is a non-trivial conversion, just output 0.
                   A correct converted value can be displayed by explicitly
This page took 0.024592 seconds and 4 git commands to generate.