Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 1/4] libdecnumber support
Date: Thu, 11 Oct 2007 15:57:00 -0000	[thread overview]
Message-ID: <20071011155418.GA22982@caradoc.them.org> (raw)
In-Reply-To: <20070920215539.570827491@br.ibm.com>

I'll review all these now.  Before you check them in, though, give
me a chance to get libdecnumber merged into the src repository.  It
shouldn't take long.

On Thu, Sep 20, 2007 at 06:54:11PM -0300, Thiago Jung Bauermann wrote:
> +#include <ctype.h>
> +#include <endian.h>
> +#include "defs.h"
> +#include "dfp.h"

What do you need ctype.h for?  That will tell me whether you really
want ctype.h or libiberty's locale-independent safe-ctype.h.

defs.h should always be first.

endian.h is not portable.  You should probably use the autoconf macro
AC_C_BIGENDIAN.

> +/* Convert decimal type to its string representation.  LEN is the length
> +   of the decimal type, 4 bytes for decimal32, 8 bytes for decimal64 and
> +   16 bytes for decimal128.  */
> +void
> +decimal_to_string (const uint8_t *decbytes, int len, char *s)
> +{
> +  uint8_t *dec = (uint8_t *)malloc (len);

You didn't include anything that would give you uint8_t; use
gdb_byte.  Also we never use malloc, only xmalloc.  Or you could avoid
the allocation by using gdb_byte dec[16].

> +        break;
> +      default:
> +	free (dec);

Spaces and tabs mixed up?  xfree, like xmalloc.

> +	error(_("Unknown decimal floating point type.\n"));

Space before parentheses please.

> +/* There is a project intended to add DFP support into GCC, described in
> +   http://gcc.gnu.org/wiki/Decimal%20Floating-Point.  This file is intended
> +   to add DFP support into GDB.  */

This comment doesn't belong here.  The file is part of GDB once the
patch is applied.

> +#ifndef DFP_H
> +#define DFP_H
> +#include <string.h>
> +#include <stdio.h>
> +#include <stdint.h>

Don't include standard headers here; stick to what defs.h provides.
Just as well, since neither string.h nor stdint.h is portable.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2007-10-11 15:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20 21:57 [patch 0/4] decimal floating point support Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 1/4] libdecnumber support Thiago Jung Bauermann
2007-10-11 15:57   ` Daniel Jacobowitz [this message]
2007-10-11 16:07     ` Daniel Jacobowitz
2007-10-15 18:32       ` Thiago Jung Bauermann
2007-10-15 18:11     ` Thiago Jung Bauermann
2007-10-15 18:38       ` Daniel Jacobowitz
2007-10-25 18:23         ` Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 3/4] decimal floating point support for expressions Thiago Jung Bauermann
2007-10-11 16:18   ` Daniel Jacobowitz
2007-10-15 18:12     ` Thiago Jung Bauermann
2007-10-24 20:12       ` Daniel Jacobowitz
2007-10-25 18:40         ` Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 4/4] decimal floating point testcases Thiago Jung Bauermann
2007-10-11 16:19   ` Daniel Jacobowitz
2007-10-15 18:12     ` Thiago Jung Bauermann
2007-10-25 18:22       ` Thiago Jung Bauermann
2007-09-20 21:57 ` [patch 2/4] decimal floating point types Thiago Jung Bauermann
2007-10-11 16:00   ` Daniel Jacobowitz
2007-10-15 18:12     ` Thiago Jung Bauermann
2007-10-24 20:11       ` Daniel Jacobowitz
2007-10-25 18:24         ` Thiago Jung Bauermann
     [not found] <20070323030737.475073862@br.ibm.com>
2007-03-27 16:30 ` [patch 1/4] libdecnumber support Thiago Jung Bauermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071011155418.GA22982@caradoc.them.org \
    --to=drow@false.org \
    --cc=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox