From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9999 invoked by alias); 11 Oct 2007 16:16:50 -0000 Received: (qmail 9991 invoked by uid 22791); 11 Oct 2007 16:16:50 -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 16:16:47 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 5CFBC982AD; Thu, 11 Oct 2007 16:16:46 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 447FC981F2; Thu, 11 Oct 2007 16:16:46 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1Ig0iL-0006RA-7i; Thu, 11 Oct 2007 12:16:45 -0400 Date: Thu, 11 Oct 2007 16:18:00 -0000 From: Daniel Jacobowitz To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org Subject: Re: [patch 3/4] decimal floating point support for expressions Message-ID: <20071011161645.GD22982@caradoc.them.org> Mail-Followup-To: Thiago Jung Bauermann , gdb-patches@sourceware.org References: <20070920215410.062714003@br.ibm.com> <20070920215539.891263549@br.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070920215539.891263549@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/msg00294.txt.bz2 On Thu, Sep 20, 2007 at 06:54:13PM -0300, Thiago Jung Bauermann wrote: > + putithere->typed_val_decfloat.type = > + builtin_type (current_gdbarch)->builtin_decfloat; Equals sign on next line please. > @@ -1376,6 +1376,20 @@ value_neg (struct value *arg1) > > type = check_typedef (value_type (arg1)); > > + if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT) > + { > + struct value *val = allocate_value (result_type); > + int len = TYPE_LENGTH (type); > + gdb_byte *decbytes = (gdb_byte *) value_contents (arg1); > + > + if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE) > + decbytes[len-1] = decbytes[len - 1] | 0x80; > + else > + decbytes[0] = decbytes[0] | 0x80; > + memcpy (value_contents_raw (val), decbytes, 16); > + return val; > + } > + The reason we allocate a new value is to leave the existing value unchanged, so you shouldn't modify the contents of arg1. The casts are probably there because otherwise GCC complained you were removing a const. Don't do that :-) > +#include "dfp.h" If you add an #include, update Makefile.in. -- Daniel Jacobowitz CodeSourcery