On Thu, 2007-10-11 at 11:57 -0400, Daniel Jacobowitz wrote: > On Thu, Sep 20, 2007 at 06:54:12PM -0300, Thiago Jung Bauermann wrote: > > + case DW_ATE_decimal_float: > > + if (size == 16) > > + { > > + type = dwarf2_fundamental_type (objfile, FT_DBL_PREC_DECFLOAT, cu); > > + } > > + else if (size == 8) > > + { > > + type = dwarf2_fundamental_type (objfile, FT_EXT_PREC_DECFLOAT, cu); > > + } > > + else > > + type = dwarf2_fundamental_type (objfile, FT_DECFLOAT, cu); > > + return type; > > You don't need a bunch of those extra braces. Right. Removed. > > + /* The following three are about decimal floating point types, which > > + are 32-bits, 64-bits and 128-bits respectively. */ > > + builtin_type->builtin_decfloat = > > + init_type (TYPE_CODE_DECFLOAT, 32 / 8, > > + 0, > > + "decimal float", (struct objfile *) NULL); > > I think our convention is to put the equals sign after the line break. Most of the types in gdbtypes_post_init have the equals sign at the end of the line, so this code was being consistent with them. But you're right, the GNU Coding Standards say to break a line before an operator. Changed. > > void > > +print_decimal_floating (const gdb_byte *valaddr, struct type *type, > > + struct ui_file *stream) > > +{ > > + char decstr[128]; > > + unsigned len = TYPE_LENGTH (type); > > + > > + decimal_to_string (valaddr, len, decstr); > > + fputs_filtered (decstr, stream); > > + return; > > +} > > Does the libdecnumber API specify that 128 bytes is enough? If so > this should be a constant in dfp.h. Actually, I just found out that libdecnumber specifies a lower limit: 43 (including the '\0' at the end), so I created a MAX_DECIMAL_STRING constant in dfp.h and use that here. What do you think of this version? -- []'s Thiago Jung Bauermann Software Engineer IBM Linux Technology Center