Remove cleanups from prepare_execute_command
[deliverable/binutils-gdb.git] / gdb / valarith.c
index bcc5ff6c0a950c6cf3f0ee2b459dec5263efd07d..ede60e4b68e35bb82fce7434a5626fd69f97deff 100644 (file)
@@ -36,9 +36,6 @@
 #define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
 #endif
 
-void _initialize_valarith (void);
-\f
-
 /* Given a pointer, return the size of its target.
    If the pointer type is void *, then return 1.
    If the target type is incomplete, then error out.
@@ -884,7 +881,10 @@ value_args_as_decimal (struct value *arg1, struct value *arg2,
     {
       *byte_order_x = gdbarch_byte_order (get_type_arch (type2));
       *len_x = TYPE_LENGTH (type2);
-      decimal_from_integral (arg1, x, *len_x, *byte_order_x);
+      if (TYPE_UNSIGNED (type1))
+       decimal_from_ulongest (value_as_long (arg1), x, *len_x, *byte_order_x);
+      else
+       decimal_from_longest (value_as_long (arg1), x, *len_x, *byte_order_x);
     }
   else
     error (_("Don't know how to convert from %s to %s."), TYPE_NAME (type1),
@@ -903,7 +903,10 @@ value_args_as_decimal (struct value *arg1, struct value *arg2,
     {
       *byte_order_y = gdbarch_byte_order (get_type_arch (type1));
       *len_y = TYPE_LENGTH (type1);
-      decimal_from_integral (arg2, y, *len_y, *byte_order_y);
+      if (TYPE_UNSIGNED (type2))
+       decimal_from_ulongest (value_as_long (arg2), y, *len_y, *byte_order_y);
+      else
+       decimal_from_longest (value_as_long (arg2), y, *len_y, *byte_order_y);
     }
   else
     error (_("Don't know how to convert from %s to %s."), TYPE_NAME (type1),
This page took 0.023437 seconds and 4 git commands to generate.