[En-Nut-Discussion] Byte select macros

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Nov 24 14:32:47 CET 2010


>>>>> "Ulrich" == Ulrich Prinz <uprinz2 at netscape.net> writes:

    Ulrich> Just for interest, can you retry with uint8_t and uint_fast8_t
    Ulrich> instead of unsigned char?


    Ulrich> and another trial with

    Ulrich>      res[0] = (uint8_t)input[0]; or

    Ulrich>      res[0] = (insigned char)input[0];

    Ulrich> instead of

    Ulrich>      res[0] = input[0] & 0xFF;

    Ulrich> Would be interesting where this compiler behavior comes
    Ulrich> from. Thanks for your effort!

I have tried many combinations, but no result was satisfactory...

    Ulrich> And: I am interested in those macros becaus they are pretty easy
    Ulrich> to handle for anything where byte orientation is important while
    Ulrich> architecture must be flexible. So you need only one point to
    Ulrich> declare those macros and nutconf takes care of selecting the
    Ulrich> right set of them for your platform.

And these macros make us independant from the compiler version...
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list