File: swapbytes

package info (click to toggle)
util-linux 2.41.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 92,868 kB
  • sloc: ansic: 179,124; sh: 22,714; yacc: 1,284; makefile: 525; xml: 422; python: 316; lex: 89; ruby: 75; csh: 37; exp: 19; sed: 16; perl: 15; sql: 9
file content (21 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Testing swab16
swab16(0x0001) = 0x0100
swab16(0x1234) = 0x3412
swab16(0xff00) = 0x00ff
swab16(0x4000) = 0x0040
swab16(0xfeff) = 0xfffe
Testing swab32
swab32(0x00000001) = 0x01000000
swab32(0x80000000) = 0x00000080
swab32(0x12345678) = 0x78563412
swab32(0xffff0000) = 0x0000ffff
swab32(0x00ff0000) = 0x0000ff00
swab32(0xff000000) = 0x000000ff
Testing swab64
swab64(0x0000000000000001) = 0x0100000000000000
swab64(0x8000000000000000) = 0x0000000000000080
swab64(0x1234567812345678) = 0x7856341278563412
swab64(0xffffffff00000000) = 0x00000000ffffffff
swab64(0x00ff000000000000) = 0x000000000000ff00
swab64(0xff00000000000000) = 0x00000000000000ff
No errors found in the byteswap implementation