On Wed, 21 Aug 2013 14:36:40 EDT erik quanstrom <quans...@quanstro.net> wrote: > uvlong x; > > x = 0x012345678abcdefull; > print("(uchar)x %.2ux\n", (uchar)x); ... > x = 0012345678abcdef > (uchar)x ef
You're casting a large int into a small int and this seems right. Just as (uchar)0x1234 => 0x34 > marshalling a 64-bit pointer in this way will lay down the > bytes with the hi and lo reversed. Perhaps you meant to do *(uchar*)&x?