This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/3] Simplify and inline get_uleb128 and get_sleb128


On 04/22/2014 08:52 AM, Josh Stone wrote:
> The trick in the original was that "(typeof (var)) __s.i" would extend
> the sign from the 7th bit, which I don't your mask will do.

Yes, that was another cut/paste error.
Not a great batting average this morning...  ;-)

> So in total:
> 
>   struct { signed int i:7; } __s = { .i = __b };
>   (var) |= (typeof (var)) __s.i * ((typeof (var)) 1 << ((nth) * 7));
> 
> Better?

Yes, that's what I had in mind.


r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]