diff options
Diffstat (limited to 'gdb/m2-lang.c')
-rw-r--r-- | gdb/m2-lang.c | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index fe02c45..f50dce6 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -34,8 +34,7 @@ struct value * eval_op_m2_high (struct type *expect_type, struct expression *exp, - enum noside noside, - struct value *arg1) + enum noside noside, struct value *arg1) { if (noside == EVAL_AVOID_SIDE_EFFECTS) return arg1; @@ -51,8 +50,8 @@ eval_op_m2_high (struct type *expect_type, struct expression *exp, type = type->field (1).type (); /* i18n: Do not translate the "_m2_high" part! */ arg1 = value_struct_elt (&temp, {}, "_m2_high", NULL, - _("unbounded structure " - "missing _m2_high field")); + _ ("unbounded structure " + "missing _m2_high field")); if (value_type (arg1) != type) arg1 = value_cast (type, arg1); @@ -65,8 +64,8 @@ eval_op_m2_high (struct type *expect_type, struct expression *exp, struct value * eval_op_m2_subscript (struct type *expect_type, struct expression *exp, - enum noside noside, - struct value *arg1, struct value *arg2) + enum noside noside, struct value *arg1, + struct value *arg2) { /* If the user attempts to subscript something that is not an array or pointer type (like a plain int variable for example), @@ -80,28 +79,26 @@ eval_op_m2_subscript (struct type *expect_type, struct expression *exp, struct value *temp = arg1; type = type->field (0).type (); if (type == NULL || (type->code () != TYPE_CODE_PTR)) - error (_("internal error: unbounded " - "array structure is unknown")); + error (_ ("internal error: unbounded " + "array structure is unknown")); /* i18n: Do not translate the "_m2_contents" part! */ arg1 = value_struct_elt (&temp, {}, "_m2_contents", NULL, - _("unbounded structure " - "missing _m2_contents field")); - + _ ("unbounded structure " + "missing _m2_contents field")); + if (value_type (arg1) != type) arg1 = value_cast (type, arg1); check_typedef (value_type (arg1)); return value_ind (value_ptradd (arg1, value_as_long (arg2))); } - else - if (type->code () != TYPE_CODE_ARRAY) - { - if (type->name ()) - error (_("cannot subscript something of type `%s'"), - type->name ()); - else - error (_("cannot subscript requested type")); - } + else if (type->code () != TYPE_CODE_ARRAY) + { + if (type->name ()) + error (_ ("cannot subscript something of type `%s'"), type->name ()); + else + error (_ ("cannot subscript requested type")); + } if (noside == EVAL_AVOID_SIDE_EFFECTS) return value_zero (type->target_type (), VALUE_LVAL (arg1)); @@ -109,8 +106,6 @@ eval_op_m2_subscript (struct type *expect_type, struct expression *exp, return value_subscript (arg1, value_as_long (arg2)); } - - /* Single instance of the M2 language. */ static m2_language m2_language_defn; @@ -124,10 +119,7 @@ m2_language::language_arch_info (struct gdbarch *gdbarch, const struct builtin_m2_type *builtin = builtin_m2_type (gdbarch); /* Helper function to allow shorter lines below. */ - auto add = [&] (struct type * t) - { - lai->add_primitive_type (t); - }; + auto add = [&] (struct type *t) { lai->add_primitive_type (t); }; add (builtin->builtin_char); add (builtin->builtin_int); @@ -142,8 +134,7 @@ m2_language::language_arch_info (struct gdbarch *gdbarch, /* See languge.h. */ void -m2_language::printchar (int c, struct type *type, - struct ui_file *stream) const +m2_language::printchar (int c, struct type *type, struct ui_file *stream) const { gdb_puts ("'", stream); emitchar (c, type, stream, '\''); @@ -154,9 +145,9 @@ m2_language::printchar (int c, struct type *type, void m2_language::printstr (struct ui_file *stream, struct type *elttype, - const gdb_byte *string, unsigned int length, - const char *encoding, int force_ellipses, - const struct value_print_options *options) const + const gdb_byte *string, unsigned int length, + const char *encoding, int force_ellipses, + const struct value_print_options *options) const { unsigned int i; unsigned int things_printed = 0; @@ -230,10 +221,10 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype, /* See language.h. */ void -m2_language::emitchar (int ch, struct type *chtype, - struct ui_file *stream, int quoter) const +m2_language::emitchar (int ch, struct type *chtype, struct ui_file *stream, + int quoter) const { - ch &= 0xFF; /* Avoid sign bit follies. */ + ch &= 0xFF; /* Avoid sign bit follies. */ if (PRINT_LITERAL_FORM (ch)) { |