Bug 2117 – Please add more byteswapping support

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2008-05-20T13:37:00Z
Last change time
2015-06-09T01:21:35Z
Assigned to
nobody
Creator
jlquinn

Comments

Comment #0 by jlquinn — 2008-05-20T13:37:20Z
Right now there is limited support for byteswapping. std.intrinsic includes bswap(uint), and std.system includes a predefined constant for system endianness. It would be really helpful to have bswap equivalents for all basic datatypes, as well as routines to swap between native endianness and explicit big or little endian, ala ntohl, ntohs, htonl, htons A related thing that would come in handy is byteswapping mmap support.
Comment #1 by caron800 — 2008-05-20T14:47:39Z
On 20/05/2008, [email protected] <[email protected]> wrote: > It would be really helpful to have bswap equivalents for all basic datatypes, Essentially, bswap(T)(T x) > as well as routines to swap between native endianness and explicit big or > little endian, ala ntohl, ntohs, htonl, htons I never did understand the difference between ntoh* and hton*. :-)
Comment #2 by issues.dlang — 2011-07-31T19:46:42Z