On Tue, Jun 2, 2020 at 11:51 AM Gerhard Sittig <gerhard.sit...@gmx.net> wrote:
> You may have noticed there is the "simple, one-shot" RL16() et al
> group of accessors. And the "stream like" *_inc() variants which
> I added after finding myself repeating the read/write access
> _and_ the address increment too many times, which "just felt
> wrong" to me.

Nice! These are a clever way to tackle this problem.
I had not noticed these before, I can see these could be handy someday.

> Let's see why. Gotta change from LE to BE format? Just swap the
> lines which collect the bytes. Gotta create a 32bit reoutine
> after 16bit support exists? Just add two more lines. Need to
> support funny alternatives to ABCD and DCBA, like BADC? Just swap
> the lines. Found a typo/braino in the implementation? Just
> arrange the lines in the correct order.

It's elegant code, very readable indeed. I see your point,
better leave the "micro management" to compiler/optimizer.
Over optimizing code can often lead to a trouble with very
little (if any) benefit...

> If you want to help, review and extend the test sequence for the
> endianess conversion. Getting more coverage is highly desirable.

I'll take a look.

-- 
Timo <t...@iki.fi>


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to