return arg;
struct value *scale = ada_scaling_factor (type);
- if (ada_is_fixed_point_type (value_type (arg)))
+ if (ada_is_gnat_encoded_fixed_point_type (value_type (arg)))
arg = cast_from_fixed (value_type (scale), arg);
else
arg = value_cast (value_type (scale), arg);
if (type == ada_check_typedef (value_type (arg2)))
return arg2;
- if (ada_is_fixed_point_type (type))
+ if (ada_is_gnat_encoded_fixed_point_type (type))
return cast_to_fixed (type, arg2);
- if (ada_is_fixed_point_type (value_type (arg2)))
+ if (ada_is_gnat_encoded_fixed_point_type (value_type (arg2)))
return cast_from_fixed (type, arg2);
return value_cast (type, arg2);
{
/* Nothing. */
}
- else if (ada_is_fixed_point_type (value_type (arg1)))
+ else if (ada_is_gnat_encoded_fixed_point_type (value_type (arg1)))
arg2 = cast_to_fixed (value_type (arg1), arg2);
- else if (ada_is_fixed_point_type (value_type (arg2)))
+ else if (ada_is_gnat_encoded_fixed_point_type (value_type (arg2)))
error
(_("Fixed-point values must be assigned to fixed-point variables"));
else
return (value_from_longest
(value_type (arg2),
value_as_long (arg1) + value_as_long (arg2)));
- if ((ada_is_fixed_point_type (value_type (arg1))
- || ada_is_fixed_point_type (value_type (arg2)))
+ if ((ada_is_gnat_encoded_fixed_point_type (value_type (arg1))
+ || ada_is_gnat_encoded_fixed_point_type (value_type (arg2)))
&& value_type (arg1) != value_type (arg2))
error (_("Operands of fixed-point addition must have the same type"));
/* Do the addition, and cast the result to the type of the first
return (value_from_longest
(value_type (arg2),
value_as_long (arg1) - value_as_long (arg2)));
- if ((ada_is_fixed_point_type (value_type (arg1))
- || ada_is_fixed_point_type (value_type (arg2)))
+ if ((ada_is_gnat_encoded_fixed_point_type (value_type (arg1))
+ || ada_is_gnat_encoded_fixed_point_type (value_type (arg2)))
&& value_type (arg1) != value_type (arg2))
error (_("Operands of fixed-point subtraction "
"must have the same type"));
else
{
type = builtin_type (exp->gdbarch)->builtin_double;
- if (ada_is_fixed_point_type (value_type (arg1)))
+ if (ada_is_gnat_encoded_fixed_point_type (value_type (arg1)))
arg1 = cast_from_fixed (type, arg1);
- if (ada_is_fixed_point_type (value_type (arg2)))
+ if (ada_is_gnat_encoded_fixed_point_type (value_type (arg2)))
arg2 = cast_from_fixed (type, arg2);
binop_promote (exp->language_defn, exp->gdbarch, &arg1, &arg2);
return ada_value_binop (arg1, arg2, op);
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
goto nosideret;
- else if (ada_is_fixed_point_type (value_type (arg1)))
+ else if (ada_is_gnat_encoded_fixed_point_type (value_type (arg1)))
return value_cast (value_type (arg1), value_neg (arg1));
else
{
Otherwise, return NULL. */
static const char *
-fixed_type_info (struct type *type)
+gnat_encoded_fixed_type_info (struct type *type)
{
const char *name = ada_type_name (type);
enum type_code code = (type == NULL) ? TYPE_CODE_UNDEF : type->code ();
return tail + 5;
}
else if (code == TYPE_CODE_RANGE && TYPE_TARGET_TYPE (type) != type)
- return fixed_type_info (TYPE_TARGET_TYPE (type));
+ return gnat_encoded_fixed_type_info (TYPE_TARGET_TYPE (type));
else
return NULL;
}
/* Returns non-zero iff TYPE represents an Ada fixed-point type. */
int
-ada_is_fixed_point_type (struct type *type)
+ada_is_gnat_encoded_fixed_point_type (struct type *type)
{
- return fixed_type_info (type) != NULL;
+ return gnat_encoded_fixed_type_info (type) != NULL;
}
/* Return non-zero iff TYPE represents a System.Address type. */
delta cannot be determined. */
struct value *
-ada_delta (struct type *type)
+gnat_encoded_fixed_point_delta (struct type *type)
{
- const char *encoding = fixed_type_info (type);
+ const char *encoding = gnat_encoded_fixed_type_info (type);
struct type *scale_type = ada_scaling_type (type);
long long num, den;
value_from_longest (scale_type, den), BINOP_DIV);
}
-/* Assuming that ada_is_fixed_point_type (TYPE), return the scaling
- factor ('SMALL value) associated with the type. */
+/* Assuming that ada_is_gnat_encoded_fixed_point_type (TYPE), return
+ the scaling factor ('SMALL value) associated with the type. */
struct value *
ada_scaling_factor (struct type *type)
{
- const char *encoding = fixed_type_info (type);
+ const char *encoding = gnat_encoded_fixed_type_info (type);
struct type *scale_type = ada_scaling_type (type);
long long num0, den0, num1, den1;
/* Print representation of Ada fixed-point type TYPE on STREAM. */
static void
-print_fixed_point_type (struct type *type, struct ui_file *stream)
+print_gnat_encoded_fixed_point_type (struct type *type, struct ui_file *stream)
{
- struct value *delta = ada_delta (type);
+ struct value *delta = gnat_encoded_fixed_point_delta (type);
struct value *small = ada_scaling_factor (type);
if (delta == nullptr)
fprintf_filtered (stream, "(false, true)");
break;
case TYPE_CODE_INT:
- if (ada_is_fixed_point_type (type))
- print_fixed_point_type (type, stream);
+ if (ada_is_gnat_encoded_fixed_point_type (type))
+ print_gnat_encoded_fixed_point_type (type, stream);
else
{
const char *name = ada_type_name (type);
}
break;
case TYPE_CODE_RANGE:
- if (ada_is_fixed_point_type (type))
- print_fixed_point_type (type, stream);
+ if (ada_is_gnat_encoded_fixed_point_type (type))
+ print_gnat_encoded_fixed_point_type (type, stream);
else if (ada_is_modular_type (type))
fprintf_filtered (stream, "mod %s",
int_string (ada_modulus (type), 10, 0, 0, 1));