On Wed, Nov 02, 2016 at 22:32 +0100, Tilman Sauerbeck wrote:
> 
> Gerhard Sittig [2016-11-02 20:39]:
> 
> Hi,
> 
> > When I looked at several places in the sigrok's subprojects'
> > sources, I noticed the absence of common endianess conversion
> > helpers.  All affected call sites appear to open code the
> > respective functions.
> 
> In my (quite old) checkout, there are some endianess helper macros in
> libsigrok-internal.h which has...
> 
> > Working on Asix Sigma support, jry@ currently is in need of
> > conversion routines for 16bit data.  I suggested to introduce
> > routines with the le16_to_cpu() naming scheme, and to consider
> 
> ... RL16() among others.

You are right!  Current sources still have the [RW]8() and
[RW][LB]{16,32,64}() macros in place, and they are used
throughout the project.

Implemented as macros, they will have side effects when used
without caution.  But knowing about this constraint one can
avoid potential problems.

Great!  Thank you for the feedback.


The floating point macro implementation uses the dirty union
trick.  This approach is popular, but is it considered reliable?
The WAV input/output modules don't use the macro, instead they
swap the bytes themselves (and use char where they should say
uint8_t).


virtually yours
Gerhard Sittig
-- 
     If you don't understand or are scared by any of the above
             ask your parents or an adult to help you.

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to