aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-valprint.c
diff options
context:
space:
mode:
authorPaul N. Hilfinger <hilfinger@adacore.com>2004-07-09 19:29:56 +0000
committerPaul N. Hilfinger <hilfinger@adacore.com>2004-07-09 19:29:56 +0000
commitc3e5cd34c66fcdcf2acf562249d583932aa9688c (patch)
treed71f38276cc385b3901a4e9a34447b16988042cd /gdb/ada-valprint.c
parente525914fa74e7f8b6abc0d2103b27555e30dcc8f (diff)
downloadgdb-c3e5cd34c66fcdcf2acf562249d583932aa9688c.zip
gdb-c3e5cd34c66fcdcf2acf562249d583932aa9688c.tar.gz
gdb-c3e5cd34c66fcdcf2acf562249d583932aa9688c.tar.bz2
Remove ARI problems:
* ada-exp.y (write_var_from_sym): Reformat to put operator at beginning of line. * ada-lang.c (MAX_OF_SIZE): Rename max_of_size. Add comment. Add comment concerning MAX_OF_TYPE and MIN_OF_TYPE. (MIN_OF_SIZE): Rename min_of_size. Add comment. (UMAX_OF_SIZE): Renmae umax_of_size. Add comment. (UMIN_OF_SIZE): Remove. (max_of_type): New function to replace orphan macro in gdbtypes.h (min_of_type): Ditto. (discrete_type_high_bound): Use max_of_type. (discrete_type_low_bound): Use min_of_type. (possible_user_operator_p): Move operator to beginning of line. (ada_is_variant_part): Ditto. (ensure_lval): Rewrite to avoid deprecated operations. (ada_finish_decode_line_1): Use gdbarch_convert_from_func_ptr_addr rather than adding DEPRECATED_FUNCTION_START_OFFSET. (ada_enum_name): Remove assignments in 'if' statements. (build_ada_types): Add gdbarch parameter. (_initialize_ada_language): Replace deprecated_register_gdbarch_swap with gdbarch_data_register_post_init. Use add_setshow_uinteger_cmd rather than add_set_cmd and add_show_from_set. * ada-valprint.c (inspect_it): Remove declaration. (repeat_count_threshold): Remove declaration. (ada_print_floating): Remove assignments in 'if' statements. (print_str): Move operator to beginning of line.
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r--gdb/ada-valprint.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 55baf10..3617d76 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -48,9 +48,6 @@ struct ada_val_print_args
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);
@@ -317,21 +314,34 @@ ada_print_floating (char *valaddr, struct type *type, struct ui_file *stream)
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);
@@ -460,9 +470,9 @@ printstr (struct ui_file *stream, char *string, unsigned int length,
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;