From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17445 invoked by alias); 11 Oct 2007 15:57:27 -0000 Received: (qmail 17434 invoked by uid 22791); 11 Oct 2007 15:57:26 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 11 Oct 2007 15:57:24 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id DC285982AD; Thu, 11 Oct 2007 15:57:22 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id BCAF3981F2; Thu, 11 Oct 2007 15:57:22 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1Ig0PZ-00069e-TF; Thu, 11 Oct 2007 11:57:21 -0400 Date: Thu, 11 Oct 2007 16:00:00 -0000 From: Daniel Jacobowitz To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org Subject: Re: [patch 2/4] decimal floating point types Message-ID: <20071011155721.GB22982@caradoc.them.org> Mail-Followup-To: Thiago Jung Bauermann , gdb-patches@sourceware.org References: <20070920215410.062714003@br.ibm.com> <20070920215539.651720008@br.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070920215539.651720008@br.ibm.com> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00291.txt.bz2 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. > + /* 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. > 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. -- Daniel Jacobowitz CodeSourcery