enum val_prettyprint pretty;
};
-extern int inspect_it;
-extern unsigned int repeat_count_threshold;
-
static void print_record (struct type *, char *, struct ui_file *, int,
int, enum val_prettyprint);
static void adjust_type_signedness (struct type *);
-static int ada_val_print_stub (PTR args0);
+static int ada_val_print_stub (void *args0);
static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR,
struct ui_file *, int, int, int,
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
}
-/* Assuming TYPE is a simple array type, prints its lower bound on STREAM,
- if non-standard (i.e., other than 1 for numbers, other than lower bound
- of index type for enumerated type). Returns 1 if something printed,
- otherwise 0. */
+/* Assuming TYPE is a simple, non-empty array type, prints its lower bound
+ on STREAM, if non-standard (i.e., other than 1 for numbers, other
+ than lower bound of index type for enumerated type). Returns 1
+ if something printed, otherwise 0. */
static int
print_optional_low_bound (struct ui_file *stream, struct type *type)
if (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
{
low_bound = TYPE_LOW_BOUND (index_type);
+ if (low_bound > TYPE_HIGH_BOUND (index_type))
+ return 0;
index_type = TYPE_TARGET_TYPE (index_type);
}
else
len = strlen (result);
/* Modify for Ada rules. */
- if ((s = strstr (result, "inf")) != NULL
- || (s = strstr (result, "Inf")) != NULL
- || (s = strstr (result, "INF")) != NULL)
+
+ s = strstr (result, "inf");
+ if (s == NULL)
+ s = strstr (result, "Inf");
+ if (s == NULL)
+ s = strstr (result, "INF");
+ if (s != NULL)
strcpy (s, "Inf");
- else if ((s = strstr (result, "nan")) != NULL
- || (s = strstr (result, "NaN")) != NULL
- || (s = strstr (result, "Nan")) != NULL)
+
+ if (s == NULL)
{
- s[0] = s[2] = 'N';
- if (result[0] == '-')
- result += 1;
+ s = strstr (result, "nan");
+ if (s == NULL)
+ s = strstr (result, "NaN");
+ if (s == NULL)
+ s = strstr (result, "Nan");
+ if (s != NULL)
+ {
+ s[0] = s[2] = 'N';
+ if (result[0] == '-')
+ result += 1;
+ }
}
- else if (strchr (result, '.') == NULL)
+
+ if (s == NULL && strchr (result, '.') == NULL)
{
- if ((s = strchr (result, 'e')) == NULL)
+ s = strchr (result, 'e');
+ if (s == NULL)
fprintf_filtered (stream, "%s.0", result);
else
fprintf_filtered (stream, "%.*s.0%s", (int) (s-result), result, s);
unsigned int i;
unsigned len;
- CHECK_TYPEDEF (type);
+ type = ada_check_typedef (type);
switch (TYPE_CODE (type))
{
rep1 = i + 1;
reps = 1;
- while (rep1 < length &&
- char_at (string, rep1, type_len) == char_at (string, i,
- type_len))
+ while (rep1 < length
+ && char_at (string, rep1, type_len) == char_at (string, i,
+ type_len))
{
rep1 += 1;
reps += 1;
/* Helper for ada_val_print; used as argument to catch_errors to
unmarshal the arguments to ada_val_print_1, which does the work. */
static int
-ada_val_print_stub (PTR args0)
+ada_val_print_stub (void *args0)
{
struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0;
return ada_val_print_1 (argsp->type, argsp->valaddr0,
LONGEST val;
char *valaddr = valaddr0 + embedded_offset;
- CHECK_TYPEDEF (type);
+ type = ada_check_typedef (type);
if (ada_is_array_descriptor_type (type) || ada_is_packed_array_type (type))
{
print_record (struct type *type, char *valaddr, struct ui_file *stream,
int format, int recurse, enum val_prettyprint pretty)
{
- CHECK_TYPEDEF (type);
+ type = ada_check_typedef (type);
fprintf_filtered (stream, "(");