Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3209

Show
Ignore:
Timestamp:
02/16/08 21:21:49 (10 months ago)
Author:
kris
Message:

closes #847

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/core/ByteSwap.d

    r3175 r3209  
    2222        byte-swap approach avoids alignment issues, so is probably 
    2323        faster overall than a traditional 'shift' implementation. 
    24  
     24        --- 
    2525        ubyte[] x = [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]; 
    2626 
    27         swap16 (x.ptr, 8) -> 02 01 04 03 06 05 08 07      
    28         swap32 (x.ptr, 8) -> 04 03 02 01 08 07 06 05 
    29         swap64 (x.ptr, 8) -> 08 07 06 05 04 03 02 01 
     27        swap16 (x) => 02 01 04 03 06 05 08 07      
     28        swap32 (x) => 04 03 02 01 08 07 06 05 
     29        swap64 (x) => 08 07 06 05 04 03 02 01 
     30        --- 
    3031 
    3132*******************************************************************************/ 
     
    3536        /*********************************************************************** 
    3637 
    37                 Reverses two-byte sequences. Parameter bytes specifies the  
     38                Reverses two-byte sequences. Parameter dst imples the  
    3839                number of bytes, which should be a multiple of 2 
    3940 
     
    4748        /*********************************************************************** 
    4849 
    49                 Reverses four-byte sequences. Parameter bytes specifies the   
     50                Reverses four-byte sequences. Parameter dst implies the   
    5051                number of bytes, which should be a multiple of 4 
    5152 
     
    5960        /*********************************************************************** 
    6061 
    61                 Reverse eight-byte sequences. Parameter bytes specifies the  
     62                Reverse eight-byte sequences. Parameter dst implies the  
    6263                number of bytes, which should be a multiple of 8 
    6364 
     
    7172        /*********************************************************************** 
    7273 
    73                 Reverse ten-byte sequences. Parameter bytes specifies the  
     74                Reverse ten-byte sequences. Parameter dst implies the  
    7475                number of bytes, which should be a multiple of 10 
    7576