Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gcc-patches@gcc.gnu.org, binutils@sourceware.org,
	       gdb-patches@sourceware.org
Subject: Re: [RFA] leb128.h: New file.
Date: Mon, 21 May 2012 14:21:00 -0000	[thread overview]
Message-ID: <20120521142009.GA24602@host2.jankratochvil.net> (raw)
In-Reply-To: <CADPb22SK=VafefzrntwjPzFNOiayCka3dG0ZU-TO-UDTP8EG9A@mail.gmail.com>

On Mon, 21 May 2012 02:30:58 +0200, Doug Evans wrote:
> Ping.
> On Thu, May 17, 2012 at 11:29 AM, Doug Evans <dje@google.com> wrote:
[...]
> > --- /dev/null   1 Jan 1970 00:00:00 -0000
> > +++ leb128.h    17 May 2012 18:23:29 -0000
[...]
> > +/* Get a definition for NULL.  */
> > +#include <stdio.h>

I think <stddef.h> for NULL.


[...]
> > +static inline int

Return type should be size_t or ptrdiff_t.  Likewise for other functions.

> > +read_uleb128 (const unsigned char *buf, const unsigned char *buf_end,
> > +             uint64_t *r)
> > +{
> > +  const unsigned char *p = buf;
> > +  unsigned int shift = 0;
> > +  uint64_t result = 0;
> > +  unsigned char byte;
> > +
> > +  while (1)
> > +    {
> > +      if (p >= buf_end)
> > +       return 0;
> > +
> > +      byte = *p++;
> > +      result |= ((uint64_t) (byte & 0x7f)) << shift;
> > +      if ((byte & 0x80) == 0)
> > +       break;
> > +      shift += 7;
> > +    }
> > +
> > +  *r = result;
> > +  return p - buf;
> > +}
[...]


Regards,
Jan


  reply	other threads:[~2012-05-21 14:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 18:29 Doug Evans
2012-05-21  0:31 ` Doug Evans
2012-05-21 14:21   ` Jan Kratochvil [this message]
2012-05-21 17:09 ` Ian Lance Taylor
2012-05-21 17:36   ` Doug Evans
2012-05-21 18:22     ` Ian Lance Taylor
  -- strict thread matches above, loose matches on Subject: below --
2012-05-15  5:02 Doug Evans

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=20120521142009.GA24602@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=dje@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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