From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5116 invoked by alias); 21 May 2012 14:21:04 -0000 Received: (qmail 4963 invoked by uid 22791); 21 May 2012 14:21:00 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 May 2012 14:20:49 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4LEKEGX022061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 May 2012 10:20:14 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4LEK9gf028157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 21 May 2012 10:20:12 -0400 Date: Mon, 21 May 2012 14:21:00 -0000 From: Jan Kratochvil To: Doug Evans Cc: gcc-patches@gcc.gnu.org, binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [RFA] leb128.h: New file. Message-ID: <20120521142009.GA24602@host2.jankratochvil.net> References: <20120517182920.64FAE2461B2@ruffy.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-05/txt/msg00765.txt.bz2 On Mon, 21 May 2012 02:30:58 +0200, Doug Evans wrote: > Ping. > On Thu, May 17, 2012 at 11:29 AM, Doug Evans 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 I think 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