From: Bryon Daly <[EMAIL PROTECTED]>

On 2/9/06, The Fool <[EMAIL PROTECTED]> wrote:

If you want to access the individual bytes, just keep the endian-ness in
mind:

// BYTE0_OFFSET == 0  // LSB byte
// BYTE3_OFFSET == 3  // MSB byte
 unsigned char GotMeB0 = *((unsigned char *) &Mem[(GetFrom *__Int_Size__) +
BYTE0_OFFSET]); // get LSByte
unsigned char GotMeB3 = *((unsigned char *) &Mem[(GetFrom *__Int_Size__) +
BYTE3_OFFSET]); // get MSByte

-----
So is this right?:

        typedef struct _FlipBytesInt64
                       {
                       BYTE           One;
                       BYTE           Two;
                       BYTE           Tre;
                       BYTE           For;
                       BYTE           Fiv;
                       BYTE           Six;
                       BYTE           Sev;
                       BYTE           Ate;
                       } FlipBytesInt64;
        
        typedef union  _FlipInt64
                       {
                       int            Flip;
                       FlipBytesInt64 Flop;
                       } FlipInt64;


       FlipMeInt64.Flip = PutMe;
       XorSwap(FlipMeInt64.Flop.Ate,FlipMeInt64.Flop.One);
       XorSwap(FlipMeInt64.Flop.Sev,FlipMeInt64.Flop.Two);
       XorSwap(FlipMeInt64.Flop.Six,FlipMeInt64.Flop.Tre);
       XorSwap(FlipMeInt64.Flop.Fiv,FlipMeInt64.Flop.For);
       PutNewMeInt64    = FlipMeInt64.Flip;
       try //
           {
           *((__int64 *) &Mem[PutAt * __Int64_Size__]) = PutNewMeInt64;
           }
_______________________________________________
http://www.mccmedia.com/mailman/listinfo/brin-l

Reply via email to